@baseplate-dev/project-builder-web 0.2.3 → 0.2.4

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.
Files changed (107) hide show
  1. package/dist/assets/-constants-BC9esibq.js +4 -0
  2. package/dist/assets/-constants-BC9esibq.js.map +1 -0
  3. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BXxolMLm.js → web-BaAZd6c4.js} +2 -2
  4. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BXxolMLm.js.map → web-BaAZd6c4.js.map} +1 -1
  5. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-C7fVVw7M.js +5 -0
  6. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-C7fVVw7M.js.map +1 -0
  7. package/dist/assets/__federation_shared_@baseplate-dev/{ui-components-DGE1buQ-.js → ui-components-CbLT5eCP.js} +2 -2
  8. package/dist/assets/__federation_shared_@baseplate-dev/{ui-components-DGE1buQ-.js.map → ui-components-CbLT5eCP.js.map} +1 -1
  9. package/dist/assets/{_virtual___federation_fn_import-CE3p-l_2.js → _virtual___federation_fn_import-CzwHXTRo.js} +2 -2
  10. package/dist/assets/{_virtual___federation_fn_import-CE3p-l_2.js.map → _virtual___federation_fn_import-CzwHXTRo.js.map} +1 -1
  11. package/dist/assets/{backend-BAEsy0fr.js → backend-B3MDDop9.js} +2 -2
  12. package/dist/assets/{backend-BAEsy0fr.js.map → backend-B3MDDop9.js.map} +1 -1
  13. package/dist/assets/{badge-with-type-label-BuG6yCtf.js → badge-with-type-label-CNVJUqNt.js} +2 -2
  14. package/dist/assets/{badge-with-type-label-BuG6yCtf.js.map → badge-with-type-label-CNVJUqNt.js.map} +1 -1
  15. package/dist/assets/{edit._id-DPcGRUbG.js → edit._id-Ce2Ymc-o.js} +2 -2
  16. package/dist/assets/{edit._id-DPcGRUbG.js.map → edit._id-Ce2Ymc-o.js.map} +1 -1
  17. package/dist/assets/{enum-info-form-BjI1ArPU.js → enum-info-form-CVHvQqYN.js} +2 -2
  18. package/dist/assets/{enum-info-form-BjI1ArPU.js.map → enum-info-form-CVHvQqYN.js.map} +1 -1
  19. package/dist/assets/{graphql-DksHNLLL.js → graphql-BlURtGp8.js} +2 -2
  20. package/dist/assets/{graphql-DksHNLLL.js.map → graphql-BlURtGp8.js.map} +1 -1
  21. package/dist/assets/{hierarchy-BwshirJR.js → hierarchy-B1V1qwhL.js} +2 -2
  22. package/dist/assets/{hierarchy-BwshirJR.js.map → hierarchy-B1V1qwhL.js.map} +1 -1
  23. package/dist/assets/{index-CVRvV2mv.js → index-1DYdEncJ.js} +2 -2
  24. package/dist/assets/{index-CVRvV2mv.js.map → index-1DYdEncJ.js.map} +1 -1
  25. package/dist/assets/{index-La9rk06J.js → index-1rH5AIf1.js} +2 -2
  26. package/dist/assets/{index-La9rk06J.js.map → index-1rH5AIf1.js.map} +1 -1
  27. package/dist/assets/{index-s17MV-9f.js → index-BEMXZzJT.js} +2 -2
  28. package/dist/assets/{index-s17MV-9f.js.map → index-BEMXZzJT.js.map} +1 -1
  29. package/dist/assets/{index-gE__lQ6b.js → index-BMCloLL3.js} +4 -4
  30. package/dist/assets/{index-gE__lQ6b.js.map → index-BMCloLL3.js.map} +1 -1
  31. package/dist/assets/{index-Dp90A2TJ.js → index-BRdI-lNh.js} +2 -2
  32. package/dist/assets/{index-Dp90A2TJ.js.map → index-BRdI-lNh.js.map} +1 -1
  33. package/dist/assets/{index-E5Zy1ClF.js → index-BazMYfmA.js} +2 -2
  34. package/dist/assets/{index-E5Zy1ClF.js.map → index-BazMYfmA.js.map} +1 -1
  35. package/dist/assets/index-Bw18F51O.js +2 -0
  36. package/dist/assets/index-Bw18F51O.js.map +1 -0
  37. package/dist/assets/{index-BS45dlQs.js → index-BxN9iLEr.js} +2 -2
  38. package/dist/assets/{index-BS45dlQs.js.map → index-BxN9iLEr.js.map} +1 -1
  39. package/dist/assets/{index-B6qfP-Zp.js → index-D9m5kBYP.js} +2 -2
  40. package/dist/assets/{index-B6qfP-Zp.js.map → index-D9m5kBYP.js.map} +1 -1
  41. package/dist/assets/{index-C6ezfkGk.js → index-DJrwWHdu.js} +2 -2
  42. package/dist/assets/{index-C6ezfkGk.js.map → index-DJrwWHdu.js.map} +1 -1
  43. package/dist/assets/{index-BNK4j9mt.js → index-DlrvL7L-.js} +2 -2
  44. package/dist/assets/{index-BNK4j9mt.js.map → index-DlrvL7L-.js.map} +1 -1
  45. package/dist/assets/{index.esm-CyH9wtdI.js → index.esm-C6ngV5UE.js} +2 -2
  46. package/dist/assets/{index.esm-CyH9wtdI.js.map → index.esm-C6ngV5UE.js.map} +1 -1
  47. package/dist/assets/{model-info-form-B9t3m8Pj.js → model-info-form-B3UWaCuz.js} +2 -2
  48. package/dist/assets/{model-info-form-B9t3m8Pj.js.map → model-info-form-B3UWaCuz.js.map} +1 -1
  49. package/dist/assets/{model-merger-DL4MVNID.js → model-merger-BoPVsTMR.js} +2 -2
  50. package/dist/assets/{model-merger-DL4MVNID.js.map → model-merger-BoPVsTMR.js.map} +1 -1
  51. package/dist/assets/{new-app-dialog-Cd7rJ7i5.js → new-app-dialog-DmiiaAcy.js} +2 -2
  52. package/dist/assets/{new-app-dialog-Cd7rJ7i5.js.map → new-app-dialog-DmiiaAcy.js.map} +1 -1
  53. package/dist/assets/{new-enum-dialog-Z3aWnnBr.js → new-enum-dialog-eE-ABw-k.js} +2 -2
  54. package/dist/assets/{new-enum-dialog-Z3aWnnBr.js.map → new-enum-dialog-eE-ABw-k.js.map} +1 -1
  55. package/dist/assets/new-model-dialog-DsUABBKe.js +2 -0
  56. package/dist/assets/new-model-dialog-DsUABBKe.js.map +1 -0
  57. package/dist/assets/{route-BxjC9xAo.js → route-BcszKLdV.js} +2 -2
  58. package/dist/assets/{route-BxjC9xAo.js.map → route-BcszKLdV.js.map} +1 -1
  59. package/dist/assets/{route-BOOZxY6E.js → route-CBp4D5qe.js} +2 -2
  60. package/dist/assets/{route-BOOZxY6E.js.map → route-CBp4D5qe.js.map} +1 -1
  61. package/dist/assets/{route-BwqWBMDI.js → route-Cey_4lZX.js} +2 -2
  62. package/dist/assets/{route-BwqWBMDI.js.map → route-Cey_4lZX.js.map} +1 -1
  63. package/dist/assets/route-CqtFDOsk.js +2 -0
  64. package/dist/assets/{route-C8YLDv4I.js.map → route-CqtFDOsk.js.map} +1 -1
  65. package/dist/assets/{route-DrufP1-c.js → route-DioBcaFQ.js} +2 -2
  66. package/dist/assets/{route-DrufP1-c.js.map → route-DioBcaFQ.js.map} +1 -1
  67. package/dist/assets/{route-BzTxfPrV.js → route-MODh5ysn.js} +2 -2
  68. package/dist/assets/{route-BzTxfPrV.js.map → route-MODh5ysn.js.map} +1 -1
  69. package/dist/assets/{route-_AecKyFO.js → route-VW3n5-PC.js} +2 -2
  70. package/dist/assets/{route-_AecKyFO.js.map → route-VW3n5-PC.js.map} +1 -1
  71. package/dist/assets/{route-B2oYTZT4.js → route-rX4E9J5V.js} +2 -2
  72. package/dist/assets/{route-B2oYTZT4.js.map → route-rX4E9J5V.js.map} +1 -1
  73. package/dist/assets/{route-B6DRGm3t.js → route-sqtj7nCf.js} +2 -2
  74. package/dist/assets/{route-B6DRGm3t.js.map → route-sqtj7nCf.js.map} +1 -1
  75. package/dist/assets/{sections-D-GS6uoS.js → sections-D48VzvlO.js} +2 -2
  76. package/dist/assets/{sections-D-GS6uoS.js.map → sections-D48VzvlO.js.map} +1 -1
  77. package/dist/assets/{sections._sectionKey-Bj4VmUuM.js → sections._sectionKey-Cojmxr6C.js} +2 -2
  78. package/dist/assets/{sections._sectionKey-Bj4VmUuM.js.map → sections._sectionKey-Cojmxr6C.js.map} +1 -1
  79. package/dist/assets/{service-C6FdRXxU.js → service-CuzPG1Yl.js} +2 -2
  80. package/dist/assets/{service-C6FdRXxU.js.map → service-CuzPG1Yl.js.map} +1 -1
  81. package/dist/assets/{template-extractor-D2LqkpO5.js → template-extractor-B9fEhgo_.js} +2 -2
  82. package/dist/assets/{template-extractor-D2LqkpO5.js.map → template-extractor-B9fEhgo_.js.map} +1 -1
  83. package/dist/assets/{theme-builder-_PghOvuC.js → theme-builder-Bw8c01EE.js} +2 -2
  84. package/dist/assets/{theme-builder-_PghOvuC.js.map → theme-builder-Bw8c01EE.js.map} +1 -1
  85. package/dist/assets/{use-definition-schema-B2FBXmC_.js → use-definition-schema-DANa9pch.js} +2 -2
  86. package/dist/assets/{use-definition-schema-B2FBXmC_.js.map → use-definition-schema-DANa9pch.js.map} +1 -1
  87. package/dist/assets/{use-enum-form-DQza9C6Q.js → use-enum-form-Dz-Wnbxj.js} +2 -2
  88. package/dist/assets/{use-enum-form-DQza9C6Q.js.map → use-enum-form-Dz-Wnbxj.js.map} +1 -1
  89. package/dist/assets/use-model-form-DMG7DdSK.js +2 -0
  90. package/dist/assets/use-model-form-DMG7DdSK.js.map +1 -0
  91. package/dist/assets/{utils-CH9UxfXa.js → utils-95Eli4qP.js} +2 -2
  92. package/dist/assets/{utils-CH9UxfXa.js.map → utils-95Eli4qP.js.map} +1 -1
  93. package/dist/assets/{web-C6Idxok-.js → web-B6BjTv_c.js} +2 -2
  94. package/dist/assets/{web-C6Idxok-.js.map → web-B6BjTv_c.js.map} +1 -1
  95. package/dist/index.html +4 -4
  96. package/package.json +6 -6
  97. package/dist/assets/-constants-gwObfy2j.js +0 -4
  98. package/dist/assets/-constants-gwObfy2j.js.map +0 -1
  99. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CDWHycLw.js +0 -5
  100. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CDWHycLw.js.map +0 -1
  101. package/dist/assets/index-CwavzuOe.js +0 -2
  102. package/dist/assets/index-CwavzuOe.js.map +0 -1
  103. package/dist/assets/new-model-dialog-uEX7hTid.js +0 -2
  104. package/dist/assets/new-model-dialog-uEX7hTid.js.map +0 -1
  105. package/dist/assets/route-C8YLDv4I.js +0 -2
  106. package/dist/assets/use-model-form-D4qoaVd7.js +0 -2
  107. package/dist/assets/use-model-form-D4qoaVd7.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{i as r}from"./_virtual___federation_fn_import-CE3p-l_2.js";import{b as $,j as e}from"./index.esm-CyH9wtdI.js";import{G as S,I as E,B as z,J as I}from"./index-BS45dlQs.js";import{s as M,U as A,d as B}from"./index-gE__lQ6b.js";import{s as P}from"./immer-xieDw-3D.js";function T(t){return S({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(t)}const{useProjectDefinition:H}=await r("@baseplate-dev/project-builder-lib/web"),{Button:D,ComboboxFieldController:U,Dialog:V,DialogContent:W,DialogFooter:G,DialogHeader:L,DialogTitle:O,InputFieldController:q}=await r("@baseplate-dev/ui-components"),{useEffect:J,useMemo:K}=await r("react"),{z:j}=await r("zod"),Q=j.object({id:j.string(),childName:j.string().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase, numbers, and dashes only"),parentRef:j.string().optional()});function X({feature:t,open:i,onClose:a}){const{definitionContainer:{definition:p},saveDefinitionWithFeedback:d}=H(),l=K(()=>({id:t?.id??"",childName:t?.name.split("/").pop()??"",parentRef:t?.parentRef}),[t]),{control:f,handleSubmit:w,reset:m,formState:{isSubmitting:v}}=$({resolver:M(Q),values:l});J(()=>{i&&m(l)},[i,l,m]);const y=w(n=>d(c=>{const x=c.features.find(s=>s.id===n.parentRef)?.name,h=n.parentRef?`${x}/${n.childName}`:n.childName;if(c.features.some(s=>s.id!==n.id&&s.name===h))throw new A("Feature with this name already exists");const b=[...c.features.filter(s=>s.id!==n.id),{id:n.id,name:h,parentRef:n.parentRef}];function F(s){const R=b.filter(u=>s?new RegExp(`^${s.name}/[^/]+$`).exec(u.name):!u.name.includes("/"));for(const u of R){const g=u.name.split("/").pop();if(!g)throw new Error("Invalid feature name");u.name=s?`${s.name}/${g}`:g,F(u)}}F(),c.features=P(b,[s=>s.name])},{onSuccess:()=>{a?.()}})),o=[{label:"None",value:void 0},...p.features.filter(n=>n.id!==t?.id).map(n=>({label:n.name,value:n.id}))];return e.jsx(V,{open:i,onOpenChange:n=>{n||a?.()},children:e.jsx(W,{children:e.jsxs("form",{className:"space-y-4",onSubmit:y,children:[e.jsx(L,{children:e.jsxs(O,{children:[t?.name?"Edit":"Add"," Feature"]})}),e.jsx(q,{control:f,name:"childName",label:"Name",autoComplete:"off","data-1p-ignore":!0}),e.jsx(U,{control:f,name:"parentRef",label:"Parent Feature",options:o}),e.jsxs(G,{children:[e.jsx(D,{onClick:a,variant:"secondary",children:"Cancel"}),e.jsx(D,{type:"submit",disabled:v,children:"Save"})]})]})})})}const{featureEntityType:C}=await r("@baseplate-dev/project-builder-lib"),{useProjectDefinition:Y}=await r("@baseplate-dev/project-builder-lib/web"),{Button:N,buttonVariants:Z,cn:_,useConfirmDialog:ee}=await r("@baseplate-dev/ui-components"),{useState:k}=await r("react");function te({feature:t,setFeatureToEdit:i,setShowFeatureForm:a,handleRemoveFeature:p}){const d=t.name.split("/").pop()??"";return e.jsxs("div",{className:"flex space-x-1",children:[e.jsx("button",{className:"mr-1 flex w-full flex-row items-center space-x-3",onClick:()=>{i(t),a(!0)},children:e.jsxs("div",{className:"flex w-full items-center space-x-1 truncate",title:d,children:[t.name.includes("/")&&e.jsxs(e.Fragment,{children:[t.name.split("/").slice(0,-2).map(l=>e.jsx("div",{className:"w-8 shrink-0"},l)),e.jsx(T,{className:"size-8 shrink-0 p-2"})]}),e.jsxs("div",{className:_(Z({variant:"secondary",size:"sm"}),"group w-full"),style:{justifyContent:"flex-start"},children:[d,e.jsx("div",{className:"flex-1"}),e.jsx(E,{className:"opacity-0 transition-opacity group-hover:opacity-100"})]})]})}),e.jsx(N,{className:"shrink-0",variant:"ghost",onClick:()=>{i({id:C.generateNewId(),name:"",parentRef:t.id}),a(!0)},size:"icon",title:`Add Sub-Feature to ${t.name}`,children:e.jsx(z,{})}),e.jsx(N,{className:"shrink-0",variant:"ghost",onClick:()=>{p(t)},size:"icon",title:`Delete ${t.name}`,children:e.jsx(I,{})})]})}const re=function(){const{definitionContainer:i,saveDefinitionWithFeedbackSync:a}=Y(),{requestConfirm:p}=ee(),{showRefIssues:d}=B(),[l,f]=k(),[w,m]=k(!1),{features:v}=i.definition,y=o=>{function n(x){const h=x.features.findIndex(b=>b.id===o.id);if(h===-1)throw new Error("Feature not found");x.features.splice(h,1)}const c=i.fixRefDeletions(n);if(c.type==="failure"){d({issues:c.issues});return}p({title:"Delete Feature",content:`Are you sure you want to delete ${o.name}?`,onConfirm:()=>{a(n,{successMessage:`Feature ${o.name} removed`})}})};return e.jsx("div",{className:"relative h-full max-h-full pb-(--action-bar-height)",children:e.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[e.jsxs("div",{className:"sticky top-0 space-y-2 border-b bg-background py-6",children:[e.jsx("h1",{children:"Hierarchy"}),e.jsx("p",{className:"max-w-3xl text-muted-foreground",children:"All business logic and features are organized in a hierarchy. The structure of the features in the list below is the way the folder structure will be created in your backend/admin applications."})]}),e.jsxs("div",{className:"py-6",children:[e.jsx("div",{className:"mb-4 flex max-w-md flex-col gap-1",children:v.map(o=>e.jsx(te,{feature:o,setFeatureToEdit:f,setShowFeatureForm:m,handleRemoveFeature:y},o.id))}),e.jsx(N,{onClick:()=>{f({id:C.generateNewId(),name:"",parentRef:void 0}),m(!0)},variant:"secondary",size:"sm",children:"Add Feature"}),e.jsx(X,{feature:l,open:w,onClose:()=>{m(!1)}})]})]})})};export{re as component};
2
- //# sourceMappingURL=hierarchy-BwshirJR.js.map
1
+ import{i as r}from"./_virtual___federation_fn_import-CzwHXTRo.js";import{b as $,j as e}from"./index.esm-C6ngV5UE.js";import{G as S,I as E,B as z,J as I}from"./index-BxN9iLEr.js";import{s as M,U as A,d as B}from"./index-BMCloLL3.js";import{s as P}from"./immer-xieDw-3D.js";function T(t){return S({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(t)}const{useProjectDefinition:H}=await r("@baseplate-dev/project-builder-lib/web"),{Button:D,ComboboxFieldController:U,Dialog:V,DialogContent:W,DialogFooter:G,DialogHeader:L,DialogTitle:O,InputFieldController:q}=await r("@baseplate-dev/ui-components"),{useEffect:J,useMemo:K}=await r("react"),{z:j}=await r("zod"),Q=j.object({id:j.string(),childName:j.string().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase, numbers, and dashes only"),parentRef:j.string().optional()});function X({feature:t,open:i,onClose:a}){const{definitionContainer:{definition:p},saveDefinitionWithFeedback:d}=H(),l=K(()=>({id:t?.id??"",childName:t?.name.split("/").pop()??"",parentRef:t?.parentRef}),[t]),{control:f,handleSubmit:w,reset:m,formState:{isSubmitting:v}}=$({resolver:M(Q),values:l});J(()=>{i&&m(l)},[i,l,m]);const y=w(n=>d(c=>{const x=c.features.find(s=>s.id===n.parentRef)?.name,h=n.parentRef?`${x}/${n.childName}`:n.childName;if(c.features.some(s=>s.id!==n.id&&s.name===h))throw new A("Feature with this name already exists");const b=[...c.features.filter(s=>s.id!==n.id),{id:n.id,name:h,parentRef:n.parentRef}];function F(s){const R=b.filter(u=>s?new RegExp(`^${s.name}/[^/]+$`).exec(u.name):!u.name.includes("/"));for(const u of R){const g=u.name.split("/").pop();if(!g)throw new Error("Invalid feature name");u.name=s?`${s.name}/${g}`:g,F(u)}}F(),c.features=P(b,[s=>s.name])},{onSuccess:()=>{a?.()}})),o=[{label:"None",value:void 0},...p.features.filter(n=>n.id!==t?.id).map(n=>({label:n.name,value:n.id}))];return e.jsx(V,{open:i,onOpenChange:n=>{n||a?.()},children:e.jsx(W,{children:e.jsxs("form",{className:"space-y-4",onSubmit:y,children:[e.jsx(L,{children:e.jsxs(O,{children:[t?.name?"Edit":"Add"," Feature"]})}),e.jsx(q,{control:f,name:"childName",label:"Name",autoComplete:"off","data-1p-ignore":!0}),e.jsx(U,{control:f,name:"parentRef",label:"Parent Feature",options:o}),e.jsxs(G,{children:[e.jsx(D,{onClick:a,variant:"secondary",children:"Cancel"}),e.jsx(D,{type:"submit",disabled:v,children:"Save"})]})]})})})}const{featureEntityType:C}=await r("@baseplate-dev/project-builder-lib"),{useProjectDefinition:Y}=await r("@baseplate-dev/project-builder-lib/web"),{Button:N,buttonVariants:Z,cn:_,useConfirmDialog:ee}=await r("@baseplate-dev/ui-components"),{useState:k}=await r("react");function te({feature:t,setFeatureToEdit:i,setShowFeatureForm:a,handleRemoveFeature:p}){const d=t.name.split("/").pop()??"";return e.jsxs("div",{className:"flex space-x-1",children:[e.jsx("button",{className:"mr-1 flex w-full flex-row items-center space-x-3",onClick:()=>{i(t),a(!0)},children:e.jsxs("div",{className:"flex w-full items-center space-x-1 truncate",title:d,children:[t.name.includes("/")&&e.jsxs(e.Fragment,{children:[t.name.split("/").slice(0,-2).map(l=>e.jsx("div",{className:"w-8 shrink-0"},l)),e.jsx(T,{className:"size-8 shrink-0 p-2"})]}),e.jsxs("div",{className:_(Z({variant:"secondary",size:"sm"}),"group w-full"),style:{justifyContent:"flex-start"},children:[d,e.jsx("div",{className:"flex-1"}),e.jsx(E,{className:"opacity-0 transition-opacity group-hover:opacity-100"})]})]})}),e.jsx(N,{className:"shrink-0",variant:"ghost",onClick:()=>{i({id:C.generateNewId(),name:"",parentRef:t.id}),a(!0)},size:"icon",title:`Add Sub-Feature to ${t.name}`,children:e.jsx(z,{})}),e.jsx(N,{className:"shrink-0",variant:"ghost",onClick:()=>{p(t)},size:"icon",title:`Delete ${t.name}`,children:e.jsx(I,{})})]})}const re=function(){const{definitionContainer:i,saveDefinitionWithFeedbackSync:a}=Y(),{requestConfirm:p}=ee(),{showRefIssues:d}=B(),[l,f]=k(),[w,m]=k(!1),{features:v}=i.definition,y=o=>{function n(x){const h=x.features.findIndex(b=>b.id===o.id);if(h===-1)throw new Error("Feature not found");x.features.splice(h,1)}const c=i.fixRefDeletions(n);if(c.type==="failure"){d({issues:c.issues});return}p({title:"Delete Feature",content:`Are you sure you want to delete ${o.name}?`,onConfirm:()=>{a(n,{successMessage:`Feature ${o.name} removed`})}})};return e.jsx("div",{className:"relative h-full max-h-full pb-(--action-bar-height)",children:e.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[e.jsxs("div",{className:"sticky top-0 space-y-2 border-b bg-background py-6",children:[e.jsx("h1",{children:"Hierarchy"}),e.jsx("p",{className:"max-w-3xl text-muted-foreground",children:"All business logic and features are organized in a hierarchy. The structure of the features in the list below is the way the folder structure will be created in your backend/admin applications."})]}),e.jsxs("div",{className:"py-6",children:[e.jsx("div",{className:"mb-4 flex max-w-md flex-col gap-1",children:v.map(o=>e.jsx(te,{feature:o,setFeatureToEdit:f,setShowFeatureForm:m,handleRemoveFeature:y},o.id))}),e.jsx(N,{onClick:()=>{f({id:C.generateNewId(),name:"",parentRef:void 0}),m(!0)},variant:"secondary",size:"sm",children:"Add Feature"}),e.jsx(X,{feature:l,open:w,onClose:()=>{m(!1)}})]})]})})};export{re as component};
2
+ //# sourceMappingURL=hierarchy-B1V1qwhL.js.map