@l10nmonster/server 3.0.0-alpha.10 → 3.0.0-alpha.12
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/index.js +24 -0
- package/package.json +1 -1
- package/routes/info.js +10 -0
- package/routes/status.js +16 -24
- package/routes/tm.js +33 -0
- package/ui/dist/assets/Cart-jHOAGjwC.js +1 -0
- package/ui/dist/assets/Job-vnJpBXcp.js +1 -0
- package/ui/dist/assets/Providers-DUp_y6mi.js +1 -0
- package/ui/dist/assets/Sources-CC5dBiir.js +1 -0
- package/ui/dist/assets/Status-SRPm28Cg.js +1 -0
- package/ui/dist/assets/StatusDetail-DqXzi16U.js +1 -0
- package/ui/dist/assets/TM-CUqywRKC.js +1 -0
- package/ui/dist/assets/TMDetail-Bl4xHL_X.js +1 -0
- package/ui/dist/assets/Welcome-D33rOKBc.js +1 -0
- package/ui/dist/assets/{api-lUcpjS_e.js → api-CQ_emPlI.js} +1 -1
- package/ui/dist/assets/badge-D0XxOmqE.js +1 -0
- package/ui/dist/assets/{grid-Ct9nMDCu.js → grid-c9ySqPWI.js} +1 -1
- package/ui/dist/assets/index-BHll-Wur.js +1 -0
- package/ui/dist/assets/index-CE6JgXwC.js +76 -0
- package/ui/dist/assets/input-C_b-hL0i.js +1 -0
- package/ui/dist/assets/link-BJrTt4Ej.js +1 -0
- package/ui/dist/assets/namespace-DqVzlNZ0.js +1 -0
- package/ui/dist/assets/select-B7OxVhQ5.js +1 -0
- package/ui/dist/assets/{tooltip-CJa6_LB4.js → tooltip-DsbPmc5I.js} +1 -1
- package/ui/dist/assets/{use-field-context-BUNHqjYw.js → use-field-context-DPgnX2eS.js} +1 -1
- package/ui/dist/assets/{use-presence-context-BX_JHICA.js → use-presence-context-w7qGDwCc.js} +1 -1
- package/ui/dist/assets/useQuery-DJATtsyt.js +1 -0
- package/ui/dist/assets/{v-stack-CIRZgxKK.js → v-stack-BLV93Nj6.js} +1 -1
- package/ui/dist/index.html +1 -1
- package/ui/dist/assets/Cart-D5N7n5W3.js +0 -1
- package/ui/dist/assets/Providers-DQro218B.js +0 -1
- package/ui/dist/assets/Sources-BWjVGVNQ.js +0 -1
- package/ui/dist/assets/Status-C0BCLcoa.js +0 -1
- package/ui/dist/assets/TM-DwJjbV3D.js +0 -1
- package/ui/dist/assets/TMDetail-Dx7FUqxf.js +0 -1
- package/ui/dist/assets/Welcome-CeVYvAKN.js +0 -1
- package/ui/dist/assets/badge-BwRiDO79.js +0 -1
- package/ui/dist/assets/index-7BvmfFYo.js +0 -76
- package/ui/dist/assets/index-DYRyEtJ_.js +0 -1
- package/ui/dist/assets/namespace-DnzAbJc8.js +0 -1
- package/ui/dist/assets/useQuery-BJCiEOEF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,m as x,j as c,l as M,n as $,o as q,p as F,E as D,b as m,d as T,g as Y}from"./index-CE6JgXwC.js";import{c as z}from"./api-CQ_emPlI.js";import{c as j,a as C,e as g,u as B,b as U,d as W,n as _}from"./index-BHll-Wur.js";import{u as P}from"./use-field-context-DPgnX2eS.js";import{u as J}from"./use-presence-context-w7qGDwCc.js";const[w,f]=j({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),I=l.forwardRef((r,o)=>{const e=f(),t=x(e.getControlProps(),r);return c.jsx(C.div,{...t,ref:o})});I.displayName="CheckboxControl";function K(r){const{value:o,onChange:e,defaultValue:t}=r,[n,a]=l.useState(t),s=o!==void 0,i=s?o:n,u=l.useCallback(h=>(s||a(h),e?.(h)),[s,e]);return[i,u]}function Q(r={}){const{defaultValue:o,value:e,onValueChange:t,disabled:n,readOnly:a,name:s,invalid:i}=r,u=!(n||a),h=J(t,{sync:!0}),[k,b]=K({value:e,defaultValue:o||[],onChange:h}),p=d=>k.some(v=>String(v)===String(d)),y=d=>{p(d)?H(d):R(d)},R=d=>{u&&(p(d)||b(k.concat(d)))},H=d=>{u&&b(k.filter(v=>String(v)!==String(d)))};return{isChecked:p,value:k,name:s,disabled:!!n,readOnly:!!a,invalid:!!i,setValue:b,addValue:R,toggleValue:y,getItemProps:d=>({checked:d.value!=null?p(d.value):void 0,onCheckedChange(){d.value!=null&&y(d.value)},name:s,disabled:n,readOnly:a,invalid:i})}}const[X,Z]=j({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),V=l.forwardRef((r,o)=>{const[e,t]=g()(r,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),n=Q(e);return c.jsx(X,{value:n,children:c.jsx(C.div,{ref:o,role:"group",...t,...M.build().group.attrs})})});V.displayName="CheckboxGroup";const N=l.forwardRef((r,o)=>{const e=f(),t=x(e.getHiddenInputProps(),r),n=P();return c.jsx(C.input,{"aria-describedby":n?.ariaDescribedby,...t,ref:o})});N.displayName="CheckboxHiddenInput";const S=l.forwardRef((r,o)=>{const e=f(),t=x(e.getLabelProps(),r);return c.jsx(C.span,{...t,ref:o})});S.displayName="CheckboxLabel";const ee=(r={})=>{const o=Z(),e=P(),t=l.useMemo(()=>x(r,o?.getItemProps({value:r.value})??{}),[r,o]),n=l.useId(),{getRootNode:a}=B(),{dir:s}=U(),i={id:n,ids:{label:e?.ids.label,hiddenInput:e?.ids.control},dir:s,disabled:e?.disabled,readOnly:e?.readOnly,invalid:e?.invalid,required:e?.required,getRootNode:a,...t},u=W(q,i);return $(u,_)},G=l.forwardRef((r,o)=>{const[e,t]=g()(r,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),n=ee(e),a=x(n.getRootProps(),t);return c.jsx(w,{value:n,children:c.jsx(C.label,{...a,ref:o})})});G.displayName="CheckboxRoot";const A=l.forwardRef((r,o)=>{const[{value:e},t]=g()(r,["value"]),n=x(e.getRootProps(),t);return c.jsx(w,{value:e,children:c.jsx(C.label,{...n,ref:o})})});A.displayName="CheckboxRootProvider";const E=l.forwardRef((r,o)=>{const e=P(),t=x(e?.getInputProps(),r);return c.jsx(C.input,{...t,ref:o})});E.displayName="FieldInput";const oe=l.forwardRef(function(o,e){const t=F({key:"checkmark",recipe:o.recipe}),[n,a]=t.splitVariantProps(o),{checked:s,indeterminate:i,disabled:u,unstyled:h,children:k,...b}=a,p=h?D:t(n);return c.jsx(m.svg,{ref:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3px",strokeLinecap:"round",strokeLinejoin:"round","data-state":i?"indeterminate":s?"checked":"unchecked","data-disabled":T(u),css:[p,o.css],...b,children:i?c.jsx("path",{d:"M5 12h14"}):s?c.jsx("polyline",{points:"20 6 9 17 4 12"}):null})}),{withProvider:L,withContext:O,useStyles:te}=z({key:"checkbox"});L(A,"root",{forwardAsChild:!0});const ue=L(G,"root",{forwardAsChild:!0});O(S,"label",{forwardAsChild:!0});const re=l.forwardRef(function(o,e){const{checked:t,indeterminate:n,...a}=o,s=f(),i=te();return t&&s.checked?c.jsx(m.svg,{ref:e,asChild:!0,...a,css:[i.indicator,o.css],children:t}):n&&s.indeterminate?c.jsx(m.svg,{ref:e,asChild:!0,...a,css:[i.indicator,o.css],children:n}):c.jsx(oe,{ref:e,checked:s.checked,indeterminate:s.indeterminate,disabled:s.disabled,unstyled:!0,...a,css:[i.indicator,o.css]})}),he=O(I,"control",{forwardAsChild:!0,defaultProps:{children:c.jsx(re,{})}});m(V,{base:{display:"flex",flexDirection:"column",gap:"1.5"}},{forwardAsChild:!0});const xe=N,{withContext:ne}=Y({key:"input"}),Ce=ne(E);export{ue as C,Ce as I,xe as a,he as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t}from"./index-CE6JgXwC.js";const{withContext:e}=t({key:"link"}),n=e("a");export{n as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,Y as A,j as e,b as x}from"./index-CE6JgXwC.js";import{c as f,I as c,W as i,d as v}from"./api-CQ_emPlI.js";const[m,C]=A({name:"AlertStatusContext",hookName:"useAlertStatusContext",providerName:"<Alert />"}),{withProvider:I,withContext:r,useStyles:P,PropsProvider:S}=f({key:"alert"}),h=I("div","root",{forwardAsChild:!0,wrapElement(o,t){return e.jsx(m,{value:{status:t.status||"info"},children:o})}}),j=S,y=r("div","title"),g=r("div","description"),w=r("div","content"),R={info:c,warning:i,success:v,error:i,neutral:c},b=n.forwardRef(function(t,a){const s=C(),l=P(),d=typeof s.status=="string"?R[s.status]:n.Fragment,{children:u=e.jsx(d,{}),...p}=t;return e.jsx(x.span,{ref:a,...p,css:[l.indicator,t.css],children:u})}),E=Object.freeze(Object.defineProperty({__proto__:null,Content:w,Description:g,Indicator:b,Root:h,RootPropsProvider:j,Title:y},Symbol.toStringTag,{value:"Module"}));export{E as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,m as l,j as n,K as F,M as q}from"./index-CE6JgXwC.js";import{c as E,C as z,a as D,b as H}from"./api-CQ_emPlI.js";import{c as P,a,f as M,e as S,b as K,u as W,d as _,n as B}from"./index-BHll-Wur.js";import{a as f,s as g,b as x,P as h}from"./use-presence-context-w7qGDwCc.js";import{u as J}from"./use-field-context-DPgnX2eS.js";const[I,m]=P({name:"SelectContext",hookName:"useSelectContext",providerName:"<SelectProvider />"}),C=c.forwardRef((o,r)=>{const e=m(),t=l(e.getClearTriggerProps(),o);return n.jsx(a.button,{...t,ref:r})});C.displayName="SelectClearTrigger";const v=c.forwardRef((o,r)=>{const e=m(),t=f(),s=l(e.getContentProps(),t.getPresenceProps(),o);return t.unmounted?null:n.jsx(a.div,{...s,ref:M(t.ref,r)})});v.displayName="SelectContent";const w=c.forwardRef((o,r)=>{const e=m(),t=l(e.getControlProps(),o);return n.jsx(a.div,{...t,ref:r})});w.displayName="SelectControl";const j=c.forwardRef((o,r)=>{const e=m(),t=l(e.getIndicatorProps(),o);return n.jsx(a.div,{...t,ref:r})});j.displayName="SelectIndicator";const[Q,ie]=P({name:"SelectItemContext",hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),[U,R]=P({name:"SelectItemPropsContext",hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),b=c.forwardRef((o,r)=>{const[e,t]=S()(o,["item","persistFocus"]),s=m(),d=l(s.getItemProps(e),t),p=s.getItemState(e);return n.jsx(U,{value:e,children:n.jsx(Q,{value:p,children:n.jsx(a.div,{...d,ref:r})})})});b.displayName="SelectItem";const[X,Y]=P({name:"SelectItemGroupPropsContext",hookName:"useSelectItemGroupPropsContext",providerName:"<SelectItemGroupPropsProvider />"}),N=c.forwardRef((o,r)=>{const e=c.useId(),[t,s]=S()(o,["id"]),d={id:e,...t},p=m(),u=l(p.getItemGroupProps(d),s);return n.jsx(X,{value:d,children:n.jsx(a.div,{...u,ref:r})})});N.displayName="SelectItemGroup";const T=c.forwardRef((o,r)=>{const e=m(),t=Y(),s=l(e.getItemGroupLabelProps({htmlFor:t.id}),o);return n.jsx(a.div,{...s,ref:r})});T.displayName="SelectItemGroupLabel";const y=c.forwardRef((o,r)=>{const e=m(),t=R(),s=l(e.getItemIndicatorProps(t),o);return n.jsx(a.div,{...s,ref:r})});y.displayName="SelectItemIndicator";const G=c.forwardRef((o,r)=>{const e=m(),t=R(),s=l(e.getItemTextProps(t),o);return n.jsx(a.span,{...s,ref:r})});G.displayName="SelectItemText";const A=c.forwardRef((o,r)=>{const e=m(),t=l(e.getLabelProps(),o);return n.jsx(a.label,{...t,ref:r})});A.displayName="SelectLabel";const O=c.forwardRef((o,r)=>{const e=m(),t=l(e.getPositionerProps(),o);return f().unmounted?null:n.jsx(a.div,{...t,ref:r})});O.displayName="SelectPositioner";const Z=o=>{const r=c.useId(),{dir:e}=K(),{getRootNode:t}=W(),s=J(),d={id:r,ids:{label:s?.ids.label,hiddenSelect:s?.ids.control},disabled:s?.disabled,readOnly:s?.readOnly,invalid:s?.invalid,required:s?.required,dir:e,getRootNode:t,...o},p=_(F,d);return q(p,B)},ee=(o,r)=>{const[e,t]=g(o),[s,d]=S()(t,["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","disabled","form","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]),p=Z(s),u=x(l({present:p.open},e)),V=l(p.getRootProps(),d);return n.jsx(I,{value:p,children:n.jsx(h,{value:u,children:n.jsx(a.div,{...V,ref:r})})})},te=c.forwardRef(ee),oe=(o,r)=>{const[e,t]=g(o),[{value:s},d]=S()(t,["value"]),p=x(l({present:s.open},e)),u=l(s.getRootProps(),d);return n.jsx(I,{value:s,children:n.jsx(h,{value:p,children:n.jsx(a.div,{...u,ref:r})})})},re=c.forwardRef(oe),$=c.forwardRef((o,r)=>{const e=m(),t=l(e.getTriggerProps(),o);return n.jsx(a.button,{...t,ref:r})});$.displayName="SelectTrigger";const L=c.forwardRef((o,r)=>{const{children:e,placeholder:t,...s}=o,d=m(),p=l(d.getValueTextProps(),s);return n.jsx(a.span,{...p,ref:r,children:e||d.valueAsString||t})});L.displayName="SelectValueText";const{withProvider:k,withContext:i}=E({key:"select"});k(re,"root",{forwardAsChild:!0});const de=k(te,"root",{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),pe=i($,"trigger",{forwardAsChild:!0}),me=i(O,"positioner",{forwardAsChild:!0}),ue=i(v,"content",{forwardAsChild:!0});i(L,"valueText",{forwardAsChild:!0});i(C,"clearTrigger",{forwardAsChild:!0,defaultProps:{children:n.jsx(H,{boxSize:"1em"})}});i(N,"itemGroup",{forwardAsChild:!0});i(T,"itemGroupLabel",{forwardAsChild:!0});const Pe=i(b,"item",{forwardAsChild:!0}),Se=i(G,"itemText",{forwardAsChild:!0}),fe=i(y,"itemIndicator",{forwardAsChild:!0,defaultProps:{children:n.jsx(D,{})}});i("div","indicatorGroup");const ge=i(j,"indicator",{forwardAsChild:!0,defaultProps:{children:n.jsx(z,{})}});i(w,"control",{forwardAsChild:!0});i(A,"label",{forwardAsChild:!0});export{de as S,pe as a,ge as b,me as c,ue as d,Pe as e,Se as f,fe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,m as i,j as s,q as A,s as R}from"./index-
|
|
1
|
+
import{r as p,m as i,j as s,q as A,s as R}from"./index-CE6JgXwC.js";import{c as j}from"./api-CQ_emPlI.js";import{a as u,s as P,b as T,P as m}from"./use-presence-context-w7qGDwCc.js";import{c as N,a as c,f as y,u as $,b,d as E,n as k}from"./index-BHll-Wur.js";const[f,a]=N({name:"TooltipContext",hookName:"useTooltipContext",providerName:"<TooltipProvider />"}),x=p.forwardRef((e,r)=>{const t=a(),o=i(t.getArrowProps(),e);return s.jsx(c.div,{...o,ref:r})});x.displayName="TooltipArrow";const g=p.forwardRef((e,r)=>{const t=a(),o=i(t.getArrowTipProps(),e);return s.jsx(c.div,{...o,ref:r})});g.displayName="TooltipArrowTip";const w=p.forwardRef((e,r)=>{const t=a(),o=u(),n=i(t.getContentProps(),o.getPresenceProps(),e);return o.unmounted?null:s.jsx(c.div,{...n,ref:y(o.ref,r)})});w.displayName="TooltipContent";const C=p.forwardRef((e,r)=>{const t=a(),o=i(t.getPositionerProps(),e);return u().unmounted?null:s.jsx(c.div,{...o,ref:r})});C.displayName="TooltipPositioner";const z=e=>{const r=p.useId(),{getRootNode:t}=$(),{dir:o}=b(),n={id:r,dir:o,getRootNode:t,...e},d=E(R,n);return A(d,k)},M=e=>{const[r,{children:t,...o}]=P(e),n=z(o),d=T(i({present:n.open},r));return s.jsx(f,{value:n,children:s.jsx(m,{value:d,children:t})})},q=e=>{const[r,{value:t,children:o}]=P(e),n=T(i({present:t.open},r));return s.jsx(f,{value:t,children:s.jsx(m,{value:n,children:o})})},v=p.forwardRef((e,r)=>{const t=a(),o=i(t.getTriggerProps(),e);return s.jsx(c.button,{...o,ref:r})});v.displayName="TooltipTrigger";const{withRootProvider:h,withContext:l}=j({key:"tooltip"});h(q);const D=h(M,{defaultProps:{lazyMount:!0,unmountOnExit:!0}}),F=l(v,"trigger",{forwardAsChild:!0}),G=l(C,"positioner",{forwardAsChild:!0}),H=l(w,"content",{forwardAsChild:!0}),I=l(g,"arrowTip",{forwardAsChild:!0}),J=l(x,"arrow",{forwardAsChild:!0,defaultProps:{children:s.jsx(I,{})}});export{D as T,F as a,G as b,H as c,J as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-BHll-Wur.js";const[o,r]=e({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1});export{r as u};
|
package/ui/dist/assets/{use-presence-context-BX_JHICA.js → use-presence-context-w7qGDwCc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as E,d as f,c as v}from"./index-
|
|
1
|
+
import{e as E,d as f,c as v}from"./index-BHll-Wur.js";import{N as P,O as g,P as y,Q as p,w as U,U as A,V as O,r as l}from"./index-CE6JgXwC.js";const h=e=>E()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function M(e,t){const{state:a,send:n,context:s}=e,i=a.matches("mounted","unmountSuspended");return{skip:!s.get("initial"),present:i,setNode(o){o&&n({type:"NODE.SET",node:o})},unmount(){n({type:"UNMOUNT"})}}}var C=P({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:a}){e([()=>t("present")],()=>{a({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",U(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:a,prop:n})=>{const s=n("present");if(s)return a({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!s&&i?.ownerDocument.visibilityState==="hidden")return a({type:"UNMOUNT",src:"visibilitychange"});p(()=>{const o=m(t.get("styles"));e.set("unmountAnimationName",o),o==="none"||o===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?a({type:"UNMOUNT",src:"presence.changed"}):a({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{p(()=>{e.set("prevAnimationName",m(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:a})=>{const n=t.get("node");if(!n)return;const s=u=>{(u.composedPath?.()?.[0]??u.target)===n&&e.set("prevAnimationName",m(t.get("styles")))},i=u=>{const c=m(t.get("styles"));A(u)===n&&c===e.get("unmountAnimationName")&&a({type:"UNMOUNT",src:"animationend"})};n.addEventListener("animationstart",s),n.addEventListener("animationcancel",i),n.addEventListener("animationend",i);const o=g(n,{animationFillMode:"forwards"});return()=>{n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",i),n.removeEventListener("animationend",i),y(()=>o())}}}}});function m(e){return e?.animationName||"none"}O()(["onExitComplete","present","immediate"]);function S(e,t={}){const{sync:a=!1}=t,n=x(e);return l.useCallback((...s)=>a?queueMicrotask(()=>n.current?.(...s)):n.current?.(...s),[a,n])}function x(e){const t=l.useRef(e);return t.current=e,t}const D=(e={})=>{const{lazyMount:t,unmountOnExit:a,present:n,skipAnimationOnMount:s=!1,...i}=e,o=l.useRef(!1),u={...i,present:n,onExitComplete:S(e.onExitComplete)},c=f(C,u),r=M(c);r.present&&(o.current=!0);const d=!r.present&&!o.current&&t||a&&!r.present&&o.current,N=()=>({"data-state":r.skip&&s?void 0:n?"open":"closed",hidden:!r.present});return{ref:r.setNode,getPresenceProps:N,present:r.present,unmounted:d}},[L,R]=v({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"});export{L as P,R as a,D as b,h as s,S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,Q as u}from"./api-CQ_emPlI.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a9 as W,r as e,j as d,b as j,aa as V}from"./index-CE6JgXwC.js";function w(t){const{gap:r,direction:n}=t,a={column:{marginY:r,marginX:0,borderInlineStartWidth:0,borderTopWidth:"1px"},"column-reverse":{marginY:r,marginX:0,borderInlineStartWidth:0,borderTopWidth:"1px"},row:{marginX:r,marginY:0,borderInlineStartWidth:"1px",borderTopWidth:0},"row-reverse":{marginX:r,marginY:0,borderInlineStartWidth:"1px",borderTopWidth:0}};return{"&":W(n,i=>a[i])}}function E(t){return e.Children.toArray(t).filter(r=>e.isValidElement(r))}const I=e.forwardRef(function(r,n){const{direction:a="column",align:i,justify:f,gap:s="0.5rem",wrap:g,children:c,separator:o,className:h,...x}=r,p=e.useMemo(()=>w({gap:s,direction:a}),[s,a]),S=e.useMemo(()=>e.isValidElement(o)?E(c).map((l,m,y)=>{const b=typeof l.key<"u"?l.key:m,u=o,k=e.cloneElement(u,{css:[p,u.props.css]});return d.jsxs(e.Fragment,{children:[l,m===y.length-1?null:k]},b)}):c,[c,o,p]);return d.jsx(j.div,{ref:n,display:"flex",alignItems:i,justifyContent:f,flexDirection:a,flexWrap:g,gap:o?void 0:s,className:V("chakra-stack",h),...x,children:S})}),T=e.forwardRef(function(r,n){return d.jsx(I,{align:"center",...r,direction:"column",ref:n})});export{I as S,T as V};
|
package/ui/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
/>
|
|
12
12
|
<link rel="manifest" href="/manifest.json" />
|
|
13
13
|
<title>L10n Monster</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-CE6JgXwC.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-CIfVvUo9.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,m as p,j as e,v as Ze,w as Ke,x as et,y as tt,z as rt,A as ot,C as st,b as nt,k as it,D as at,G as lt,H as se,I as ct,J as ae,K as dt,L as ut,M as pt,B as u,F as D,T as d,S as ht,e as T}from"./index-7BvmfFYo.js";import{u as gt}from"./useQuery-BJCiEOEF.js";import{c as le,a as mt,b as xt,d as ft,f as bt}from"./api-lUcpjS_e.js";import{V as I}from"./v-stack-CIRZgxKK.js";import{B as ne}from"./badge-BwRiDO79.js";import{e as N,c as O,a as g,f as M,u as ce,b as de,d as ue,n as pe}from"./index-DYRyEtJ_.js";import{u as he}from"./use-field-context-BUNHqjYw.js";import{b as L,a as E,s as J,P as $}from"./use-presence-context-BX_JHICA.js";const[ge,jt]=O({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),me=t=>N()(t,["lazyMount","unmountOnExit"]),[xe,w]=O({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),fe=a.forwardRef((t,r)=>{const s=w(),o=jt(),n=L({...o,present:s.open}),l=p(s.getBackdropProps(),n.getPresenceProps(),t);return n.unmounted?null:e.jsx(g.div,{...l,ref:M(n.ref,r)})});fe.displayName="DialogBackdrop";const be=a.forwardRef((t,r)=>{const s=w(),o=p(s.getCloseTriggerProps(),t);return e.jsx(g.button,{...o,ref:r})});be.displayName="DialogCloseTrigger";const je=a.forwardRef((t,r)=>{const s=w(),o=E(),n=p(s.getContentProps(),o.getPresenceProps(),t);return o.unmounted?null:e.jsx(g.div,{...n,ref:M(o.ref,r)})});je.displayName="DialogContent";const Se=a.forwardRef((t,r)=>{const s=w(),o=p(s.getDescriptionProps(),t);return e.jsx(g.div,{...o,ref:r})});Se.displayName="DialogDescription";const Pe=a.forwardRef((t,r)=>{const s=w(),o=p(s.getPositionerProps(),t);return E().unmounted?null:e.jsx(g.div,{...o,ref:r})});Pe.displayName="DialogPositioner";const St=t=>{const r=a.useId(),{getRootNode:s}=ce(),{dir:o}=de(),n={id:r,getRootNode:s,dir:o,...t},l=ue(Ze,n);return Ke(l,pe)},Pt=t=>{const[r,{children:s,...o}]=J(t),[n]=me(r),l=St(o),c=L(p({present:l.open},r));return e.jsx(xe,{value:l,children:e.jsx(ge,{value:n,children:e.jsx($,{value:c,children:s})})})},vt=t=>{const[r,{value:s,children:o}]=J(t),[n]=me(r),l=L(p({present:s.open},r));return e.jsx(xe,{value:s,children:e.jsx(ge,{value:n,children:e.jsx($,{value:l,children:o})})})},ve=a.forwardRef((t,r)=>{const s=w(),o=p(s.getTitleProps(),t);return e.jsx(g.h2,{...o,ref:r})});ve.displayName="DialogTitle";const Ce=a.forwardRef((t,r)=>{const s=w(),o=E(),n=p({...s.getTriggerProps(),"aria-controls":o.unmounted?void 0:s.getTriggerProps()["aria-controls"]},t);return e.jsx(g.button,{...n,ref:r})});Ce.displayName="DialogTrigger";var Ct=t=>{if(!t)return;const r=et(t),s=tt(t),o=rt(t),n=()=>{requestAnimationFrame(()=>{t.style.height="auto";let x;r.boxSizing==="content-box"?x=t.scrollHeight-(parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)):x=t.scrollHeight+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),r.maxHeight!=="none"&&x>parseFloat(r.maxHeight)?(r.overflowY==="hidden"&&(t.style.overflowY="scroll"),x=parseFloat(r.maxHeight)):r.overflowY!=="hidden"&&(t.style.overflowY="hidden"),t.style.height=`${x}px`})};t.addEventListener("input",n),t.form?.addEventListener("reset",n);const l=Object.getPrototypeOf(t),c=Object.getOwnPropertyDescriptor(l,"value");Object.defineProperty(t,"value",{...c,set(){c?.set?.apply(this,arguments),n()}});const b=new s.ResizeObserver(()=>{requestAnimationFrame(()=>n())});b.observe(t);const v=new s.MutationObserver(()=>n());return v.observe(t,{attributes:!0,attributeFilter:["rows","placeholder"]}),o.fonts?.addEventListener("loadingdone",n),()=>{t.removeEventListener("input",n),t.form?.removeEventListener("reset",n),o.fonts?.removeEventListener("loadingdone",n),b.disconnect(),v.disconnect()}};const ye=a.forwardRef((t,r)=>{const{autoresize:s,...o}=t,n=a.useRef(null),l=he(),c=p(l?.getTextareaProps(),{style:{resize:s?"none":void 0}},o);return a.useEffect(()=>{if(s)return Ct(n.current)},[s]),e.jsx(g.textarea,{...c,ref:M(r,n)})});ye.displayName="FieldTextarea";const[we,P]=O({name:"SelectContext",hookName:"useSelectContext",providerName:"<SelectProvider />"}),Ae=a.forwardRef((t,r)=>{const s=P(),o=p(s.getClearTriggerProps(),t);return e.jsx(g.button,{...o,ref:r})});Ae.displayName="SelectClearTrigger";const Te=a.forwardRef((t,r)=>{const s=P(),o=E(),n=p(s.getContentProps(),o.getPresenceProps(),t);return o.unmounted?null:e.jsx(g.div,{...n,ref:M(o.ref,r)})});Te.displayName="SelectContent";const Re=a.forwardRef((t,r)=>{const s=P(),o=p(s.getControlProps(),t);return e.jsx(g.div,{...o,ref:r})});Re.displayName="SelectControl";const Ie=a.forwardRef((t,r)=>{const s=P(),o=p(s.getIndicatorProps(),t);return e.jsx(g.div,{...o,ref:r})});Ie.displayName="SelectIndicator";const[yt,Kt]=O({name:"SelectItemContext",hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),[wt,Oe]=O({name:"SelectItemPropsContext",hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),ze=a.forwardRef((t,r)=>{const[s,o]=N()(t,["item","persistFocus"]),n=P(),l=p(n.getItemProps(s),o),c=n.getItemState(s);return e.jsx(wt,{value:s,children:e.jsx(yt,{value:c,children:e.jsx(g.div,{...l,ref:r})})})});ze.displayName="SelectItem";const[At,Tt]=O({name:"SelectItemGroupPropsContext",hookName:"useSelectItemGroupPropsContext",providerName:"<SelectItemGroupPropsProvider />"}),De=a.forwardRef((t,r)=>{const s=a.useId(),[o,n]=N()(t,["id"]),l={id:s,...o},c=P(),b=p(c.getItemGroupProps(l),n);return e.jsx(At,{value:l,children:e.jsx(g.div,{...b,ref:r})})});De.displayName="SelectItemGroup";const Ne=a.forwardRef((t,r)=>{const s=P(),o=Tt(),n=p(s.getItemGroupLabelProps({htmlFor:o.id}),t);return e.jsx(g.div,{...n,ref:r})});Ne.displayName="SelectItemGroupLabel";const Le=a.forwardRef((t,r)=>{const s=P(),o=Oe(),n=p(s.getItemIndicatorProps(o),t);return e.jsx(g.div,{...n,ref:r})});Le.displayName="SelectItemIndicator";const Ee=a.forwardRef((t,r)=>{const s=P(),o=Oe(),n=p(s.getItemTextProps(o),t);return e.jsx(g.span,{...n,ref:r})});Ee.displayName="SelectItemText";const We=a.forwardRef((t,r)=>{const s=P(),o=p(s.getLabelProps(),t);return e.jsx(g.label,{...o,ref:r})});We.displayName="SelectLabel";const ke=a.forwardRef((t,r)=>{const s=P(),o=p(s.getPositionerProps(),t);return E().unmounted?null:e.jsx(g.div,{...o,ref:r})});ke.displayName="SelectPositioner";const Rt=t=>{const r=a.useId(),{dir:s}=de(),{getRootNode:o}=ce(),n=he(),l={id:r,ids:{label:n?.ids.label,hiddenSelect:n?.ids.control},disabled:n?.disabled,readOnly:n?.readOnly,invalid:n?.invalid,required:n?.required,dir:s,getRootNode:o,...t},c=ue(ot,l);return st(c,pe)},It=(t,r)=>{const[s,o]=J(t),[n,l]=N()(o,["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","disabled","form","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]),c=Rt(n),b=L(p({present:c.open},s)),v=p(c.getRootProps(),l);return e.jsx(we,{value:c,children:e.jsx($,{value:b,children:e.jsx(g.div,{...v,ref:r})})})},Ot=a.forwardRef(It),zt=(t,r)=>{const[s,o]=J(t),[{value:n},l]=N()(o,["value"]),c=L(p({present:n.open},s)),b=p(n.getRootProps(),l);return e.jsx(we,{value:n,children:e.jsx($,{value:c,children:e.jsx(g.div,{...b,ref:r})})})},Dt=a.forwardRef(zt),Fe=a.forwardRef((t,r)=>{const s=P(),o=p(s.getTriggerProps(),t);return e.jsx(g.button,{...o,ref:r})});Fe.displayName="SelectTrigger";const Me=a.forwardRef((t,r)=>{const{children:s,placeholder:o,...n}=t,l=P(),c=p(l.getValueTextProps(),n);return e.jsx(g.span,{...c,ref:r,children:s||l.valueAsString||o})});Me.displayName="SelectValueText";const{withRootProvider:Je,withContext:y}=le({key:"dialog"});Je(vt,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});const H=Je(Pt,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});y(Ce,"trigger",{forwardAsChild:!0});const V=y(Pe,"positioner",{forwardAsChild:!0}),q=y(je,"content",{forwardAsChild:!0});y(Se,"description",{forwardAsChild:!0});const Y=y(ve,"title",{forwardAsChild:!0}),Q=y(be,"closeTrigger",{forwardAsChild:!0});a.forwardRef(function(r,s){const o=w();return e.jsx(nt.button,{...r,ref:s,onClick:()=>o.setOpen(!1)})});const _=y(fe,"backdrop",{forwardAsChild:!0}),X=y("div","body");y("div","footer");const Z=y("div","header"),{withProvider:$e,withContext:S}=le({key:"select"});$e(Dt,"root",{forwardAsChild:!0});const Nt=$e(Ot,"root",{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),Lt=S(Fe,"trigger",{forwardAsChild:!0}),Et=S(ke,"positioner",{forwardAsChild:!0}),Wt=S(Te,"content",{forwardAsChild:!0});S(Me,"valueText",{forwardAsChild:!0});S(Ae,"clearTrigger",{forwardAsChild:!0,defaultProps:{children:e.jsx(ft,{boxSize:"1em"})}});S(De,"itemGroup",{forwardAsChild:!0});S(Ne,"itemGroupLabel",{forwardAsChild:!0});const kt=S(ze,"item",{forwardAsChild:!0}),Ft=S(Ee,"itemText",{forwardAsChild:!0}),Mt=S(Le,"itemIndicator",{forwardAsChild:!0,defaultProps:{children:e.jsx(xt,{})}});S("div","indicatorGroup");const Jt=S(Ie,"indicator",{forwardAsChild:!0,defaultProps:{children:e.jsx(mt,{})}});S(Re,"control",{forwardAsChild:!0});S(We,"label",{forwardAsChild:!0});const{withContext:$t}=it({key:"textarea"}),Bt=$t(ye);var Gt=class extends at{#r;#o=void 0;#e;#t;constructor(t,r){super(),this.#r=t,this.setOptions(r),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#r.defaultMutationOptions(t),lt(this.options,r)||this.#r.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),r?.mutationKey&&this.options.mutationKey&&se(r.mutationKey)!==se(this.options.mutationKey)?this.reset():this.#e?.state.status==="pending"&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#n(t)}getCurrentResult(){return this.#o}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#s(),this.#n()}mutate(t,r){return this.#t=r,this.#e?.removeObserver(this),this.#e=this.#r.getMutationCache().build(this.#r,this.options),this.#e.addObserver(this),this.#e.execute(t)}#s(){const t=this.#e?.state??ct();this.#o={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#n(t){ae.batch(()=>{if(this.#t&&this.hasListeners()){const r=this.#o.variables,s=this.#o.context;t?.type==="success"?(this.#t.onSuccess?.(t.data,r,s),this.#t.onSettled?.(t.data,null,r,s)):t?.type==="error"&&(this.#t.onError?.(t.error,r,s),this.#t.onSettled?.(void 0,t.error,r,s))}this.listeners.forEach(r=>{r(this.#o)})})}};function ie(t,r){const s=dt(),[o]=a.useState(()=>new Gt(s,t));a.useEffect(()=>{o.setOptions(t)},[o,t]);const n=a.useSyncExternalStore(a.useCallback(c=>o.subscribe(ae.batchCalls(c)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=a.useCallback((c,b)=>{o.mutate(c,b).catch(ut)},[o]);if(n.error&&pt(o.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:l,mutateAsync:n.mutate}}const Ut=({langPairKey:t,tus:r,onRemoveTU:s})=>{const[o,n]=a.useState(""),[l,c]=a.useState(!1),[b,v]=a.useState(!1),[x,R]=a.useState(null),[h,j]=a.useState(""),[C,B]=a.useState(""),[A,K]=a.useState(null),[Be,ee]=a.useState(!1),{data:Ge={},isLoading:Ue}=gt({queryKey:["info"],queryFn:()=>bt("/api/info")}),He=Ge.providers||[],te=ie({mutationFn:async({sourceLang:i,targetLang:m,tus:f,providerList:z})=>{const U=await fetch("/api/dispatcher/createJobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceLang:i,targetLang:m,tus:f,providerList:z})});if(!U.ok){const Xe=await U.json();throw new Error(Xe.message||"Failed to create jobs")}return U.json()}}),G=ie({mutationFn:async({jobs:i,instructions:m})=>{const f=await fetch("/api/dispatcher/startJobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobs:i,instructions:m})});if(!f.ok){const z=await f.json();throw new Error(z.message||"Failed to start jobs")}return f.json()}});function re(i){return i.map(m=>typeof m=="string"?m:`{{${m.t}}}`).join("")}function Ve(i){return new Date(i).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const qe=async()=>{if(!o){alert("Please select a provider first");return}const i=Array.isArray(r)?r:r.tus;try{const f=(await te.mutateAsync({sourceLang:k,targetLang:F,tus:i,providerList:[o]})).find(z=>z.translationProvider===o);f?(R(f),j(""),c(!0)):(B(`Provider "${o}" did not accept any of the selected translation units.`),v(!0))}catch(m){B(`Failed to create job: ${m.message}`),v(!0)}},Ye=i=>{n(i)},Qe=async()=>{if(x)try{const i=await G.mutateAsync({jobs:[x],instructions:h||void 0}),m=i.find(f=>f.jobGuid===x.jobGuid)||i[0];K(m),c(!1),ee(!0)}catch(i){B(`Failed to start job: ${i.message}`),v(!0)}},oe=()=>{if(ee(!1),K(null),R(null),j(""),x&&x.tus){const i=new Set(x.tus.map(f=>f.guid)),m=Array.isArray(r)?r:r.tus;for(let f=m.length-1;f>=0;f--)i.has(m[f].guid)&&s(t,f)}},_e=i=>i===0?"Free":i==null?"Unknown":`$${i.toFixed(2)}`,W=Array.isArray(r)?r:r.tus,k=Array.isArray(r)?t.split("|")[0]||t.split("→")[0]:r.sourceLang,F=Array.isArray(r)?t.split("|")[1]||t.split("→").slice(1).join("→"):r.targetLang;return e.jsxs(u,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:[e.jsxs(I,{gap:4,align:"stretch",children:[e.jsx(u,{children:e.jsxs(D,{align:"center",justify:"space-between",mb:2,children:[e.jsxs(D,{align:"center",gap:3,children:[e.jsx(ne,{colorPalette:"blue",size:"sm",children:k}),e.jsx(d,{color:"fg.muted",fontSize:"lg",children:"→"}),e.jsx(ne,{colorPalette:"green",size:"sm",children:F}),e.jsxs(D,{align:"center",gap:3,ml:4,children:[e.jsxs(Nt,{size:"sm",width:"250px",value:o?[o]:[],onValueChange:i=>{},positioning:{strategy:"absolute",placement:"bottom-start",flip:!0,gutter:4},children:[e.jsxs(Lt,{children:[e.jsx(d,{fontSize:"sm",flex:"1",textAlign:"left",children:o||"Select Provider"}),e.jsx(Jt,{})]}),e.jsx(Et,{children:e.jsx(Wt,{zIndex:1e3,bg:"white",borderWidth:"1px",borderColor:"border.default",borderRadius:"md",shadow:"lg",minW:"250px",maxH:"200px",overflow:"auto",children:Ue?e.jsxs(u,{p:3,textAlign:"center",children:[e.jsx(ht,{size:"sm"}),e.jsx(d,{fontSize:"sm",color:"fg.muted",mt:2,children:"Loading providers..."})]}):He.map(i=>e.jsxs(kt,{item:i,value:i,onClick:()=>Ye(i),children:[e.jsx(Ft,{children:i}),e.jsx(Mt,{})]},i))})})]}),e.jsx(T,{size:"sm",colorPalette:"blue",onClick:qe,disabled:!o,loading:te.isPending,children:"Create Job"})]})]}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:[W.length," ",W.length===1?"TU":"TUs"]})]})}),e.jsx(u,{bg:"white",borderRadius:"md",overflow:"auto",children:e.jsxs(u,{as:"table",w:"100%",fontSize:"sm",children:[e.jsx(u,{as:"thead",bg:"blue.subtle",borderBottom:"2px",borderColor:"blue.muted",shadow:"sm",children:e.jsxs(u,{as:"tr",children:[e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"120px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"GUID"})}),e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"350px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"SOURCE"})}),e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"350px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"TARGET"})}),e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"center",minW:"40px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"QUALITY"})}),e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"120px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"PROVIDER"})}),e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"120px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"TIMESTAMP"})}),e.jsx(u,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"center",minW:"100px",children:e.jsx(d,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"ACTION"})})]})}),e.jsx(u,{as:"tbody",children:W.map((i,m)=>e.jsxs(u,{as:"tr",_hover:{bg:"gray.subtle"},children:[e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(d,{fontSize:"xs",fontFamily:"mono",color:"blue.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:i.guid})}),e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(d,{fontSize:"xs",noOfLines:2,dir:k?.startsWith("he")||k?.startsWith("ar")?"rtl":"ltr",children:Array.isArray(i.nsrc)?re(i.nsrc):i.nsrc})}),e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(d,{fontSize:"xs",noOfLines:2,dir:F?.startsWith("he")||F?.startsWith("ar")?"rtl":"ltr",children:Array.isArray(i.ntgt)?re(i.ntgt):i.ntgt})}),e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsx(d,{fontSize:"xs",children:i.q})}),e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(d,{fontSize:"xs",children:i.translationProvider||i.provider})}),e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(d,{fontSize:"xs",color:"fg.muted",children:Ve(i.ts)})}),e.jsx(u,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsx(T,{size:"xs",colorPalette:"red",variant:"outline",onClick:()=>s(t,m),children:"Remove"})})]},`${i.guid}-${m}`))})]})})]}),e.jsxs(H,{open:l,onOpenChange:i=>c(i.open),children:[e.jsx(_,{}),e.jsx(V,{children:e.jsxs(q,{maxW:"500px",children:[e.jsxs(Z,{children:[e.jsx(Y,{children:"Job Created Successfully"}),e.jsx(Q,{})]}),e.jsx(X,{children:x&&e.jsxs(I,{gap:4,align:"stretch",children:[e.jsxs(u,{children:[e.jsxs(d,{fontSize:"lg",fontWeight:"bold",color:"green.600",children:[x.tus?.length||0," TUs accepted out of ",W.length," sent"]}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:["Provider: ",o]}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:["Estimated Cost: ",_e(x.estimatedCost)]})]}),e.jsxs(u,{children:[e.jsx(d,{fontSize:"sm",fontWeight:"bold",mb:2,children:"Job Instructions (optional):"}),e.jsx(Bt,{placeholder:"Enter any specific instructions for this translation job...",value:h,onChange:i=>j(i.target.value),rows:3})]}),e.jsxs(D,{gap:3,children:[e.jsx(T,{colorPalette:"gray",variant:"outline",onClick:()=>{c(!1),R(null),j("")},flex:"1",disabled:G.isPending,children:"Cancel"}),e.jsx(T,{colorPalette:"green",onClick:Qe,loading:G.isPending,flex:"1",children:"Push Job"})]})]})})]})})]}),e.jsxs(H,{open:b,onOpenChange:i=>v(i.open),children:[e.jsx(_,{}),e.jsx(V,{children:e.jsxs(q,{maxW:"400px",children:[e.jsxs(Z,{children:[e.jsx(Y,{children:"Job Creation Failed"}),e.jsx(Q,{})]}),e.jsx(X,{children:e.jsxs(I,{gap:4,align:"stretch",children:[e.jsx(d,{color:"red.600",children:C}),e.jsx(T,{colorPalette:"red",onClick:()=>v(!1),w:"100%",children:"Close"})]})})]})})]}),e.jsxs(H,{open:Be,onOpenChange:i=>{i.open||oe()},children:[e.jsx(_,{}),e.jsx(V,{children:e.jsxs(q,{maxW:"400px",children:[e.jsxs(Z,{children:[e.jsx(Y,{children:"Job Status"}),e.jsx(Q,{})]}),e.jsx(X,{children:A&&e.jsxs(I,{gap:4,align:"stretch",children:[e.jsxs(u,{children:[e.jsx(d,{fontSize:"lg",fontWeight:"bold",color:"blue.600",children:"Job Started Successfully"}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:["Job ID: ",A.jobGuid]}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:["Provider: ",A.translationProvider]}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:["Language Pair: ",A.sourceLang," → ",A.targetLang]}),e.jsxs(d,{fontSize:"sm",color:"fg.muted",children:["Status: ",e.jsx(d,{as:"span",fontWeight:"bold",color:A.status==="completed"?"green.600":"orange.600",children:A.status})]})]}),e.jsx(u,{children:e.jsx(T,{colorPalette:"blue",onClick:oe,w:"100%",children:"Close & Remove TUs from Cart"})})]})})]})})]})]})},er=()=>{const[t,r]=a.useState({}),[s,o]=a.useState(!0),n=()=>{try{const h=sessionStorage.getItem("tmCart");return h?JSON.parse(h):{}}catch(h){return console.error("Error loading cart:",h),{}}},l=h=>{sessionStorage.setItem("tmCart",JSON.stringify(h)),window.dispatchEvent(new Event("cartUpdated"))},c=()=>{o(!0);const h=n();r(h),o(!1)},b=(h,j)=>{const C=n();C[h]&&(Array.isArray(C[h])?(C[h].splice(j,1),C[h].length===0&&delete C[h]):(C[h].tus.splice(j,1),C[h].tus.length===0&&delete C[h]),l(C),c())},v=()=>{l({}),c()},x=()=>Object.values(t).reduce((h,j)=>Array.isArray(j)?h+j.length:h+(j.tus?j.tus.length:0),0);if(a.useEffect(()=>{c()},[]),s)return e.jsx(u,{py:6,px:6,children:e.jsx(d,{children:"Loading cart..."})});const R=x();return e.jsx(u,{py:6,px:6,children:e.jsxs(I,{gap:6,align:"stretch",children:[e.jsxs(D,{align:"center",justify:"space-between",children:[e.jsx(d,{fontSize:"2xl",fontWeight:"bold",children:"Translation Memory Cart"}),R>0&&e.jsx(T,{colorPalette:"red",variant:"outline",onClick:v,children:"Empty Cart"})]}),R===0?e.jsxs(u,{p:8,textAlign:"center",borderWidth:"1px",borderRadius:"lg",bg:"bg.muted",children:[e.jsx(d,{fontSize:"lg",color:"fg.default",mb:2,children:"Your cart is empty"}),e.jsx(d,{color:"fg.muted",children:"Add translation units from the TM pages to get started"})]}):e.jsx(I,{gap:6,align:"stretch",children:Object.entries(t).map(([h,j])=>e.jsx(Ut,{langPairKey:h,tus:j,onRemoveTU:b},h))})]})})};export{er as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,B as s,T as r,r as S,R as z,S as y,F as W}from"./index-7BvmfFYo.js";import{A as v}from"./namespace-DnzAbJc8.js";import{u as w}from"./useQuery-BJCiEOEF.js";import{f as C}from"./api-lUcpjS_e.js";import{V as p}from"./v-stack-CIRZgxKK.js";import{G as P}from"./grid-Ct9nMDCu.js";import{B as R}from"./badge-BwRiDO79.js";const A=({providers:n,selectedProvider:l,onProviderSelect:i})=>{const d=Object.keys(n||{});return e.jsxs(s,{w:"300px",borderRight:"1px",borderColor:"border.default",p:4,bg:"bg.muted",minH:"70vh",children:[e.jsx(r,{fontSize:"lg",fontWeight:"bold",mb:4,children:"Providers"}),e.jsxs(p,{gap:2,align:"stretch",children:[d.map(o=>e.jsxs(s,{p:3,borderRadius:"md",cursor:"pointer",bg:l===o?"blue.subtle":"white",borderWidth:"1px",borderColor:l===o?"blue.600":"border.default",_hover:{bg:l===o?"blue.subtle":"gray.subtle"},onClick:()=>i(o),children:[e.jsx(r,{fontSize:"sm",fontWeight:"medium",noOfLines:2,children:o}),n[o]?.info?.type&&e.jsx(r,{fontSize:"xs",color:"fg.muted",mt:1,children:n[o].info.type})]},o)),d.length===0&&e.jsx(r,{color:"fg.muted",fontSize:"sm",textAlign:"center",mt:4,children:"No providers found"})]})]})},O=({provider:n,providerId:l})=>{if(!n)return e.jsx(s,{p:6,textAlign:"center",children:e.jsx(r,{color:"fg.muted",children:"Select a provider to view details"})});const{info:i,properties:d}=n,o=t=>{if(!t)return t;const h={31:"#ef4444",32:"#22c55e",33:"#eab308",34:"#3b82f6",35:"#a855f7",36:"#06b6d4",39:"inherit"},a=[];let c=0,m="inherit";const b=/\u001B\[([0-9;]*)m/g;let x;for(;(x=b.exec(t))!==null;){if(x.index>c){const j=t.slice(c,x.index);a.push(e.jsx("span",{style:{color:m},children:j},`${c}-text`))}const f=x[1];h[f]&&(m=h[f]),c=x.index+x[0].length}if(c<t.length){const f=t.slice(c);a.push(e.jsx("span",{style:{color:m},children:f},`${c}-text`))}return a.length>0?a:t},g=t=>Array.isArray(t)?t.map((h,a)=>e.jsxs(s,{display:"flex",alignItems:"flex-start",gap:2,children:[e.jsx(r,{fontSize:"sm",color:"fg.muted",mt:"1px",children:"•"}),e.jsx(r,{fontSize:"sm",flex:"1",children:o(h)})]},a)):e.jsx(r,{fontSize:"sm",children:o(t)}),u=t=>typeof t=="object"&&t!==null?e.jsx(s,{as:"pre",fontSize:"xs",bg:"bg.muted",p:2,borderRadius:"md",overflow:"auto",maxH:"200px",children:JSON.stringify(t,null,2)}):e.jsx(r,{fontSize:"sm",children:String(t)});return e.jsx(s,{flex:"1",p:6,overflow:"auto",children:e.jsxs(p,{gap:6,align:"stretch",children:[e.jsx(s,{children:e.jsx(r,{fontSize:"2xl",fontWeight:"bold",mb:2,children:l})}),e.jsxs(s,{p:4,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:[e.jsx(r,{fontSize:"lg",fontWeight:"semibold",mb:4,children:"Information"}),e.jsxs(P,{templateColumns:"auto 1fr",gap:3,alignItems:"start",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Type:"}),e.jsx(R,{colorPalette:"blue",size:"sm",children:i.type}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Cost per Word:"}),e.jsx(r,{fontSize:"sm",children:i.costPerWord}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Cost per MChar:"}),e.jsx(r,{fontSize:"sm",children:i.costPerMChar}),i.description&&e.jsxs(e.Fragment,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Description:"}),e.jsx(s,{children:g(i.description)})]})]})]}),e.jsxs(s,{p:4,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:[e.jsx(r,{fontSize:"lg",fontWeight:"semibold",mb:4,children:"Properties"}),Object.keys(d).length===0?e.jsx(r,{color:"fg.muted",fontSize:"sm",children:"No properties available"}):e.jsx(p,{gap:4,align:"stretch",children:Object.entries(d).map(([t,h])=>e.jsxs(s,{children:[e.jsxs(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",mb:2,children:[t,":"]}),e.jsx(s,{pl:4,children:u(h)})]},t))})]})]})})},L=()=>{const[n,l]=S.useState(null),{data:i={},isLoading:d,error:o}=w({queryKey:["providers"],queryFn:()=>C("/api/providers")});return z.useEffect(()=>{i&&Object.keys(i).length>0&&!n&&l(Object.keys(i)[0])},[i,n]),d?e.jsx(s,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(y,{size:"xl"})}):o?e.jsx(s,{mt:5,px:6,children:e.jsx(v,{status:"error",children:e.jsxs(s,{children:[e.jsx(r,{fontWeight:"bold",children:"Error"}),e.jsx(r,{children:o?.message||"Failed to fetch provider data"})]})})}):e.jsxs(s,{py:6,px:6,children:[e.jsxs(s,{textAlign:"center",mb:6,children:[e.jsx(r,{fontSize:"2xl",fontWeight:"bold",mb:2,children:"Translation Providers"}),e.jsx(r,{color:"fg.muted",children:"Configuration and details for all available translation providers"})]}),e.jsx(s,{borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",overflow:"hidden",minH:"70vh",children:e.jsxs(W,{children:[e.jsx(A,{providers:i,selectedProvider:n,onProviderSelect:l}),e.jsx(O,{provider:i[n],providerId:n})]})})]})};export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,B as r,T as t,F as u,S as g}from"./index-7BvmfFYo.js";import{A as j}from"./namespace-DnzAbJc8.js";import{G as m}from"./grid-Ct9nMDCu.js";import{V as f}from"./v-stack-CIRZgxKK.js";import{u as p}from"./useQuery-BJCiEOEF.js";import{f as b}from"./api-lUcpjS_e.js";import{B as h}from"./badge-BwRiDO79.js";import{T as S,a as w,b as z,c as y,d as A}from"./tooltip-CJa6_LB4.js";import"./use-presence-context-BX_JHICA.js";import"./index-DYRyEtJ_.js";const C=({item:o})=>{const x=s=>{const l=new Date,d=new Date(s),c=l-d,n=Math.floor(c/1e3),i=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"short"});return n<60?i.format(-n,"second"):n<3600?i.format(-Math.floor(n/60),"minute"):n<86400?i.format(-Math.floor(n/3600),"hour"):n<2592e3?i.format(-Math.floor(n/86400),"day"):n<31536e3?i.format(-Math.floor(n/2592e3),"month"):i.format(-Math.floor(n/31536e3),"year")},a=s=>new Date(s).toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"});return e.jsx(r,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.default",bg:"yellow.subtle",w:"100%",children:e.jsxs(m,{templateColumns:"2fr 80px 3fr 80px 80px 100px",gap:4,alignItems:"center",children:[e.jsxs(r,{children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Project"}),e.jsx(t,{fontSize:"sm",fontWeight:"semibold",children:o.prj||"Default"})]}),e.jsxs(r,{children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Source"}),e.jsx(h,{colorPalette:"blue",size:"sm",children:o.sourceLang})]}),e.jsxs(r,{children:[e.jsxs(t,{fontSize:"xs",color:"fg.muted",mb:1,children:["Targets (",o.targetLangs.length,")"]}),e.jsx(u,{wrap:"wrap",gap:1,children:o.targetLangs.map(s=>e.jsx(h,{colorPalette:"green",size:"sm",children:s},s))})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Resources"}),e.jsx(t,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:o.resCount.toLocaleString()})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Segments"}),e.jsx(t,{fontSize:"sm",fontWeight:"bold",color:"purple.600",children:o.segmentCount.toLocaleString()})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Modified"}),e.jsxs(S,{children:[e.jsx(w,{asChild:!0,children:e.jsx(t,{fontSize:"xs",color:"fg.muted",cursor:"help",children:x(o.lastModified)})}),e.jsx(z,{children:e.jsxs(y,{children:[e.jsx(A,{}),e.jsx(t,{fontSize:"sm",children:a(o.lastModified)})]})})]})]})]})})},P=()=>{const{data:o={},isLoading:x,error:a}=p({queryKey:["activeContentStats"],queryFn:()=>b("/api/activeContentStats")});return x?e.jsx(r,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(g,{size:"xl"})}):a?e.jsx(r,{mt:5,px:6,children:e.jsx(j,{status:"error",children:e.jsxs(r,{children:[e.jsx(t,{fontWeight:"bold",children:"Error"}),e.jsx(t,{children:a})]})})}):e.jsx(r,{py:6,px:6,children:e.jsxs(f,{gap:6,align:"stretch",children:[e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"2xl",fontWeight:"bold",mb:2,children:"Active Content Sources"}),e.jsx(t,{color:"fg.muted",children:"Overview of content sources across all channels"})]}),Object.keys(o).length===0?e.jsx(r,{p:6,borderWidth:"1px",borderRadius:"md",bg:"white",textAlign:"center",children:e.jsx(t,{color:"fg.muted",children:"No active content found."})}):e.jsx(f,{gap:6,align:"center",children:Object.entries(o).map(([s,l])=>e.jsx(r,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",minW:"800px",maxW:"1200px",w:"100%",children:e.jsxs(f,{gap:4,align:"stretch",children:[e.jsx(r,{children:e.jsx(t,{fontSize:"xl",fontWeight:"bold",color:"blue.600",mb:2,children:s})}),l.length===0?e.jsx(r,{p:6,borderWidth:"1px",borderRadius:"md",bg:"bg.muted",textAlign:"center",w:"100%",children:e.jsx(t,{color:"fg.muted",fontSize:"sm",children:"No content found for this channel"})}):e.jsx(m,{templateColumns:"repeat(auto-fit, minmax(800px, 1200px))",gap:4,justifyItems:"center",children:l.sort((d,c)=>new Date(c.lastModified)-new Date(d.lastModified)).map((d,c)=>e.jsx(C,{item:d},c))})]})},s))})]})})};export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as h,m as g,j as e,c as M,a as Q,b as k,d as $,T as c,B as a,F as z,S as D}from"./index-7BvmfFYo.js";import{A as G}from"./namespace-DnzAbJc8.js";import{G as K}from"./grid-Ct9nMDCu.js";import{c as T,f as U}from"./api-lUcpjS_e.js";import{c as J,a as w,u as V,b as X,d as Y,n as Z,e as q}from"./index-DYRyEtJ_.js";import{u as L}from"./use-field-context-BUNHqjYw.js";import{u as _}from"./useQuery-BJCiEOEF.js";const[W,j]=J({name:"SwitchContext",hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),N=h.forwardRef((i,o)=>{const r=j(),t=g(r.getControlProps(),i);return e.jsx(w.span,{...t,ref:o})});N.displayName="SwitchControl";const O=h.forwardRef((i,o)=>{const r=j(),t=g(r.getHiddenInputProps(),i),s=L();return e.jsx(w.input,{"aria-describedby":s?.ariaDescribedby,...t,ref:o})});O.displayName="SwitchHiddenInput";const I=h.forwardRef((i,o)=>{const r=j(),t=g(r.getLabelProps(),i);return e.jsx(w.span,{...t,ref:o})});I.displayName="SwitchLabel";const ee=i=>{const o=h.useId(),{getRootNode:r}=V(),{dir:t}=X(),s=L(),d={id:o,ids:{label:s?.ids.label,hiddenInput:s?.ids.control},dir:t,disabled:s?.disabled,readOnly:s?.readOnly,invalid:s?.invalid,required:s?.required,getRootNode:r,...i},n=Y(Q,d);return M(n,Z)},A=h.forwardRef((i,o)=>{const[r,t]=q()(i,["checked","defaultChecked","disabled","form","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]),s=ee(r),d=g(s.getRootProps(),t);return e.jsx(W,{value:s,children:e.jsx(w.label,{...d,ref:o})})});A.displayName="SwitchRoot";const H=h.forwardRef((i,o)=>{const[{value:r},t]=q()(i,["value"]),s=g(r.getRootProps(),t);return e.jsx(W,{value:r,children:e.jsx(w.label,{...s,ref:o})})});H.displayName="SwitchRootProvider";const E=h.forwardRef((i,o)=>{const r=j(),t=g(r.getThumbProps(),i);return e.jsx(w.span,{...t,ref:o})});E.displayName="SwitchThumb";const{withProvider:te,withContext:y}=T({key:"card"}),re=te("div","root"),se=y("div","body");y("div","header");y("div","footer");y("h3","title");y("p","description");const{withProvider:F,withContext:v,useStyles:oe}=T({key:"switch"});F(H,"root",{forwardAsChild:!0});const ne=F(A,"root",{forwardAsChild:!0}),ie=v(I,"label",{forwardAsChild:!0}),B=v(E,"thumb",{forwardAsChild:!0}),ce=v(N,"control",{forwardAsChild:!0,defaultProps:{children:e.jsx(B,{})}});h.forwardRef(function(o,r){const t=j(),s=oe(),{fallback:d,children:n,unstyled:m,...l}=o;return e.jsx(k.span,{ref:r,"data-checked":$(t.checked),...l,css:[m?void 0:s.indicator,o.css],children:t.checked?n:d})});h.forwardRef(function(o,r){const t=j(),{fallback:s,children:d,...n}=o;return e.jsx(k.span,{ref:r,"data-checked":$(t.checked),...n,children:t.checked?d:s})});const ae=O,de=({project:i})=>{const{sourceLang:o,targetLang:r,resCount:t,segmentCount:s,translationStatus:d}=i,n={untranslated:0,"in flight":0,translated:0,"low quality":0,words:0,chars:0};for(const{minQ:l,q:x,seg:u,words:b,chars:f}of d){const p=x===null?"untranslated":x===0?"in flight":x>=l?"translated":"low quality";n[p]+=u,n.words+=b,n.chars+=f}const m=Math.round(n.translated/s*100);return e.jsx(re,{variant:"outline",bg:"yellow.subtle",children:e.jsxs(se,{children:[e.jsxs(c,{fontSize:"lg",fontWeight:"semibold",mb:2,children:[o," → ",r]}),e.jsx(a,{mb:3,children:e.jsxs(z,{align:"center",gap:2,mb:1,children:[e.jsx(a,{flex:"1",bg:"gray.muted",rounded:"full",height:"6px",position:"relative",children:e.jsx(a,{bg:"blue.600",height:"100%",rounded:"full",width:`${m}%`,transition:"width 0.3s ease"})}),e.jsxs(c,{fontSize:"sm",color:"fg.muted",minW:"45px",children:[m,"%"]})]})}),e.jsxs(c,{fontSize:"sm",children:["Resources: ",t.toLocaleString()]}),e.jsxs(c,{fontSize:"sm",children:["Segments: ",s.toLocaleString()]}),e.jsxs(c,{fontSize:"sm",children:["Words: ",n.words.toLocaleString()]}),n.untranslated>0&&e.jsxs(c,{fontSize:"sm",color:"orange.600",children:["Untranslated segments: ",n.untranslated.toLocaleString()]})]})})},ge=()=>{const[i,o]=h.useState(!1),{data:r={},isLoading:t,error:s}=_({queryKey:["status"],queryFn:()=>U("/api/status")});if(t)return e.jsx(a,{display:"flex",justifyContent:"center",mt:5,children:e.jsx(D,{size:"xl"})});if(s)return e.jsx(a,{mt:5,px:6,children:e.jsx(G,{status:"error",children:e.jsxs(a,{children:[e.jsx(c,{fontWeight:"bold",children:"Error"}),e.jsx(c,{children:s})]})})});const d=(n,m)=>{const l={translated:0};for(const{minQ:x,q:u,seg:b}of n)(u===null?"untranslated":u===0?"in flight":u>=x?"translated":"low quality")==="translated"&&(l.translated+=b);return Math.round(l.translated/m*100)};return e.jsxs(a,{py:6,px:6,children:[e.jsx(z,{align:"center",gap:3,mb:6,children:e.jsxs(ne,{checked:i,onCheckedChange:n=>o(n.checked),children:[e.jsx(ae,{}),e.jsx(ce,{children:e.jsx(B,{})}),e.jsx(ie,{children:e.jsx(c,{fontSize:"md",fontWeight:"medium",children:"Hide complete"})})]})}),Object.entries(r).map(([n,m])=>Object.entries(m).map(([l,x])=>Object.entries(x).map(([u,b])=>e.jsxs(a,{mb:6,p:3,borderWidth:"1px",borderRadius:"md",bg:"white",borderColor:"border.default",children:[e.jsxs(a,{display:"flex",alignItems:"center",gap:3,flexWrap:"wrap",children:[e.jsxs(a,{children:[e.jsx(c,{fontSize:"sm",color:"fg.muted",mb:1,children:"Channel"}),e.jsx(c,{fontSize:"xl",fontWeight:"semibold",color:"blue.600",children:n})]}),e.jsx(a,{height:"40px",width:"1px",bg:"border.default"}),e.jsxs(a,{children:[e.jsx(c,{fontSize:"sm",color:"fg.muted",mb:1,children:"Project"}),e.jsx(c,{fontSize:"xl",fontWeight:"semibold",color:"green.600",children:l})]})]}),e.jsx(K,{templateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:4,mt:4,children:Object.entries(b).filter(([f,p])=>{if(!i)return!0;const P=p.reduce((S,C)=>S+C.seg,0);return d(p,P)<100}).map(([f,p])=>{const P=p.reduce((S,C)=>S+C.res,0),R=p.reduce((S,C)=>S+C.seg,0);return e.jsx(de,{project:{sourceLang:u,targetLang:f,resCount:P,segmentCount:R,translationStatus:p}},`${u}-${f}-${l}-${n}`)})})]},`${u}-${n}-${l}`)))),Object.keys(r).length===0&&!t&&e.jsx(c,{mt:4,color:"fg.muted",children:"No active content found."})]})};export{ge as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as m,j as e,B as r,F as x,T as t,e as u,S as f}from"./index-7BvmfFYo.js";import{A as g}from"./namespace-DnzAbJc8.js";import{G as j}from"./grid-Ct9nMDCu.js";import{V as h}from"./v-stack-CIRZgxKK.js";import{u as p}from"./useQuery-BJCiEOEF.js";import{f as b}from"./api-lUcpjS_e.js";import{B as a}from"./badge-BwRiDO79.js";const S=({sourceLang:n,targetLang:i,providers:o})=>{const l=m(),c=s=>{switch(s){case"done":return"green";case"pending":return"yellow";case"error":return"red";default:return"gray"}};return e.jsx(r,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",w:"900px",children:e.jsxs(h,{gap:4,align:"stretch",children:[e.jsx(r,{children:e.jsxs(x,{align:"center",justify:"space-between",mb:2,children:[e.jsxs(x,{align:"center",gap:3,children:[e.jsx(a,{colorPalette:"blue",size:"sm",children:n}),e.jsx(t,{color:"fg.muted",fontSize:"lg",children:"→"}),e.jsx(a,{colorPalette:"green",size:"sm",children:i})]}),e.jsx(u,{size:"sm",variant:"outline",onClick:()=>l(`/tm/${n}/${i}`),children:"View"})]})}),e.jsx(h,{gap:3,align:"stretch",children:o.map((s,d)=>e.jsx(r,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.default",bg:"yellow.subtle",children:e.jsxs(j,{templateColumns:"2fr 80px 80px 80px 80px",gap:4,alignItems:"center",children:[e.jsxs(r,{children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Provider"}),e.jsx(t,{fontSize:"sm",fontWeight:"semibold",children:s.translationProvider})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Status"}),e.jsx(a,{colorPalette:c(s.status),size:"sm",children:s.status})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"TUs"}),e.jsx(t,{fontSize:"sm",fontWeight:"bold",color:"purple.600",children:s.tuCount.toLocaleString()})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Unique"}),e.jsx(t,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:s.distinctGuids.toLocaleString()})]}),e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"xs",color:"fg.muted",mb:1,children:"Jobs"}),e.jsx(t,{fontSize:"sm",fontWeight:"bold",color:"teal.600",children:s.jobCount.toLocaleString()})]})]})},d))})]})})},B=()=>{m();const{data:n={},isLoading:i,error:o}=p({queryKey:["tmStats"],queryFn:()=>b("/api/tm/stats")});return i?e.jsx(r,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(f,{size:"xl"})}):o?e.jsx(r,{mt:5,px:6,children:e.jsx(g,{status:"error",children:e.jsxs(r,{children:[e.jsx(t,{fontWeight:"bold",children:"Error"}),e.jsx(t,{children:o})]})})}):e.jsx(r,{py:6,px:6,children:e.jsxs(h,{gap:6,align:"stretch",children:[e.jsxs(r,{textAlign:"center",children:[e.jsx(t,{fontSize:"2xl",fontWeight:"bold",mb:2,children:"Translation Memory Summary"}),e.jsx(t,{color:"fg.muted",children:"Overview of jobs by translation provider for each language pair"})]}),Object.keys(n).length===0?e.jsx(r,{p:6,borderWidth:"1px",borderRadius:"md",bg:"white",textAlign:"center",children:e.jsx(t,{color:"fg.muted",children:"No translation memory data found."})}):e.jsx(x,{justify:"center",w:"100%",children:e.jsx(j,{templateColumns:"repeat(auto-fit, 900px)",gap:6,justifyItems:"center",justifyContent:"center",children:Object.entries(n).flatMap(([l,c])=>Object.entries(c).map(([s,d])=>e.jsx(S,{sourceLang:l,targetLang:s,providers:d},`${l}-${s}`)))})})]})})};export{B as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,m as I,j as e,f as je,g as Ce,h as ve,i as ke,E as Pe,b as A,d as Se,k as we,l as q,n as ye,o as Re,p as ze,u as Be,B as i,S as E,T as a,F as N,e as We}from"./index-7BvmfFYo.js";import{A as Ie}from"./namespace-DnzAbJc8.js";import{c as Fe,Q as Ne,u as Ae,f as Oe}from"./api-lUcpjS_e.js";import{c as Z,a as F,e as V,u as Te,b as Ge,d as Ee,n as De}from"./index-DYRyEtJ_.js";import{u as M}from"./use-field-context-BUNHqjYw.js";import{u as Ve}from"./use-presence-context-BX_JHICA.js";import{V as k}from"./v-stack-CIRZgxKK.js";import{T as U,a as $,b as Q,c as H,d as J}from"./tooltip-CJa6_LB4.js";const[ee,O]=Z({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),te=d.forwardRef((r,o)=>{const s=O(),n=I(s.getControlProps(),r);return e.jsx(F.div,{...n,ref:o})});te.displayName="CheckboxControl";function Me(r){const{value:o,onChange:s,defaultValue:n}=r,[c,x]=d.useState(n),l=o!==void 0,p=l?o:c,b=d.useCallback(m=>(l||x(m),s?.(m)),[l,s]);return[p,b]}function Le(r={}){const{defaultValue:o,value:s,onValueChange:n,disabled:c,readOnly:x,name:l,invalid:p}=r,b=!(c||x),m=Ve(n,{sync:!0}),[j,h]=Me({value:s,defaultValue:o||[],onChange:m}),C=f=>j.some(B=>String(B)===String(f)),z=f=>{C(f)?T(f):R(f)},R=f=>{b&&(C(f)||h(j.concat(f)))},T=f=>{b&&h(j.filter(B=>String(B)!==String(f)))};return{isChecked:C,value:j,name:l,disabled:!!c,readOnly:!!x,invalid:!!p,setValue:h,addValue:R,toggleValue:z,getItemProps:f=>({checked:f.value!=null?C(f.value):void 0,onCheckedChange(){f.value!=null&&z(f.value)},name:l,disabled:c,readOnly:x,invalid:p})}}const[qe,Ue]=Z({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),re=d.forwardRef((r,o)=>{const[s,n]=V()(r,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),c=Le(s);return e.jsx(qe,{value:c,children:e.jsx(F.div,{ref:o,role:"group",...n,...je.build().group.attrs})})});re.displayName="CheckboxGroup";const oe=d.forwardRef((r,o)=>{const s=O(),n=I(s.getHiddenInputProps(),r),c=M();return e.jsx(F.input,{"aria-describedby":c?.ariaDescribedby,...n,ref:o})});oe.displayName="CheckboxHiddenInput";const se=d.forwardRef((r,o)=>{const s=O(),n=I(s.getLabelProps(),r);return e.jsx(F.span,{...n,ref:o})});se.displayName="CheckboxLabel";const $e=(r={})=>{const o=Ue(),s=M(),n=d.useMemo(()=>I(r,o?.getItemProps({value:r.value})??{}),[r,o]),c=d.useId(),{getRootNode:x}=Te(),{dir:l}=Ge(),p={id:c,ids:{label:s?.ids.label,hiddenInput:s?.ids.control},dir:l,disabled:s?.disabled,readOnly:s?.readOnly,invalid:s?.invalid,required:s?.required,getRootNode:x,...n},b=Ee(ve,p);return Ce(b,De)},ne=d.forwardRef((r,o)=>{const[s,n]=V()(r,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),c=$e(s),x=I(c.getRootProps(),n);return e.jsx(ee,{value:c,children:e.jsx(F.label,{...x,ref:o})})});ne.displayName="CheckboxRoot";const ie=d.forwardRef((r,o)=>{const[{value:s},n]=V()(r,["value"]),c=I(s.getRootProps(),n);return e.jsx(ee,{value:s,children:e.jsx(F.label,{...c,ref:o})})});ie.displayName="CheckboxRootProvider";const le=d.forwardRef((r,o)=>{const s=M(),n=I(s?.getInputProps(),r);return e.jsx(F.input,{...n,ref:o})});le.displayName="FieldInput";const Qe=d.forwardRef(function(o,s){const n=ke({key:"checkmark",recipe:o.recipe}),[c,x]=n.splitVariantProps(o),{checked:l,indeterminate:p,disabled:b,unstyled:m,children:j,...h}=x,C=m?Pe:n(c);return e.jsx(A.svg,{ref:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3px",strokeLinecap:"round",strokeLinejoin:"round","data-state":p?"indeterminate":l?"checked":"unchecked","data-disabled":Se(b),css:[C,o.css],...h,children:p?e.jsx("path",{d:"M5 12h14"}):l?e.jsx("polyline",{points:"20 6 9 17 4 12"}):null})}),{withProvider:ae,withContext:ce,useStyles:He}=Fe({key:"checkbox"});ae(ie,"root",{forwardAsChild:!0});const _=ae(ne,"root",{forwardAsChild:!0});ce(se,"label",{forwardAsChild:!0});const Je=d.forwardRef(function(o,s){const{checked:n,indeterminate:c,...x}=o,l=O(),p=He();return n&&l.checked?e.jsx(A.svg,{ref:s,asChild:!0,...x,css:[p.indicator,o.css],children:n}):c&&l.indeterminate?e.jsx(A.svg,{ref:s,asChild:!0,...x,css:[p.indicator,o.css],children:c}):e.jsx(Qe,{ref:s,checked:l.checked,indeterminate:l.indeterminate,disabled:l.disabled,unstyled:!0,...x,css:[p.indicator,o.css]})}),K=ce(te,"control",{forwardAsChild:!0,defaultProps:{children:e.jsx(Je,{})}});A(re,{base:{display:"flex",flexDirection:"column",gap:"1.5"}},{forwardAsChild:!0});const Y=oe,{withContext:_e}=we({key:"input"}),y=_e(le);var Ke=class extends Ne{constructor(r,o){super(r,o)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(r){super.setOptions({...r,behavior:q()})}getOptimisticResult(r){return r.behavior=q(),super.getOptimisticResult(r)}fetchNextPage(r){return this.fetch({...r,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(r){return this.fetch({...r,meta:{fetchMore:{direction:"backward"}}})}createResult(r,o){const{state:s}=r,n=super.createResult(r,o),{isFetching:c,isRefetching:x,isError:l,isRefetchError:p}=n,b=s.fetchMeta?.fetchMore?.direction,m=l&&b==="forward",j=c&&b==="forward",h=l&&b==="backward",C=c&&b==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Re(o,s.data),hasPreviousPage:ye(o,s.data),isFetchNextPageError:m,isFetchingNextPage:j,isFetchPreviousPageError:h,isFetchingPreviousPage:C,isRefetchError:p&&!m&&!h,isRefetching:x&&!j&&!C}}};function Ye(r,o){return Ae(r,Ke)}function D(r){return r.map(o=>typeof o=="string"?o:`{{${o.t}}}`).join("")}function X(r){return new Date(r).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const it=()=>{const{sourceLang:r,targetLang:o}=ze();Be();const[s,n]=d.useState(new Set),[c,x]=d.useState({guid:"",rid:"",sid:"",nsrc:"",ntgt:"",q:"",translationProvider:"",ts:"",jobGuid:""}),[l,p]=d.useState({guid:"",rid:"",sid:"",nsrc:"",ntgt:"",q:"",translationProvider:"",ts:"",jobGuid:""}),b=d.useRef(),m=d.useRef(),j=d.useRef(null),h=d.useRef({}),C=d.useMemo(()=>["tmSearch",r,o,c],[r,o,c]),{data:z,isLoading:R,isError:T,error:L,fetchNextPage:f,hasNextPage:B,isFetchingNextPage:G}=Ye({queryKey:C,queryFn:async({pageParam:t=1})=>{const u=new URLSearchParams({sourceLang:r,targetLang:o,page:t.toString(),limit:"100",...Object.fromEntries(Object.entries(c).filter(([W,me])=>me.trim()!==""))});return await Oe(`/api/tm/search?${u}`)},getNextPageParam:(t,u)=>t.data.length===parseInt(t.limit)?u.length+1:void 0,staleTime:3e4,refetchOnWindowFocus:!1,placeholderData:t=>t}),v=d.useMemo(()=>z?.pages.flatMap(t=>t.data)||[],[z]),de=d.useCallback(t=>{R||G||(b.current&&b.current.disconnect(),b.current=new IntersectionObserver(u=>{u[0].isIntersecting&&B&&f()}),t&&b.current.observe(t))},[R,G,B,f]),P=d.useCallback(t=>{j.current=t},[]),S=d.useCallback(()=>{j.current=null},[]),w=d.useCallback((t,u)=>{p(g=>({...g,[t]:u})),n(new Set),clearTimeout(m.current),m.current=setTimeout(()=>{x(g=>({...g,[t]:u}))},300)},[]),ue=(t,u)=>{const g=new Set(s);u?g.add(t):g.delete(t),n(g)},he=t=>{if(t){const u=new Set(v.map((g,W)=>W));n(u)}else n(new Set)},xe=()=>{const t=sessionStorage.getItem("tmCart");return t?JSON.parse(t):{}},be=t=>{sessionStorage.setItem("tmCart",JSON.stringify(t))},fe=()=>{const t=xe(),u=`${r}|${o}`;t[u]||(t[u]={sourceLang:r,targetLang:o,tus:[]});const g=Array.from(s).map(W=>v[W]);t[u].tus.push(...g),be(t),n(new Set),window.dispatchEvent(new Event("cartUpdated"))},pe=v.length>0&&s.size===v.length,ge=s.size>0&&s.size<v.length;return d.useEffect(()=>{if(j.current&&h.current[j.current]){const t=h.current[j.current];setTimeout(()=>{if(t&&document.contains(t)){t.focus();const u=t.value.length;t.setSelectionRange(u,u)}},10)}},[v]),d.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),R&&v.length===0&&!z?e.jsx(i,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(E,{size:"xl"})}):T?e.jsx(i,{mt:5,px:6,children:e.jsx(Ie,{status:"error",children:e.jsxs(i,{children:[e.jsx(a,{fontWeight:"bold",children:"Error"}),e.jsx(a,{children:L?.message||"Failed to fetch translation memory data"})]})})}):e.jsx(i,{py:6,px:6,children:e.jsxs(k,{gap:6,align:"stretch",children:[e.jsxs(i,{children:[e.jsxs(N,{align:"center",justify:"space-between",mb:2,children:[e.jsxs(N,{align:"center",gap:3,children:[e.jsxs(a,{fontSize:"2xl",fontWeight:"bold",children:["Translation Memory: ",r," → ",o]}),R&&e.jsx(E,{size:"sm"})]}),s.size>0&&e.jsxs(We,{colorPalette:"blue",onClick:fe,children:["Add to Cart (",s.size," ",s.size===1?"TU":"TUs",")"]})]}),e.jsx(a,{color:"fg.muted",children:"Detailed view of translation units"})]}),e.jsxs(i,{bg:"white",borderRadius:"lg",shadow:"sm",overflow:"auto",maxH:"70vh",children:[e.jsxs(i,{as:"table",w:"100%",fontSize:"sm",children:[e.jsx(i,{as:"thead",position:"sticky",top:0,bg:"blue.subtle",zIndex:1,borderBottom:"2px",borderColor:"blue.muted",shadow:"sm",children:e.jsxs(i,{as:"tr",children:[e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"60px",textAlign:"center",children:e.jsxs(_,{checked:pe,onCheckedChange:t=>he(t.checked),children:[e.jsx(Y,{ref:t=>{t&&(t.indeterminate=ge)}}),e.jsx(K,{})]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"GUID"}),e.jsx(y,{size:"xs",placeholder:"Filter GUID...",value:l.guid,onChange:t=>w("guid",t.target.value),onFocus:()=>P("guid"),onBlur:S,ref:t=>{t&&(h.current.guid=t)},bg:"yellow.subtle"},"guid-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"JOB GUID"}),e.jsx(y,{size:"xs",placeholder:"Filter Job GUID...",value:l.jobGuid,onChange:t=>w("jobGuid",t.target.value),onFocus:()=>P("jobGuid"),onBlur:S,ref:t=>{t&&(h.current.jobGuid=t)},bg:"yellow.subtle"},"jobGuid-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"150px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"RID"}),e.jsx(y,{size:"xs",placeholder:"Filter RID...",value:l.rid,onChange:t=>w("rid",t.target.value),onFocus:()=>P("rid"),onBlur:S,ref:t=>{t&&(h.current.rid=t)},bg:"yellow.subtle"},"rid-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"150px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"SID"}),e.jsx(y,{size:"xs",placeholder:"Filter SID...",value:l.sid,onChange:t=>w("sid",t.target.value),onFocus:()=>P("sid"),onBlur:S,ref:t=>{t&&(h.current.sid=t)},bg:"yellow.subtle"},"sid-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"350px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"NSRC"}),e.jsx(y,{size:"xs",placeholder:"Filter source...",value:l.nsrc,onChange:t=>w("nsrc",t.target.value),onFocus:()=>P("nsrc"),onBlur:S,ref:t=>{t&&(h.current.nsrc=t)},bg:"yellow.subtle",dir:r?.startsWith("he")||r?.startsWith("ar")?"rtl":"ltr"},"nsrc-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"350px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"NTGT"}),e.jsx(y,{size:"xs",placeholder:"Filter target...",value:l.ntgt,onChange:t=>w("ntgt",t.target.value),onFocus:()=>P("ntgt"),onBlur:S,ref:t=>{t&&(h.current.ntgt=t)},bg:"yellow.subtle",dir:o?.startsWith("he")||o?.startsWith("ar")?"rtl":"ltr"},"ntgt-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"40px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Q"}),e.jsx(y,{size:"xs",placeholder:"Quality...",value:l.q,onChange:t=>w("q",t.target.value),onFocus:()=>P("q"),onBlur:S,ref:t=>{t&&(h.current.q=t)},bg:"yellow.subtle"},"q-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Provider"}),e.jsx(y,{size:"xs",placeholder:"Provider...",value:l.translationProvider,onChange:t=>w("translationProvider",t.target.value),onFocus:()=>P("translationProvider"),onBlur:S,ref:t=>{t&&(h.current.translationProvider=t)},bg:"yellow.subtle"},"translationProvider-input")]})}),e.jsx(i,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(k,{gap:2,align:"stretch",children:[e.jsx(a,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Timestamp"}),e.jsx(y,{size:"xs",placeholder:"Date...",value:l.ts,onChange:t=>w("ts",t.target.value),onFocus:()=>P("ts"),onBlur:S,ref:t=>{t&&(h.current.ts=t)},bg:"yellow.subtle"},"ts-input")]})})]})}),e.jsx(i,{as:"tbody",children:v.map((t,u)=>e.jsxs(i,{as:"tr",ref:u===v.length-20?de:null,_hover:{bg:"gray.subtle"},children:[e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsxs(_,{checked:s.has(u),onCheckedChange:g=>ue(u,g.checked),children:[e.jsx(Y,{}),e.jsx(K,{})]})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",fontFamily:"mono",color:"blue.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:t.guid})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",fontFamily:"mono",color:"green.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:t.jobGuid})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",wordBreak:"break-all",whiteSpace:"normal",children:t.rid})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",wordBreak:"break-all",whiteSpace:"normal",children:t.sid})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:t.notes?e.jsxs(U,{children:[e.jsx($,{asChild:!0,children:e.jsx(a,{fontSize:"xs",noOfLines:2,cursor:"help",dir:r?.startsWith("he")||r?.startsWith("ar")?"rtl":"ltr",children:D(t.nsrc)})}),e.jsx(Q,{children:e.jsxs(H,{maxW:"400px",bg:"yellow.100",borderWidth:"1px",borderColor:"yellow.300",shadow:"lg",children:[e.jsx(J,{}),e.jsxs(i,{children:[t.notes.desc&&e.jsx(a,{fontSize:"sm",mb:2,whiteSpace:"pre-wrap",color:"black",children:t.notes.desc}),t.notes.ph&&e.jsxs(i,{children:[e.jsx(a,{fontSize:"xs",fontWeight:"bold",color:"gray.600",mb:1,children:"Placeholders:"}),Object.entries(t.notes.ph).map(([g,W])=>e.jsxs(i,{mb:1,children:[e.jsx(a,{fontSize:"xs",fontFamily:"mono",color:"blue.600",children:g}),e.jsxs(a,{fontSize:"xs",color:"gray.600",children:[W.desc," (e.g., ",W.sample,")"]})]},g))]})]})]})})]}):e.jsx(a,{fontSize:"xs",noOfLines:2,dir:r?.startsWith("he")||r?.startsWith("ar")?"rtl":"ltr",children:D(t.nsrc)})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",noOfLines:2,dir:o?.startsWith("he")||o?.startsWith("ar")?"rtl":"ltr",children:D(t.ntgt)})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",children:t.q})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(a,{fontSize:"xs",children:t.translationProvider})}),e.jsx(i,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsxs(U,{children:[e.jsx($,{asChild:!0,children:e.jsx(a,{fontSize:"xs",color:"fg.muted",cursor:"help",children:X(t.ts)})}),e.jsx(Q,{children:e.jsxs(H,{children:[e.jsx(J,{}),e.jsxs(a,{fontSize:"sm",children:["Job Date: ",X(t.updatedAt)]})]})})]})})]},`${t.guid}-${u}`))})]}),G&&e.jsx(N,{justify:"center",p:4,children:e.jsx(E,{size:"md"})}),!B&&v.length>0&&e.jsx(N,{justify:"center",p:4,children:e.jsx(a,{color:"fg.muted",fontSize:"sm",children:"No more results"})}),v.length===0&&!R&&e.jsx(N,{justify:"center",p:8,children:e.jsx(a,{color:"fg.muted",children:"No translation units found for the current filters"})})]})]})})};export{it as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,B as r,S as d,T as i,F as s}from"./index-7BvmfFYo.js";import{A as a}from"./namespace-DnzAbJc8.js";import{V as n}from"./v-stack-CIRZgxKK.js";import{u as c}from"./useQuery-BJCiEOEF.js";import{f as x}from"./api-lUcpjS_e.js";const j=()=>{const{data:t,isLoading:l,error:o}=c({queryKey:["info"],queryFn:()=>x("/api/info")});return l?e.jsx(r,{display:"flex",justifyContent:"center",mt:20,children:e.jsx(d,{size:"xl"})}):o?e.jsx(r,{mt:10,px:6,children:e.jsx(a,{status:"error",children:e.jsxs(r,{children:[e.jsx(i,{fontWeight:"bold",children:"Error"}),e.jsx(i,{children:o})]})})}):e.jsx(r,{py:20,px:6,children:e.jsx(n,{gap:8,align:"center",children:t&&e.jsx(r,{p:8,borderWidth:"1px",borderRadius:"xl",bg:"white",shadow:"lg",width:"500px",height:"300px",position:"relative",background:"linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%)",borderColor:"border.default",children:e.jsxs(s,{height:"100%",direction:"column",justify:"space-between",children:[e.jsxs(s,{align:"center",gap:4,children:[e.jsx("img",{src:"/logo.svg",alt:"L10n Monster",width:"60",height:"60"}),e.jsx(r,{children:e.jsx(i,{fontSize:"xl",fontWeight:"bold",color:"fg.default",lineHeight:"1.2",children:t.description})})]}),e.jsxs(n,{gap:3,align:"stretch",mt:4,children:[e.jsxs(r,{children:[e.jsx(i,{fontSize:"xs",color:"fg.muted",textTransform:"uppercase",letterSpacing:"wide",mb:1,children:"Version"}),e.jsx(i,{fontSize:"lg",fontWeight:"semibold",color:"blue.600",children:t.version})]}),e.jsxs(r,{children:[e.jsx(i,{fontSize:"xs",color:"fg.muted",textTransform:"uppercase",letterSpacing:"wide",mb:1,children:"Project Directory"}),e.jsx(i,{fontSize:"xs",fontFamily:"mono",color:"fg.muted",wordBreak:"break-all",lineHeight:"1.3",children:t.baseDir})]})]}),e.jsx(r,{position:"absolute",top:"-10px",right:"-10px",width:"80px",height:"80px",bg:"blue.subtle",borderRadius:"full",opacity:"0.5",zIndex:"-1"})]})})})})};export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./index-7BvmfFYo.js";const{withContext:t}=e({key:"badge"}),a=t("span");export{a as B};
|