@kaitranntt/ccs 7.77.1-dev.11 → 7.77.1-dev.13
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/auth/auth-commands.d.ts +2 -1
- package/dist/auth/auth-commands.d.ts.map +1 -1
- package/dist/auth/auth-commands.js +18 -4
- package/dist/auth/auth-commands.js.map +1 -1
- package/dist/auth/commands/backup-command.d.ts.map +1 -1
- package/dist/auth/commands/backup-command.js +7 -2
- package/dist/auth/commands/backup-command.js.map +1 -1
- package/dist/auth/commands/create-command.d.ts.map +1 -1
- package/dist/auth/commands/create-command.js +14 -16
- package/dist/auth/commands/create-command.js.map +1 -1
- package/dist/auth/commands/default-command.d.ts +1 -1
- package/dist/auth/commands/default-command.d.ts.map +1 -1
- package/dist/auth/commands/default-command.js +10 -2
- package/dist/auth/commands/default-command.js.map +1 -1
- package/dist/auth/commands/index.d.ts +1 -0
- package/dist/auth/commands/index.d.ts.map +1 -1
- package/dist/auth/commands/index.js +3 -1
- package/dist/auth/commands/index.js.map +1 -1
- package/dist/auth/commands/list-command.d.ts.map +1 -1
- package/dist/auth/commands/list-command.js +16 -3
- package/dist/auth/commands/list-command.js.map +1 -1
- package/dist/auth/commands/remove-command.d.ts.map +1 -1
- package/dist/auth/commands/remove-command.js +5 -1
- package/dist/auth/commands/remove-command.js.map +1 -1
- package/dist/auth/commands/resources-command.d.ts +3 -0
- package/dist/auth/commands/resources-command.d.ts.map +1 -0
- package/dist/auth/commands/resources-command.js +115 -0
- package/dist/auth/commands/resources-command.js.map +1 -0
- package/dist/auth/commands/show-command.d.ts.map +1 -1
- package/dist/auth/commands/show-command.js +13 -4
- package/dist/auth/commands/show-command.js.map +1 -1
- package/dist/auth/commands/types.d.ts +11 -1
- package/dist/auth/commands/types.d.ts.map +1 -1
- package/dist/auth/commands/types.js +41 -2
- package/dist/auth/commands/types.js.map +1 -1
- package/dist/auth/profile-continuity-inheritance.d.ts.map +1 -1
- package/dist/auth/profile-continuity-inheritance.js +2 -1
- package/dist/auth/profile-continuity-inheritance.js.map +1 -1
- package/dist/auth/profile-detector.d.ts.map +1 -1
- package/dist/auth/profile-detector.js +1 -0
- package/dist/auth/profile-detector.js.map +1 -1
- package/dist/auth/profile-registry.d.ts +2 -0
- package/dist/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +6 -2
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/auth/shared-resource-policy.d.ts +20 -0
- package/dist/auth/shared-resource-policy.d.ts.map +1 -0
- package/dist/auth/shared-resource-policy.js +69 -0
- package/dist/auth/shared-resource-policy.js.map +1 -0
- package/dist/cliproxy/auth/oauth-handler.d.ts +34 -0
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +85 -13
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/commands/command-catalog.d.ts +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +1 -0
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/completion-backend.d.ts.map +1 -1
- package/dist/commands/completion-backend.js +7 -0
- package/dist/commands/completion-backend.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +1 -0
- package/dist/commands/help-command.js.map +1 -1
- package/dist/commands/sync-command.d.ts.map +1 -1
- package/dist/commands/sync-command.js +3 -2
- package/dist/commands/sync-command.js.map +1 -1
- package/dist/config/migration-manager.d.ts.map +1 -1
- package/dist/config/migration-manager.js +12 -0
- package/dist/config/migration-manager.js.map +1 -1
- package/dist/config/schemas/auth.d.ts +2 -0
- package/dist/config/schemas/auth.d.ts.map +1 -1
- package/dist/config/schemas/auth.js.map +1 -1
- package/dist/dispatcher/flows/account-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/account-flow.js +4 -3
- package/dist/dispatcher/flows/account-flow.js.map +1 -1
- package/dist/shared/claude-extension-setup.d.ts.map +1 -1
- package/dist/shared/claude-extension-setup.js +5 -1
- package/dist/shared/claude-extension-setup.js.map +1 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/ui/assets/accounts-CW9bbE4S.js +1 -0
- package/dist/ui/assets/{alert-dialog-CDKh6Iej.js → alert-dialog-ClPYGzV3.js} +1 -1
- package/dist/ui/assets/{api-BHoqwj9I.js → api-BjpAFHdA.js} +1 -1
- package/dist/ui/assets/{auth-section--qaXBZqv.js → auth-section-wl4-fzwD.js} +1 -1
- package/dist/ui/assets/{backups-section-B0UrPJSd.js → backups-section-CRfyOhtX.js} +1 -1
- package/dist/ui/assets/{channels-LNSoyw91.js → channels-DH0HkSGX.js} +1 -1
- package/dist/ui/assets/{checkbox-qW_Bg5Pj.js → checkbox-CTpEjpTH.js} +1 -1
- package/dist/ui/assets/{claude-extension-CMbaulCy.js → claude-extension-BQOBO5Au.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-DM_Qss9R.js → cliproxy-ai-providers-DoUPKyI5.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-L8agopTe.js → cliproxy-control-panel-CvjXdHw9.js} +1 -1
- package/dist/ui/assets/{cliproxy-275p7_R-.js → cliproxy-qUbiZjec.js} +2 -2
- package/dist/ui/assets/{codex-Bq4vc-Bt.js → codex-BeeazJpw.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-DT--b5KS.js → confirm-dialog-CYj_LLWN.js} +1 -1
- package/dist/ui/assets/{copilot-C-h6PKsb.js → copilot-ZCJeM_Zk.js} +1 -1
- package/dist/ui/assets/{cursor-BNYNTdOU.js → cursor-CtBjQ1_j.js} +1 -1
- package/dist/ui/assets/{droid-BDcKP8ys.js → droid-BLmzMBtN.js} +1 -1
- package/dist/ui/assets/{globalenv-section-B-MZK7oT.js → globalenv-section-0ENDeVbM.js} +1 -1
- package/dist/ui/assets/{health-Z4tbeEMB.js → health-BEnDHk-j.js} +1 -1
- package/dist/ui/assets/{icons-DIVjDO-z.js → icons-DzKUh8vG.js} +1 -1
- package/dist/ui/assets/{index-BYH8td_-.js → index-B3xma6R0.js} +1 -1
- package/dist/ui/assets/{index-BnUnpDeI.js → index-Bs28kNJN.js} +27 -27
- package/dist/ui/assets/{index-CNr-xTDQ.js → index-C04Kst21.js} +1 -1
- package/dist/ui/assets/{index-XlZulaah.js → index-Cip18A41.js} +1 -1
- package/dist/ui/assets/{index-lrKih76J.js → index-ClMz157R.js} +1 -1
- package/dist/ui/assets/index-D2_yb3d2.css +1 -0
- package/dist/ui/assets/{index-Bx05FUIb.js → index-DrCrZ7r1.js} +1 -1
- package/dist/ui/assets/{index-DeESkz1L.js → index-O9Qq-UJq.js} +1 -1
- package/dist/ui/assets/{logs-CPq1nOO3.js → logs-DQxVdsHm.js} +1 -1
- package/dist/ui/assets/{masked-input-DKEaMpuM.js → masked-input-eN6tFUjN.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-DHvXGB-0.js → proxy-status-widget-50UIM6S8.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-DYFizqns.js → raw-json-settings-editor-panel-DqKmVWL-.js} +1 -1
- package/dist/ui/assets/{searchable-select-0sMBiw79.js → searchable-select-JO0gngYE.js} +1 -1
- package/dist/ui/assets/{separator-Iwj015MP.js → separator-AoncAA6l.js} +1 -1
- package/dist/ui/assets/shared-BTv96-3y.js +8 -0
- package/dist/ui/assets/{table-BtToEVHU.js → table-BM_YK49c.js} +1 -1
- package/dist/ui/assets/{updates-TpeG63IU.js → updates-eo4H4NOg.js} +1 -1
- package/dist/ui/assets/use-accounts-ELLatpzU.js +1 -0
- package/dist/ui/index.html +3 -3
- package/dist/web-server/routes/account-route-helpers.d.ts +3 -0
- package/dist/web-server/routes/account-route-helpers.d.ts.map +1 -1
- package/dist/web-server/routes/account-route-helpers.js.map +1 -1
- package/dist/web-server/routes/account-routes.d.ts.map +1 -1
- package/dist/web-server/routes/account-routes.js +97 -4
- package/dist/web-server/routes/account-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +29 -0
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/shared-routes-collections.d.ts +13 -0
- package/dist/web-server/shared-routes-collections.d.ts.map +1 -0
- package/dist/web-server/shared-routes-collections.js +170 -0
- package/dist/web-server/shared-routes-collections.js.map +1 -0
- package/dist/web-server/shared-routes-content.d.ts +16 -0
- package/dist/web-server/shared-routes-content.d.ts.map +1 -0
- package/dist/web-server/shared-routes-content.js +152 -0
- package/dist/web-server/shared-routes-content.js.map +1 -0
- package/dist/web-server/shared-routes-markdown-walker.d.ts +12 -0
- package/dist/web-server/shared-routes-markdown-walker.d.ts.map +1 -0
- package/dist/web-server/shared-routes-markdown-walker.js +97 -0
- package/dist/web-server/shared-routes-markdown-walker.js.map +1 -0
- package/dist/web-server/shared-routes-markdown.d.ts +18 -0
- package/dist/web-server/shared-routes-markdown.d.ts.map +1 -0
- package/dist/web-server/shared-routes-markdown.js +167 -0
- package/dist/web-server/shared-routes-markdown.js.map +1 -0
- package/dist/web-server/shared-routes-path-guards.d.ts +16 -0
- package/dist/web-server/shared-routes-path-guards.d.ts.map +1 -0
- package/dist/web-server/shared-routes-path-guards.js +93 -0
- package/dist/web-server/shared-routes-path-guards.js.map +1 -0
- package/dist/web-server/shared-routes-plugin-registry-content.d.ts +12 -0
- package/dist/web-server/shared-routes-plugin-registry-content.d.ts.map +1 -0
- package/dist/web-server/shared-routes-plugin-registry-content.js +93 -0
- package/dist/web-server/shared-routes-plugin-registry-content.js.map +1 -0
- package/dist/web-server/shared-routes-plugins.d.ts +21 -0
- package/dist/web-server/shared-routes-plugins.d.ts.map +1 -0
- package/dist/web-server/shared-routes-plugins.js +197 -0
- package/dist/web-server/shared-routes-plugins.js.map +1 -0
- package/dist/web-server/shared-routes-symlink-status.d.ts +27 -0
- package/dist/web-server/shared-routes-symlink-status.d.ts.map +1 -0
- package/dist/web-server/shared-routes-symlink-status.js +135 -0
- package/dist/web-server/shared-routes-symlink-status.js.map +1 -0
- package/dist/web-server/shared-routes-types.d.ts +23 -0
- package/dist/web-server/shared-routes-types.d.ts.map +1 -0
- package/dist/web-server/shared-routes-types.js +15 -0
- package/dist/web-server/shared-routes-types.js.map +1 -0
- package/dist/web-server/shared-routes.d.ts +2 -1
- package/dist/web-server/shared-routes.d.ts.map +1 -1
- package/dist/web-server/shared-routes.js +49 -455
- package/dist/web-server/shared-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/accounts-CZAk1r5e.js +0 -1
- package/dist/ui/assets/index-CczVFk1P.css +0 -1
- package/dist/ui/assets/shared-DsbHybKL.js +0 -8
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as j}from"./react-vendor-Bjx91N7w.js";import{a as Q,bv as ee,bw as se,bx as te,Q as ae,R as re,U as ne,B as $,bi as S,bj as M,bk as L,d as I,I as le,n as B,c as U,C as ie,b as de}from"./index-BnUnpDeI.js";import{a3 as ce,aa as oe,b8 as me,T as E,R as T,F as he,av as ue,w as xe}from"./icons-DIVjDO-z.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";function Se(){const{t:s}=Q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:q,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(q,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:U("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:U("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=Q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
|
|
2
|
-
`).trim();if(!a)return{blocks:[],frontmatter:[]};let l=a;const t=[];if(l.startsWith(`---
|
|
3
|
-
`)){const r=l.indexOf(`
|
|
4
|
-
---
|
|
5
|
-
`,4);if(r!==-1){const d=l.slice(4,r).trim();for(const n of d.split(`
|
|
6
|
-
`)){const o=n.match(/^([A-Za-z0-9_-]+)\s*:\s*(.+)$/);o&&t.push({key:o[1],value:o[2].trim().replace(/^['"]|['"]$/g,"")})}l=l.slice(r+5).trim()}}return{blocks:je(l),frontmatter:t}}function je(s){if(!s.trim())return[];const a=s.split(`
|
|
7
|
-
`),l=[];let t=[],r=[],d=[],n="",o=null;const c=()=>{t.length!==0&&(l.push({type:"paragraph",text:t.join(" ")}),t=[])},h=()=>{r.length!==0&&(l.push({type:"unordered-list",items:r}),r=[])},p=()=>{d.length!==0&&(l.push({type:"ordered-list",items:d}),d=[])},w=()=>{o&&(l.push({type:"code",language:n,content:o.join(`
|
|
8
|
-
`)}),n="",o=null)};for(const m of a){if(o){m.trim().startsWith("```")?w():o.push(m);continue}if(m.trim().startsWith("```")){c(),h(),p(),n=m.trim().replace(/^```/,"").trim(),o=[];continue}if(m.trim().length===0){c(),h(),p();continue}const x=m.match(/^(#{1,6})\s+(.*)$/);if(x){c(),h(),p(),l.push({type:"heading",level:x[1].length,text:x[2].trim()});continue}const y=m.match(/^\s*[-*]\s+(.*)$/);if(y){c(),p(),r.push(y[1].trim());continue}const g=m.match(/^\s*\d+\.\s+(.*)$/);if(g){c(),h(),d.push(g[1].trim());continue}h(),p(),t.push(m.trim())}return c(),h(),p(),w(),l}export{Se as SharedPage};
|