@tryghost/admin-toolbar 0.1.0
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/LICENSE +21 -0
- package/README.md +25 -0
- package/package.json +75 -0
- package/umd/admin-toolbar.min.js +376 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-2026 Ghost Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Admin Toolbar
|
|
2
|
+
|
|
3
|
+
Frontend staff toolbar for Ghost sites. Uses Preact (~3KB) instead of React
|
|
4
|
+
(~40KB) since this is a lightweight public-facing widget that only needs basic
|
|
5
|
+
rendering and hooks — the same rationale applies to any future small public
|
|
6
|
+
scripts where bundle size matters more than ecosystem compatibility.
|
|
7
|
+
|
|
8
|
+
## Development
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm build # one-off build
|
|
12
|
+
pnpm dev # build + preview with watch (started automatically by pnpm dev from root)
|
|
13
|
+
pnpm test # build + run tests against UMD bundle
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## How it's served
|
|
17
|
+
|
|
18
|
+
In production, the script is loaded from jsDelivr via the `adminToolbar` config
|
|
19
|
+
in `defaults.json`, following the same CDN pattern as portal, comments-ui, and
|
|
20
|
+
the other public apps. In development, the Docker Dockerfile overrides the URL
|
|
21
|
+
to proxy through Caddy to the local vite preview server on port 4176.
|
|
22
|
+
|
|
23
|
+
# Copyright & License
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tryghost/admin-toolbar",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": "https://github.com/TryGhost/Ghost",
|
|
6
|
+
"author": "Ghost Foundation",
|
|
7
|
+
"files": [
|
|
8
|
+
"umd/",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"preact": "catalog:"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "pnpm exec vite build",
|
|
21
|
+
"build:watch": "pnpm exec vite build --watch",
|
|
22
|
+
"dev": "concurrently --kill-others --names preview,build \"pnpm exec vite preview -l silent\" \"pnpm build:watch\"",
|
|
23
|
+
"lint": "pnpm exec eslint src --ext .js --cache",
|
|
24
|
+
"test": "pnpm run build && pnpm exec mocha --exit --trace-warnings --timeout=60000 \"test/**/*.test.js\"",
|
|
25
|
+
"preship": "pnpm lint",
|
|
26
|
+
"ship": "node ../../.github/scripts/release-apps.js",
|
|
27
|
+
"prepublishOnly": "pnpm build"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"concurrently": "catalog:",
|
|
31
|
+
"eslint": "catalog:",
|
|
32
|
+
"jsdom": "catalog:",
|
|
33
|
+
"mocha": "catalog:",
|
|
34
|
+
"vite": "catalog:"
|
|
35
|
+
},
|
|
36
|
+
"eslintConfig": {
|
|
37
|
+
"ignorePatterns": [
|
|
38
|
+
"umd/**/*.js"
|
|
39
|
+
],
|
|
40
|
+
"env": {
|
|
41
|
+
"browser": true
|
|
42
|
+
},
|
|
43
|
+
"parserOptions": {
|
|
44
|
+
"sourceType": "module",
|
|
45
|
+
"ecmaVersion": 2022
|
|
46
|
+
},
|
|
47
|
+
"extends": [
|
|
48
|
+
"plugin:ghost/browser"
|
|
49
|
+
],
|
|
50
|
+
"plugins": [
|
|
51
|
+
"ghost"
|
|
52
|
+
],
|
|
53
|
+
"overrides": [
|
|
54
|
+
{
|
|
55
|
+
"files": [
|
|
56
|
+
"test/**/*.js"
|
|
57
|
+
],
|
|
58
|
+
"env": {
|
|
59
|
+
"mocha": true,
|
|
60
|
+
"node": true
|
|
61
|
+
},
|
|
62
|
+
"parserOptions": {
|
|
63
|
+
"sourceType": "script"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"rules": {
|
|
68
|
+
"ghost/filenames/match-regex": [
|
|
69
|
+
"error",
|
|
70
|
+
"^[a-z0-9.-]+$",
|
|
71
|
+
false
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
(function(){"use strict";var I,b,me,E,pe,he,fe,Z,P,N,be,Q,ee,te,L={},C=[],je=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(e,t){for(var n in t)e[n]=t[n];return e}function ne(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,n){var r,i,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?I.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return R(e,l,r,i,null)}function R(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++me,__i:-1,__u:0};return i==null&&b.vnode!=null&&b.vnode(o),o}function F(e){return e.children}function O(e,t){this.props=e,this.context=t}function $(e,t){if(t==null)return e.__?$(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?$(e):null}function qe(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=T({},t);o.__v=t.__v+1,b.vnode&&b.vnode(o),oe(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??$(t),!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,ze(r,o,i),t.__e=t.__=null,o.__e!=n&&ge(o)}}function ge(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),ge(e)}function ve(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!B.__r++||pe!=b.debounceRendering)&&((pe=b.debounceRendering)||he)(B)}function B(){try{for(var e,t=1;E.length;)E.length>t&&E.sort(fe),e=E.shift(),t=E.length,qe(e)}finally{E.length=B.__r=0}}function ye(e,t,n,r,i,o,l,_,m,s,u){var a,p,c,x,g,w,f,h=r&&r.__k||C,M=t.length;for(m=Ge(n,t,h,m,M),a=0;a<M;a++)(c=n.__k[a])!=null&&(p=c.__i!=-1&&h[c.__i]||L,c.__i=a,w=oe(e,c,p,i,o,l,_,m,s,u),x=c.__e,c.ref&&p.ref!=c.ref&&(p.ref&&ie(p.ref,null,c),u.push(c.ref,c.__c||x,c)),g==null&&x!=null&&(g=x),(f=!!(4&c.__u))||p.__k===c.__k?(m=xe(c,m,e,f),f&&p.__e&&(p.__e=null)):typeof c.type=="function"&&w!==void 0?m=w:x&&(m=x.nextSibling),c.__u&=-7);return n.__e=g,m}function Ge(e,t,n,r,i){var o,l,_,m,s,u=n.length,a=u,p=0;for(e.__k=new Array(i),o=0;o<i;o++)(l=t[o])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[o]=R(null,l,null,null,null):D(l)?l=e.__k[o]=R(F,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[o]=R(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,m=o+p,l.__=e,l.__b=e.__b+1,_=null,(s=l.__i=Ve(l,n,m,a))!=-1&&(a--,(_=n[s])&&(_.__u|=2)),_==null||_.__v==null?(s==-1&&(i>u?p--:i<u&&p++),typeof l.type!="function"&&(l.__u|=4)):s!=m&&(s==m-1?p--:s==m+1?p++:(s>m?p--:p++,l.__u|=4))):e.__k[o]=null;if(a)for(o=0;o<u;o++)(_=n[o])!=null&&(2&_.__u)==0&&(_.__e==r&&(r=$(_)),Ee(_,_));return r}function xe(e,t,n,r){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=xe(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=$(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ve(e,t,n,r){var i,o,l,_=e.key,m=e.type,s=t[n],u=s!=null&&(2&s.__u)==0;if(s===null&&_==null||u&&_==s.key&&m==s.type)return n;if(r>(u?1:0)){for(i=n-1,o=n+1;i>=0||o<t.length;)if((s=t[l=i>=0?i--:o++])!=null&&(2&s.__u)==0&&_==s.key&&m==s.type)return l}return-1}function we(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||je.test(t)?n:n+"px"}function W(e,t,n,r,i){var o,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||we(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||we(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(be,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[N]=r[N]:(n[N]=Q,e.addEventListener(t,o?te:ee,o)):e.removeEventListener(t,o?te:ee,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function ke(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[P]==null)t[P]=Q++;else if(t[P]<n[N])return;return n(b.event?b.event(t):t)}}}function oe(e,t,n,r,i,o,l,_,m,s){var u,a,p,c,x,g,w,f,h,M,S,H,We,K,ue,z=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(m=!!(32&n.__u),o=[_=t.__e=n.__e]),(u=b.__b)&&u(t);e:if(typeof z=="function")try{if(f=t.props,h=z.prototype&&z.prototype.render,M=(u=z.contextType)&&r[u.__c],S=u?M?M.props.value:u.__:r,n.__c?w=(a=t.__c=n.__c).__=a.__E:(h?t.__c=a=new z(f,S):(t.__c=a=new O(f,S),a.constructor=z,a.render=Xe),M&&M.sub(a),a.state||(a.state={}),a.__n=r,p=a.__d=!0,a.__h=[],a._sb=[]),h&&a.__s==null&&(a.__s=a.state),h&&z.getDerivedStateFromProps!=null&&(a.__s==a.state&&(a.__s=T({},a.__s)),T(a.__s,z.getDerivedStateFromProps(f,a.__s))),c=a.props,x=a.state,a.__v=t,p)h&&z.getDerivedStateFromProps==null&&a.componentWillMount!=null&&a.componentWillMount(),h&&a.componentDidMount!=null&&a.__h.push(a.componentDidMount);else{if(h&&z.getDerivedStateFromProps==null&&f!==c&&a.componentWillReceiveProps!=null&&a.componentWillReceiveProps(f,S),t.__v==n.__v||!a.__e&&a.shouldComponentUpdate!=null&&a.shouldComponentUpdate(f,a.__s,S)===!1){t.__v!=n.__v&&(a.props=f,a.state=a.__s,a.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),C.push.apply(a.__h,a._sb),a._sb=[],a.__h.length&&l.push(a);break e}a.componentWillUpdate!=null&&a.componentWillUpdate(f,a.__s,S),h&&a.componentDidUpdate!=null&&a.__h.push(function(){a.componentDidUpdate(c,x,g)})}if(a.context=S,a.props=f,a.__P=e,a.__e=!1,H=b.__r,We=0,h)a.state=a.__s,a.__d=!1,H&&H(t),u=a.render(a.props,a.state,a.context),C.push.apply(a.__h,a._sb),a._sb=[];else do a.__d=!1,H&&H(t),u=a.render(a.props,a.state,a.context),a.state=a.__s;while(a.__d&&++We<25);a.state=a.__s,a.getChildContext!=null&&(r=T(T({},r),a.getChildContext())),h&&!p&&a.getSnapshotBeforeUpdate!=null&&(g=a.getSnapshotBeforeUpdate(c,x)),K=u!=null&&u.type===F&&u.key==null?Te(u.props.children):u,_=ye(e,D(K)?K:[K],t,n,r,i,o,l,_,m,s),a.base=t.__e,t.__u&=-161,a.__h.length&&l.push(a),w&&(a.__E=a.__=null)}catch(U){if(t.__v=null,m||o!=null)if(U.then){for(t.__u|=m?160:128;_&&_.nodeType==8&&_.nextSibling;)_=_.nextSibling;o[o.indexOf(_)]=null,t.__e=_}else{for(ue=o.length;ue--;)ne(o[ue]);re(t)}else t.__e=n.__e,t.__k=n.__k,U.then||re(t);b.__e(U,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):_=t.__e=Ye(n.__e,t,n,r,i,o,l,m,s);return(u=b.diffed)&&u(t),128&t.__u?void 0:_}function re(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(re))}function ze(e,t,n){for(var r=0;r<n.length;r++)ie(n[r],n[++r],n[++r]);b.__c&&b.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){b.__e(o,i.__v)}})}function Te(e){return typeof e!="object"||e==null||e.__b>0?e:D(e)?e.map(Te):e.constructor!==void 0?null:T({},e)}function Ye(e,t,n,r,i,o,l,_,m){var s,u,a,p,c,x,g,w=n.props||L,f=t.props,h=t.type;if(h=="svg"?i="http://www.w3.org/2000/svg":h=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!h&&(h?c.localName==h:c.nodeType==3)){e=c,o[s]=null;break}}if(e==null){if(h==null)return document.createTextNode(f);e=document.createElementNS(i,h,f.is&&f),_&&(b.__m&&b.__m(t,o),_=!1),o=null}if(h==null)w===f||_&&e.data==f||(e.data=f);else{if(o=h=="textarea"&&f.defaultValue!=null?null:o&&I.call(e.childNodes),!_&&o!=null)for(w={},s=0;s<e.attributes.length;s++)w[(c=e.attributes[s]).name]=c.value;for(s in w)c=w[s],s=="dangerouslySetInnerHTML"?a=c:s=="children"||s in f||s=="value"&&"defaultValue"in f||s=="checked"&&"defaultChecked"in f||W(e,s,null,c,i);for(s in f)c=f[s],s=="children"?p=c:s=="dangerouslySetInnerHTML"?u=c:s=="value"?x=c:s=="checked"?g=c:_&&typeof c!="function"||w[s]===c||W(e,s,c,w[s],i);if(u)_||a&&(u.__html==a.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(a&&(e.innerHTML=""),ye(t.type=="template"?e.content:e,D(p)?p:[p],t,n,r,h=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,l,o?o[0]:n.__k&&$(n,0),_,m),o!=null)for(s=o.length;s--;)ne(o[s]);_&&h!="textarea"||(s="value",h=="progress"&&x==null?e.removeAttribute("value"):x!=null&&(x!==e[s]||h=="progress"&&!x||h=="option"&&x!=w[s])&&W(e,s,x,w[s],i),s="checked",g!=null&&g!=e[s]&&W(e,s,g,w[s],i))}return e}function ie(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(i){b.__e(i,n)}}function Ee(e,t,n){var r,i;if(b.unmount&&b.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ie(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){b.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ee(r[i],t,n||typeof e.type!="function");n||ne(e.__e),e.__c=e.__=e.__e=void 0}function Xe(e,t,n){return this.constructor(e,n)}function Je(e,t,n){var r,i,o,l;t==document&&(t=document.documentElement),b.__&&b.__(e,t),i=(r=!1)?null:t.__k,o=[],l=[],oe(t,e=t.__k=d(F,null,[e]),i||L,L,t.namespaceURI,i?null:t.firstChild?I.call(t.childNodes):null,o,i?i.__e:t.firstChild,r,l),ze(o,e,l)}I=C.slice,b={__e:function(e,t,n,r){for(var i,o,l;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),l=i.__d),l)return i.__E=i}catch(_){e=_}throw e}},me=0,O.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof e=="function"&&(e=e(T({},n),this.props)),e&&T(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ve(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ve(this))},O.prototype.render=F,E=[],he=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fe=function(e,t){return e.__v.__b-t.__v.__b},B.__r=0,Z=Math.random().toString(8),P="__d"+Z,N="__a"+Z,be=/(PointerCapture)$|Capture$/i,Q=0,ee=ke(!1),te=ke(!0);const j="ghost-admin-toolbar-root",Me="--gh-admin-toolbar-bottom-offset",Ke=2e3,Se="ghost-admin-toolbar-display",q="minimized",ae="expanded";function Ze(e){const t=document.createElement("iframe");return t.dataset.frame="admin-auth",t.src=`${e}auth-frame/`,t.title="Ghost admin authentication",t.tabIndex=-1,t.style.cssText="display:none;width:0;height:0;border:0;",document.body.appendChild(t),t}function Qe(e,t){let n=0;const r={},i=new URL(e).origin;window.addEventListener("message",function(l){if(l.origin!==i)return;let _;try{_=JSON.parse(l.data)}catch{return}const m=r[_.uid];m&&(delete r[_.uid],m(_.error,_.result))});function o(l,_){return new Promise((m,s)=>{n+=1;const u=n,a=window.setTimeout(()=>{delete r[u],s(new Error("Admin authentication timed out"))},Ke);r[u]=(p,c)=>{window.clearTimeout(a),p?s(new Error(p)):m(c)},t.contentWindow?.postMessage(JSON.stringify({uid:u,action:l,..._}),i)})}return{getUser:async()=>(await o("getUser"))?.users?.[0]||null}}function et(e){const t=new Set(["owner","administrator","editor"]);return(e?.roles||[]).some(n=>t.has((n?.name||"").toLowerCase()))}let $e=null;function tt(e){$e===null&&($e=document.body.style.paddingBottom||"");const t=`${e+24}px`;document.documentElement.style.setProperty(Me,t),document.body.style.paddingBottom=`calc(var(${Me}) + env(safe-area-inset-bottom, 0px))`}function nt(){return document.currentScript||document.querySelector("script[data-ghost-admin-toolbar]")}function ot(e){return e?e.endsWith("/")?e:`${e}/`:null}function rt(e){const t=e?.dataset||{},n=ot(t.ghostAdminToolbar);return n?{adminUrl:n,siteTitle:t.siteTitle||"Ghost",pageContext:t.pageContext||"",resourceType:t.resourceType||"",resourceId:t.resourceId||"",resourceSlug:t.resourceSlug||"",siteAnalyticsEnabled:t.siteAnalyticsEnabled==="true",activityPubEnabled:t.activitypubEnabled==="true",membersEnabled:t.membersEnabled==="true",commentsEnabled:t.commentsEnabled!=="false"}:null}var A,v,le,Ae,G=0,Ue=[],y=b,Ne=y.__b,He=y.__r,Ie=y.diffed,Pe=y.__c,Le=y.unmount,Ce=y.__;function V(e,t){y.__h&&y.__h(v,e,G||t),G=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Y(e){return G=1,it(Fe,e)}function it(e,t,n){var r=V(A++,2);if(r.t=e,!r.__c&&(r.__=[Fe(void 0,t),function(_){var m=r.__N?r.__N[0]:r.__[0],s=r.t(m,_);m!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.__f)){var i=function(_,m,s){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(p){return p.__c});if(u.every(function(p){return!p.__N}))return!o||o.call(this,_,m,s);var a=r.__c.props!==_;return u.some(function(p){if(p.__N){var c=p.__[0];p.__=p.__N,p.__N=void 0,c!==p.__[0]&&(a=!0)}}),o&&o.call(this,_,m,s)||a};v.__f=!0;var o=v.shouldComponentUpdate,l=v.componentWillUpdate;v.componentWillUpdate=function(_,m,s){if(this.__e){var u=o;o=void 0,i(_,m,s),o=u}l&&l.call(this,_,m,s)},v.shouldComponentUpdate=i}return r.__N||r.__}function at(e,t){var n=V(A++,3);!y.__s&&_e(n.__H,t)&&(n.__=e,n.u=t,v.__H.__h.push(n))}function lt(e,t){var n=V(A++,4);!y.__s&&_e(n.__H,t)&&(n.__=e,n.u=t,v.__h.push(n))}function De(e){return G=5,st(function(){return{current:e}},[])}function st(e,t){var n=V(A++,7);return _e(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function _t(){for(var e;e=Ue.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(X),t.__h.some(se),t.__h=[]}catch(n){t.__h=[],y.__e(n,e.__v)}}}y.__b=function(e){v=null,Ne&&Ne(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},y.__r=function(e){He&&He(e),A=0;var t=(v=e.__c).__H;t&&(le===v?(t.__h=[],v.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(X),t.__h.some(se),t.__h=[],A=0)),le=v},y.diffed=function(e){Ie&&Ie(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ue.push(t)!==1&&Ae===y.requestAnimationFrame||((Ae=y.requestAnimationFrame)||dt)(_t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),le=v=null},y.__c=function(e,t){t.some(function(n){try{n.__h.some(X),n.__h=n.__h.filter(function(r){return!r.__||se(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(r,n.__v)}}),Pe&&Pe(e,t)},y.unmount=function(e){Le&&Le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{X(r)}catch(i){t=i}}),n.__H=void 0,t&&y.__e(t,n.__v))};var Re=typeof requestAnimationFrame=="function";function dt(e){var t,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Re&&(t=requestAnimationFrame(n))}function X(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function se(e){var t=v;e.__c=e.__(),v=t}function _e(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Fe(e,t){return typeof t=="function"?t(e):t}function k(e,t){const n=t.replace(/^\/+/,"");return`${e}#/${n}`}function ct(e,t){return k(e,`comments?filter=${encodeURIComponent(`post_id:${t}`)}`)}function ut(){const e=new URL(window.location.href);return e.searchParams.set("admin","0"),`${e.pathname}${e.search}${e.hash}`}function mt(e){return e.pageContext==="home"?pt(e):e.resourceType==="post"&&e.resourceId?ht(e):e.resourceType==="tag"&&e.resourceSlug?[{href:k(e.adminUrl,`tags/${encodeURIComponent(e.resourceSlug)}`),icon:"edit",label:"Edit"}]:e.resourceType&&e.resourceId?[{href:k(e.adminUrl,`editor/${e.resourceType}/${e.resourceId}`),icon:"edit",label:"Edit"}]:[]}function pt(e){const t=[];return e.siteAnalyticsEnabled&&t.push({href:k(e.adminUrl,"analytics"),icon:"siteAnalytics",label:"Analytics"}),e.activityPubEnabled&&t.push({href:k(e.adminUrl,"activitypub"),icon:"network",label:"Network"}),t.push({href:k(e.adminUrl,"posts/"),icon:"posts",label:"Posts"}),e.membersEnabled&&t.push({href:k(e.adminUrl,"members"),icon:"members",label:"Members"}),t.push({href:k(e.adminUrl,"settings"),icon:"settings",label:"Settings"}),t}function ht(e){const t=[{href:k(e.adminUrl,`posts/analytics/${e.resourceId}`),icon:"analytics",label:"Analytics"},{href:k(e.adminUrl,`editor/${e.resourceType}/${e.resourceId}`),icon:"edit",label:"Edit"}];return e.commentsEnabled&&t.push({href:ct(e.adminUrl,e.resourceId),icon:"comments",label:"Comments"}),t}const ft={analytics:[d("path",{d:"M4 19V5"}),d("path",{d:"M4 19h16"}),d("path",{d:"M8 16v-5"}),d("path",{d:"M12 16V8"}),d("path",{d:"M16 16v-3"})],comments:[d("path",{d:"M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4Z"})],edit:[d("path",{d:"M12 20h9"}),d("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"})],members:[d("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),d("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),d("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),d("circle",{cx:"9",cy:"7",r:"4"})],network:[d("circle",{cx:"5",cy:"19",r:"2"}),d("circle",{cx:"19",cy:"5",r:"2"}),d("circle",{cx:"12",cy:"12",r:"4"}),d("path",{d:"M8.8 21.5a10 10 0 0 0 12.7-12.7"}),d("path",{d:"M2.5 15.2A10 10 0 0 1 15.2 2.5"})],posts:[d("path",{d:"M13 21h8"}),d("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"})],siteAnalytics:[d("path",{d:"M16 7h6v6"}),d("path",{d:"m22 7-8.5 8.5-5-5L2 17"})],settings:[d("path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}),d("circle",{cx:"12",cy:"12",r:"3"})],more:[d("circle",{cx:"12",cy:"5",r:"1"}),d("circle",{cx:"12",cy:"12",r:"1"}),d("circle",{cx:"12",cy:"19",r:"1"})],moreHorizontal:[d("circle",{cx:"5",cy:"12",r:"1"}),d("circle",{cx:"12",cy:"12",r:"1"}),d("circle",{cx:"19",cy:"12",r:"1"})]};function de({name:e}){return d("svg",{"aria-hidden":"true",className:`gh-admin-toolbar-icon gh-admin-toolbar-icon-${e}`,fill:"none",height:"20",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",width:"20"},ft[e])}function bt(){try{return window.localStorage?.getItem(Se)===q?q:ae}catch{return ae}}function Oe(e){try{window.localStorage?.setItem(Se,e)}catch{}}function gt(e){return e?.name||e?.email||"Staff"}function vt(e){return e?.profile_image||""}function J({children:e}){return d("span",{className:"gh-admin-toolbar-sr-only"},e)}function ce({children:e,label:t}){return d("span",{className:"gh-admin-toolbar-tooltip-wrap"},[e,d("span",{className:"gh-admin-toolbar-tooltip",role:"tooltip"},t)])}function yt({href:e,icon:t,label:n}){const r=d("a",{className:"gh-admin-toolbar-link",href:e,"aria-label":n},[d(de,{name:t}),d(J,null,n)]);return d(ce,{label:n},r)}function xt({isMinimized:e,isOpen:t,onMaximize:n,onMinimize:r,setIsOpen:i}){const o="More",l=d("button",{type:"button",className:"gh-admin-toolbar-button","aria-expanded":t?"true":"false","aria-haspopup":"menu","aria-label":o,onClick:()=>{i(!t)},onKeyDown:_=>{_.key==="Escape"&&i(!1)}},[d(de,{name:"more"}),d(J,null,o)]);return d("div",{className:"gh-admin-toolbar-menu-wrap",onFocusOut:_=>{_.currentTarget.contains(_.relatedTarget)||i(!1)}},[d(ce,{label:o},l),t?d("div",{className:"gh-admin-toolbar-menu"},[d("button",{type:"button",className:"gh-admin-toolbar-menu-item",onClick:e?n:r},e?"Maximize":"Minimize"),d("a",{className:"gh-admin-toolbar-menu-item",href:ut()},"Hide toolbar")]):null])}function wt({adminUrl:e,siteTitle:t,user:n}){const r=gt(n),i=vt(n),o=d("a",{className:"gh-admin-toolbar-user",href:k(e,""),"aria-label":`Open Ghost Admin for ${r} on ${t}`},[d("span",{className:"gh-admin-toolbar-avatar","aria-hidden":"true"},[d("span",{className:"gh-admin-toolbar-avatar-fallback"},r.slice(0,1).toUpperCase()),i?d("img",{alt:"",className:"gh-admin-toolbar-avatar-image",loading:"lazy",onError:l=>{l.currentTarget.remove()},referrerPolicy:"no-referrer",src:i}):null]),d(J,null,"Admin")]);return d(ce,{label:"Admin"},o)}function kt({config:e,user:t}){const[n,r]=Y(!1),[i,o]=Y(()=>bt()===q),[l,_]=Y(!1),[m,s]=Y(null),u=De(null),a=De(null),p=mt(e);function c(){_(!0)}function x(){n||(r(!1),_(!1))}return lt(()=>{if(!u.current||!a.current)return;if(i){s({height:Math.max(a.current.scrollHeight+12,44),width:a.current.scrollWidth+8});return}const g=u.current.getBoundingClientRect();s({height:g.height,width:g.width})},[i,p.length]),at(()=>{const g=document.getElementById(j);if(g)return g.classList.toggle("gh-admin-toolbar-menu-open",n),g.classList.toggle("gh-admin-toolbar-is-minimized",i&&!l),()=>{g.classList.remove("gh-admin-toolbar-menu-open"),g.classList.remove("gh-admin-toolbar-is-minimized")}},[n,i,l]),d("nav",{className:`gh-admin-toolbar${i?" gh-admin-toolbar-minimized-mode":""}${l?" gh-admin-toolbar-minimized-expanded":""}`,onFocusOut:g=>{i&&!g.currentTarget.contains(g.relatedTarget)&&x()},onMouseLeave:()=>{x()},onMouseEnter:()=>{i&&c()},onMouseOver:()=>{i&&c()},onPointerEnter:()=>{i&&c()},ref:u,role:"navigation",style:i?{"--gh-admin-toolbar-expanded-height":`${m?.height||44}px`,"--gh-admin-toolbar-expanded-width":`${m?.width||178}px`}:null,"aria-label":"Ghost admin toolbar"},[d("button",{type:"button",className:"gh-admin-toolbar-minimized-pill","aria-label":"Show admin toolbar",onClick:c},[d(de,{name:"moreHorizontal"}),d(J,null,"Show admin toolbar")]),d("div",{className:"gh-admin-toolbar-section",ref:a},[d(wt,{adminUrl:e.adminUrl,siteTitle:e.siteTitle,user:t}),...p.map(g=>d(yt,g)),d(xt,{isMinimized:i,isOpen:n,onMaximize:()=>{Oe(ae),r(!1),o(!1),_(!1)},onMinimize:()=>{Oe(q),r(!1),o(!0),_(!1)},setIsOpen:r})])])}function zt(){return`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial;
|
|
4
|
+
color-scheme: light;
|
|
5
|
+
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
line-height: 1.4;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.gh-admin-toolbar {
|
|
11
|
+
align-items: center;
|
|
12
|
+
background: #fff;
|
|
13
|
+
border: 1px solid #dce0e6;
|
|
14
|
+
border-radius: 999px;
|
|
15
|
+
bottom: calc(16px + env(safe-area-inset-bottom, 0px));
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.08);
|
|
18
|
+
color: #050505;
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: 6px;
|
|
21
|
+
left: 50%;
|
|
22
|
+
min-height: 44px;
|
|
23
|
+
overflow: visible;
|
|
24
|
+
padding: 5px 7px;
|
|
25
|
+
position: fixed;
|
|
26
|
+
transform: translateX(-50%);
|
|
27
|
+
transition: width 180ms cubic-bezier(0.16, 1, 0.3, 1), height 180ms cubic-bezier(0.16, 1, 0.3, 1), min-height 180ms cubic-bezier(0.16, 1, 0.3, 1), padding 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
28
|
+
z-index: 2147483647;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.gh-admin-toolbar-minimized-mode {
|
|
32
|
+
height: 18px;
|
|
33
|
+
min-height: 0;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
padding: 1px;
|
|
36
|
+
width: 32px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.gh-admin-toolbar-minimized-mode.gh-admin-toolbar-minimized-expanded {
|
|
40
|
+
height: var(--gh-admin-toolbar-expanded-height);
|
|
41
|
+
min-height: var(--gh-admin-toolbar-expanded-height);
|
|
42
|
+
overflow: visible;
|
|
43
|
+
padding: 5px 7px;
|
|
44
|
+
width: var(--gh-admin-toolbar-expanded-width);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.gh-admin-toolbar-minimized-pill {
|
|
48
|
+
align-items: center;
|
|
49
|
+
appearance: none;
|
|
50
|
+
background: transparent;
|
|
51
|
+
border: 0;
|
|
52
|
+
border-radius: 999px;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
color: #0a0a0a;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
height: 12px;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
left: 50%;
|
|
60
|
+
opacity: 0;
|
|
61
|
+
padding: 0;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 50%;
|
|
65
|
+
transform: translate(-50%, -50%);
|
|
66
|
+
transition: background 120ms ease, color 120ms ease, opacity 110ms ease;
|
|
67
|
+
width: 28px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.gh-admin-toolbar-minimized-mode .gh-admin-toolbar-minimized-pill {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
pointer-events: auto;
|
|
73
|
+
transition-delay: 80ms;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.gh-admin-toolbar-minimized-mode.gh-admin-toolbar-minimized-expanded .gh-admin-toolbar-minimized-pill {
|
|
77
|
+
opacity: 0;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
transition-delay: 0ms;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.gh-admin-toolbar-minimized-pill:hover {
|
|
83
|
+
background: #f2f4f7;
|
|
84
|
+
color: #15171a;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.gh-admin-toolbar-minimized-pill:focus-visible {
|
|
88
|
+
outline: 2px solid #15171a;
|
|
89
|
+
outline-offset: 3px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.gh-admin-toolbar-section {
|
|
93
|
+
align-items: center;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex: 0 0 auto;
|
|
96
|
+
gap: 4px;
|
|
97
|
+
min-width: 0;
|
|
98
|
+
opacity: 1;
|
|
99
|
+
transform: scale(1);
|
|
100
|
+
transition: opacity 120ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.gh-admin-toolbar-minimized-mode .gh-admin-toolbar-section {
|
|
105
|
+
opacity: 0;
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
transform: scale(0.92);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.gh-admin-toolbar-minimized-mode.gh-admin-toolbar-minimized-expanded .gh-admin-toolbar-section {
|
|
111
|
+
opacity: 1;
|
|
112
|
+
pointer-events: auto;
|
|
113
|
+
transform: scale(1);
|
|
114
|
+
transition-delay: 60ms;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.gh-admin-toolbar-link,
|
|
118
|
+
.gh-admin-toolbar-button {
|
|
119
|
+
align-items: center;
|
|
120
|
+
appearance: none;
|
|
121
|
+
background: transparent;
|
|
122
|
+
border: 0;
|
|
123
|
+
border-radius: 999px;
|
|
124
|
+
box-sizing: border-box;
|
|
125
|
+
color: #0a0a0a;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
flex: 0 0 auto;
|
|
129
|
+
font: inherit;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
height: 32px;
|
|
132
|
+
padding: 0;
|
|
133
|
+
text-decoration: none;
|
|
134
|
+
transition: background 120ms ease, color 120ms ease, transform 120ms ease;
|
|
135
|
+
width: 32px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.gh-admin-toolbar-link:hover,
|
|
139
|
+
.gh-admin-toolbar-button:hover {
|
|
140
|
+
background: #f2f4f7;
|
|
141
|
+
color: #15171a;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.gh-admin-toolbar-link:focus-visible,
|
|
145
|
+
.gh-admin-toolbar-button:focus-visible {
|
|
146
|
+
outline: 2px solid #15171a;
|
|
147
|
+
outline-offset: 3px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.gh-admin-toolbar-tooltip-wrap {
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
position: relative;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.gh-admin-toolbar-tooltip {
|
|
156
|
+
background: #15171a;
|
|
157
|
+
border-radius: 6px;
|
|
158
|
+
bottom: calc(100% + 8px);
|
|
159
|
+
box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18), 0 1px 4px rgba(15, 23, 42, 0.12);
|
|
160
|
+
box-sizing: border-box;
|
|
161
|
+
color: #fff;
|
|
162
|
+
font-size: 12px;
|
|
163
|
+
font-weight: 600;
|
|
164
|
+
left: 50%;
|
|
165
|
+
line-height: 1;
|
|
166
|
+
max-width: 220px;
|
|
167
|
+
opacity: 0;
|
|
168
|
+
padding: 7px 8px;
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
position: absolute;
|
|
171
|
+
transform: translateX(-50%) translateY(2px);
|
|
172
|
+
transition: opacity 120ms ease, transform 120ms ease;
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
z-index: 2147483647;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.gh-admin-toolbar-tooltip-wrap:hover .gh-admin-toolbar-tooltip,
|
|
178
|
+
.gh-admin-toolbar-tooltip-wrap:has(:focus-visible) .gh-admin-toolbar-tooltip {
|
|
179
|
+
opacity: 1;
|
|
180
|
+
transform: translateX(-50%) translateY(0);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host(.gh-admin-toolbar-menu-open) .gh-admin-toolbar-tooltip {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.gh-admin-toolbar-menu-wrap {
|
|
188
|
+
display: inline-flex;
|
|
189
|
+
position: relative;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.gh-admin-toolbar-menu {
|
|
193
|
+
background: #fff;
|
|
194
|
+
border: 1px solid #dce0e6;
|
|
195
|
+
border-radius: 10px;
|
|
196
|
+
bottom: calc(100% + 10px);
|
|
197
|
+
box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
left: 50%;
|
|
200
|
+
min-width: 112px;
|
|
201
|
+
padding: 4px;
|
|
202
|
+
position: absolute;
|
|
203
|
+
transform: translateX(-50%);
|
|
204
|
+
z-index: 2147483647;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.gh-admin-toolbar-menu-item {
|
|
208
|
+
align-items: center;
|
|
209
|
+
border-radius: 7px;
|
|
210
|
+
box-sizing: border-box;
|
|
211
|
+
color: #15171a;
|
|
212
|
+
display: flex;
|
|
213
|
+
font-family: inherit;
|
|
214
|
+
font-size: 13px;
|
|
215
|
+
font-weight: 600;
|
|
216
|
+
line-height: 1;
|
|
217
|
+
padding: 9px 10px;
|
|
218
|
+
text-decoration: none;
|
|
219
|
+
white-space: nowrap;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.gh-admin-toolbar-menu-item:hover {
|
|
223
|
+
background: #f2f4f7;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
button.gh-admin-toolbar-menu-item {
|
|
227
|
+
appearance: none;
|
|
228
|
+
background: transparent;
|
|
229
|
+
border: 0;
|
|
230
|
+
cursor: pointer;
|
|
231
|
+
text-align: left;
|
|
232
|
+
width: 100%;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.gh-admin-toolbar-menu-item:focus-visible {
|
|
236
|
+
outline: 2px solid #15171a;
|
|
237
|
+
outline-offset: 2px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.gh-admin-toolbar-icon {
|
|
241
|
+
flex: 0 0 auto;
|
|
242
|
+
height: 17px;
|
|
243
|
+
width: 17px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.gh-admin-toolbar-icon-siteAnalytics,
|
|
247
|
+
.gh-admin-toolbar-icon-network,
|
|
248
|
+
.gh-admin-toolbar-icon-posts,
|
|
249
|
+
.gh-admin-toolbar-icon-members,
|
|
250
|
+
.gh-admin-toolbar-icon-settings {
|
|
251
|
+
transform: scale(0.9);
|
|
252
|
+
transform-origin: center;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.gh-admin-toolbar-icon-settings {
|
|
256
|
+
transform: scale(0.96);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.gh-admin-toolbar-icon-moreHorizontal {
|
|
260
|
+
height: 18px;
|
|
261
|
+
width: 18px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.gh-admin-toolbar-user {
|
|
265
|
+
align-items: center;
|
|
266
|
+
background: #f6f7f9;
|
|
267
|
+
border-radius: 999px;
|
|
268
|
+
color: #111;
|
|
269
|
+
display: inline-flex;
|
|
270
|
+
flex: 0 0 auto;
|
|
271
|
+
height: 32px;
|
|
272
|
+
justify-content: center;
|
|
273
|
+
overflow: hidden;
|
|
274
|
+
text-decoration: none;
|
|
275
|
+
width: 32px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.gh-admin-toolbar-user:hover {
|
|
279
|
+
background: #eef1f5;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.gh-admin-toolbar-user:focus-visible {
|
|
283
|
+
outline: 2px solid #15171a;
|
|
284
|
+
outline-offset: 3px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.gh-admin-toolbar-avatar {
|
|
288
|
+
align-items: center;
|
|
289
|
+
background: #15171a;
|
|
290
|
+
border-radius: 999px;
|
|
291
|
+
color: #fff;
|
|
292
|
+
display: inline-flex;
|
|
293
|
+
font-size: 11px;
|
|
294
|
+
font-weight: 700;
|
|
295
|
+
height: 24px;
|
|
296
|
+
justify-content: center;
|
|
297
|
+
line-height: 1;
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
position: relative;
|
|
300
|
+
width: 24px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.gh-admin-toolbar-avatar-fallback {
|
|
304
|
+
align-items: center;
|
|
305
|
+
display: inline-flex;
|
|
306
|
+
height: 100%;
|
|
307
|
+
justify-content: center;
|
|
308
|
+
width: 100%;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.gh-admin-toolbar-avatar-image {
|
|
312
|
+
display: block;
|
|
313
|
+
height: 100%;
|
|
314
|
+
inset: 0;
|
|
315
|
+
object-fit: cover;
|
|
316
|
+
position: absolute;
|
|
317
|
+
width: 100%;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.gh-admin-toolbar-sr-only {
|
|
321
|
+
border: 0;
|
|
322
|
+
clip: rect(0 0 0 0);
|
|
323
|
+
clip-path: inset(50%);
|
|
324
|
+
height: 1px;
|
|
325
|
+
margin: -1px;
|
|
326
|
+
overflow: hidden;
|
|
327
|
+
padding: 0;
|
|
328
|
+
position: absolute;
|
|
329
|
+
white-space: nowrap;
|
|
330
|
+
width: 1px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
@media (max-width: 700px) {
|
|
334
|
+
.gh-admin-toolbar {
|
|
335
|
+
max-width: calc(100vw - 24px);
|
|
336
|
+
overflow-x: auto;
|
|
337
|
+
padding: 6px;
|
|
338
|
+
scrollbar-width: none;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.gh-admin-toolbar-minimized-mode {
|
|
342
|
+
height: 18px;
|
|
343
|
+
min-height: 0;
|
|
344
|
+
overflow: hidden;
|
|
345
|
+
padding: 1px;
|
|
346
|
+
width: 32px;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.gh-admin-toolbar-minimized-mode.gh-admin-toolbar-minimized-expanded {
|
|
350
|
+
height: var(--gh-admin-toolbar-expanded-height);
|
|
351
|
+
min-height: var(--gh-admin-toolbar-expanded-height);
|
|
352
|
+
overflow: visible;
|
|
353
|
+
padding: 5px 7px;
|
|
354
|
+
width: var(--gh-admin-toolbar-expanded-width);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.gh-admin-toolbar::-webkit-scrollbar {
|
|
358
|
+
display: none;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.gh-admin-toolbar-link,
|
|
362
|
+
.gh-admin-toolbar-button,
|
|
363
|
+
.gh-admin-toolbar-user {
|
|
364
|
+
height: 32px;
|
|
365
|
+
width: 32px;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
@media (prefers-reduced-motion: reduce) {
|
|
370
|
+
.gh-admin-toolbar,
|
|
371
|
+
.gh-admin-toolbar-section,
|
|
372
|
+
.gh-admin-toolbar-minimized-pill {
|
|
373
|
+
transition: none;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
`}const Tt=5e3;function Et(e){return new Promise((t,n)=>{let r;function i(){window.clearTimeout(r),e.removeEventListener("load",o),e.removeEventListener("error",l)}function o(){i(),t()}function l(){i(),n(new Error("auth_frame_load_error"))}r=window.setTimeout(()=>{i(),n(new Error("auth_frame_load_timeout"))},Tt),e.addEventListener("load",o),e.addEventListener("error",l)})}function Mt({config:e,user:t,frame:n}){if(document.getElementById(j))return;const r=document.createElement("div");r.id=j;const i=r.attachShadow({mode:"open"}),o=document.createElement("style"),l=document.createElement("div");o.textContent=zt(),i.append(o,l),document.body.appendChild(r),Je(d(kt,{config:e,user:t}),l),window.requestAnimationFrame(()=>{const _=l.querySelector(".gh-admin-toolbar");tt(_?.offsetHeight||56)}),n.dataset.toolbarMounted="true"}async function Be(){if(!document.body||document.getElementById(j)||new URLSearchParams(window.location.search).get("admin_toolbar")==="0")return;const t=rt(nt());if(!t)return;const n=Ze(t.adminUrl),r=Qe(t.adminUrl,n);try{await Et(n);const i=await r.getUser();if(!i||!et(i)){n.remove();return}Mt({config:t,user:i,frame:n})}catch{n.remove()}}function St(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Be,{once:!0}):Be()}typeof document<"u"&&St()})();
|