@blocklet/pages-kit-inner-components 0.6.24 → 0.6.26
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/lib/cjs/add-component.js +1 -1
- package/lib/cjs/chunks/home-DtcV9AQz.js +39 -0
- package/lib/cjs/chunks/index-B5nhwNMT.js +475 -0
- package/lib/cjs/chunks/{publish-button-BAFrnjhg.js → publish-button-1rzLInzU.js} +1 -1
- package/lib/cjs/chunks/site-state-8lUnv-C3.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +2 -2
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +1 -1
- package/lib/es/chunks/{home-8eDa8KD4.js → home-CP6-1N2p.js} +182 -181
- package/lib/es/chunks/index-CaKPHd8j.js +3013 -0
- package/lib/es/chunks/{publish-button-CaPZ_kmc.js → publish-button-BvvRgazT.js} +2 -2
- package/lib/es/chunks/{site-state-CqlS8v17.js → site-state-Bx2ZDYuu.js} +1 -1
- package/lib/es/home.js +2 -2
- package/lib/es/locales.js +10 -4
- package/lib/es/resources.js +1 -1
- package/lib/es/site-state.js +1 -1
- package/package.json +12 -12
- package/lib/cjs/chunks/home-BUhkvEa6.js +0 -39
- package/lib/cjs/chunks/index-BIQBchDT.js +0 -475
- package/lib/cjs/chunks/site-state-CkqENAbR.js +0 -1
- package/lib/es/chunks/index-MrU6URFS.js +0 -2780
|
@@ -10,8 +10,8 @@ import { produce as De } from "immer";
|
|
|
10
10
|
import Z from "lodash/difference";
|
|
11
11
|
import { useState as D, useMemo as C, useCallback as O, useImperativeHandle as Oe, useEffect as E, useRef as Ae } from "react";
|
|
12
12
|
import { useAsync as je } from "react-use";
|
|
13
|
-
import { L as ve } from "./home-
|
|
14
|
-
import { p as Ce, g as Re } from "./index-
|
|
13
|
+
import { L as ve } from "./home-CP6-1N2p.js";
|
|
14
|
+
import { p as Ce, g as Re } from "./index-CaKPHd8j.js";
|
|
15
15
|
function ze(s) {
|
|
16
16
|
const [u, g] = D(!1);
|
|
17
17
|
return /* @__PURE__ */ t(
|
package/lib/es/home.js
CHANGED
|
@@ -21,8 +21,8 @@ import "react-helmet";
|
|
|
21
21
|
import "react-router-dom";
|
|
22
22
|
import "react-use";
|
|
23
23
|
import "ufo";
|
|
24
|
-
import "./chunks/index-
|
|
25
|
-
import { a as R, P as S, d as W, c as j, b as k, T as q, H as v } from "./chunks/home-
|
|
24
|
+
import "./chunks/index-CaKPHd8j.js";
|
|
25
|
+
import { a as R, P as S, d as W, c as j, b as k, T as q, H as v } from "./chunks/home-CP6-1N2p.js";
|
|
26
26
|
import "./chunks/session-C72Dq8zg.js";
|
|
27
27
|
export {
|
|
28
28
|
R as HomeView,
|
package/lib/es/locales.js
CHANGED
|
@@ -224,8 +224,8 @@ const t = e({
|
|
|
224
224
|
dark: "Dark",
|
|
225
225
|
reverse: "Reverse",
|
|
226
226
|
background: "Background",
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
backgroundFullWidth: "Background Full Width",
|
|
228
|
+
backgroundFullWidthHelper: "The background will cover the entire page",
|
|
229
229
|
badge: "Badge",
|
|
230
230
|
buttons: "Buttons",
|
|
231
231
|
button: "Button",
|
|
@@ -296,12 +296,15 @@ const t = e({
|
|
|
296
296
|
paddingX: "Horizontal Padding",
|
|
297
297
|
maxWidth: "Max Width",
|
|
298
298
|
maxWidthCustomTip: "For example: 1200px, 80%, 50vw",
|
|
299
|
+
paddingCustomTip: "For example: 10px, 20px, 30px",
|
|
300
|
+
layoutBlockMaxWidthHelper: "Set the maximum width of the layout, this will make the layout not follow the maximum width setting in the page global style",
|
|
299
301
|
customValue: "Custom Value",
|
|
300
302
|
stickyHeader: "Sticky Header",
|
|
301
303
|
translucent: "Translucent Mode",
|
|
302
304
|
hideNavMenus: "Hide Navigation Menus",
|
|
303
305
|
hideFooter: "Hide Footer",
|
|
304
306
|
size: "Size",
|
|
307
|
+
height: "Height",
|
|
305
308
|
autoWidth: "Auto Width",
|
|
306
309
|
iframeHeight: "Content Height",
|
|
307
310
|
translucentTextColor: "Translucent Text Color",
|
|
@@ -779,8 +782,8 @@ const t = e({
|
|
|
779
782
|
dark: "暗黑",
|
|
780
783
|
reverse: "反转",
|
|
781
784
|
background: "背景",
|
|
782
|
-
|
|
783
|
-
|
|
785
|
+
backgroundFullWidth: "背景全宽",
|
|
786
|
+
backgroundFullWidthHelper: "背景将覆盖整个页面",
|
|
784
787
|
badge: "标签",
|
|
785
788
|
buttons: "按钮",
|
|
786
789
|
button: "按钮",
|
|
@@ -851,12 +854,15 @@ const t = e({
|
|
|
851
854
|
paddingX: "左右内边距",
|
|
852
855
|
maxWidth: "最大宽度",
|
|
853
856
|
maxWidthCustomTip: "例如: 1200px, 80%, 50vw",
|
|
857
|
+
paddingCustomTip: "例如: 10px, 20px, 30px",
|
|
858
|
+
layoutBlockMaxWidthHelper: "设置布局的最大宽度,这将会布局将不会遵循页面公共样式中的最大宽度设置",
|
|
854
859
|
customValue: "自定义值",
|
|
855
860
|
stickyHeader: "固定导航栏",
|
|
856
861
|
translucent: "沉浸式",
|
|
857
862
|
hideNavMenus: "隐藏导航菜单",
|
|
858
863
|
hideFooter: "隐藏页脚",
|
|
859
864
|
size: "大小",
|
|
865
|
+
height: "高度",
|
|
860
866
|
autoWidth: "宽度自适应",
|
|
861
867
|
iframeHeight: "定义内容高度",
|
|
862
868
|
translucentTextColor: "沉浸式文本颜色",
|
package/lib/es/resources.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as A, a as M, l as b } from "./chunks/components-BWQM8y6L.js";
|
|
2
|
-
import { P as w, C as J, R as X, S as x, t as W, g as G } from "./chunks/site-state-
|
|
2
|
+
import { P as w, C as J, R as X, S as x, t as W, g as G } from "./chunks/site-state-Bx2ZDYuu.js";
|
|
3
3
|
import { Router as K } from "express";
|
|
4
4
|
import a from "fs";
|
|
5
5
|
import m from "joi";
|
package/lib/es/site-state.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./chunks/components-BWQM8y6L.js";
|
|
2
|
-
import { c as O, a as b, b as h, S as y, e as L, f as U, h as q, d as v, g as z, i as C, m as F, t as G, j as J, u as K } from "./chunks/site-state-
|
|
2
|
+
import { c as O, a as b, b as h, S as y, e as L, f as U, h as q, d as v, g as z, i as C, m as F, t as G, j as J, u as K } from "./chunks/site-state-Bx2ZDYuu.js";
|
|
3
3
|
import { nextId as Q } from "@blocklet/pages-kit/utils/common";
|
|
4
4
|
import "@blocklet/pages-kit/utils/page-model";
|
|
5
5
|
import "@blocklet/pages-kit/utils/property";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit-inner-components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.26",
|
|
4
4
|
"description": "Pages Kit inner components library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -71,20 +71,20 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@arcblock/did-auth": "^1.21.0",
|
|
73
73
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
74
|
-
"@arcblock/did-connect": "^3.0.
|
|
75
|
-
"@arcblock/react-hooks": "^3.0.
|
|
76
|
-
"@arcblock/ux": "^3.0.
|
|
77
|
-
"@blocklet/ai-runtime": "^0.4.
|
|
78
|
-
"@blocklet/aigne-hub": "^0.2.
|
|
79
|
-
"@blocklet/code-editor": "^0.4.
|
|
74
|
+
"@arcblock/did-connect": "^3.0.37",
|
|
75
|
+
"@arcblock/react-hooks": "^3.0.37",
|
|
76
|
+
"@arcblock/ux": "^3.0.37",
|
|
77
|
+
"@blocklet/ai-runtime": "^0.4.277",
|
|
78
|
+
"@blocklet/aigne-hub": "^0.2.24",
|
|
79
|
+
"@blocklet/code-editor": "^0.4.277",
|
|
80
80
|
"@blocklet/embed": "^0.2.5",
|
|
81
81
|
"@blocklet/js-sdk": "^1.16.46",
|
|
82
82
|
"@blocklet/logger": "1.16.44",
|
|
83
|
-
"@blocklet/quickjs": "^0.4.
|
|
83
|
+
"@blocklet/quickjs": "^0.4.277",
|
|
84
84
|
"@blocklet/sdk": "^1.16.46",
|
|
85
|
-
"@blocklet/studio-ui": "^0.4.
|
|
85
|
+
"@blocklet/studio-ui": "^0.4.277",
|
|
86
86
|
"@blocklet/tracker": "^1.16.46",
|
|
87
|
-
"@blocklet/ui-react": "^3.0.
|
|
87
|
+
"@blocklet/ui-react": "^3.0.37",
|
|
88
88
|
"@blocklet/uploader": "^0.2.4",
|
|
89
89
|
"@blocklet/uploader-server": "^0.2.2",
|
|
90
90
|
"@emotion/cache": "^11.14.0",
|
|
@@ -203,8 +203,8 @@
|
|
|
203
203
|
"yaml": "^2.5.0",
|
|
204
204
|
"yjs": "^13.6.18",
|
|
205
205
|
"zustand": "^4.5.5",
|
|
206
|
-
"@blocklet/pages-kit": "^0.6.
|
|
207
|
-
"@blocklet/pages-kit-block-studio": "^0.6.
|
|
206
|
+
"@blocklet/pages-kit": "^0.6.26",
|
|
207
|
+
"@blocklet/pages-kit-block-studio": "^0.6.26"
|
|
208
208
|
},
|
|
209
209
|
"devDependencies": {
|
|
210
210
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),k=require("./state-tEydRMV8.js"),$=require("@arcblock/ux/lib/Locale/context"),te=require("@arcblock/ux/lib/Result"),M=require("@arcblock/ux/lib/Theme"),ne=require("@blocklet/pages-kit/builtin/page/header"),oe=require("@blocklet/pages-kit/contexts/color"),G=require("@blocklet/pages-kit/utils/data-source"),re=require("@blocklet/pages-kit/utils/route"),se=require("@blocklet/ui-react/lib/Header"),ae=require("@emotion/css"),B=require("@emotion/react"),y=require("@mui/material"),F=require("ahooks"),ie=require("isomorphic-dompurify"),ce=require("lodash/cloneDeep"),le=require("lodash/isEmpty"),ue=require("lodash/isEqual"),p=require("react"),de=require("react-helmet"),v=require("react-router-dom"),W=require("react-use"),S=require("ufo"),_=require("./index-BIQBchDT.js"),pe=require("@blocklet/ui-react/lib/Footer");require("webfontloader");const z=require("./session-BRtsDvA-.js"),R=t=>t&&t.__esModule?t:{default:t},K=R(te),ge=R(se),me=R(ie),L=R(ce),he=R(le),Y=R(ue),fe=R(pe),xe=M.styled(y.Box)`
|
|
2
|
-
display: contents;
|
|
3
|
-
& > div > div > .MuiContainer-root {
|
|
4
|
-
max-width: unset;
|
|
5
|
-
}
|
|
6
|
-
`;function je({meta:t,...n}){const c=M.useTheme();return e.jsx(xe,{children:e.jsx(fe.default,{...n,meta:t,theme:c||{}})})}function J(t){return e.jsx(y.Box,{...t,sx:[{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center"},...Array.isArray(t.sx)?t.sx:[t.sx]],children:e.jsx(y.CircularProgress,{size:30})})}function ye(t){return e.jsx(be,{...t})}const be=M.styled(y.Box)`
|
|
7
|
-
position: fixed;
|
|
8
|
-
left: 0;
|
|
9
|
-
top: 0;
|
|
10
|
-
z-index: 999999999999;
|
|
11
|
-
width: 80px;
|
|
12
|
-
font-size: 12px;
|
|
13
|
-
text-align: center;
|
|
14
|
-
opacity: 0.7;
|
|
15
|
-
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
`,Pe=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
18
|
-
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;function ve({titleFontFamily:t,descriptionFontFamily:n}){const r=y.useTheme()?.typography?.fontFamily;p.useEffect(()=>{},[t,n]);const a=`${r}, ${Pe}`;return e.jsx(B.Global,{styles:B.css`
|
|
19
|
-
#app {
|
|
20
|
-
font-family: ${a};
|
|
21
|
-
|
|
22
|
-
.page-kit-section__title {
|
|
23
|
-
font-family: ${a};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.page-kit-section__description {
|
|
27
|
-
font-family: ${a};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`})}function V(t){return t!=null}function we(){const[t]=v.useSearchParams(),{session:n}=z.useSessionContext(),c=z.useIsRoleOrMultiTenant("owner","admin","pagesEditor","member"),r=p.useMemo(()=>{const o=t.get("mode");return _.STATE_MODES.includes(o)?o:"production"},[t]),a=r==="production"?r:n.user?c?r:"production":null;return a?e.jsx(Q,{mode:a}):null}function Q({mode:t}){if(t!=="draft"){const n=window.__PAGE_STATE__;return n?e.jsx(E,{mode:t,state:n}):e.jsx(Re,{mode:t,children:({state:c})=>e.jsx(E,{mode:t,state:c})})}return e.jsx(Se,{children:({state:n})=>e.jsx(E,{mode:t,state:n})})}const ke=p.lazy(()=>Promise.resolve().then(()=>require("./publish-button-BAFrnjhg.js"))),Se=p.lazy(()=>Promise.resolve().then(()=>require("./draft-data-BM4piqW0.js")));function Re({mode:t,children:n}){const r=document.querySelector('meta[property="pages:version"]')?.content,a=k.useProjectId(),o=p.useMemo(()=>{if(r==="{{pagesPublishedAt}}"){const l=localStorage.getItem(k.getProjectPageVersionKey(a??""));return Number(l)?Number(l):new Date().getTime()}return Number(r)},[r]),{loading:g,value:i}=W.useAsync(()=>_.getPages({mode:t,version:o}),[t,o]);return g?e.jsx(J,{}):i?n({state:i}):null}function E({mode:t,state:n}){const{t:c,locale:r}=$.useLocaleContext(),[a]=v.useSearchParams(),o=k.useProjectId(),g=k.useProjectSlug(),i=a.get("hiddenBadge")==="true",l=a.get("showPublish")==="true",{pageIds:h,pages:u,routeIds:d,routes:j,supportedLocales:b,config:{defaultLocale:P},resources:C}=n,x=k.getAllComponents(n),f=p.useMemo(()=>b?.some(m=>m.locale===r)?r:void 0,[r,b]),q=Object.values(j||{}).find(m=>m?.path==="/")||Object.values(u).find(m=>m?.slug==="/")?void 0:Object.values(u)[0],O=p.useMemo(()=>t==="production"?h.map(m=>{const s=u[m];return s&&{id:s.id,path:S.joinURL("/",g||o||"",s.slug)}}).filter(V):d.map(m=>{const s=j[m];return s?{id:s.id,path:S.joinURL("/",g||o||"",s.path,`?mode=${t}&showPublish=true`)}:null}).filter(V),[h,u,t,j,d,o,g]),T=([...m])=>(t!=="production"&&l&&m.unshift(e.jsx(p.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(ke,{ref:{current:null},mode:"production",state:n})})),m);return e.jsxs(_.Provider,{value:{pages:O},children:[e.jsxs(v.Routes,{children:[q&&e.jsx(v.Route,{index:!0,element:e.jsx(v.Navigate,{to:S.joinURL("/",f||"",q.slug)})}),d?.map(m=>{const s=j?.[m];if(!s||!s.displayTemplateId)return null;const A=u[s.displayTemplateId];if(!A)return null;let D=[];return s.params&&s.params.length>0&&(D=re.generateParamCombinations({basePath:s.path,params:s.params,routeId:s.id,paramsOptions:s.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]})?.map(H=>{const N=H.paramOptionIds.join("-");return e.jsx(v.Route,{path:S.joinURL(":projectIdOrSlug?",H.path),element:e.jsx(U,{mode:t,components:x,page:A,locale:f,defaultLocale:P,headerAddons:T,state:n,pageData:s.dataSource?.pathDataMappings?.[N]?.dataCache?.[f||P||"en"]})},N)})),D.push(e.jsx(v.Route,{path:S.joinURL(":projectIdOrSlug?",s.path),element:e.jsx(U,{mode:t,components:x,page:A,locale:f,defaultLocale:P,headerAddons:T,state:n,pageData:s.dataSource?.pathDataMappings?.[s.id]?.dataCache?.[f||P||"en"]})},s.id)),D}),h.map(m=>{const s=u[m];return s?e.jsx(v.Route,{path:S.joinURL(":projectIdOrSlug?",s.slug),element:e.jsx(I,{mode:t,components:x,page:s,locale:f,defaultLocale:P,headerAddons:T})},s.id):null}),C.pages&&Object.values(C.pages).map(({blockletId:m,page:s})=>e.jsx(v.Route,{path:S.joinURL("/",`@${m}`,s.slug),element:e.jsx(I,{mode:t,components:x,page:s,locale:f,defaultLocale:P,headerAddons:T})},s.id)),e.jsx(v.Route,{path:"*",element:e.jsx(y.Box,{sx:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(K.default,{status:404,extra:e.jsx(ee,{href:"/",children:c("common.back")}),sx:{bgcolor:"transparent",width:"100%",height:"100%"}})})})]}),t!=="production"&&!i&&e.jsx(ye,{sx:{bgcolor:"info.light"},children:t}),e.jsx(ve,{})]})}function U({mode:t,pageData:n,components:c,page:r,locale:a,defaultLocale:o,headerAddons:g,state:i}){const l=F.useReactive({page:null});p.useEffect(()=>{const u=r||null;u?l.page=L.default(u):l.page=null},[r,JSON.stringify(r),l]);const h=p.useRef(void 0);return p.useEffect(()=>{Y.default(n,h.current)||n&&l.page&&(G.setPageDataSource(l.page,i,a,n),h.current=L.default(n))},[l.page,n,a,i]),l.page?e.jsx(I,{mode:t,components:c,page:l.page,locale:a,defaultLocale:o,headerAddons:g}):null}function Ce({mode:t,state:n,path:c,pageData:r}){const{t:a,locale:o}=$.useLocaleContext(),{pages:g,supportedLocales:i,config:{defaultLocale:l},resources:h}=n,u=Object.values(g).find(x=>x?.slug===c),d=Object.values(h.pages||{}).find(x=>x.page.slug===c),j=p.useMemo(()=>i?.some(x=>x.locale===o)?o:void 0,[o,i]),b=F.useReactive({page:null});p.useEffect(()=>{const x=u||d?.page||null;x?b.page=L.default(x):b.page=null},[u,d]);const P=p.useRef(void 0);if(p.useEffect(()=>{Y.default(r,P.current)||r&&b.page&&(G.setPageDataSource(b.page,n,j,r),P.current=L.default(r))},[{}]),!u&&!d?.page)return e.jsx(y.Box,{sx:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(K.default,{style:{background:"inherit"},status:404,extra:e.jsx(ee,{href:"/",children:a("common.back")})})});const C=k.getAllComponents(n);return b.page?e.jsx(I,{mode:t,components:C,page:b.page,locale:j,defaultLocale:l}):null}function I({mode:t,components:n,page:c,locale:r,defaultLocale:a,headerAddons:o}){const g=oe.useColorConvert(),i=c.locales?.[r]??c.locales?.[a]??{},l=i.title||window.blocklet?.appName,h=i.description||window.blocklet?.appDescription,u=k.autoResizeImage(k.getImageAbsoluteUrl(i.image),540),{logo:d,brand:j,description:b,...P}=ne.useHeaderState(),C=p.useMemo(()=>f=>{let w=o?.(f)??f;return w=P.addons?.(w)??w,w},[P.addons,o]),x=p.useMemo(()=>i.header?.translucent?Z:X,[i.header?.translucent]);return e.jsxs(_.PageProvider,{page:c,defaultLocale:a,currentLocale:r,children:[e.jsx(B.Global,{styles:B.css`
|
|
31
|
-
body {
|
|
32
|
-
background-color: ${g(!i.backgroundColor||i.backgroundColor==="transparent"?"background.default":i.backgroundColor)} !important;
|
|
33
|
-
}
|
|
34
|
-
`}),e.jsx(x,{hideNavMenu:!!i.header?.hideNavMenus,translucentTextColor:i.header?.translucentTextColor,...d?{logo:d}:{},...j?{brand:j}:{},...b?{description:b}:{},className:ae.cx(i.header?.sticky&&"sticky","page-header"),maxWidth:!1,addons:C}),e.jsx(v.ScrollRestoration,{}),e.jsxs(de.Helmet,{children:[e.jsx("title",{children:l}),e.jsx("meta",{name:"og:title",content:l}),e.jsx("meta",{name:"og:description",content:h}),e.jsx("meta",{name:"og:image",content:u}),e.jsx("meta",{name:"twitter:image:src",content:u}),e.jsx("meta",{name:"twitter:image",content:u}),e.jsx("meta",{property:"twitter:description",content:h}),e.jsx("meta",{property:"twitter:title",content:l}),e.jsx("meta",{name:"description",content:h})]}),e.jsx(y.Stack,{className:"PageView-root",sx:{flexGrow:1,"& .BlockBase-root:first-child":{pt:"0 !important"}},children:c.sectionIds.map(f=>{const w=c.sections[f];if(!w||w.visibility==="hidden")return null;const q=c.dataSource?.[f]?.[r],O=c.dataSource?.[f]?.[a]??{};return e.jsx(_.BlockRenderer,{id:f,type:w.component,mode:t,section:w,config:{...he.default(q)?O:q,locale:r,dev:t==="draft"?{mode:t,components:n,defaultLocale:a}:{mode:t,defaultLocale:a}},page:c},f)})}),!i.footer?.hidden&&e.jsx(je,{})]})}const X=M.styled(ge.default)`
|
|
35
|
-
&.sticky {
|
|
36
|
-
position: sticky;
|
|
37
|
-
top: 0;
|
|
38
|
-
}
|
|
39
|
-
`;function qe({logo:t}){const[n,c]=p.useState(),r=y.useMediaQuery(o=>o.breakpoints.down("sm")),{value:a}=W.useAsync(()=>{const o=new URL(r?window?.blocklet?.appLogo||"/.well-known/service/blocklet/logo":window?.blocklet?.appLogoRect||"/.well-known/service/blocklet/logo-rect",window.location.origin);o.searchParams.delete("imageFilter"),o.searchParams.delete("f");const g=o.toString();return new Promise(i=>{fetch(g).then(l=>{l.headers.get("content-type")?.includes("svg")&&l.text().then(u=>{c(u),i(null)}),i(l.url)})})},[r]);if(t)return t;if(n)return e.jsx(y.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:me.default.sanitize(n)}});if(a){const o=new URL(a);o.searchParams.set("imageFilter","convert"),o.searchParams.set("f","png"),o.searchParams.set("h","80");const g=o.toString();return e.jsx("img",{src:g,alt:"logo"})}return null}function Z({logo:t,translucentTextColor:n,...c}){const a=F.useScroll(document.getElementById("app"),d=>d.top<1200),o=y.useTheme(),g=Math.min(a?.top??0,800),i=p.useMemo(()=>{let d=Math.min(g/800,1),j="";return d>.1?(d=Math.max(d,.6),j=y.alpha(o.palette.text.primary,d)):j=n||"#EEEEEE",{backgroundOpacity:d,textColor:j,isReversed:d<.7}},[g,800,o.palette.text.primary,n]),{backgroundOpacity:l,textColor:h,isReversed:u}=i;return e.jsx(X,{logo:e.jsx(qe,{logo:t}),...c,sx:{position:"fixed !important",top:0,left:0,right:0,zIndex:o.zIndex.appBar,backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:-1,backgroundColor:y.alpha(o.palette.background.default,l),backdropFilter:l>=.6?"blur(10px)":"blur(0px)",transition:"backgroundColor 0.3s ease-in-out"},transition:"color 0.3s ease-in-out",".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${h} !important`},".header-logo":{color:`${h} !important`},"& .navmenu--horizontal":{bgcolor:"transparent !important"},".header-logo > div":{filter:`invert(${u?1:0})`,transition:"filter 0.3s ease-in-out"}}})}const ee=M.styled(y.Button)``;exports.Home=we;exports.HomeView=Q;exports.Loading=J;exports.PageRoutes=E;exports.PageView=I;exports.PageViewByPath=Ce;exports.PageViewWithDataSource=U;exports.TranslucentHeader=Z;
|