@weconjs/core 1.2.2 → 1.2.6
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/README.md +460 -259
- package/dist/config.d.ts +7 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +21 -43
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +5 -0
- package/dist/server/index.js.map +1 -1
- package/dist/types.d.ts +10 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/devtools/client/assets/ModuleDetail-BoiZYmmO.js +0 -1
- package/dist/devtools/client/assets/TranslationEditor-Dz2BHJgQ.js +0 -6
- package/dist/devtools/client/assets/api-CvtLmLuv.js +0 -11
- package/dist/devtools/client/assets/arrow-left-C26_8YjI.js +0 -6
- package/dist/devtools/client/assets/chevron-right-ByQ2jwEZ.js +0 -6
- package/dist/devtools/client/assets/index-BFzJyDrn.css +0 -1
- package/dist/devtools/client/assets/index-BI-oiBt-.js +0 -1
- package/dist/devtools/client/assets/index-BMd21Cuf.js +0 -1
- package/dist/devtools/client/assets/index-BjgISQg5.js +0 -181
- package/dist/devtools/client/assets/index-D825pKz_.js +0 -6
- package/dist/devtools/client/assets/index-DS8GcC6h.js +0 -6
- package/dist/devtools/client/assets/index-DaglUNul.js +0 -1
- package/dist/devtools/client/index.html +0 -15
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as o,r as l,j as e,m as x}from"./index-BjgISQg5.js";import{a as m,L as f}from"./api-CvtLmLuv.js";import{C as p}from"./chevron-right-ByQ2jwEZ.js";/**
|
|
2
|
-
* @license lucide-react v0.460.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const d=o("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function u(){const[s,n]=l.useState(null),[r,t]=l.useState(!0);return l.useEffect(()=>{m.get("/config").then(a=>n(a.data)).catch(console.error).finally(()=>t(!1))},[]),r?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(f,{className:"size-8 animate-spin text-primary"})}):e.jsxs(x.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex size-full flex-col gap-6 overflow-y-auto p-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-primary",children:"Configuration"}),e.jsx("p",{className:"mt-1 text-sm text-secondary",children:"Resolved application configuration"})]}),s&&e.jsx("div",{className:"rounded-primary border border-primary bg-secondary p-4",children:e.jsx(c,{data:s})})]})}function c({data:s,depth:n=0}){if(s==null)return e.jsx("span",{className:"text-gray-400",children:"null"});if(typeof s!="object")return typeof s=="string"?e.jsxs("span",{className:"text-green-600",children:['"',s,'"']}):typeof s=="boolean"?e.jsx("span",{className:"text-blue-600",children:s?"true":"false"}):e.jsx("span",{className:"text-orange-600",children:String(s)});if(Array.isArray(s))return s.length===0?e.jsx("span",{className:"text-gray-400",children:"[]"}):e.jsx("div",{className:"flex flex-col gap-1",style:{marginLeft:n>0?16:0},children:s.map((t,a)=>e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsxs("span",{className:"text-xs text-gray-400",children:["[",a,"]"]}),e.jsx(c,{data:t,depth:n+1})]},a))});const r=Object.entries(s);return r.length===0?e.jsx("span",{className:"text-gray-400",children:"{}"}):e.jsx("div",{className:"flex flex-col gap-1",style:{marginLeft:n>0?16:0},children:r.map(([t,a])=>e.jsx(j,{propKey:t,value:a,depth:n},t))})}function j({propKey:s,value:n,depth:r}){const[t,a]=l.useState(r<2),i=typeof n=="object"&&n!==null;return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:`flex items-center gap-1 font-mono text-xs ${i?"cursor-pointer":""}`,onClick:()=>i&&a(!t),children:[i?t?e.jsx(d,{className:"size-3 text-secondary"}):e.jsx(p,{className:"size-3 text-secondary"}):e.jsx("span",{className:"inline-block w-3"}),e.jsx("span",{className:"font-semibold text-primary",children:s}),e.jsx("span",{className:"text-gray-400",children:":"}),!i&&e.jsx("span",{className:"ml-1",children:e.jsx(c,{data:n,depth:r+1})}),i&&!t&&e.jsx("span",{className:"text-gray-400",children:Array.isArray(n)?`[${n.length}]`:`{${Object.keys(n).length}}`})]}),i&&t&&e.jsx(c,{data:n,depth:r+1})]})}export{u as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as m,r as a,j as e,m as h}from"./index-BjgISQg5.js";import{a as y,L as u}from"./api-CvtLmLuv.js";/**
|
|
2
|
-
* @license lucide-react v0.460.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const b=m("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),f={GET:"bg-green-100 text-green-700",POST:"bg-blue-100 text-blue-700",PUT:"bg-yellow-100 text-yellow-700",PATCH:"bg-orange-100 text-orange-700",DELETE:"bg-red-100 text-red-700"};function N(){const[r,c]=a.useState([]),[n,d]=a.useState(!0),[s,i]=a.useState("");if(a.useEffect(()=>{y.get("/routes").then(t=>c(t.data)).catch(console.error).finally(()=>d(!1))},[]),n)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(u,{className:"size-8 animate-spin text-primary"})});const x=r.filter(t=>t.path.toLowerCase().includes(s.toLowerCase())||t.rai.toLowerCase().includes(s.toLowerCase())||t.method.toLowerCase().includes(s.toLowerCase()));return e.jsxs(h.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex size-full flex-col gap-6 overflow-y-auto p-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-primary",children:"Routes"}),e.jsxs("p",{className:"mt-1 text-sm text-secondary",children:[r.length," endpoint",r.length!==1?"s":""]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-secondary"}),e.jsx("input",{type:"text",placeholder:"Search by path, RAI, or method...",value:s,onChange:t=>i(t.target.value),className:"w-full rounded-secondary border border-primary bg-secondary py-2 pl-9 pr-4 text-sm text-primary outline-none focus:border-blue-500"})]}),e.jsx("div",{className:"overflow-auto rounded-primary border border-primary",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-primary bg-primary text-left text-xs text-secondary",children:[e.jsx("th",{className:"px-4 py-3",children:"Method"}),e.jsx("th",{className:"px-4 py-3",children:"Path"}),e.jsx("th",{className:"px-4 py-3",children:"RAI"}),e.jsx("th",{className:"px-4 py-3",children:"Roles"})]})}),e.jsx("tbody",{children:x.map((t,p)=>{var l;return e.jsxs("tr",{className:"border-b border-primary bg-secondary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:`inline-block rounded px-2 py-0.5 text-xs font-semibold ${f[t.method.toUpperCase()]??"bg-gray-100 text-gray-700"}`,children:t.method.toUpperCase()})}),e.jsx("td",{className:"px-4 py-2.5 font-mono text-xs text-primary",children:t.path}),e.jsx("td",{className:"px-4 py-2.5 font-mono text-xs text-secondary",children:t.rai}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:(l=t.roles)==null?void 0:l.map(o=>e.jsx("span",{className:"rounded-full bg-primary px-2 py-0.5 text-xs text-secondary",children:o},o))})})]},p)})})]})})]})}export{N as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,u as x,j as e,m as r,G as n}from"./index-BjgISQg5.js";import{a as d,L as p}from"./api-CvtLmLuv.js";import{C as f}from"./chevron-right-ByQ2jwEZ.js";function j(){const[a,c]=i.useState([]),[l,o]=i.useState(!0),m=x();return i.useEffect(()=>{d.get("/i18n").then(s=>c(s.data)).catch(console.error).finally(()=>o(!1))},[]),l?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(p,{className:"size-8 animate-spin text-primary"})}):a.length===0?e.jsxs(r.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex size-full flex-col items-center justify-center gap-4 p-6",children:[e.jsx(n,{className:"size-12 text-secondary"}),e.jsx("p",{className:"text-secondary",children:"No i18n namespaces found"}),e.jsx("p",{className:"text-xs text-secondary",children:"Enable i18n in your Wecon config to manage translations."})]}):e.jsxs(r.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex size-full flex-col gap-6 overflow-y-auto p-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-primary",children:"Translations"}),e.jsxs("p",{className:"mt-1 text-sm text-secondary",children:[a.length," namespace",a.length!==1?"s":""]})]}),e.jsx("div",{className:"flex flex-col gap-3",children:a.map(s=>e.jsxs("div",{className:"rounded-primary border border-primary bg-secondary p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[e.jsx(n,{className:"size-5 text-secondary"}),e.jsx("span",{className:"font-semibold text-primary",children:s.namespace})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.languages.map(t=>e.jsxs(r.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>m(`/i18n/${s.namespace}/${t}`),className:"flex items-center gap-2 rounded-secondary border border-primary px-3 py-1.5 text-xs transition-colors hover:bg-primary",children:[e.jsx("span",{className:"font-semibold text-primary",children:t.toUpperCase()}),e.jsxs("span",{className:"text-secondary",children:[s.keyCount[t]??0," keys"]}),e.jsx(f,{className:"size-3 text-secondary"})]},t))})]},s.namespace))})]})}export{j as default};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🔧</text></svg>" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Wecon DevTools</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-BjgISQg5.js"></script>
|
|
9
|
-
<link rel="stylesheet" crossorigin href="./assets/index-BFzJyDrn.css">
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
<div id="root"></div>
|
|
14
|
-
</body>
|
|
15
|
-
</html>
|