@uibot/registry 0.5.0 → 0.7.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/dist/index.js +9 -9
- package/dist/shadcn/r/admin-dashboard.json +70 -0
- package/dist/shadcn/r/admin-shell.json +148 -0
- package/dist/shadcn/r/ai-chat.json +74 -0
- package/dist/shadcn/r/analytics-dashboard.json +65 -0
- package/dist/shadcn/r/app-shell-floating.json +54 -0
- package/dist/shadcn/r/app-shell-icon-rail.json +54 -0
- package/dist/shadcn/r/app-shell-inset.json +54 -0
- package/dist/shadcn/r/app-shell-settings.json +54 -0
- package/dist/shadcn/r/app-shell-sidebar.json +54 -0
- package/dist/shadcn/r/app-shell-workspace.json +54 -0
- package/dist/shadcn/r/auth.json +61 -0
- package/dist/shadcn/r/blog.json +64 -0
- package/dist/shadcn/r/charts.json +211 -0
- package/dist/shadcn/r/content.json +444 -0
- package/dist/shadcn/r/creation-html-generation.json +29 -0
- package/dist/shadcn/r/creation-reference-generation.json +29 -0
- package/dist/shadcn/r/creation-revision-export.json +27 -0
- package/dist/shadcn/r/creation-shared.json +24 -0
- package/dist/shadcn/r/creation-workspace.json +33 -0
- package/dist/shadcn/r/crm.json +67 -0
- package/dist/shadcn/r/dashboard.json +147 -0
- package/dist/shadcn/r/data-studio.json +368 -0
- package/dist/shadcn/r/data-table.json +224 -0
- package/dist/shadcn/r/data.json +320 -0
- package/dist/shadcn/r/ecommerce.json +65 -0
- package/dist/shadcn/r/feedback.json +300 -0
- package/dist/shadcn/r/field.json +164 -0
- package/dist/shadcn/r/form.json +425 -0
- package/dist/shadcn/r/grid.json +188 -0
- package/dist/shadcn/r/interactive.json +355 -0
- package/dist/shadcn/r/kanban.json +154 -0
- package/dist/shadcn/r/layout.json +529 -0
- package/dist/shadcn/r/lms.json +74 -0
- package/dist/shadcn/r/marketing.json +402 -0
- package/dist/shadcn/r/nav.json +257 -0
- package/dist/shadcn/r/portfolio.json +62 -0
- package/dist/shadcn/r/presentation.json +454 -0
- package/dist/shadcn/r/pricing.json +63 -0
- package/dist/shadcn/r/primitives.json +360 -0
- package/dist/shadcn/r/saas-landing.json +60 -0
- package/dist/shadcn/r/sections.json +734 -0
- package/dist/shadcn/r/settings.json +72 -0
- package/dist/shadcn/r/shadcn-admin-shell.json +49 -0
- package/dist/shadcn/r/shadcn-admin.json +76 -0
- package/dist/shadcn/r/store.json +75 -0
- package/dist/shadcn/r/support-inbox.json +63 -0
- package/dist/shadcn/r/team-directory.json +59 -0
- package/dist/shadcn/r/uibot-base.json +30 -0
- package/dist/shadcn/r/uibot-theme.json +86 -0
- package/dist/shadcn/r/workspace.json +174 -0
- package/dist/shadcn/registry.json +615 -0
- package/dist/shadcn.d.ts +10 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{lstatSync as
|
|
2
|
+
import{lstatSync as gr,mkdirSync as Ue,readFileSync as mr,realpathSync as fr,writeFileSync as je}from"fs";import{basename as yr,dirname as ue,isAbsolute as Cr,resolve as E,sep as Ne}from"path";function Ke(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let s of r)n.set(s.name,s);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let o=[],a=new Set;for(let s of e.lockfile.artifacts??[]){a.add(s.name);let l=n.get(s.name);if(!l){o.push({name:s.name,kind:"missing-in-manifest",lockVersion:s.version,detail:`locked ${s.name}@${s.version} not present in registry manifest`});continue}let c=Ge(l);if(c&&c!==s.version)o.push({name:s.name,kind:"version-mismatch",lockVersion:s.version,manifestVersion:c,detail:`${s.name}: lock ${s.version} \u2260 registry ${c}`})}return{ok:o.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:o}}function Ge(e){return e.artifact?.version??e.version}function Ye(){return{version:1,artifacts:[]}}function Je(e){return{version:1,artifacts:e}}import{readFileSync as Qe,realpathSync as ge}from"fs";import{resolve as B,relative as Ze,dirname as Xe,extname as et,sep as Z}from"path";function tt(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function rt(e){let t=e.readFile??((c)=>Qe(c,"utf8")),r=new Map,n=(c,d=B(e.sourceDir))=>{let u=Ze(d,B(c));if(u===".."||u.startsWith(`..${Z}`)||u.startsWith(Z))throw Error(`Block dependency outside sourceDir: ${c}`);return u.replaceAll(Z,"/")},o=(c)=>{if(n(B(e.sourceDir,c)),!e.readFile)n(ge(B(e.sourceDir,c)),ge(e.sourceDir));let d=r.get(c);if(d!==void 0)return d;let u=t(B(e.sourceDir,c));return r.set(c,u),u},a=(c)=>{let d=new Map,u=(f)=>{if(d.has(f))return;let p=o(f);d.set(f,{path:f,type:tt(f),content:p});let i=p.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let g of i){let y=n(B(e.sourceDir,Xe(f),g[1]??"")),C=et(y)?[y]:[`${y}.ts`,`${y}.tsx`,`${y}/index.ts`,`${y}/index.tsx`],S;for(let F of C)try{o(F),S=F;break}catch(D){if(D instanceof Error&&D.message.includes("outside sourceDir"))throw D}if(!S)throw Error(`Unresolved block dependency: ${f} -> ${g[1]}`);u(S)}};return u(c),[...d.values()]},s=(c)=>{let d=new Set;for(let u of c){if(typeof u.content!=="string")continue;for(let f of u.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let p=f[1]??"";if(p.startsWith("node:"))continue;let i=p.startsWith("@")?p.split("/").slice(0,2).join("/"):p.split("/")[0]??"";if(i==="react"||i==="react-dom"||i.startsWith("@uibot/"))continue;d.add(i)}}return[...d].sort()},l=[];for(let c of Object.keys(e.catalog)){let d=e.blockFileMap[c];if(d===void 0)continue;let u=e.catalog[c];if(u===void 0)continue;let f=o(d),p=a(d),i=s(p);l.push({name:c,category:u.category,description:u.description,sourceCode:f,files:p,catalogEntry:u,...i.length>0?{dependencies:i}:{}})}return l}function $r(e){return e.flatMap((t)=>rt(t))}import{readdirSync as nt,readFileSync as ot,statSync as it}from"fs";import{basename as st,join as at}from"path";var ct="0.1.0";function me(e){let{dir:t}=e,r;try{r=nt(t)}catch{return[]}let n=e.defaultVersion??ct,o=e.defaultLevel??"L4",a=e.defaultCategory??"template",s=[];for(let l of r){if(!/\.ya?ml$/i.test(l))continue;let c=at(t,l);try{if(!it(c).isFile())continue}catch{continue}let d=ot(c,"utf8");if(!d.trim())continue;let u=st(l).replace(/\.ya?ml$/i,""),f=dt(u),p=ut(u),i=pt(d)??`${p} template`;s.push({name:f,version:n,title:p,description:i,yaml:d,absolutePath:c,templateContract:{name:f,description:i,level:o,category:a,keywords:[f,u.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:gt(d)}})}return s.sort((l,c)=>l.name.localeCompare(c.name))}function lt(e){let t=new Map;for(let r of e)for(let n of me(r)){let o=t.get(n.name);if(o)throw Error(`duplicate template source name "${n.name}": ${o.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function fe(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function X(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:fe(e)}}function dt(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function ut(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function pt(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function gt(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var mt="0.1.0";function ft(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??mt,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function ye(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:ft(e,t)}}function Gr(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((a)=>ye(a,r)),o=(t.templates??[]).map((a)=>X(a));return{name:t.name,items:[...n,...o]}}function Yr(e,t={}){return ye(e,t)}var ht={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},Un=Array.from(new Set(Object.values(ht).flat()));var Ce=["experimental","candidate","recommended"];var he=["missing","declared","verified","external-consumer"],ee=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],bt=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])})]);var te="uibot.registry.item.v1";var Rt="https://ui.shadcn.com/schema/registry.json",xt="https://ui.shadcn.com/schema/registry-item.json",kt=["clsx","tailwind-merge"],Pt="components/uibot",St="lib",It="@uibot",At="uibot/templates",re="uibot-base",be="uibot-theme";function ne(e){return e.replace(/\./g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Re(e,t){let r=e.sourceCode;if(r=r.replace(/import\s+(type\s+)?(\{[^}]*\})\s+from\s+["']@uibot\/renderer-react["'];?/g,(a,s,l)=>`import ${s??"type "}${l} from "${t.rendererShimImport}";`),t.contractsShimImport){let a=t.contractsShimImport;r=r.replace(/import\s+(type\s+)?(\{[^}]*\})\s+from\s+["']@uibot\/contracts["'];?/g,(s,l,c)=>`import ${l??"type "}${c} from "${a}";`)}let n=new Set;r=r.replace(/\bReact\.([A-Z]\w*)/g,(a,s)=>(n.add(s),s));let o=!1;if(r=r.replace(/(?:^|\n)function cn\([\s\S]*?\)\s*(?::[^\n{]+)?\{[\s\S]*?\n\}\n?/,()=>(o=!0,`
|
|
3
3
|
`)),o){let a=`import { cn } from "${t.cnUtilImport}";
|
|
4
|
-
`,
|
|
5
|
-
`,r.indexOf("import "));if(
|
|
4
|
+
`,s=r.indexOf(`
|
|
5
|
+
`,r.indexOf("import "));if(s>=0)r=`${r.slice(0,s+1)}${a}${r.slice(s+1)}`;else r=a+r}if(n.size>0){let a=[...n].sort().join(", "),s=/import\s+type\s+\{([^}]*)\}\s+from\s+["']react["'];?/;if(s.test(r))r=r.replace(s,(l,c)=>`import type { ${[...new Set([...c.split(",").map((u)=>u.trim()).filter(Boolean),...n])].sort().join(", ")} } from "react";`);else{let l=`import type { ${a} } from "react";
|
|
6
6
|
`,c=r.indexOf(`
|
|
7
7
|
`,r.indexOf("import "));if(c>=0)r=`${r.slice(0,c+1)}${l}${r.slice(c+1)}`;else r=l+r}}return`${r.replace(/\n{3,}/g,`
|
|
8
8
|
|
|
9
9
|
`).trimStart().trimEnd()}
|
|
10
|
-
`}function
|
|
11
|
-
`,type:"registry:ui"})}let D={},Q=(t.templates??[]).filter((m)=>(m.channel??"public")===n),
|
|
12
|
-
`,type:"registry:lib"}],meta:{uibot:W}}}return vt(s,t.composites??[],{channel:n,ref:o,componentsDir:a}),{registry:{$schema:bt,name:t.registryName,...t.homepage?{homepage:t.homepage}:{},items:Object.values(s).map((m)=>({name:m.name,type:m.type,...m.description?{description:m.description}:{},...m.registryDependencies?{registryDependencies:m.registryDependencies}:{},...m.dependencies?{dependencies:m.dependencies}:{}}))},items:s,unresolvedTemplateTypes:D}}function vt(e,t,r){let n=new Map;for(let o of t){if(n.has(o.name)||e[o.name])throw Error(`composite item "${o.name}" collides with another item`);n.set(o.name,o)}for(let o of t){let a=o.channel??"public",i=xe(o),l=new Set(o.files.map((d)=>d.path));for(let d of o.requires??[]){let u=n.get(d);if(!u)throw Error(`composite "${o.name}" requires unknown "${d}"`);if((u.channel??"public")!==a)throw Error(`composite "${o.name}" (${a}) requires "${d}" from another channel`);if(xe(u)!==i)throw Error(`composite "${o.name}" requires "${d}" from another directory`);for(let f of u.files)l.add(f.path)}for(let d of o.files){if(!Pe.test(d.path))throw Error(`composite "${o.name}" file "${d.path}" must be a plain relative path`);for(let u of wt(d.content)){if(!u.startsWith("./")||u.includes("/../"))throw Error(`${o.name}/${d.path} imports ${u}; only ./ imports within the item directory are allowed`);let f=u.slice(2).replace(/\.js$/,"");if(![f,`${f}.ts`,`${f}.tsx`,`${f}/index.ts`,`${f}/index.tsx`].some((s)=>l.has(s)))throw Error(`${o.name}/${d.path} imports ${u}, which no required item ships`)}}if(a!==r.channel)continue;let c=o.files.map((d)=>{let u=`${r.componentsDir}/${i}/${d.path}`;return{path:u,target:u,content:d.content,type:d.path.endsWith(".tsx")?"registry:component":"registry:lib"}});e[o.name]={name:o.name,type:o.type,description:o.description,dependencies:["react",...o.dependencies??[]],registryDependencies:[...o.primitives??[],...(o.requires??[]).map(r.ref)],files:c,meta:{composite:!0,channel:a}}}}var Pe=/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)*$/i;function xe(e){if(!Pe.test(e.dir)||e.dir.split("/").includes(".."))throw Error(`composite "${e.name}" dir "${e.dir}" must be a plain relative path`);return e.dir}function wt(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:])\/\/.*$/gm,"$1"),r=[],n=[/\bfrom\s*["'](\.{1,2}\/[^"']+)["']/g,/\bimport\s*["'](\.{1,2}\/[^"']+)["']/g,/\bimport\s*\(\s*["'](\.{1,2}\/[^"']+)["']\s*\)/g];for(let o of n)for(let a of t.matchAll(o))r.push(a[1]??"");return r}function Et(e){if(e.baseUrl){let r=e.baseUrl.replace(/\/$/,"");return(n)=>`${r}/r/${n}.json`}let t=e.namespace??St;if(!/^@[a-z0-9][a-z0-9-]*$/.test(t))throw Error(`registry namespace must look like "@uibot", got "${t}"`);return(r)=>`${t}/${r}`}function Dt(e,t,r){let n=e.name.replace(/\./g,""),o=`${r}/`,a=t.files.find((i)=>i.path.startsWith(o)&&/\.(tsx|ts)$/.test(i.path)&&Tt(i.content,n));if(!a)throw Error(`block "${e.name}" has no named export "${n}" in item "${t.name}"`);return{name:e.name,export:n,module:a.path.slice(o.length),catalog:e.catalogEntry}}function Tt(e,t){let r=ke(t),n=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"");if(new RegExp(`export\\s+(?:const|let|function|class)\\s+${r}\\b`).test(n))return!0;for(let o of n.matchAll(/export\s*\{([^}]*)\}/g)){let a=(o[1]??"").split(",").map((l)=>{let[,c]=l.trim().split(/\s+as\s+/);return(c??l.trim().replace(/^type\s+/,"")).trim()}),i=(o[1]??"").split(",").map((l)=>l.trim()).filter((l)=>l.startsWith("type ")).map((l)=>l.replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim());if(a.includes(t)&&!i.includes(t))return!0}return!1}function Ot(e,t){return(e.split("/").pop()??t).replace(/\.(tsx|ts|jsx|js)$/,"")||t}var Ko=Rt;function Ft(e="/api/registry"){let t=(e||"/api/registry").trim(),r=t.startsWith("/")?t:`/${t}`;return r.length>1?r.replace(/\/$/,""):r}function U(e,t=200){return Response.json(e,{status:t})}function Yo(e){let t=Ft(e.basePath),r=`${t}/registry.json`,n=`${t}/artifacts/`,o=new Map(e.manifest.items.map((a)=>[a.name,a]));return async function(i){let l=new URL(i.url);if(i.method!=="GET")return U({error:"Method not allowed"},405);if(l.pathname===r)return U(e.manifest);if(l.pathname.startsWith(n)){let c=l.pathname.slice(n.length),d=decodeURIComponent(c.endsWith(".json")?c.slice(0,-5):c),u=o.get(d);if(!u)return U({error:`Artifact '${d}' not found`},404);return U(u)}return U({error:"Not found"},404)}}var oe="uibot.resource.admission.v1",Mt=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure"],_t=["packed-install","typecheck","browser"],Zo=["invalid-admission-manifest","invalid-admission-record","invalid-admission-check","duplicate-admission-record","unknown-admission-resource","missing-source-metadata","missing-license-metadata","dependency-closure-failed"];class Se extends Error{expected;actual;code="resource-admission-index-mismatch";constructor(e,t){super(`resource admission index mismatch: expected ${e}, received ${t}`);this.expected=e;this.actual=t;this.name="ResourceAdmissionIndexMismatchError"}}class Ie extends Error{issueCount;code="resource-admission-report-rejected";constructor(e){super(`resource admission report contains ${e.toString()} issue(s)`);this.issueCount=e;this.name="ResourceAdmissionReportRejectedError"}}class Ae extends Error{code="resource-admission-report-not-derived";constructor(){super("resource admission report must come directly from assessResourceAdmissions");this.name="ResourceAdmissionReportNotDerivedError"}}var Bt=new Set(ee),Lt=new Set(he),ve=new WeakSet,G={missing:0,declared:1,verified:2,"external-consumer":3};function Nt(e,t){return e<t?-1:e>t?1:0}function L(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function Y(e,t){let r=new Set(t);return Object.keys(e).every((n)=>r.has(n))}function we(e){return[...new Set(e.map((t)=>t.trim()).filter(Boolean))].sort(Nt)}function Vt(e,t,r,n){if(!L(r)||!Y(r,["status","evidence"])){n.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} must contain only status and evidence`});return}if(typeof r.status!=="string"||!Lt.has(r.status)||r.status==="missing"){n.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} status must be declared, verified or external-consumer`});return}if(!Array.isArray(r.evidence)||r.evidence.length===0||r.evidence.some((o)=>typeof o!=="string"||!o.trim())){n.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} evidence must be a non-empty string array`});return}return{status:r.status,evidence:we(r.evidence)}}function Ut(e){if(e===void 0)return;if(!L(e)||!Y(e,["source","version","license"]))return;if(Object.values(e).some((r)=>r!==void 0&&typeof r!=="string"))return;return{...typeof e.source==="string"&&e.source.trim()?{source:e.source.trim()}:{},...typeof e.version==="string"&&e.version.trim()?{version:e.version.trim()}:{},...typeof e.license==="string"&&e.license.trim()?{license:e.license.trim()}:{}}}function jt(e,t){let r=new Map,n=[];if(!L(t)||!Y(t,["schemaVersion","records"])||t.schemaVersion!==oe||!Array.isArray(t.records))return n.push({code:"invalid-admission-manifest",detail:`expected ${oe} with a records array`}),{records:r,issues:n};let o=new Set(e.resources.map((a)=>a.id));for(let a of t.records){if(!L(a)||!Y(a,["resourceId","provenance","checks"])||typeof a.resourceId!=="string"||!a.resourceId.trim()||!L(a.checks)){n.push({code:"invalid-admission-record",...L(a)&&typeof a.resourceId==="string"?{resourceId:a.resourceId}:{},detail:"record must contain only resourceId, optional provenance and checks"});continue}let i=a.resourceId.trim();if(r.has(i)){n.push({code:"duplicate-admission-record",resourceId:i,detail:i});continue}if(!o.has(i)){n.push({code:"unknown-admission-resource",resourceId:i,detail:i});continue}let l=Ut(a.provenance);if(a.provenance!==void 0&&!l){n.push({code:"invalid-admission-record",resourceId:i,detail:"provenance must contain only string source, version and license fields"});continue}let c={},d=!1;for(let[u,f]of Object.entries(a.checks)){if(!Bt.has(u)){n.push({code:"invalid-admission-check",resourceId:i,detail:`unknown receipt check: ${u}`}),d=!0;continue}let p=u,s=Vt(i,p,f,n);if(s)c[p]=s;else d=!0}if(d)continue;r.set(i,{resourceId:i,...l?{provenance:l}:{},checks:c})}return{records:r,issues:n}}function $t(e){let t=new Map(e.resources.map((o)=>[o.id,o])),r=new Map;function n(o,a,i,l){if(r.has(o)||l.has(a))return;if(i.has(a)){r.set(o,`dependency cycle reached ${a}`);return}let c=t.get(a);if(!c){r.set(o,`missing dependency ${a}`);return}i.add(a);for(let d of c.dependencies)if(n(o,d,i,l),r.has(o))break;i.delete(a),l.add(a)}for(let o of e.resources)n(o.id,o.id,new Set,new Set);return r}var qt=/^(unknown|unlicensed|none|n\/?a)$/i,zt=/^SPDX-License-Identifier:\s*(\S+)/im,Ht=/^(?:the\s+)?(mit|apache(?:\s+license(?:\s*,?\s*version\s*2\.0)?)?|bsd-2-clause|bsd-3-clause|isc|unlicense)\b/i;function M(e){let t=e?.trim();if(!t||qt.test(t))return;return t}function Wt(e){if(!e?.trim())return;let t=e.match(zt)?.[1];if(t)return M(t);let r=e.match(Ht)?.[1];if(!r)return;let n=r.toLowerCase();if(n.startsWith("mit"))return"MIT";if(n.startsWith("apache"))return"Apache-2.0";if(n.startsWith("bsd-2"))return"BSD-2-Clause";if(n.startsWith("bsd-3"))return"BSD-3-Clause";if(n==="isc")return"ISC";if(n==="unlicense")return"Unlicense";return}function Xo(e){return M(e.frontmatterLicense)??M(e.packageJsonLicense)??Wt(e.licenseFileText)}function Ee(e){return Boolean(M(e))}var j={states:/\b(disabled|loading|error|empty|pending|busy|children|active|muted|boolean-state)\b/i,accessibility:/\b(label|aria|accessible|alt|role)\b/i,"light-theme":/:root\b|\b(light(?:-theme)?|theme token|css variables?)\b/i,"dark-theme":/\b(dark(?:-theme)?)\b/i,responsive:/\b(size|responsive|breakpoint|sm|md|lg|xl|full)\b/i};function ie(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let n of e)ie(n,t);return}let r=e;for(let[n,o]of Object.entries(r)){if(t.push(n),n==="type"&&o==="boolean")t.push("boolean-state");ie(o,t)}}function Kt(e){let t=[];return ie(e.props,t),[e.name,e.description,...e.tags??[],...e.usageScenarios??[],...e.constraints??[],...t,...Object.keys(e.slots??{}),...Object.keys(e.events??{}),e.slots&&Object.keys(e.slots).length>0?"empty":""].join(`
|
|
13
|
-
`)}function
|
|
14
|
-
`);return{contract:Boolean(e.props&&Object.keys(e.props).length>0||e.events&&Object.keys(e.events).length>0||e.slots&&Object.keys(e.slots).length>0)?"verified":"declared",states:j.states.test(r)?"verified":"missing",accessibility:j.accessibility.test(r)?"verified":"missing","light-theme":j["light-theme"].test(r)?"verified":"missing","dark-theme":j["dark-theme"].test(r)?"verified":"missing",responsive:j.responsive.test(r)?"verified":"missing"}}function Gt(e){return{source:"declared",license:Ee(e.source.license)?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"}}function Yt(e){if(!Mt.every((n)=>G[e[n]]>=G.verified))return"experimental";return _t.every((n)=>e[n]==="external-consumer")?"recommended":"candidate"}function De(e){let t=JSON.stringify({schemaVersion:e.schemaVersion,resources:e.resources.map((o)=>({id:o.id,kind:o.kind,title:o.title,description:o.description,...o.category?{category:o.category}:{},tags:o.tags,aliases:o.aliases,capabilities:o.capabilities,dependencies:o.dependencies,source:o.source})),aliases:e.aliases}),r=0xcbf29ce484222325n,n=0x100000001b3n;for(let o of new TextEncoder().encode(t))r^=BigInt(o),r=BigInt.asUintN(64,r*n);return`fnv1a64:${r.toString(16).padStart(16,"0")}`}function Jt(e,t,r){let n=Gt(e),o=[`resource://${e.source.type}/${e.source.id}`,`resource://contract/${e.id}`],a=[];if(r)a.push({code:"dependency-closure-failed",resourceId:e.id,check:"dependency-closure",detail:r});else n["dependency-closure"]="verified",o.push(`resource://index/${e.id}`);if(t)for(let c of ee){if(c==="dependency-closure")continue;let d=t.checks[c];if(!d)continue;if(c==="source"&&G[d.status]>=G.verified&&(!t.provenance?.source||!t.provenance.version)){a.push({code:"missing-source-metadata",resourceId:e.id,check:c,detail:"verified source requires provenance.source and provenance.version"});continue}if(c==="license"&&!Ee(t.provenance?.license)){a.push({code:"missing-license-metadata",resourceId:e.id,check:c,detail:"license evidence requires a concrete provenance.license"});continue}if(n[c]=d.status,o.push(...d.evidence),c==="source"&&t.provenance?.source)o.push(t.provenance.source)}let i=Yt(n),l={level:i==="recommended"?"external-consumer":i==="candidate"?"verified":"declared",maturity:i,checks:n,evidence:we(o)};return Object.freeze(l.checks),Object.freeze(l.evidence),Object.freeze(l),Object.freeze(a),Object.freeze({resourceId:e.id,receipt:l,issues:a})}function ti(e,t){let r=jt(e,t),n=$t(e),o=e.resources.map((c)=>Jt(c,r.records.get(c.id),n.get(c.id))),a=[...r.issues,...o.flatMap((c)=>c.issues)],i=Object.fromEntries(Ce.map((c)=>[c,0]));for(let c of o)i[c.receipt.maturity]+=1;Object.freeze(o),Object.freeze(i);for(let c of a)Object.freeze(c);Object.freeze(a);let l=Object.freeze({schemaVersion:oe,indexFingerprint:De(e),resources:o,counts:i,issues:a});return ve.add(l),l}function ri(e,t){if(!ve.has(t))throw new Ae;if(t.issues.length>0)throw new Ie(t.issues.length);let r=De(e);if(r!==t.indexFingerprint)throw new Se(t.indexFingerprint,r);let n=new Map(t.resources.map((a)=>[a.resourceId,a.receipt])),o=e.resources.map((a)=>{let i=n.get(a.id);if(!i)return a;return Object.freeze({...a,receipt:i})});return Object.freeze(o),Object.freeze({schemaVersion:e.schemaVersion,resources:o,aliases:e.aliases})}var Qt="uibot.resource.index.v1",ii=["invalid-resource-source-id","duplicate-resource-id","dangling-resource-dependency","ambiguous-resource-dependency"];class N extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function k(e,t){return e<t?-1:e>t?1:0}function b(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function Zt(e){let t=b(e).replace(/ /g,"-");if(!t)throw new N("invalid-resource-source-id",e);return t}function v(e,t){return`${e}:${Zt(t)}`}function J(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let o=b(n);if(!o||t.has(o))continue;t.set(o,n)}return[...t.entries()].sort(([r],[n])=>k(r,n)).map(([,r])=>r)}function q(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function Xt(e){let t=M(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function z(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:J(e.tags),aliases:J(e.aliases),capabilities:J(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(k),source:Xt(e.source),receipt:e.receipt}}function er(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function tr(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function rr(e){let t=new Map;for(let r of Object.keys(e).sort(k)){let n=e[r];if(!n)continue;let o=v("component",r);for(let a of J([r,n.name])){let i=b(a),l=t.get(i)??[];if(!l.includes(o))l.push(o);t.set(i,l.sort(k))}}return t}function nr(e,t,r){let n=r.get(b(e))??[];if(n.length===0)throw new N("dangling-resource-dependency",`${t} -> ${v("component",e)}`);if(n.length>1)throw new N("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function or(e,t,r,n){let o=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,o))return v("template",o);return nr(e,t,r)}function H(e,t,r){return M(r?.[e]??t)}function si(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>k(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[v("template",t)]}))}function ai(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],o=e.examples??[],a=e.skills??[],i=e.licenses,l=rr(t),c=[];for(let s of Object.keys(t).sort(k)){let g=t[s];if(!g)continue;let y=v("component",s),C=H(y,void 0,i);c.push(z({id:y,kind:"component",title:g.name,description:g.description,category:g.category,tags:g.tags??[],aliases:[s,g.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:s,...C?{license:C}:{}},receipt:q(Boolean(C))}))}for(let s of Object.keys(r).sort(k)){let g=r[s];if(!g)continue;let y=v("template",s),C=H(y,void 0,i);c.push(z({id:y,kind:"template",title:g.name,description:g.description,category:g.category,tags:g.keywords,aliases:[s,g.name],capabilities:[],dependencies:(g.composedFrom??[]).map((S)=>or(S,y,l,r)),source:{type:"template-contract",id:s,...C?{license:C}:{}},receipt:q(Boolean(C))}))}for(let s of[...n].sort((g,y)=>k(g.id,y.id))){let g=v("design-guide",s.id),y=H(g,void 0,i);c.push(z({id:g,kind:"design-guide",title:s.title,description:er(s),category:s.category,tags:s.tags,aliases:[s.id,s.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:s.id,...s.sourceUrl?{url:s.sourceUrl}:{},...y?{license:y}:{}},receipt:q(Boolean(y))}))}for(let s of[...o].sort((g,y)=>k(g.id,y.id))){let g=v("example",s.id),y=H(g,s.license,i);c.push(z({id:g,kind:"example",title:s.title,description:s.description,...s.category?{category:s.category}:{},tags:s.tags??[],aliases:[s.id,s.title,...s.aliases??[]],capabilities:s.capabilities??[],dependencies:s.dependencies??[],source:{type:"example",id:s.id,...s.version?{version:s.version}:{},...s.sourceUrl?{url:s.sourceUrl}:{},...y?{license:y}:{}},receipt:q(Boolean(y))}))}for(let s of[...a].sort((g,y)=>k(g.id,y.id))){let g=v("skill",s.id),y=H(g,void 0,i);c.push(z({id:g,kind:"skill",title:s.title,description:s.description?.trim()||s.title,tags:[...s.tags??[],...s.triggers??[]],aliases:[s.id,s.title,...s.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:s.id,...s.version?{version:s.version}:{},...y?{license:y}:{}},receipt:q(Boolean(y))}))}c.sort((s,g)=>k(s.id,g.id));let d=new Set;for(let s of c){if(d.has(s.id))throw new N("duplicate-resource-id",s.id);d.add(s.id)}for(let s of c)for(let g of s.dependencies)if(!d.has(g))throw new N("dangling-resource-dependency",`${s.id} -> ${g}`);let u=new Map;for(let s of c)for(let g of s.aliases){let y=b(g);if(!y)continue;let C=u.get(y)??new Set;C.add(s.id),u.set(y,C)}let f=Object.freeze(Object.fromEntries([...u.entries()].sort(([s],[g])=>k(s,g)).map(([s,g])=>[s,Object.freeze([...g].sort(k))]))),p=Object.freeze(c.map(tr));return Object.freeze({schemaVersion:Qt,resources:p,aliases:f})}var ir=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],sr=Object.freeze(ir.map((e)=>Object.freeze([...e]))),Te=new Map;for(let e of sr){let t=Object.freeze([...new Set(e.map(b).filter(Boolean))].sort());for(let r of t)Te.set(r,t)}function se(e){let t=b(e);return Te.get(t)??Object.freeze([t])}var gi=["resource-query-empty","resource-query-invalid-limit","resource-not-found","resource-alias-ambiguous"];class O extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var de=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),ar=Object.freeze(Object.keys(de)),Oe=new Map(ar.map((e,t)=>[e,t])),Fe=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function P(e,t){return e<t?-1:e>t?1:0}function Me(e){return new Set((e??[]).map(b).filter(Boolean))}function ae(e,t){let r=Me(t);if(r.size===0)return!0;let n=Me(e);return[...r].some((o)=>n.has(o))}function cr(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!ae(e.tags,t.tags))return!1;if(!ae(e.category?[e.category]:[],t.categories))return!1;if(!ae(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function lr(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function w(e,t,r,n=de[t]){if(e.some((o)=>o.code===t&&o.value===r))return;e.push({code:t,value:r,score:n})}function ce(e,t){return e.find((r)=>b(r)===t)}function le(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function dr(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(o,a)=>a);for(let o=1;o<=e.length;o+=1){let a=[o],i=o;for(let l=1;l<=t.length;l+=1){let c=(n[l-1]??r+1)+(e[o-1]===t[l-1]?0:1),d=Math.min((n[l]??r+1)+1,(a[l-1]??r+1)+1,c);a.push(d),i=Math.min(i,d)}if(i>r)return r+1;n=a}return n[t.length]??r+1}function ur(e,t){let r=b(t),n=[];if(b(e.id)===r)w(n,"exact-id",e.id);if(b(e.title)===r)w(n,"exact-title",e.title);let o=ce(e.aliases,r);if(o)w(n,"alias",o);let a=ce(e.tags,r);if(a)w(n,"tag",a);let i=ce(e.capabilities,r);if(i)w(n,"capability",i);if(e.category&&b(e.category)===r)w(n,"category",e.category);if(!o){let d=se(r).filter((f)=>f!==r),u=new Set(le(e).map(b));if(d.some((f)=>u.has(f)))w(n,"alias",t.trim())}let l=r.split(" ").filter(Boolean),c=b(le(e).join(" "));if(l.length>0&&l.every((d)=>c.includes(d)))w(n,"token",t.trim());if(n.length===0&&r.length>=4){let d;for(let u of le(e)){let f=b(u);if(f.length<4)continue;let p=dr(r,f,2);if(p<=2&&(!d||p<d.distance||p===d.distance&&P(u,d.value)<0))d={value:u,distance:p}}if(d)w(n,"fuzzy",d.value,de.fuzzy-d.distance)}return n.sort((d,u)=>{if(d.score!==u.score)return u.score-d.score;return(Oe.get(d.code)??99)-(Oe.get(u.code)??99)||P(d.value,u.value)})}function _e(e,t,r){if(t.has(r))return[r];let n=b(r),o=e.aliases[n];if(o?.length)return[...o];let a=new Set;for(let i of se(n))for(let l of e.aliases[i]??[])a.add(l);return[...a].sort(P)}function Be(e,t){return new O("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function mi(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let o=n.trim(),a=_e(e,t,o);if(a.length===0)throw new O("resource-not-found",o);if(a.length>1)throw Be(o,a);let i=a[0],l=i?t.get(i):void 0;if(!l)throw new O("resource-not-found",o);return l}return Object.freeze({manifest:()=>e,search(n){let o=n.text?.trim()??"";if(!o&&!lr(n))throw new O("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new O("resource-query-invalid-limit",String(n.limit));let a=e.resources.filter((i)=>cr(i,n)).map((i)=>{let l=o?ur(i,o):[];return{resource:i,score:l.reduce((c,d)=>c+d.score,0),reasons:l}}).filter((i)=>!o||i.reasons.length>0).sort((i,l)=>l.score-i.score||P(i.resource.id,l.resource.id));return n.limit===void 0?a:a.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((p)=>!p.trim()))throw new O("resource-query-empty","at least one build root is required");let o=[],a=new Set;for(let p of n){let s=p.trim(),g=_e(e,t,s);if(g.length===0)o.push({id:s,reason:"missing-resource"});else if(g.length>1)throw Be(s,g);else{let y=g[0];if(y)a.add(y)}}let i=new Set,l=new Set,c=new Set,d=[],u=[],f=(p,s)=>{if(i.has(p))return;if(l.has(p)){o.push({id:p,...s?{requiredBy:s}:{},reason:"dependency-cycle"});return}let g=t.get(p);if(!g){o.push({id:p,...s?{requiredBy:s}:{},reason:"missing-resource"});return}l.add(p),c.add(p);let y=[...g.dependencies].sort((C,S)=>{let F=t.get(C),D=t.get(S);return(Fe.get(F?.kind??"")??99)-(Fe.get(D?.kind??"")??99)||P(C,S)});for(let C of y)u.push({from:p,to:C,relation:"depends-on"}),f(C,p);l.delete(p),i.add(p),d.push(p)};for(let p of[...a].sort(P))f(p);return{roots:[...a].sort(P),nodes:[...c].sort(P).map((p)=>{let s=t.get(p);if(!s)throw new O("resource-not-found",p);return{id:p,kind:s.kind,maturity:s.receipt.maturity}}),edges:u.sort((p,s)=>P(p.from,s.from)||P(p.to,s.to)),order:d,gaps:o.sort((p,s)=>P(p.id,s.id)||P(p.requiredBy??"",s.requiredBy??"")||P(p.reason,s.reason))}}})}function Cr(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}function hr(e){if(!e.name)throw Error("Plugin distribution manifest requires a name");return e}class br{id;priority;items;constructor(e,t,r){this.id=e;this.priority=t;this.items=r}get(e){return this.items[e]}}class Rr{id;priority;items;constructor(e,t,r){this.id=e;this.priority=t;this.items=r}get(e){return this.items[e]}}async function je(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function xr(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await je(r,t);return Cr(n)}async function kr(e,t){let r=e.endsWith("/plugins.json")?e:`${e.replace(/\/$/,"")}/plugins.json`,n=await je(r,t);return hr(n)}class Pr{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=xr(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Sr{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=kr(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).plugins.find((r)=>r.pluginId===e)}}class Ir{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}class Ar{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var vr="uibot.artifacts.lock.json";function wr(e){return E(e,"components","registry")}function Er(e){return E(e,"templates","registry")}function Dr(e,t){if(e.kind==="component")return E(t.componentsDir??wr(t.workspaceRoot));return E(t.templatesDir??Er(t.workspaceRoot))}function Tr(e){return E(e.workspaceRoot,e.lockfilePath??vr)}function Or(e){try{return JSON.parse(gr(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Fr(e,t){Ve(ue(e),{recursive:!0}),Ue(e,`${JSON.stringify(t,null,2)}
|
|
15
|
-
`,"utf8")}function
|
|
10
|
+
`}function vt(e){let t={category:e.category,level:e.level};if(e.props)t.props=e.props;if(e.slots)t.slots=e.slots;if(e.events)t.events=e.events;if(e.usageScenarios)t.scenarios=e.usageScenarios;if(e.constraints)t.constraints=e.constraints;return t}function Wo(e){return{light:xe(e,":root"),dark:xe(e,".dark")}}function xe(e,t){let r={},n=new RegExp(`${Pe(t)}\\s*\\{`,"g"),o;while((o=n.exec(e))!==null){let a=o.index+o[0].length,s=1,l=a;for(;l<e.length&&s>0;l++){let d=e[l];if(d==="{")s++;else if(d==="}")s--}let c=e.slice(a,l-1);for(let d of c.matchAll(/--([\w-]+)\s*:\s*([^;]+);/g)){let u=d[1],f=d[2];if(u!==void 0&&f!==void 0)r[u]=f.trim()}}return r}function Pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ko(e,t){let r=t.sharedDependencies??kt,n=t.channel??"public",o=Dt(t),a=(t.componentsDir??Pt).replace(/\/$/,""),s=(t.libDir??St).replace(/\/$/,""),l=`${s}/uibot-renderer.ts`,c=`${s}/utils.ts`,d=`${s}/uibot-contracts.ts`,u="@/lib/uibot-renderer",f="@/lib/utils",p="@/lib/uibot-contracts",i={},g={name:re,type:"registry:lib",description:"UIBot runtime base: RendererComponent type shim + cn util. Pulled automatically by every UIBot block.",dependencies:r,files:[{path:l,content:t.rendererShimContent,type:"registry:lib"},{path:c,content:t.cnUtilContent,type:"registry:lib"},...t.contractsShimContent?[{path:d,content:t.contractsShimContent,type:"registry:lib"}]:[]],meta:{base:!0}};if(i[re]=g,t.cssVars)i[be]={name:be,type:"registry:theme",description:"UIBot OKLCH palette for the semantic tokens the blocks use. Optional: skip it when the host defines its own.",files:[],cssVars:t.cssVars};let y=new Map,C=new Map,S=new Map,F=new Map;for(let m of e){let I=m.files[0]?.path??`${ne(m.name)}.tsx`,x=m.channel??"public",h=F.get(I);if(h&&h!==x)throw Error(`${I} mixes ${h} and ${x} blocks; split the file`);F.set(I,x)}for(let m of e){if((m.channel??"public")!==n)continue;let x=m.files[0]?.path??`${ne(m.name)}.tsx`,h=y.get(x);if(!h){let R=ne(Ft(x,m.name)),W=Re(m,{rendererShimImport:"@/lib/uibot-renderer",cnUtilImport:"@/lib/utils",...t.contractsShimContent?{contractsShimImport:"@/lib/uibot-contracts"}:{}}),T=`${a}/${R}.tsx`,V={schema:te,item:R,channel:n,components:[]};S.set(R,V),h={name:R,type:"registry:ui",description:m.description??m.catalogEntry.description,dependencies:["react",...m.dependencies??[]],registryDependencies:[o(re)],files:m.files.length<=1?[{path:T,target:T,content:W,type:"registry:ui"}]:m.files.map((K)=>{if(typeof K.content!=="string")throw Error(`Missing block source content: ${K.path}`);let pe=`${a}/${K.path.replace(/^blocks\//,"")}`;return{path:pe,target:pe,content:Re({...m,sourceCode:K.content},{rendererShimImport:"@/lib/uibot-renderer",cnUtilImport:"@/lib/utils",...t.contractsShimContent?{contractsShimImport:"@/lib/uibot-contracts"}:{}}),type:"registry:ui"}}),meta:{...vt(m.catalogEntry),provides:[m.name],uibot:V}},y.set(x,h),i[R]=h}else{let R=h.meta;if(R.provides&&!R.provides.includes(m.name))R.provides.push(m.name)}let A=S.get(h.name);if(A?.components&&!C.has(m.name))A.components.push(Tt(m,h,a)),C.set(m.name,h.name)}for(let[m,I]of S){let x=i[m];if(!x)continue;I.components?.sort((A,R)=>A.name.localeCompare(R.name));let h=`${a}/${m}.uibot.json`;x.files.push({path:h,target:h,content:`${JSON.stringify(I,null,2)}
|
|
11
|
+
`,type:"registry:ui"})}let D={},Q=(t.templates??[]).filter((m)=>(m.channel??"public")===n),We=new Set(Q.map((m)=>m.name));for(let m of Q){if(i[m.name])throw Error(`template item "${m.name}" collides with a component item`);let I=m.templateContract.composedFrom??[],x=new Set,h=[];for(let T of I){let V=C.get(T);if(V)x.add(o(V));else if(We.has(T)&&T!==m.name)x.add(o(T));else h.push(T)}if(h.length>0)D[m.name]=h;let A=`${s}/${At}`,R=`${m.name}.uibot.yaml`,W={schema:te,item:m.name,channel:n,template:{file:R,contract:m.templateContract}};i[m.name]={name:m.name,type:"registry:block",description:m.description,registryDependencies:[...x].sort(),files:[{path:`${A}/${R}`,target:`${A}/${R}`,content:m.yaml,type:"registry:lib"},{path:`${A}/${m.name}.uibot.json`,target:`${A}/${m.name}.uibot.json`,content:`${JSON.stringify(W,null,2)}
|
|
12
|
+
`,type:"registry:lib"}],meta:{uibot:W}}}return wt(i,t.composites??[],{channel:n,ref:o,componentsDir:a}),{registry:{$schema:Rt,name:t.registryName,...t.homepage?{homepage:t.homepage}:{},items:Object.values(i).map((m)=>({name:m.name,type:m.type,...m.description?{description:m.description}:{},...m.registryDependencies?{registryDependencies:m.registryDependencies}:{},...m.dependencies?{dependencies:m.dependencies}:{}}))},items:i,unresolvedTemplateTypes:D}}function wt(e,t,r){let n=new Map;for(let o of t){if(n.has(o.name)||e[o.name])throw Error(`composite item "${o.name}" collides with another item`);n.set(o.name,o)}for(let o of t){let a=o.channel??"public",s=ke(o),l=new Set(o.files.map((d)=>d.path));for(let d of o.requires??[]){let u=n.get(d);if(!u)throw Error(`composite "${o.name}" requires unknown "${d}"`);if((u.channel??"public")!==a)throw Error(`composite "${o.name}" (${a}) requires "${d}" from another channel`);if(ke(u)!==s)throw Error(`composite "${o.name}" requires "${d}" from another directory`);for(let f of u.files)l.add(f.path)}for(let d of o.files){if(!Se.test(d.path))throw Error(`composite "${o.name}" file "${d.path}" must be a plain relative path`);for(let u of Et(d.content)){if(!u.startsWith("./")||u.includes("/../"))throw Error(`${o.name}/${d.path} imports ${u}; only ./ imports within the item directory are allowed`);let f=u.slice(2).replace(/\.js$/,"");if(![f,`${f}.ts`,`${f}.tsx`,`${f}/index.ts`,`${f}/index.tsx`].some((i)=>l.has(i)))throw Error(`${o.name}/${d.path} imports ${u}, which no required item ships`)}}if(a!==r.channel)continue;let c=o.files.map((d)=>{let u=`${r.componentsDir}/${s}/${d.path}`;return{path:u,target:u,content:d.content,type:d.path.endsWith(".tsx")?"registry:component":"registry:lib"}});e[o.name]={name:o.name,type:o.type,description:o.description,dependencies:["react",...o.dependencies??[]],registryDependencies:[...o.primitives??[],...(o.requires??[]).map(r.ref)],files:c,meta:{composite:!0,channel:a}}}}var Se=/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)*$/i;function ke(e){if(!Se.test(e.dir)||e.dir.split("/").includes(".."))throw Error(`composite "${e.name}" dir "${e.dir}" must be a plain relative path`);return e.dir}function Et(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:])\/\/.*$/gm,"$1"),r=[],n=[/\bfrom\s*["'](\.{1,2}\/[^"']+)["']/g,/\bimport\s*["'](\.{1,2}\/[^"']+)["']/g,/\bimport\s*\(\s*["'](\.{1,2}\/[^"']+)["']\s*\)/g];for(let o of n)for(let a of t.matchAll(o))r.push(a[1]??"");return r}function Dt(e){if(e.baseUrl){let r=e.baseUrl.replace(/\/$/,"");return(n)=>`${r}/r/${n}.json`}let t=e.namespace??It;if(!/^@[a-z0-9][a-z0-9-]*$/.test(t))throw Error(`registry namespace must look like "@uibot", got "${t}"`);return(r)=>`${t}/${r}`}function Tt(e,t,r){let n=e.name.replace(/\./g,""),o=`${r}/`,a=t.files.find((s)=>s.path.startsWith(o)&&/\.(tsx|ts)$/.test(s.path)&&Ot(s.content,n));if(!a)throw Error(`block "${e.name}" has no named export "${n}" in item "${t.name}"`);return{name:e.name,export:n,module:a.path.slice(o.length),catalog:e.catalogEntry}}function Ot(e,t){let r=Pe(t),n=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"");if(new RegExp(`export\\s+(?:const|let|function|class)\\s+${r}\\b`).test(n))return!0;for(let o of n.matchAll(/export\s*\{([^}]*)\}/g)){let a=(o[1]??"").split(",").map((l)=>{let[,c]=l.trim().split(/\s+as\s+/);return(c??l.trim().replace(/^type\s+/,"")).trim()}),s=(o[1]??"").split(",").map((l)=>l.trim()).filter((l)=>l.startsWith("type ")).map((l)=>l.replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim());if(a.includes(t)&&!s.includes(t))return!0}return!1}function Ft(e,t){return(e.split("/").pop()??t).replace(/\.(tsx|ts|jsx|js)$/,"")||t}var Go=xt;function Mt(e="/api/registry"){let t=(e||"/api/registry").trim(),r=t.startsWith("/")?t:`/${t}`;return r.length>1?r.replace(/\/$/,""):r}function U(e,t=200){return Response.json(e,{status:t})}function Jo(e){let t=Mt(e.basePath),r=`${t}/registry.json`,n=`${t}/artifacts/`,o=new Map(e.manifest.items.map((a)=>[a.name,a]));return async function(s){let l=new URL(s.url);if(s.method!=="GET")return U({error:"Method not allowed"},405);if(l.pathname===r)return U(e.manifest);if(l.pathname.startsWith(n)){let c=l.pathname.slice(n.length),d=decodeURIComponent(c.endsWith(".json")?c.slice(0,-5):c),u=o.get(d);if(!u)return U({error:`Artifact '${d}' not found`},404);return U(u)}return U({error:"Not found"},404)}}var oe="uibot.resource.admission.v1",_t=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure"],Bt=["packed-install","typecheck","browser"],Xo=["invalid-admission-manifest","invalid-admission-record","invalid-admission-check","duplicate-admission-record","unknown-admission-resource","missing-source-metadata","missing-license-metadata","dependency-closure-failed"];class Ie extends Error{expected;actual;code="resource-admission-index-mismatch";constructor(e,t){super(`resource admission index mismatch: expected ${e}, received ${t}`);this.expected=e;this.actual=t;this.name="ResourceAdmissionIndexMismatchError"}}class Ae extends Error{issueCount;code="resource-admission-report-rejected";constructor(e){super(`resource admission report contains ${e.toString()} issue(s)`);this.issueCount=e;this.name="ResourceAdmissionReportRejectedError"}}class ve extends Error{code="resource-admission-report-not-derived";constructor(){super("resource admission report must come directly from assessResourceAdmissions");this.name="ResourceAdmissionReportNotDerivedError"}}var Lt=new Set(ee),Nt=new Set(he),we=new WeakSet,G={missing:0,declared:1,verified:2,"external-consumer":3};function Vt(e,t){return e<t?-1:e>t?1:0}function L(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function Y(e,t){let r=new Set(t);return Object.keys(e).every((n)=>r.has(n))}function Ee(e){return[...new Set(e.map((t)=>t.trim()).filter(Boolean))].sort(Vt)}function Ut(e,t,r,n){if(!L(r)||!Y(r,["status","evidence"])){n.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} must contain only status and evidence`});return}if(typeof r.status!=="string"||!Nt.has(r.status)||r.status==="missing"){n.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} status must be declared, verified or external-consumer`});return}if(!Array.isArray(r.evidence)||r.evidence.length===0||r.evidence.some((o)=>typeof o!=="string"||!o.trim())){n.push({code:"invalid-admission-check",resourceId:e,check:t,detail:`${t} evidence must be a non-empty string array`});return}return{status:r.status,evidence:Ee(r.evidence)}}function jt(e){if(e===void 0)return;if(!L(e)||!Y(e,["source","version","license"]))return;if(Object.values(e).some((r)=>r!==void 0&&typeof r!=="string"))return;return{...typeof e.source==="string"&&e.source.trim()?{source:e.source.trim()}:{},...typeof e.version==="string"&&e.version.trim()?{version:e.version.trim()}:{},...typeof e.license==="string"&&e.license.trim()?{license:e.license.trim()}:{}}}function $t(e,t){let r=new Map,n=[];if(!L(t)||!Y(t,["schemaVersion","records"])||t.schemaVersion!==oe||!Array.isArray(t.records))return n.push({code:"invalid-admission-manifest",detail:`expected ${oe} with a records array`}),{records:r,issues:n};let o=new Set(e.resources.map((a)=>a.id));for(let a of t.records){if(!L(a)||!Y(a,["resourceId","provenance","checks"])||typeof a.resourceId!=="string"||!a.resourceId.trim()||!L(a.checks)){n.push({code:"invalid-admission-record",...L(a)&&typeof a.resourceId==="string"?{resourceId:a.resourceId}:{},detail:"record must contain only resourceId, optional provenance and checks"});continue}let s=a.resourceId.trim();if(r.has(s)){n.push({code:"duplicate-admission-record",resourceId:s,detail:s});continue}if(!o.has(s)){n.push({code:"unknown-admission-resource",resourceId:s,detail:s});continue}let l=jt(a.provenance);if(a.provenance!==void 0&&!l){n.push({code:"invalid-admission-record",resourceId:s,detail:"provenance must contain only string source, version and license fields"});continue}let c={},d=!1;for(let[u,f]of Object.entries(a.checks)){if(!Lt.has(u)){n.push({code:"invalid-admission-check",resourceId:s,detail:`unknown receipt check: ${u}`}),d=!0;continue}let p=u,i=Ut(s,p,f,n);if(i)c[p]=i;else d=!0}if(d)continue;r.set(s,{resourceId:s,...l?{provenance:l}:{},checks:c})}return{records:r,issues:n}}function qt(e){let t=new Map(e.resources.map((o)=>[o.id,o])),r=new Map;function n(o,a,s,l){if(r.has(o)||l.has(a))return;if(s.has(a)){r.set(o,`dependency cycle reached ${a}`);return}let c=t.get(a);if(!c){r.set(o,`missing dependency ${a}`);return}s.add(a);for(let d of c.dependencies)if(n(o,d,s,l),r.has(o))break;s.delete(a),l.add(a)}for(let o of e.resources)n(o.id,o.id,new Set,new Set);return r}var zt=/^(unknown|unlicensed|none|n\/?a)$/i,Ht=/^SPDX-License-Identifier:\s*(\S+)/im,Wt=/^(?:the\s+)?(mit|apache(?:\s+license(?:\s*,?\s*version\s*2\.0)?)?|bsd-2-clause|bsd-3-clause|isc|unlicense)\b/i;function M(e){let t=e?.trim();if(!t||zt.test(t))return;return t}function Kt(e){if(!e?.trim())return;let t=e.match(Ht)?.[1];if(t)return M(t);let r=e.match(Wt)?.[1];if(!r)return;let n=r.toLowerCase();if(n.startsWith("mit"))return"MIT";if(n.startsWith("apache"))return"Apache-2.0";if(n.startsWith("bsd-2"))return"BSD-2-Clause";if(n.startsWith("bsd-3"))return"BSD-3-Clause";if(n==="isc")return"ISC";if(n==="unlicense")return"Unlicense";return}function ei(e){return M(e.frontmatterLicense)??M(e.packageJsonLicense)??Kt(e.licenseFileText)}function De(e){return Boolean(M(e))}var j={states:/\b(disabled|loading|error|empty|pending|busy|children|active|muted|boolean-state)\b/i,accessibility:/\b(label|aria|accessible|alt|role)\b/i,"light-theme":/:root\b|\b(light(?:-theme)?|theme token|css variables?)\b/i,"dark-theme":/\b(dark(?:-theme)?)\b/i,responsive:/\b(size|responsive|breakpoint|sm|md|lg|xl|full)\b/i};function ie(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let n of e)ie(n,t);return}let r=e;for(let[n,o]of Object.entries(r)){if(t.push(n),n==="type"&&o==="boolean")t.push("boolean-state");ie(o,t)}}function Gt(e){let t=[];return ie(e.props,t),[e.name,e.description,...e.tags??[],...e.usageScenarios??[],...e.constraints??[],...t,...Object.keys(e.slots??{}),...Object.keys(e.events??{}),e.slots&&Object.keys(e.slots).length>0?"empty":""].join(`
|
|
13
|
+
`)}function ti(e,t={}){let r=[Gt(e),t.sourceText??"",t.stylesText??""].join(`
|
|
14
|
+
`);return{contract:Boolean(e.props&&Object.keys(e.props).length>0||e.events&&Object.keys(e.events).length>0||e.slots&&Object.keys(e.slots).length>0)?"verified":"declared",states:j.states.test(r)?"verified":"missing",accessibility:j.accessibility.test(r)?"verified":"missing","light-theme":j["light-theme"].test(r)?"verified":"missing","dark-theme":j["dark-theme"].test(r)?"verified":"missing",responsive:j.responsive.test(r)?"verified":"missing"}}function Yt(e){return{source:"declared",license:De(e.source.license)?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"}}function Jt(e){if(!_t.every((n)=>G[e[n]]>=G.verified))return"experimental";return Bt.every((n)=>e[n]==="external-consumer")?"recommended":"candidate"}function Te(e){let t=JSON.stringify({schemaVersion:e.schemaVersion,resources:e.resources.map((o)=>({id:o.id,kind:o.kind,title:o.title,description:o.description,...o.category?{category:o.category}:{},tags:o.tags,aliases:o.aliases,capabilities:o.capabilities,dependencies:o.dependencies,source:o.source})),aliases:e.aliases}),r=0xcbf29ce484222325n,n=0x100000001b3n;for(let o of new TextEncoder().encode(t))r^=BigInt(o),r=BigInt.asUintN(64,r*n);return`fnv1a64:${r.toString(16).padStart(16,"0")}`}function Qt(e,t,r){let n=Yt(e),o=[`resource://${e.source.type}/${e.source.id}`,`resource://contract/${e.id}`],a=[];if(r)a.push({code:"dependency-closure-failed",resourceId:e.id,check:"dependency-closure",detail:r});else n["dependency-closure"]="verified",o.push(`resource://index/${e.id}`);if(t)for(let c of ee){if(c==="dependency-closure")continue;let d=t.checks[c];if(!d)continue;if(c==="source"&&G[d.status]>=G.verified&&(!t.provenance?.source||!t.provenance.version)){a.push({code:"missing-source-metadata",resourceId:e.id,check:c,detail:"verified source requires provenance.source and provenance.version"});continue}if(c==="license"&&!De(t.provenance?.license)){a.push({code:"missing-license-metadata",resourceId:e.id,check:c,detail:"license evidence requires a concrete provenance.license"});continue}if(n[c]=d.status,o.push(...d.evidence),c==="source"&&t.provenance?.source)o.push(t.provenance.source)}let s=Jt(n),l={level:s==="recommended"?"external-consumer":s==="candidate"?"verified":"declared",maturity:s,checks:n,evidence:Ee(o)};return Object.freeze(l.checks),Object.freeze(l.evidence),Object.freeze(l),Object.freeze(a),Object.freeze({resourceId:e.id,receipt:l,issues:a})}function ri(e,t){let r=$t(e,t),n=qt(e),o=e.resources.map((c)=>Qt(c,r.records.get(c.id),n.get(c.id))),a=[...r.issues,...o.flatMap((c)=>c.issues)],s=Object.fromEntries(Ce.map((c)=>[c,0]));for(let c of o)s[c.receipt.maturity]+=1;Object.freeze(o),Object.freeze(s);for(let c of a)Object.freeze(c);Object.freeze(a);let l=Object.freeze({schemaVersion:oe,indexFingerprint:Te(e),resources:o,counts:s,issues:a});return we.add(l),l}function ni(e,t){if(!we.has(t))throw new ve;if(t.issues.length>0)throw new Ae(t.issues.length);let r=Te(e);if(r!==t.indexFingerprint)throw new Ie(t.indexFingerprint,r);let n=new Map(t.resources.map((a)=>[a.resourceId,a.receipt])),o=e.resources.map((a)=>{let s=n.get(a.id);if(!s)return a;return Object.freeze({...a,receipt:s})});return Object.freeze(o),Object.freeze({schemaVersion:e.schemaVersion,resources:o,aliases:e.aliases})}var Zt="uibot.resource.index.v1",si=["invalid-resource-source-id","duplicate-resource-id","dangling-resource-dependency","ambiguous-resource-dependency"];class N extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function k(e,t){return e<t?-1:e>t?1:0}function b(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function Xt(e){let t=b(e).replace(/ /g,"-");if(!t)throw new N("invalid-resource-source-id",e);return t}function v(e,t){return`${e}:${Xt(t)}`}function J(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let o=b(n);if(!o||t.has(o))continue;t.set(o,n)}return[...t.entries()].sort(([r],[n])=>k(r,n)).map(([,r])=>r)}function q(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function er(e){let t=M(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function z(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:J(e.tags),aliases:J(e.aliases),capabilities:J(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(k),source:er(e.source),receipt:e.receipt}}function tr(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function rr(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function nr(e){let t=new Map;for(let r of Object.keys(e).sort(k)){let n=e[r];if(!n)continue;let o=v("component",r);for(let a of J([r,n.name])){let s=b(a),l=t.get(s)??[];if(!l.includes(o))l.push(o);t.set(s,l.sort(k))}}return t}function or(e,t,r){let n=r.get(b(e))??[];if(n.length===0)throw new N("dangling-resource-dependency",`${t} -> ${v("component",e)}`);if(n.length>1)throw new N("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function ir(e,t,r,n){let o=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,o))return v("template",o);return or(e,t,r)}function H(e,t,r){return M(r?.[e]??t)}function ai(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>k(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[v("template",t)]}))}function ci(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],o=e.examples??[],a=e.skills??[],s=e.licenses,l=nr(t),c=[];for(let i of Object.keys(t).sort(k)){let g=t[i];if(!g)continue;let y=v("component",i),C=H(y,void 0,s);c.push(z({id:y,kind:"component",title:g.name,description:g.description,category:g.category,tags:g.tags??[],aliases:[i,g.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:i,...C?{license:C}:{}},receipt:q(Boolean(C))}))}for(let i of Object.keys(r).sort(k)){let g=r[i];if(!g)continue;let y=v("template",i),C=H(y,void 0,s);c.push(z({id:y,kind:"template",title:g.name,description:g.description,category:g.category,tags:g.keywords,aliases:[i,g.name],capabilities:[],dependencies:(g.composedFrom??[]).map((S)=>ir(S,y,l,r)),source:{type:"template-contract",id:i,...C?{license:C}:{}},receipt:q(Boolean(C))}))}for(let i of[...n].sort((g,y)=>k(g.id,y.id))){let g=v("design-guide",i.id),y=H(g,void 0,s);c.push(z({id:g,kind:"design-guide",title:i.title,description:tr(i),category:i.category,tags:i.tags,aliases:[i.id,i.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:i.id,...i.sourceUrl?{url:i.sourceUrl}:{},...y?{license:y}:{}},receipt:q(Boolean(y))}))}for(let i of[...o].sort((g,y)=>k(g.id,y.id))){let g=v("example",i.id),y=H(g,i.license,s);c.push(z({id:g,kind:"example",title:i.title,description:i.description,...i.category?{category:i.category}:{},tags:i.tags??[],aliases:[i.id,i.title,...i.aliases??[]],capabilities:i.capabilities??[],dependencies:i.dependencies??[],source:{type:"example",id:i.id,...i.version?{version:i.version}:{},...i.sourceUrl?{url:i.sourceUrl}:{},...y?{license:y}:{}},receipt:q(Boolean(y))}))}for(let i of[...a].sort((g,y)=>k(g.id,y.id))){let g=v("skill",i.id),y=H(g,void 0,s);c.push(z({id:g,kind:"skill",title:i.title,description:i.description?.trim()||i.title,tags:[...i.tags??[],...i.triggers??[]],aliases:[i.id,i.title,...i.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:i.id,...i.version?{version:i.version}:{},...y?{license:y}:{}},receipt:q(Boolean(y))}))}c.sort((i,g)=>k(i.id,g.id));let d=new Set;for(let i of c){if(d.has(i.id))throw new N("duplicate-resource-id",i.id);d.add(i.id)}for(let i of c)for(let g of i.dependencies)if(!d.has(g))throw new N("dangling-resource-dependency",`${i.id} -> ${g}`);let u=new Map;for(let i of c)for(let g of i.aliases){let y=b(g);if(!y)continue;let C=u.get(y)??new Set;C.add(i.id),u.set(y,C)}let f=Object.freeze(Object.fromEntries([...u.entries()].sort(([i],[g])=>k(i,g)).map(([i,g])=>[i,Object.freeze([...g].sort(k))]))),p=Object.freeze(c.map(rr));return Object.freeze({schemaVersion:Zt,resources:p,aliases:f})}var sr=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],ar=Object.freeze(sr.map((e)=>Object.freeze([...e]))),Oe=new Map;for(let e of ar){let t=Object.freeze([...new Set(e.map(b).filter(Boolean))].sort());for(let r of t)Oe.set(r,t)}function se(e){let t=b(e);return Oe.get(t)??Object.freeze([t])}var mi=["resource-query-empty","resource-query-invalid-limit","resource-not-found","resource-alias-ambiguous"];class O extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var de=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),cr=Object.freeze(Object.keys(de)),Fe=new Map(cr.map((e,t)=>[e,t])),Me=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function P(e,t){return e<t?-1:e>t?1:0}function _e(e){return new Set((e??[]).map(b).filter(Boolean))}function ae(e,t){let r=_e(t);if(r.size===0)return!0;let n=_e(e);return[...r].some((o)=>n.has(o))}function lr(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!ae(e.tags,t.tags))return!1;if(!ae(e.category?[e.category]:[],t.categories))return!1;if(!ae(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function dr(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function w(e,t,r,n=de[t]){if(e.some((o)=>o.code===t&&o.value===r))return;e.push({code:t,value:r,score:n})}function ce(e,t){return e.find((r)=>b(r)===t)}function le(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function ur(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(o,a)=>a);for(let o=1;o<=e.length;o+=1){let a=[o],s=o;for(let l=1;l<=t.length;l+=1){let c=(n[l-1]??r+1)+(e[o-1]===t[l-1]?0:1),d=Math.min((n[l]??r+1)+1,(a[l-1]??r+1)+1,c);a.push(d),s=Math.min(s,d)}if(s>r)return r+1;n=a}return n[t.length]??r+1}function pr(e,t){let r=b(t),n=[];if(b(e.id)===r)w(n,"exact-id",e.id);if(b(e.title)===r)w(n,"exact-title",e.title);let o=ce(e.aliases,r);if(o)w(n,"alias",o);let a=ce(e.tags,r);if(a)w(n,"tag",a);let s=ce(e.capabilities,r);if(s)w(n,"capability",s);if(e.category&&b(e.category)===r)w(n,"category",e.category);if(!o){let d=se(r).filter((f)=>f!==r),u=new Set(le(e).map(b));if(d.some((f)=>u.has(f)))w(n,"alias",t.trim())}let l=r.split(" ").filter(Boolean),c=b(le(e).join(" "));if(l.length>0&&l.every((d)=>c.includes(d)))w(n,"token",t.trim());if(n.length===0&&r.length>=4){let d;for(let u of le(e)){let f=b(u);if(f.length<4)continue;let p=ur(r,f,2);if(p<=2&&(!d||p<d.distance||p===d.distance&&P(u,d.value)<0))d={value:u,distance:p}}if(d)w(n,"fuzzy",d.value,de.fuzzy-d.distance)}return n.sort((d,u)=>{if(d.score!==u.score)return u.score-d.score;return(Fe.get(d.code)??99)-(Fe.get(u.code)??99)||P(d.value,u.value)})}function Be(e,t,r){if(t.has(r))return[r];let n=b(r),o=e.aliases[n];if(o?.length)return[...o];let a=new Set;for(let s of se(n))for(let l of e.aliases[s]??[])a.add(l);return[...a].sort(P)}function Le(e,t){return new O("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function fi(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let o=n.trim(),a=Be(e,t,o);if(a.length===0)throw new O("resource-not-found",o);if(a.length>1)throw Le(o,a);let s=a[0],l=s?t.get(s):void 0;if(!l)throw new O("resource-not-found",o);return l}return Object.freeze({manifest:()=>e,search(n){let o=n.text?.trim()??"";if(!o&&!dr(n))throw new O("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new O("resource-query-invalid-limit",String(n.limit));let a=e.resources.filter((s)=>lr(s,n)).map((s)=>{let l=o?pr(s,o):[];return{resource:s,score:l.reduce((c,d)=>c+d.score,0),reasons:l}}).filter((s)=>!o||s.reasons.length>0).sort((s,l)=>l.score-s.score||P(s.resource.id,l.resource.id));return n.limit===void 0?a:a.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((p)=>!p.trim()))throw new O("resource-query-empty","at least one build root is required");let o=[],a=new Set;for(let p of n){let i=p.trim(),g=Be(e,t,i);if(g.length===0)o.push({id:i,reason:"missing-resource"});else if(g.length>1)throw Le(i,g);else{let y=g[0];if(y)a.add(y)}}let s=new Set,l=new Set,c=new Set,d=[],u=[],f=(p,i)=>{if(s.has(p))return;if(l.has(p)){o.push({id:p,...i?{requiredBy:i}:{},reason:"dependency-cycle"});return}let g=t.get(p);if(!g){o.push({id:p,...i?{requiredBy:i}:{},reason:"missing-resource"});return}l.add(p),c.add(p);let y=[...g.dependencies].sort((C,S)=>{let F=t.get(C),D=t.get(S);return(Me.get(F?.kind??"")??99)-(Me.get(D?.kind??"")??99)||P(C,S)});for(let C of y)u.push({from:p,to:C,relation:"depends-on"}),f(C,p);l.delete(p),s.add(p),d.push(p)};for(let p of[...a].sort(P))f(p);return{roots:[...a].sort(P),nodes:[...c].sort(P).map((p)=>{let i=t.get(p);if(!i)throw new O("resource-not-found",p);return{id:p,kind:i.kind,maturity:i.receipt.maturity}}),edges:u.sort((p,i)=>P(p.from,i.from)||P(p.to,i.to)),order:d,gaps:o.sort((p,i)=>P(p.id,i.id)||P(p.requiredBy??"",i.requiredBy??"")||P(p.reason,i.reason))}}})}function hr(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}function br(e){if(!e.name)throw Error("Plugin distribution manifest requires a name");return e}class Rr{id;priority;items;constructor(e,t,r){this.id=e;this.priority=t;this.items=r}get(e){return this.items[e]}}class xr{id;priority;items;constructor(e,t,r){this.id=e;this.priority=t;this.items=r}get(e){return this.items[e]}}async function $e(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function kr(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await $e(r,t);return hr(n)}async function Pr(e,t){let r=e.endsWith("/plugins.json")?e:`${e.replace(/\/$/,"")}/plugins.json`,n=await $e(r,t);return br(n)}class Sr{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=kr(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Ir{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=Pr(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).plugins.find((r)=>r.pluginId===e)}}class Ar{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}class vr{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var wr="uibot.artifacts.lock.json";function Er(e){return E(e,"components","registry")}function Dr(e){return E(e,"templates","registry")}function Tr(e,t){if(e.kind==="component")return E(t.componentsDir??Er(t.workspaceRoot));return E(t.templatesDir??Dr(t.workspaceRoot))}function Or(e){return E(e.workspaceRoot,e.lockfilePath??wr)}function Fr(e){try{return JSON.parse(mr(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Mr(e,t){Ue(ue(e),{recursive:!0}),je(e,`${JSON.stringify(t,null,2)}
|
|
15
|
+
`,"utf8")}function _r(e,t){return{version:1,artifacts:[...e.artifacts.filter((n)=>n.name!==t.name),t].sort((n,o)=>n.name.localeCompare(o.name))}}function Br(e){if(e.kind==="component")return{components:{[e.name]:e.catalogEntry}};return{templates:{[e.name]:e.templateContract}}}class _ extends Error{artifactName;offendingPath;baseDir;constructor(e,t,r){super(`Artifact "${e}" file path escapes workspace: "${t}" resolves outside "${r}"`);this.artifactName=e;this.offendingPath=t;this.baseDir=r;this.name="ArtifactContainmentError"}}function qe(e,t){let r=t.endsWith(Ne)?t:t+Ne;return e===t||e.startsWith(r)}function Ve(e){let t=E(e),r=[];while(!0)try{return gr(t),E(fr(t),...r)}catch(n){if(n.code!=="ENOENT")throw n;let o=ue(t);if(o===t)throw n;r.unshift(yr(t)),t=o}}function ze(e,t,r,n){try{let o=Ve(t),a=Ve(e);if(!qe(a,o))throw new _(r,n,t)}catch(o){if(o instanceof _)throw o;throw new _(r,n,t)}}function He(e,t,r){if(e.includes("\x00"))throw new _(r,e,t);if(Cr(e))throw new _(r,e,t);let n=E(t,e);if(!qe(n,t))throw new _(r,e,t);return ze(n,t,r,e),n}function Lr(e,t){let r=[];for(let n of e.files){let o=n.target??n.path;r.push(He(o,t,e.name))}return r}function Ri(e,t){let r=E(t.workspaceRoot),n=Tr(e,t);ze(n,r,e.name,n);let o=He(e.name,n,e.name),a=Lr(e,o),s=[];for(let f=0;f<e.files.length;f++){let p=e.files[f],i=a[f];Ue(ue(i),{recursive:!0}),je(i,p.content??"","utf8"),s.push(i)}let l={name:e.name,version:e.version,source:t.source??"registry",installedAt:new Date().toISOString()},c=Or(t),d=Fr(c),u=_r(d,l);return Mr(c,u),{artifactLock:l,catalogPatch:Br(e),writtenFiles:s}}export{_ as ArtifactContainmentError,Ar as ArtifactRegistryResolver,Rr as MemoryArtifactRegistrySource,xr as MemoryPluginRegistrySource,vr as PluginRegistryResolver,Xo as RESOURCE_ADMISSION_ERROR_CODES,oe as RESOURCE_ADMISSION_SCHEMA_VERSION,Bt as RESOURCE_EXTERNAL_CHECKS,si as RESOURCE_INDEX_ERROR_CODES,Zt as RESOURCE_INDEX_SCHEMA_VERSION,_t as RESOURCE_PREFLIGHT_CHECKS,ar as RESOURCE_QUERY_ALIAS_GROUPS,mi as RESOURCE_QUERY_ERROR_CODES,bt as RESOURCE_QUERY_OPERATION_MANIFEST,de as RESOURCE_QUERY_SCORE_WEIGHTS,Sr as RemoteArtifactRegistrySource,Ir as RemotePluginRegistrySource,Ie as ResourceAdmissionIndexMismatchError,ve as ResourceAdmissionReportNotDerivedError,Ae as ResourceAdmissionReportRejectedError,N as ResourceIndexError,O as ResourceQueryError,Go as SHADCN_REGISTRY_ITEM_SCHEMA,re as UIBOT_BASE_ITEM,be as UIBOT_THEME_ITEM,ni as applyResourceAdmissionReport,He as assertPathContained,ri as assessResourceAdmissions,ai as buildExamplesFromL4Templates,ci as buildResourceIndex,Ko as buildShadcnRegistry,Gr as buildUiBotRegistryManifest,vt as catalogEntryToMeta,$r as collectAllBlockSources,rt as collectBlockSources,me as collectTemplateSources,lt as collectTemplateSourcesFromDirs,Ke as compareLockToManifest,fi as createResourceQueryService,Jo as createUIBotRegistryHttpHandler,ei as deriveResourceLicense,Yr as emitArtifactJson,Ye as emptyLockfile,ti as evaluateCatalogPreflight,se as expandResourceQueryAliases,kr as fetchArtifactRegistryManifest,Pr as fetchPluginDistributionManifest,Ri as installArtifactToWorkspace,Je as lockfileWith,Mt as normalizeRegistryBasePath,b as normalizeResourceAlias,M as normalizeResourceLicense,Wo as parseOklchCssVars,br as parsePluginDistributionManifest,hr as parseRegistryManifest,Te as resourceAdmissionIndexFingerprint,X as templateSourceToRegistryItem,ye as toArtifactRegistryItem,ft as toComponentArtifact,ne as toItemName,v as toResourceId,fe as toTemplateArtifact,Re as transformBlockSource};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-dashboard",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Acme Admin",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@uibot/app-shell-sidebar",
|
|
8
|
+
"@uibot/charts",
|
|
9
|
+
"@uibot/data",
|
|
10
|
+
"@uibot/data-studio",
|
|
11
|
+
"@uibot/feedback",
|
|
12
|
+
"@uibot/grid",
|
|
13
|
+
"@uibot/interactive",
|
|
14
|
+
"@uibot/layout",
|
|
15
|
+
"@uibot/nav"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/uibot/templates/admin-dashboard.uibot.yaml",
|
|
20
|
+
"target": "lib/uibot/templates/admin-dashboard.uibot.yaml",
|
|
21
|
+
"content": "version: \"2.0\"\npages:\n - id: admin-dashboard\n path: /\n title: Acme Admin\n blocks:\n - type: PageLayout\n template: app-shell-sidebar\n props:\n title: Acme Console\n slots:\n headerActions:\n - type: Button\n props:\n label: New report\n size: sm\n variant: outline\n sidebar:\n - type: PageSiderMenu\n props:\n title: Workspace\n children:\n - type: MenuLink\n props:\n label: Overview\n href: \"#\"\n icon: \"▦\"\n active: true\n - type: MenuLink\n props:\n label: Customers\n href: \"#\"\n icon: \"◍\"\n badge: \"n/a\"\n - type: MenuLink\n props:\n label: Orders\n href: \"#\"\n icon: \"▤\"\n badge: \"38\"\n - type: MenuLink\n props:\n label: Analytics\n href: \"#\"\n icon: \"◔\"\n - type: MenuLink\n props:\n label: Settings\n href: \"#\"\n icon: \"⚙\"\n children:\n - type: Box\n props:\n className: \"flex items-end justify-between gap-4 mb-3 border-b border-border pb-3\"\n children:\n - type: Box\n children:\n - type: Heading\n props:\n level: 2\n text: Overview\n - type: Paragraph\n props:\n size: sm\n muted: true\n text: \"Demo window · last 30 days · Linear-like density\"\n - type: BadgeGroup\n props:\n items:\n - label: 3 failing checks\n tone: error\n - label: Queue healthy\n tone: success\n - type: Toast\n props:\n level: warning\n title: Status first\n message: \"Payment retry is failing for 3 orders. Sample data below — unknown live counts stay n/a.\"\n - type: StatGrid\n props:\n cols: \"4\"\n items:\n - label: Failing checks\n value: \"3\"\n change: \"needs triage\"\n trend: down\n - label: Open orders\n value: \"38\"\n description: \"in the demo table\"\n - label: Revenue (demo)\n value: \"$48,210\"\n change: \"+12.5%\"\n trend: up\n - label: Live visitors\n value: \"n/a\"\n description: \"source offline\"\n - type: Grid\n props:\n cols: \"3\"\n gap: lg\n children:\n - type: Box\n props:\n className: \"col-span-2\"\n children:\n - type: Card\n props:\n title: Revenue trend\n description: \"Demo series · hairline card, no drop shadow\"\n children:\n - type: TrendChart\n props:\n height: 200\n labels: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\"]\n series:\n - name: MRR\n area: true\n points: [18, 24, 22, 30, 38, 48]\n - name: Target\n points: [20, 25, 30, 32, 40, 44]\n - type: Card\n props:\n title: Pipeline\n children:\n - type: TimelineList\n props:\n items:\n - time: \"09:24\"\n title: \"Order #4821 shipped\"\n status: ok\n - time: \"08:50\"\n title: \"Refund requested\"\n desc: \"Customer #221\"\n status: warn\n - time: \"08:12\"\n title: \"Payment failed\"\n desc: \"Retrying in 1h\"\n status: error\n - time: \"07:40\"\n title: \"New signup\"\n status: ok\n - type: Card\n props:\n title: Recent orders\n description: \"Empty state is wired if the demo rows are cleared\"\n slots:\n actions:\n - type: Button\n props:\n label: Export\n variant: outline\n size: sm\n children:\n - type: Table\n props:\n emptyText: No orders in this window.\n columns:\n - key: id\n label: Order\n - key: customer\n label: Customer\n - key: total\n label: Total\n align: right\n - key: status\n label: Status\n rows:\n - id: \"#4821\"\n customer: Jane Cooper\n total: \"$210.00\"\n status: Shipped\n - id: \"#4820\"\n customer: Wade Warren\n total: \"$84.20\"\n status: Processing\n - id: \"#4819\"\n customer: Esther Howard\n total: \"$1,420.00\"\n status: Paid\n - id: \"#4818\"\n customer: Cameron W.\n total: \"$32.00\"\n status: Refunded\n",
|
|
22
|
+
"type": "registry:lib"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "lib/uibot/templates/admin-dashboard.uibot.json",
|
|
26
|
+
"target": "lib/uibot/templates/admin-dashboard.uibot.json",
|
|
27
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-dashboard\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"admin-dashboard.uibot.yaml\",\n \"contract\": {\n \"name\": \"admin-dashboard\",\n \"description\": \"Acme Admin\",\n \"level\": \"L4\",\n \"category\": \"template\",\n \"keywords\": [\n \"admin-dashboard\",\n \"admin-dashboard\",\n \"uibot-template\"\n ],\n \"composedFrom\": [\n \"BadgeGroup\",\n \"Box\",\n \"Button\",\n \"Card\",\n \"Grid\",\n \"Heading\",\n \"MenuLink\",\n \"PageLayout\",\n \"PageSiderMenu\",\n \"Paragraph\",\n \"StatGrid\",\n \"Table\",\n \"TimelineList\",\n \"Toast\",\n \"TrendChart\",\n \"app-shell-sidebar\"\n ]\n }\n }\n}\n",
|
|
28
|
+
"type": "registry:lib"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"meta": {
|
|
32
|
+
"uibot": {
|
|
33
|
+
"schema": "uibot.registry.item.v1",
|
|
34
|
+
"item": "admin-dashboard",
|
|
35
|
+
"channel": "public",
|
|
36
|
+
"template": {
|
|
37
|
+
"file": "admin-dashboard.uibot.yaml",
|
|
38
|
+
"contract": {
|
|
39
|
+
"name": "admin-dashboard",
|
|
40
|
+
"description": "Acme Admin",
|
|
41
|
+
"level": "L4",
|
|
42
|
+
"category": "template",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"admin-dashboard",
|
|
45
|
+
"admin-dashboard",
|
|
46
|
+
"uibot-template"
|
|
47
|
+
],
|
|
48
|
+
"composedFrom": [
|
|
49
|
+
"BadgeGroup",
|
|
50
|
+
"Box",
|
|
51
|
+
"Button",
|
|
52
|
+
"Card",
|
|
53
|
+
"Grid",
|
|
54
|
+
"Heading",
|
|
55
|
+
"MenuLink",
|
|
56
|
+
"PageLayout",
|
|
57
|
+
"PageSiderMenu",
|
|
58
|
+
"Paragraph",
|
|
59
|
+
"StatGrid",
|
|
60
|
+
"Table",
|
|
61
|
+
"TimelineList",
|
|
62
|
+
"Toast",
|
|
63
|
+
"TrendChart",
|
|
64
|
+
"app-shell-sidebar"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "admin-shell",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"description": "Workspace navigation with configured groups, brand and account",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"react"
|
|
8
|
+
],
|
|
9
|
+
"registryDependencies": [
|
|
10
|
+
"@uibot/uibot-base"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/uibot/admin-shell.tsx",
|
|
15
|
+
"target": "components/uibot/admin-shell.tsx",
|
|
16
|
+
"content": "import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { Icon } from \"./icons\";\nimport { emit, records, text, type BlockContext } from \"./interaction\";\nimport { PREVIEW_SCOPE_CSS, SCROLLBAR_CSS } from \"./preview-scope\";\n\nconst shellStyle = `\n.uibot-admin{font-family:var(--nui-font,Inter,ui-sans-serif,system-ui,sans-serif);display:flex;height:100dvh;overflow:hidden;background:var(--nui-sidebar,#fafafa);color:var(--nui-foreground,#171717);font-size:14px;line-height:1.5}.uibot-admin.dark{background:#141414;color:#fafafa}.uibot-admin *{box-sizing:border-box}.uibot-admin button,.uibot-admin a,.uibot-admin summary{touch-action:manipulation}.uibot-admin button:focus-visible,.uibot-admin a:focus-visible,.uibot-admin summary:focus-visible{outline:2px solid #737373;outline-offset:3px}.nui-sidebar{width:256px;flex:none;padding:8px;position:sticky;top:0;height:100dvh;overflow:auto;display:flex;flex-direction:column}.nui-main{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden;margin:8px;margin-inline-start:0;border:1px solid var(--nui-border,#e5e5e5);border-radius:12px;background:var(--nui-surface,#fff);box-shadow:0 1px 2px #00000005}.dark .nui-main{background:#0a0a0a;border-color:#262626}.nui-header{flex:none;height:64px;display:flex;gap:20px;align-items:center;padding:0 24px}.nui-header-links{display:flex;gap:24px;font-weight:500;font-size:14px}.nui-header-links a{color:#737373;text-decoration:none}.nui-header-links a[aria-current=page]{color:inherit}.nui-toolbar{display:flex;gap:12px;align-items:center;margin-inline-start:auto}.nui-icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;background:transparent;border:0;color:inherit;cursor:pointer}.nui-icon-button:hover{background:#88888815}.nui-search{display:flex;align-items:center;gap:9px;border:1px solid #e5e5e5;background:transparent;color:#737373;border-radius:6px;padding:5px 10px;width:240px;text-align:start}.nui-search kbd{margin-inline-start:auto;background:#88888810;border-radius:4px;padding:0 4px;font-size:11px}.nui-avatar{width:32px;height:32px;border-radius:50%;background:#eaeaea;color:#353535;display:grid;place-items:center;font-size:12px;font-weight:500}.nui-content{flex:1;min-height:0;overflow:auto;padding:20px 24px 28px}.nui-content>*+*{margin-top:20px}.nui-no-sidebar .nui-main{margin-inline-start:8px}.nui-brand{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:14px;text-align:start;width:100%;border:0;background:transparent;color:inherit}.nui-brand-mark{width:32px;height:32px;border-radius:8px;background:#171717;color:white;display:grid;place-items:center}.dark .nui-brand-mark{background:#fafafa;color:#171717}.nui-brand-copy{display:flex;flex:1;flex-direction:column;font-size:14px;line-height:19px}.nui-brand-copy small{font-size:12px;color:#737373}.nui-nav-group{margin:12px 0}.nui-nav-label{font-size:12px;font-weight:500;color:#737373;padding:0 8px;margin-bottom:6px}.nui-nav-link{display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:6px;font-size:14px;color:inherit;text-decoration:none;white-space:nowrap}.nui-nav-link:hover{background:#88888810}.nui-nav-link[aria-current=page]{background:var(--nui-accent,#e9e9e9);color:var(--nui-accent-foreground,inherit);font-weight:500}.dark .nui-nav-link[aria-current=page]{background:var(--nui-accent,#272727)}.dark .nui-nav-link .nui-badge{background:#fafafa;color:#171717}.nui-nav-link .nui-badge{margin-inline-start:auto;border-radius:5px;background:#171717;color:#fff;font-size:11px;padding:0 6px}.nui-nav-section summary{cursor:pointer;list-style:none}.nui-nav-section summary>svg:last-child{margin-inline-start:auto}.nui-nav-section[open] summary>svg:last-child{transform:rotate(90deg)}.nui-rail .nui-nav-section>div{display:none}.nui-nav-footer{margin-top:auto;padding-top:24px}.nui-rail .nui-sidebar{width:64px}.nui-rail .nui-nav-label,.nui-rail .nui-nav-text,.nui-rail .nui-brand-copy,.nui-rail .nui-badge,.nui-rail .nui-brand-chevron{display:none}.nui-rail .nui-nav-link{justify-content:center;padding:10px 0}.nui-command{border:1px solid #ddd;border-radius:10px;width:500px;max-width:calc(100vw - 32px);padding:0;margin:auto;background:inherit;color:inherit;box-shadow:0 20px 80px #0003}.nui-command::backdrop,.nui-mobile::backdrop{background:#0008}.nui-command input{width:100%;padding:16px;border:0;border-bottom:1px solid #8883;background:transparent;outline:none}.nui-command nav{padding:8px;max-height:360px;overflow:auto}.nui-mobile{margin:0;padding:8px;width:280px;max-width:85vw;height:100dvh;max-height:100dvh;border:0;background:#fafafa;color:#171717}.nui-mobile .nui-nav-footer{margin-top:24px}.nui-user-menu{position:relative}.nui-user-menu summary{list-style:none;cursor:pointer}.nui-user-menu nav{position:absolute;inset-inline-end:0;top:40px;min-width:190px;border:1px solid #8883;background:var(--nui-surface,#fff);border-radius:8px;padding:8px;z-index:40;box-shadow:0 4px 12px #0002}.nui-user-menu a{display:block;padding:8px;color:inherit;text-decoration:none}.dark .nui-user-menu nav,.dark .nui-command,.dark .nui-mobile{background:var(--nui-surface,#171717);color:#fafafa}.nui-mobile-close{float:right}.nui-brand-picker summary{list-style:none;cursor:pointer}.nui-brand-picker nav{padding:4px 8px;margin-bottom:12px}.nui-brand-picker a{display:block;padding:4px;color:inherit}\n@media(max-width:1024px){.nui-header-links{display:none}.nui-search{width:200px}}@media(max-width:767px){.nui-sidebar{display:none}.nui-main{margin:0;border:0;border-radius:0}.nui-header{padding:0 16px;gap:8px;height:60px}.nui-content{padding:16px}.nui-search{width:150px;font-size:12px}.nui-search kbd{display:none}.nui-toolbar{gap:5px}.uibot-admin table{min-width:680px}.uibot-admin h1{font-size:24px}}\n${PREVIEW_SCOPE_CSS}${SCROLLBAR_CSS}`;\nexport const AppNavigation: RendererComponent = (props, ctx) => (\n <>\n <style>{shellStyle}</style>\n <Navigation props={props} ctx={ctx} />\n </>\n);\nfunction Navigation({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n return (\n <>\n <details className=\"nui-brand-picker\">\n <summary aria-label={text(props.brand, \"Shadcn Admin\")}>\n <div className=\"nui-brand\">\n {typeof props.logoSrc === \"string\" && props.logoSrc ? (\n <img\n src={props.logoSrc}\n alt={text(props.brand, \"Brand\")}\n width={32}\n height={32}\n style={{ objectFit: \"contain\", flexShrink: 0 }}\n />\n ) : (\n <span className=\"nui-brand-mark\">\n <Icon name=\"command\" />\n </span>\n )}\n <span className=\"nui-brand-copy\">\n <strong>{text(props.brand, \"Shadcn Admin\")}</strong>\n <small>{text(props.subtitle, \"Vite + ShadcnUI\")}</small>\n </span>\n <span className=\"nui-brand-chevron\">\n <Icon name=\"chevrons-up-down\" size={16} />\n </span>\n </div>\n </summary>\n <nav aria-label=\"Workspaces\">\n {records(props.workspaces).map((w) => (\n <a\n key={text(w.href)}\n href={text(w.href)}\n onClick={() => emit(ctx, \"onNavigate\", { href: text(w.href) })}\n >\n {text(w.label)}\n </a>\n ))}\n </nav>\n </details>\n <nav aria-label=\"Main navigation\">\n {records(props.groups).map((group) => (\n <div className=\"nui-nav-group\" key={text(group.label)}>\n <div className=\"nui-nav-label\">{text(group.label)}</div>\n {records(group.items).map((item) =>\n records(item.children).length ? (\n <details\n key={text(item.label)}\n className=\"nui-nav-section\"\n open={\n records(item.children).some((child) => child.href === props.activePath) ||\n undefined\n }\n >\n <summary\n className=\"nui-nav-link\"\n aria-label={text(item.label)}\n title={text(item.label)}\n >\n <Icon name={text(item.icon, \"boxes\")} />\n <span className=\"nui-nav-text\">{text(item.label)}</span>\n <Icon name=\"chevron-right\" size={16} />\n </summary>\n <div className=\"ms-4 border-s ps-3\">\n {records(item.children).map((child) => (\n <a\n className=\"nui-nav-link\"\n key={text(child.href)}\n href={text(child.href)}\n aria-current={child.href === props.activePath ? \"page\" : undefined}\n onClick={() => emit(ctx, \"onNavigate\", { href: text(child.href) })}\n >\n {text(child.label)}\n </a>\n ))}\n </div>\n </details>\n ) : (\n <a\n key={text(item.href)}\n className=\"nui-nav-link\"\n title={text(item.label)}\n href={text(item.href)}\n aria-current={\n item.active === true || item.href === props.activePath ? \"page\" : undefined\n }\n onClick={() => emit(ctx, \"onNavigate\", { href: text(item.href) })}\n >\n <Icon name={text(item.icon, \"boxes\")} />\n <span className=\"nui-nav-text\">{text(item.label)}</span>\n {Boolean(item.badge) && <span className=\"nui-badge\">{text(item.badge)}</span>}\n </a>\n ),\n )}\n </div>\n ))}\n </nav>\n <div className=\"nui-nav-footer\">\n <a className=\"nui-nav-link\" href={text(props.profileHref, \"/settings/profile\")}>\n <span className=\"nui-avatar\">{text(props.initials, \"SN\")}</span>\n <span className=\"nui-brand-copy\">\n <strong>{text(props.userName, \"shadcn\")}</strong>\n <small>{text(props.email, \"m@example.com\")}</small>\n </span>\n <Icon name=\"chevrons-up-down\" size={16} />\n </a>\n </div>\n </>\n );\n}\nexport function AdminFrame({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const [rail, setRail] = useState(false),\n [localDark, setDark] = useState(props.theme === \"dark\"),\n [query, setQuery] = useState(\"\");\n const [systemDark, setSystemDark] = useState(false);\n const [smallScreen, setSmallScreen] = useState(false);\n const [mobileOpen, setMobileOpen] = useState(false);\n useEffect(() => {\n const media = window.matchMedia(\"(max-width:767px)\");\n const sync = () => setSmallScreen(media.matches);\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, []);\n useEffect(() => {\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const sync = () => setSystemDark(media.matches);\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, []);\n const dark =\n props.theme === \"system\"\n ? systemDark\n : typeof props.theme === \"string\"\n ? props.theme === \"dark\"\n : localDark;\n const root = useRef<HTMLDivElement>(null);\n // A page without sidebar content gets no empty navigation rail, toggle or drawer.\n const hasSidebarSlot: unknown = ctx.slots.sidebar;\n const hasSidebar = Array.isArray(hasSidebarSlot)\n ? hasSidebarSlot.length > 0\n : Boolean(hasSidebarSlot);\n const mobile = useRef<HTMLDialogElement>(null),\n command = useRef<HTMLDialogElement>(null),\n trigger = useRef<HTMLElement | null>(null);\n const close = (dialog: HTMLDialogElement | null) => {\n dialog?.close();\n trigger.current?.focus();\n };\n const show = useCallback((dialog: HTMLDialogElement | null) => {\n trigger.current = document.activeElement as HTMLElement;\n dialog?.showModal();\n }, []);\n useEffect(() => {\n const key = (e: KeyboardEvent) => {\n if (root.current?.closest(\"[inert]\")) return;\n if (\n document.activeElement !== document.body &&\n !root.current?.contains(document.activeElement)\n )\n return;\n if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"k\") {\n e.preventDefault();\n show(command.current);\n }\n };\n document.addEventListener(\"keydown\", key);\n return () => document.removeEventListener(\"keydown\", key);\n }, [show]);\n useEffect(() => {\n const menus = () =>\n Array.from(\n root.current?.querySelectorAll<HTMLDetailsElement>(\n \".nui-user-menu[open],.nui-brand-picker[open]\",\n ) ?? [],\n );\n const dismissOutside = (event: PointerEvent) => {\n for (const menu of menus()) if (!menu.contains(event.target as Node)) menu.open = false;\n };\n const dismissEscape = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || root.current?.querySelector(\"dialog[open]\")) return;\n for (const menu of menus()) {\n if (!menu.contains(document.activeElement)) continue;\n event.preventDefault();\n menu.open = false;\n menu.querySelector<HTMLElement>(\"summary\")?.focus();\n }\n };\n document.addEventListener(\"pointerdown\", dismissOutside);\n document.addEventListener(\"keydown\", dismissEscape);\n return () => {\n document.removeEventListener(\"pointerdown\", dismissOutside);\n document.removeEventListener(\"keydown\", dismissEscape);\n };\n }, []);\n useEffect(() => {\n if (!smallScreen) mobile.current?.close();\n }, [smallScreen]);\n const activePath = props.activePath ?? ctx.resolve?.getState?.(\"currentPath\");\n const routes = records(props.routes).filter((r) =>\n text(r.label).toLowerCase().includes(query.toLowerCase()),\n );\n return (\n <div\n ref={root}\n style={\n {\n fontFamily:\n props.font === \"System\"\n ? \"system-ui,sans-serif\"\n : props.font === \"Manrope\"\n ? \"Manrope,system-ui,sans-serif\"\n : undefined,\n ...Object.fromEntries(\n Object.entries(\n (props.tokens && typeof props.tokens === \"object\" ? props.tokens : {}) as Record<\n string,\n unknown\n >,\n )\n .filter(\n ([key, value]) =>\n [\n \"sidebar\",\n \"surface\",\n \"foreground\",\n \"accent\",\n \"accent-foreground\",\n \"primary\",\n \"primary-foreground\",\n \"border\",\n \"font\",\n ].includes(key) && typeof value === \"string\",\n )\n .map(([key, value]) => [\n key === \"primary\" || key === \"primary-foreground\" ? `--${key}` : `--nui-${key}`,\n value,\n ]),\n ),\n } as CSSProperties\n }\n data-uibot-type=\"PageLayout\"\n data-appearance=\"admin\"\n dir={props.direction === \"rtl\" ? \"rtl\" : \"ltr\"}\n className={`uibot-admin ${rail && !smallScreen ? \"nui-rail\" : \"\"} ${dark ? \"dark\" : \"\"} ${hasSidebar ? \"\" : \"nui-no-sidebar\"}`}\n onClickCapture={(event) => {\n if (rail && (event.target as HTMLElement).closest(\".nui-sidebar summary\")) setRail(false);\n }}\n >\n <style>{shellStyle}</style>\n {hasSidebar && <aside className=\"nui-sidebar\">{ctx.slots.sidebar as ReactNode[]}</aside>}\n <div className=\"nui-main\">\n <header className=\"nui-header\">\n {hasSidebar && (\n <button\n type=\"button\"\n className=\"nui-icon-button\"\n aria-label=\"Toggle sidebar\"\n aria-expanded={smallScreen ? mobileOpen : !rail}\n onClick={() => {\n if (smallScreen) {\n setMobileOpen(true);\n show(mobile.current);\n } else setRail(!rail);\n }}\n >\n <Icon name=\"panel-left\" />\n </button>\n )}\n <nav className=\"nui-header-links\" aria-label=\"Workspace\">\n {records(props.headerLinks).map((link) => (\n <a\n href={text(link.href)}\n key={text(link.label)}\n aria-current={\n link.href === activePath ||\n (link.href === \"/settings/profile\" &&\n typeof activePath === \"string\" &&\n activePath.startsWith(\"/settings/\"))\n ? \"page\"\n : undefined\n }\n >\n {text(link.label)}\n </a>\n ))}\n </nav>\n <div className=\"nui-toolbar\">\n <button type=\"button\" className=\"nui-search\" onClick={() => show(command.current)}>\n <Icon name=\"search\" size={16} />\n Search<kbd>⌘ K</kbd>\n </button>\n <button\n type=\"button\"\n className=\"nui-icon-button\"\n aria-label={dark ? \"Use light theme\" : \"Use dark theme\"}\n onClick={() => {\n setDark(!dark);\n emit(\n ctx,\n \"onThemeChange\",\n { theme: dark ? \"light\" : \"dark\" },\n dark ? \"light\" : \"dark\",\n );\n }}\n >\n <Icon name={dark ? \"moon\" : \"sun\"} />\n </button>\n <details className=\"nui-user-menu\">\n <summary aria-label=\"Open account menu\">\n <span className=\"nui-avatar\">{text(props.initials, \"SN\")}</span>\n </summary>\n <nav aria-label=\"Account\">\n {records(\n props.accountLinks ?? [\n { href: \"/settings/profile\", label: \"Profile\" },\n { href: \"/settings/account\", label: \"Account\" },\n { href: \"/settings/notifications\", label: \"Notifications\" },\n { href: \"/sign-in\", label: \"Sign in\" },\n ],\n ).map((link) => (\n <a key={text(link.href)} href={text(link.href)}>\n {text(link.label)}\n </a>\n ))}\n </nav>\n </details>\n {ctx.slots.headerActions as ReactNode[]}\n </div>\n </header>\n <main className=\"nui-content\">{ctx.children as ReactNode[]}</main>\n {ctx.slots.footer as ReactNode[]}\n </div>\n {hasSidebar && (\n <dialog\n ref={mobile}\n className=\"nui-mobile\"\n aria-label=\"Navigation\"\n onClose={() => {\n setMobileOpen(false);\n trigger.current?.focus();\n }}\n >\n <button\n type=\"button\"\n className=\"nui-icon-button nui-mobile-close\"\n aria-label=\"Close navigation\"\n onClick={() => close(mobile.current)}\n >\n <Icon name=\"x\" />\n </button>\n <div\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"a\")) close(mobile.current);\n }}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </div>\n </dialog>\n )}\n <dialog\n ref={command}\n className=\"nui-command\"\n aria-label=\"Search pages\"\n onClose={() => {\n setQuery(\"\");\n trigger.current?.focus();\n }}\n onKeyDown={(event) => {\n if (\n ![\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(event.key) ||\n event.target instanceof HTMLInputElement\n )\n return;\n const links = Array.from(\n command.current?.querySelectorAll<HTMLAnchorElement>(\"nav a\") ?? [],\n );\n if (!links.length) return;\n event.preventDefault();\n const index = links.indexOf(document.activeElement as HTMLAnchorElement);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? links.length - 1\n : (index + (event.key === \"ArrowDown\" ? 1 : -1) + links.length) % links.length;\n links[next]?.focus();\n }}\n >\n <input\n aria-label=\"Search pages\"\n autoComplete=\"off\"\n placeholder=\"Type a command or search...\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n const links = command.current?.querySelectorAll<HTMLAnchorElement>(\"nav a\");\n if (!links?.length) return;\n e.preventDefault();\n links[e.key === \"ArrowDown\" ? 0 : links.length - 1]?.focus();\n }\n }}\n />\n <nav>\n {routes.map((route) => (\n <a\n className=\"nui-nav-link\"\n href={text(route.href)}\n key={text(route.href)}\n onClick={() => close(command.current)}\n >\n <Icon name={text(route.icon, \"chevron-right\")} />\n {text(route.label)}\n </a>\n ))}\n {!routes.length && <p className=\"p-4 text-sm\">No results found.</p>}\n </nav>\n </dialog>\n </div>\n );\n}\n",
|
|
17
|
+
"type": "registry:ui"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "components/uibot/icons.tsx",
|
|
21
|
+
"target": "components/uibot/icons.tsx",
|
|
22
|
+
"content": "/*\nISC License\n\nCopyright (c) 2026 Lucide Icons and Contributors\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n---\n\nThe following Lucide icons are derived from the Feather project:\n\nairplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out\n\nThe MIT License (MIT) (for the icons listed above)\n\nCopyright (c) 2013-present Cole Bemis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n// Icon paths from lucide-react 1.8.0 (ISC); see docs/shadcn-admin-attribution.md.\nimport { createElement } from \"react\";\nconst paths: Record<string, [string, Record<string, string>][]> = {\n \"panel-left\": [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M9 3v18\", key: \"fh3hqa\" }],\n ],\n \"layout-dashboard\": [\n [\"rect\", { width: \"7\", height: \"9\", x: \"3\", y: \"3\", rx: \"1\", key: \"10lvy0\" }],\n [\"rect\", { width: \"7\", height: \"5\", x: \"14\", y: \"3\", rx: \"1\", key: \"16une8\" }],\n [\"rect\", { width: \"7\", height: \"9\", x: \"14\", y: \"12\", rx: \"1\", key: \"1hutg5\" }],\n [\"rect\", { width: \"7\", height: \"5\", x: \"3\", y: \"16\", rx: \"1\", key: \"ldoo1y\" }],\n ],\n \"list-todo\": [\n [\"path\", { d: \"M13 5h8\", key: \"a7qcls\" }],\n [\"path\", { d: \"M13 12h8\", key: \"h98zly\" }],\n [\"path\", { d: \"M13 19h8\", key: \"c3s6r1\" }],\n [\"path\", { d: \"m3 17 2 2 4-4\", key: \"1jhpwq\" }],\n [\"rect\", { x: \"3\", y: \"4\", width: \"6\", height: \"6\", rx: \"1\", key: \"cif1o7\" }],\n ],\n users: [\n [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"path\", { d: \"M16 3.128a4 4 0 0 1 0 7.744\", key: \"16gr8j\" }],\n [\"path\", { d: \"M22 21v-2a4 4 0 0 0-3-3.87\", key: \"kshegd\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n ],\n settings: [\n [\n \"path\",\n {\n 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\",\n key: \"1i5ecw\",\n },\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }],\n ],\n \"message-circle\": [\n [\n \"path\",\n {\n d: \"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\",\n key: \"1sd12s\",\n },\n ],\n ],\n command: [\n [\n \"path\",\n {\n d: \"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3\",\n key: \"11bfej\",\n },\n ],\n ],\n search: [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }],\n ],\n sun: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"path\", { d: \"M12 2v2\", key: \"tus03m\" }],\n [\"path\", { d: \"M12 20v2\", key: \"1lh1kg\" }],\n [\"path\", { d: \"m4.93 4.93 1.41 1.41\", key: \"149t6j\" }],\n [\"path\", { d: \"m17.66 17.66 1.41 1.41\", key: \"ptbguv\" }],\n [\"path\", { d: \"M2 12h2\", key: \"1t8f8n\" }],\n [\"path\", { d: \"M20 12h2\", key: \"1q8mjw\" }],\n [\"path\", { d: \"m6.34 17.66-1.41 1.41\", key: \"1m8zz5\" }],\n [\"path\", { d: \"m19.07 4.93-1.41 1.41\", key: \"1shlcs\" }],\n ],\n moon: [\n [\n \"path\",\n {\n d: \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n key: \"kfwtm\",\n },\n ],\n ],\n \"chevron-down\": [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]],\n \"chevron-right\": [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]],\n \"chevrons-up-down\": [\n [\"path\", { d: \"m7 15 5 5 5-5\", key: \"1hf1tw\" }],\n [\"path\", { d: \"m7 9 5-5 5 5\", key: \"sgt6xg\" }],\n ],\n plus: [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n ],\n download: [\n [\"path\", { d: \"M12 15V3\", key: \"m9g1x1\" }],\n [\"path\", { d: \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\", key: \"ih7n3h\" }],\n [\"path\", { d: \"m7 10 5 5 5-5\", key: \"brsn70\" }],\n ],\n \"sliders-horizontal\": [\n [\"path\", { d: \"M10 5H3\", key: \"1qgfaw\" }],\n [\"path\", { d: \"M12 19H3\", key: \"yhmn1j\" }],\n [\"path\", { d: \"M14 3v4\", key: \"1sua03\" }],\n [\"path\", { d: \"M16 17v4\", key: \"1q0r14\" }],\n [\"path\", { d: \"M21 12h-9\", key: \"1o4lsq\" }],\n [\"path\", { d: \"M21 19h-5\", key: \"1rlt1p\" }],\n [\"path\", { d: \"M21 5h-7\", key: \"1oszz2\" }],\n [\"path\", { d: \"M8 10v4\", key: \"tgpxqk\" }],\n [\"path\", { d: \"M8 12H3\", key: \"a7s4jb\" }],\n ],\n shield: [\n [\n \"path\",\n {\n d: \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\",\n key: \"oel41y\",\n },\n ],\n ],\n \"log-out\": [\n [\"path\", { d: \"m16 17 5-5-5-5\", key: \"1bji2h\" }],\n [\"path\", { d: \"M21 12H9\", key: \"dn1m92\" }],\n [\"path\", { d: \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\", key: \"1uf3rs\" }],\n ],\n boxes: [\n [\n \"path\",\n {\n d: \"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\",\n key: \"lc1i9w\",\n },\n ],\n [\"path\", { d: \"m7 16.5-4.74-2.85\", key: \"1o9zyk\" }],\n [\"path\", { d: \"m7 16.5 5-3\", key: \"va8pkn\" }],\n [\"path\", { d: \"M7 16.5v5.17\", key: \"jnp8gn\" }],\n [\n \"path\",\n {\n d: \"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\",\n key: \"8zsnat\",\n },\n ],\n [\"path\", { d: \"m17 16.5-5-3\", key: \"8arw3v\" }],\n [\"path\", { d: \"m17 16.5 4.74-2.85\", key: \"8rfmw\" }],\n [\"path\", { d: \"M17 16.5v5.17\", key: \"k6z78m\" }],\n [\n \"path\",\n {\n d: \"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\",\n key: \"1xygjf\",\n },\n ],\n [\"path\", { d: \"M12 8 7.26 5.15\", key: \"1vbdud\" }],\n [\"path\", { d: \"m12 8 4.74-2.85\", key: \"3rx089\" }],\n [\"path\", { d: \"M12 13.5V8\", key: \"1io7kd\" }],\n ],\n \"chart-no-axes-column\": [\n [\"path\", { d: \"M5 21v-6\", key: \"1hz6c0\" }],\n [\"path\", { d: \"M12 21V3\", key: \"1lcnhd\" }],\n [\"path\", { d: \"M19 21V9\", key: \"unv183\" }],\n ],\n ellipsis: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"19\", cy: \"12\", r: \"1\", key: \"1wjl8i\" }],\n [\"circle\", { cx: \"5\", cy: \"12\", r: \"1\", key: \"1pcz8c\" }],\n ],\n \"arrow-up\": [\n [\"path\", { d: \"m5 12 7-7 7 7\", key: \"hav0vg\" }],\n [\"path\", { d: \"M12 19V5\", key: \"x0mq9r\" }],\n ],\n \"arrow-down\": [\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\", key: \"1idqje\" }],\n ],\n x: [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }],\n ],\n check: [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]],\n send: [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\",\n },\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }],\n ],\n mail: [\n [\"path\", { d: \"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\", key: \"132q7q\" }],\n [\"rect\", { x: \"2\", y: \"4\", width: \"20\", height: \"16\", rx: \"2\", key: \"izxlao\" }],\n ],\n calendar: [\n [\"path\", { d: \"M8 2v4\", key: \"1cmpym\" }],\n [\"path\", { d: \"M16 2v4\", key: \"4m81vk\" }],\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"4\", rx: \"2\", key: \"1hopcy\" }],\n [\"path\", { d: \"M3 10h18\", key: \"8toen8\" }],\n ],\n eye: [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\",\n },\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }],\n ],\n \"eye-off\": [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\",\n },\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\",\n },\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }],\n ],\n};\nexport function Icon({ name, size = 18 }: { name: string; size?: number }) {\n const nodes = paths[name] ?? paths.boxes ?? [];\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n style={{ flexShrink: 0 }}\n >\n {nodes.map(([tag, attributes]) => createElement(tag, attributes))}\n </svg>\n );\n}\n",
|
|
23
|
+
"type": "registry:ui"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "components/uibot/interaction.ts",
|
|
27
|
+
"target": "components/uibot/interaction.ts",
|
|
28
|
+
"content": "import type { RendererComponent } from \"@/lib/uibot-renderer\";\nexport type BlockContext = Parameters<RendererComponent>[1];\nexport type Chain = Parameters<NonNullable<BlockContext[\"dispatch\"]>>[0];\nexport type EventValue = string | number | boolean | null;\nexport function emit(\n ctx: BlockContext,\n name: string,\n values: Record<string, EventValue | EventValue[]> = {},\n value?: EventValue,\n): void {\n const element = ctx.element as { events?: Record<string, Chain> };\n const chain = element.events?.[name];\n if (chain?.length)\n void ctx.dispatch?.(chain, {\n event: { type: name, values, ...(value !== undefined ? { value } : {}) },\n });\n}\nexport function text(value: unknown, fallback = \"\"): string {\n return value == null ? fallback : String(value);\n}\nexport function records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value)\n ? value.filter(\n (v): v is Record<string, unknown> => !!v && typeof v === \"object\" && !Array.isArray(v),\n )\n : [];\n}\n\nconst submissions = new WeakMap<object, { payload: string; key: string }>();\n/** A new owner represents a new user intent; an unchanged failed submission keeps its key. */\nexport function submissionKey(owner: object, values: unknown): string {\n const payload = JSON.stringify(values);\n const previous = submissions.get(owner);\n if (previous?.payload === payload) return previous.key;\n const key = crypto.randomUUID();\n submissions.set(owner, { payload, key });\n return key;\n}\n",
|
|
29
|
+
"type": "registry:ui"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"path": "components/uibot/preview-scope.ts",
|
|
33
|
+
"target": "components/uibot/preview-scope.ts",
|
|
34
|
+
"content": "/**\n * Page frames (`PageLayout`) fill the viewport so only their main area scrolls. Hosts that embed a\n * rendered page in a smaller pane mark the pane with `data-uibot-preview-scope`; inside it the frame\n * fills the pane instead of the viewport: wrappers between the pane and the frame become a flex column\n * chain, so a pane that is a flex column with a definite height hands the frame exactly the space\n * left under any sibling (such as a notice strip). Without such a pane the frame falls back to\n * `height:100%`, and to content height when that is not definite either. The pane also becomes the\n * containing block for fixed-position content (floating toasts, dialogs), so they anchor to the\n * preview instead of the whole browser window.\n */\nexport const PREVIEW_SCOPE_CSS =\n \"[data-uibot-preview-scope]{contain:layout}[data-uibot-preview-scope] .uibot-admin,[data-uibot-preview-scope] .uibot-page-layout{height:100%;min-height:0;flex:1 1 0}[data-uibot-preview-scope] div:has(.uibot-admin),[data-uibot-preview-scope] div:has(.uibot-page-layout){display:flex;flex-direction:column;min-height:0;flex:1 1 0}\";\n\n/**\n * shadcn/ui Scroll Area look for every scroll container inside a page frame (content area, sidebar,\n * table wrappers, dialogs): a slim 10px track with a rounded, theme-aware thumb. This styles the\n * native scrollbar so it matches shadcn's `ScrollArea`; it does not load Radix.\n */\nexport const SCROLLBAR_CSS =\n \".uibot-admin,.uibot-admin *,.uibot-page-layout,.uibot-page-layout *{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,currentColor 28%,transparent) transparent}.uibot-admin ::-webkit-scrollbar,.uibot-page-layout ::-webkit-scrollbar{width:10px;height:10px}.uibot-admin ::-webkit-scrollbar-track,.uibot-page-layout ::-webkit-scrollbar-track{background:transparent}.uibot-admin ::-webkit-scrollbar-thumb,.uibot-page-layout ::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:9999px;background:color-mix(in srgb,currentColor 28%,transparent);background-clip:padding-box}.uibot-admin ::-webkit-scrollbar-thumb:hover,.uibot-page-layout ::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,currentColor 45%,transparent);background-clip:padding-box}.uibot-admin ::-webkit-scrollbar-corner,.uibot-page-layout ::-webkit-scrollbar-corner{background:transparent}\";\n",
|
|
35
|
+
"type": "registry:ui"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"path": "components/uibot/admin-shell.uibot.json",
|
|
39
|
+
"target": "components/uibot/admin-shell.uibot.json",
|
|
40
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"admin-shell\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"AppNavigation\",\n \"export\": \"AppNavigation\",\n \"module\": \"admin-shell.tsx\",\n \"catalog\": {\n \"name\": \"AppNavigation\",\n \"tags\": [\n \"navigation\"\n ],\n \"description\": \"Workspace navigation with configured groups, brand and account\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"props\": {\n \"activePath\": {\n \"type\": \"string\"\n },\n \"brand\": {\n \"type\": \"string\"\n },\n \"logoSrc\": {\n \"type\": \"string\",\n \"description\": \"Optional brand image URL; preserve its aspect ratio\"\n },\n \"subtitle\": {\n \"type\": \"string\"\n },\n \"groups\": {\n \"type\": \"array\"\n },\n \"workspaces\": {\n \"type\": \"array\"\n },\n \"userName\": {\n \"type\": \"string\"\n },\n \"email\": {\n \"type\": \"string\"\n },\n \"initials\": {\n \"type\": \"string\"\n },\n \"profileHref\": {\n \"type\": \"string\"\n }\n },\n \"events\": {\n \"onNavigate\": {\n \"description\": \"Serializable values in event.values\"\n }\n }\n }\n }\n ]\n}\n",
|
|
41
|
+
"type": "registry:ui"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"meta": {
|
|
45
|
+
"category": "composite",
|
|
46
|
+
"level": "L2",
|
|
47
|
+
"props": {
|
|
48
|
+
"activePath": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"brand": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"logoSrc": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Optional brand image URL; preserve its aspect ratio"
|
|
57
|
+
},
|
|
58
|
+
"subtitle": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"groups": {
|
|
62
|
+
"type": "array"
|
|
63
|
+
},
|
|
64
|
+
"workspaces": {
|
|
65
|
+
"type": "array"
|
|
66
|
+
},
|
|
67
|
+
"userName": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"email": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"initials": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
},
|
|
76
|
+
"profileHref": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"events": {
|
|
81
|
+
"onNavigate": {
|
|
82
|
+
"description": "Serializable values in event.values"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"provides": [
|
|
86
|
+
"AppNavigation"
|
|
87
|
+
],
|
|
88
|
+
"uibot": {
|
|
89
|
+
"schema": "uibot.registry.item.v1",
|
|
90
|
+
"item": "admin-shell",
|
|
91
|
+
"channel": "public",
|
|
92
|
+
"components": [
|
|
93
|
+
{
|
|
94
|
+
"name": "AppNavigation",
|
|
95
|
+
"export": "AppNavigation",
|
|
96
|
+
"module": "admin-shell.tsx",
|
|
97
|
+
"catalog": {
|
|
98
|
+
"name": "AppNavigation",
|
|
99
|
+
"tags": [
|
|
100
|
+
"navigation"
|
|
101
|
+
],
|
|
102
|
+
"description": "Workspace navigation with configured groups, brand and account",
|
|
103
|
+
"category": "composite",
|
|
104
|
+
"level": "L2",
|
|
105
|
+
"props": {
|
|
106
|
+
"activePath": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"brand": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"logoSrc": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "Optional brand image URL; preserve its aspect ratio"
|
|
115
|
+
},
|
|
116
|
+
"subtitle": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"groups": {
|
|
120
|
+
"type": "array"
|
|
121
|
+
},
|
|
122
|
+
"workspaces": {
|
|
123
|
+
"type": "array"
|
|
124
|
+
},
|
|
125
|
+
"userName": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"email": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"initials": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
"profileHref": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"events": {
|
|
139
|
+
"onNavigate": {
|
|
140
|
+
"description": "Serializable values in event.values"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|