@knoflows/engine 0.1.0-alpha.0 → 0.1.0-alpha.10
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 +2 -2
- package/dist/engine.js +33 -128
- package/dist/migrations/20260917165450_baseline/migration.sql +127 -0
- package/dist/migrations/20260917165450_baseline/snapshot.json +1212 -0
- package/dist/migrations/20260918025930_context_files/migration.sql +7 -0
- package/dist/migrations/20260918025930_context_files/snapshot.json +1275 -0
- package/dist/migrations/20260918074816_large_kate_bishop/migration.sql +8 -0
- package/dist/migrations/20260918074816_large_kate_bishop/snapshot.json +1338 -0
- package/package.json +19 -10
- package/static/assets/i18n/en.json +261 -14
- package/static/assets/i18n/es.json +261 -14
- package/static/{chunk-DLA1DsR_.js → chunk-2KSNHCgb.js} +1 -1
- package/static/chunk-3mppll1n.js +1 -0
- package/static/chunk-6BQlxALO.js +1 -0
- package/static/chunk-A4AkMf2s.js +1 -0
- package/static/chunk-B2hO-qT3.js +1 -0
- package/static/chunk-B8MrNxxk.js +1 -0
- package/static/chunk-BAc0DRm8.js +1 -0
- package/static/chunk-BFkZ796p.js +7 -0
- package/static/chunk-BNOYZq-b.js +1 -0
- package/static/chunk-BUuwGTt7.js +66 -0
- package/static/chunk-BVw7xkK9.js +1 -0
- package/static/chunk-BbcTWKT2.js +1 -0
- package/static/chunk-BhGgxvgu.js +1 -0
- package/static/chunk-BjZIiizu.js +1 -0
- package/static/chunk-CDWIMt6y.js +1 -0
- package/static/{chunk-B8aKNL-C.js → chunk-CEcbtdnK.js} +1 -1
- package/static/chunk-CJDp11v5.js +1 -0
- package/static/chunk-CJRNatUw.js +1 -0
- package/static/chunk-CWbxWv5I.js +1 -0
- package/static/chunk-Cd8F2jeN.js +1 -0
- package/static/chunk-Cf_xd8ER.js +1 -0
- package/static/chunk-CgqRVtSF.js +1 -0
- package/static/chunk-CxBYhrEj.js +1 -0
- package/static/chunk-D6YfO72h.js +1 -0
- package/static/chunk-DNOjVPY0.js +1 -0
- package/static/chunk-DQnMulwi.js +1 -0
- package/static/chunk-DblClAqu.js +1 -0
- package/static/chunk-DjibVmY7.js +1 -0
- package/static/chunk-DoXxOh8j.js +1 -0
- package/static/chunk-Ojn34cvU.js +1 -0
- package/static/chunk-W5GAgssE.js +1 -0
- package/static/chunk-XLpSkczx.js +1 -0
- package/static/chunk-cHfOiAJm.js +1 -0
- package/static/chunk-eSxb3-OU.js +1 -0
- package/static/chunk-hZzW00VR.js +1 -0
- package/static/chunk-jct1_zOr.js +1 -0
- package/static/chunk-mzyds3TS.js +1 -0
- package/static/chunk-tYnBYi0l.js +1 -0
- package/static/chunk-wbdetocK.js +5 -0
- package/static/index.html +6 -3
- package/static/main-MNK6ZYDO.js +249 -0
- package/static/styles-6MW3GE4V.css +1 -0
- package/static/chunk-8joH1h3C.js +0 -1
- package/static/chunk-B4A7hSM3.js +0 -1
- package/static/chunk-B5hULR_G.js +0 -1
- package/static/chunk-BNylhXVN.js +0 -1
- package/static/chunk-BV9svMMc.js +0 -1
- package/static/chunk-BX5sYPy1.js +0 -1
- package/static/chunk-Be6g3Cmv.js +0 -1
- package/static/chunk-Bgtkf8nM.js +0 -1
- package/static/chunk-Bl6kwpIK.js +0 -1
- package/static/chunk-BvDaTl4u.js +0 -1
- package/static/chunk-ByacugWF.js +0 -1
- package/static/chunk-CPYgCVHJ.js +0 -1
- package/static/chunk-CRPsjdw8.js +0 -1
- package/static/chunk-CZLubDvD.js +0 -1
- package/static/chunk-Cczqw9G5.js +0 -1
- package/static/chunk-CntkJjcW.js +0 -1
- package/static/chunk-Cuh7ppOq.js +0 -1
- package/static/chunk-Cv76Fxhr.js +0 -66
- package/static/chunk-D3rwM_uV.js +0 -7
- package/static/chunk-DHPxevqq.js +0 -1
- package/static/chunk-DYzjfNdD.js +0 -1
- package/static/chunk-DdSpqYCm.js +0 -5
- package/static/chunk-Di8Mt9Sl.js +0 -1
- package/static/chunk-Di_OsX8x.js +0 -1
- package/static/chunk-DlU8g0UO.js +0 -1
- package/static/chunk-DpU7iV6a.js +0 -1
- package/static/chunk-iJsU0w_6.js +0 -1
- package/static/chunk-mjUdDQQg.js +0 -1
- package/static/main-JSLBK4RN.js +0 -235
- package/static/styles-W2TNDHKW.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {U as Ut}from'./chunk-CDWIMt6y.js';import {q as qe}from'./chunk-BhGgxvgu.js';import {a as ai,z}from'./chunk-CWbxWv5I.js';import {_ as _n,C as Cn}from'./chunk-Ojn34cvU.js';import {W,I}from'./chunk-DNOjVPY0.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-3mppll1n.js';import {C,V as Ve$1,b as at,a0 as $0,H as Hw,q as qo,r,u as ue,o,Q as QE,M as Mi,n as n8,am as S4,J as J6,k as k3,d as dd,z as zc,c as t7,Z as y7,X as Xb,e as V5,D as D5,K as Kt,f as _i,m as bD,g as Kc,a4 as Mh,a5 as ah,p as gI,B as _D,ae as Zi,a8 as a,af as E,i as ie,F as LD,v as vw,R as Rw,h as gh,P as Ph,O as Ow,w as nl,E as VD,j as oE,N as ND,S as SD,x as ch,y as sE,A as xD,l as lh,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';var Me=(()=>{class t{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(E())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(E())}create(e){return this.http.post(this.baseUrl,e).pipe(E())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(E())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(E())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Se=(t,f)=>f.id;function Te(t,f){if(t&1){let e=LD();_i(0,"header",1)(1,"h1"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",4),gh("click",function(){Pu(e);let r=VD();return Lu(r.openCreateForm())}),vw(5),Rw(6,"transloco"),Kc()();}t&2&&(gI(2),Ph(Ow(3,2,"context-files.title")),gI(3),nl(" ",Ow(6,4,"context-files.create")," "));}function Ie(t,f){t&1&&(_i(0,"p",2),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Fe(t,f){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ye(t,f){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function Ne(t,f){if(t&1&&(_i(0,"p",9),vw(1),Kc()),t&2){let e=VD(3);gI(),Ph(e.saveError());}}function we(t,f){if(t&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),t&2){let e=f.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.tierKey(e)));}}function De(t,f){if(t&1){let e=LD();_i(0,"button",20),gh("click",function(){Pu(e);let r=VD(3);return Lu(r.cancelForm())}),vw(1),Rw(2,"transloco"),Kc();}t&2&&(gI(),nl(" ",Ow(2,1,"context-files.form.cancel")," "));}function ke(t,f){if(t&1){let e=LD();_i(0,"section",6),bD(1,Ne,2,1,"p",9),_i(2,"label",10)(3,"span"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"input",11),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formName.set(r))}),Kc(),oE(),Kc(),_i(7,"div",10)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"nz-select",12),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formTier.set(r))}),ND(12,we,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(14,"div",10)(15,"span"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"app-file-browser",14),gh("pathChange",function(r){Pu(e);let p=VD(2);return Lu(p.formPath.set(r))}),Kc(),_i(19,"p",15),vw(20),Rw(21,"transloco"),Kc()(),_i(22,"label",10)(23,"span"),vw(24),Rw(25,"transloco"),Kc(),_i(26,"input",16),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formDescription.set(r))}),Kc(),oE(),Kc(),_i(27,"div",17)(28,"button",18),gh("click",function(){Pu(e);let r=VD(2);return Lu(r.submitForm())}),vw(29),Rw(30,"transloco"),Kc(),bD(31,De,3,3,"button",19),Kc()();}if(t&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,13,"context-files.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,15,"context-files.form.tier")),gI(2),ch("ngModel",e.formTier()),sE(),gI(),xD(e.tiers),gI(4),Ph(Ow(17,17,"context-files.form.path")),gI(2),ch("path",e.formPath()),gI(2),Ph(Ow(21,19,"context-files.form.pathHint")),gI(4),Ph(Ow(25,21,"context-files.form.description")),gI(2),ch("ngModel",e.formDescription()),sE(),gI(2),ch("nzLoading",e.saving()),gI(),nl(" ",Ow(30,23,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),_D(e.inSelectionMode()?-1:31);}}function Le(t,f){if(t&1){let e=LD();_i(0,"section",7)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",21),gh("click",function(){Pu(e);let r=VD(2);return Lu(r.openCreateForm())}),vw(5),Rw(6,"transloco"),Kc()();}t&2&&(gI(2),Ph(Ow(3,2,"context-files.emptyState")),gI(3),nl(" ",Ow(6,4,"context-files.create")," "));}function Pe(t,f){t&1&&lh(0,"th");}function Ve(t,f){t&1&&(_i(0,"th"),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"context-files.column.actions")));}function Be(t,f){if(t&1){let e=LD();_i(0,"td")(1,"label",24),gh("nzCheckedChange",function(r){Pu(e);let p=VD().$implicit,T=VD(3);return Lu(T.toggleSelected(p.id,r))}),Kc()();}if(t&2){let e=VD().$implicit,n=VD(3);gI(),ch("nzChecked",n.isSelected(e.id)),ah("data-testid","select-"+e.id);}}function Oe(t,f){if(t&1){let e=LD();_i(0,"td",23)(1,"button",25),gh("click",function(){Pu(e);let r=VD().$implicit,p=VD(3);return Lu(p.openEditForm(r))}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",26),Rw(5,"transloco"),Rw(6,"transloco"),Rw(7,"transloco"),gh("nzOnConfirm",function(){Pu(e);let r=VD().$implicit,p=VD(3);return Lu(p.deleteFile(r.id))}),vw(8),Rw(9,"transloco"),Kc()();}if(t&2){let e=VD().$implicit;gI(),ah("data-testid","edit-"+e.id),gI(),nl(" ",Ow(3,7,"context-files.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(5,9,"context-files.deleteConfirm"))("nzOkText",Ow(6,11,"context-files.delete"))("nzCancelText",Ow(7,13,"common.cancel")),ah("data-testid","delete-"+e.id),gI(4),nl(" ",Ow(9,15,"context-files.delete")," ");}}function $e(t,f){if(t&1&&(_i(0,"tr"),bD(1,Be,2,2,"td"),_i(2,"td"),vw(3),Kc(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td",22),vw(9),Kc(),_i(10,"td"),vw(11),Kc(),bD(12,Oe,10,17,"td",23),Kc()),t&2){let e=f.$implicit,n=VD(3);ah("data-testid","context-file-"+e.id),gI(),_D(n.inSelectionMode()?1:-1),gI(),ah("data-testid","name-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","tier-"+e.id),gI(),Ph(Ow(7,11,n.tierKey(e.tier))),gI(2),ah("data-testid","path-"+e.id),gI(),Ph(e.path),gI(),ah("data-testid","description-"+e.id),gI(),Ph(e.description),gI(),_D(n.inSelectionMode()?-1:12);}}function Ae(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),bD(3,Pe,1,0,"th"),_i(4,"th"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"th"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"th"),vw(11),Rw(12,"transloco"),Kc(),_i(13,"th"),vw(14),Rw(15,"transloco"),Kc(),bD(16,Ve,3,3,"th"),Kc()(),_i(17,"tbody"),ND(18,$e,13,13,"tr",null,Se),Kc()()),t&2){let e=VD(2);ch("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),_D(e.inSelectionMode()?3:-1),gI(2),Ph(Ow(6,9,"context-files.column.name")),gI(3),Ph(Ow(9,11,"context-files.column.tier")),gI(3),Ph(Ow(12,13,"context-files.column.path")),gI(3),Ph(Ow(15,15,"context-files.column.description")),gI(2),_D(e.inSelectionMode()?-1:16),gI(2),xD(e.files());}}function Ue(t,f){if(t&1&&(bD(0,ye,2,1,"p",5),bD(1,ke,32,25,"section",6),bD(2,Le,7,6,"section",7)(3,Ae,20,17,"nz-table",8)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.inSelectionMode()||e.formOpen()?1:-1),gI(),_D(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Re=["user","organization","project"],zt=(()=>{class t{constructor(){this.filesApi=C(Me),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Ut,{optional:true}),this.selectionModeInput=$0(false),this.inSelectionMode=Hw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Re,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,ze)=>N.name.localeCompare(ze.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof o||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"pathChange","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),bD(1,Te,7,6,"header",1),bD(2,Ie,3,3,"p",2)(3,Fe,2,1,"p",3)(4,Ue,4,3),Kc()),n&2&&(Mh("list-page",!r.inSelectionMode()),ah("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),_D(r.inSelectionMode()?-1:1),gI(),_D(r.loading()?2:r.loadError()?3:4));},dependencies:[Mi,n8,S4,J6,k3,dd,zc,t7,y7,Lt,ut,ai,z,_n,Cn,Xb,V5,D5,pc,as,dc,Kl,cc,Ji,ls,W,I,qe,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();export{Me as M,zt as z};
|