headroom-cms 0.1.9 → 0.1.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.
Files changed (123) hide show
  1. package/admin/assets/{AdminsPage-Bt_ekZen.js → AdminsPage-BIWASote.js} +1 -1
  2. package/admin/assets/AllContentPage-1gXe2OC7.js +1 -0
  3. package/admin/assets/{ApiKeysPage-BfWCxGhC.js → ApiKeysPage-BBW4ATBx.js} +1 -1
  4. package/admin/assets/AuditPage-B5GGFWGG.js +1 -0
  5. package/admin/assets/BlockEditor-CQpF8tYb.css +1 -0
  6. package/admin/assets/BlockEditor-ClskiZoX.js +176 -0
  7. package/admin/assets/BlockTypeEditPage-CY0gCPei.js +1 -0
  8. package/admin/assets/BlockTypesPage-D8Me6OeX.js +1 -0
  9. package/admin/assets/{BulkActionBar-TRiXXLQd.js → BulkActionBar--35xjnOP.js} +1 -1
  10. package/admin/assets/CollectionEditPage-y8t0ZO89.js +1 -0
  11. package/admin/assets/{CollectionsPage-ClplrxNn.js → CollectionsPage-BQmGXpvW.js} +1 -1
  12. package/admin/assets/{ContentCreatePage-DfYcEH1u.js → ContentCreatePage-DlgxamOe.js} +1 -1
  13. package/admin/assets/ContentEditPage-WkSbCnnG.js +1 -0
  14. package/admin/assets/ContentField-D04Uo1Ov.js +1 -0
  15. package/admin/assets/ContentListPage-BDMx7pWb.js +1 -0
  16. package/admin/assets/CustomBlockPreview-Cs9bFDh4.js +479 -0
  17. package/admin/assets/FieldRenderer-wE-mtqZB.js +2 -0
  18. package/admin/assets/FilterBar-kFcOLffg.js +1 -0
  19. package/admin/assets/FloatingComposerController-D4uLQfUX-C0Lhbmda.js +1 -0
  20. package/admin/assets/IconPicker-BrgSAsa_.js +3 -0
  21. package/admin/assets/{LoginPage-DutieANA.js → LoginPage-Bi7TBzK4.js} +1 -1
  22. package/admin/assets/MediaField-B-Cz8TlK.js +1 -0
  23. package/admin/assets/MediaPage-C84p9d1U.js +1 -0
  24. package/admin/assets/Pagination-CuHwUPHi.js +1 -0
  25. package/admin/assets/RelationshipPicker-Dv7GaLcU.js +1 -0
  26. package/admin/assets/{SiteSettingsPage-BtCC3RKc.js → SiteSettingsPage-nBT7NzkA.js} +1 -1
  27. package/admin/assets/{SiteUserEditPage-ClHmp0T-.js → SiteUserEditPage-DroUTii9.js} +1 -1
  28. package/admin/assets/SiteUsersPage-iVXPCBPe.js +1 -0
  29. package/admin/assets/{SitesPage-Bw_WBN6v.js → SitesPage-BefZeWuJ.js} +1 -1
  30. package/admin/assets/{SubmissionDetailPage-DS08LGxd.js → SubmissionDetailPage-ktmzzOE1.js} +1 -1
  31. package/admin/assets/SubmissionEditPage-C-ykTI2t.js +1 -0
  32. package/admin/assets/SubmissionListPage-DA-8deUy.js +1 -0
  33. package/admin/assets/{TagInput-BILCaC9b.js → TagInput-d-Hw1fkL.js} +1 -1
  34. package/admin/assets/{TagsPage-DdeZokow.js → TagsPage-BZzDvcKa.js} +1 -1
  35. package/admin/assets/{UsersPage-B0vLxjrg.js → UsersPage-CnQAOOGF.js} +1 -1
  36. package/admin/assets/{WebhookEditPage-SlJE4d3z.js → WebhookEditPage-KeS8hmdW.js} +1 -1
  37. package/admin/assets/{WebhooksPage-C6lGZLpr.js → WebhooksPage-CASjmlPN.js} +1 -1
  38. package/admin/assets/{card-hXVtlM0q.js → card-CZTHR2Qa.js} +1 -1
  39. package/admin/assets/checkbox-DEgzM8H9.js +1 -0
  40. package/admin/assets/{collapsible-B414SspL.js → collapsible-D3d29uJp.js} +1 -1
  41. package/admin/assets/{command-fvBFHye4.js → command-CdzYw11U.js} +1 -1
  42. package/admin/assets/contentStatus-CkPi9Dh6.js +1 -0
  43. package/admin/assets/{core.esm-B_kcYf6n.js → core.esm-DdQHdRkd.js} +2 -2
  44. package/admin/assets/index-BA3y7HJs.js +18 -0
  45. package/admin/assets/index-c7UygSvP.css +1 -0
  46. package/admin/assets/popover-BFw_h3j6.js +1 -0
  47. package/admin/assets/radix-C5ZmWuuL.js +51 -0
  48. package/admin/assets/select-dX9e6VDt.js +1 -0
  49. package/admin/assets/{serializeToText-DR_WnxiI.js → serializeToText-Zin3gYPm.js} +1 -1
  50. package/admin/assets/{sortable.esm-QyXA6fio.js → sortable.esm-qVEMoaTg.js} +1 -1
  51. package/admin/assets/{table-DLoIbCQ5.js → table-Dk7eeOt2.js} +1 -1
  52. package/admin/assets/{textarea-vSXNxwTe.js → textarea-CpDSUg2s.js} +1 -1
  53. package/admin/assets/useAdminResolver-Bljb4XGQ.js +1 -0
  54. package/admin/assets/useContent-CW0tm0FY.js +1 -0
  55. package/admin/assets/useContentSearch-_bwacEth.js +1 -0
  56. package/admin/assets/{useMedia-e3sqWm_t.js → useMedia-Cu5N4rY8.js} +1 -1
  57. package/admin/assets/usePageTitle-DYvuJQp6.js +1 -0
  58. package/admin/assets/useSiteUsers-CKtC_8Jc.js +1 -0
  59. package/admin/assets/{useTags-f7AVSLuj.js → useTags-ybsMbCst.js} +1 -1
  60. package/admin/assets/{useWebhooks-BH_r8-Mo.js → useWebhooks-BAB-3sLa.js} +1 -1
  61. package/admin/assets/yjs-tXBm_srz.js +5 -0
  62. package/admin/index.html +3 -3
  63. package/admin/sw.js +1 -1
  64. package/dist/admin-site.d.ts +12 -0
  65. package/dist/admin-site.d.ts.map +1 -1
  66. package/dist/admin-site.js +8 -1
  67. package/dist/admin-site.js.map +1 -1
  68. package/dist/api.d.ts +7 -0
  69. package/dist/api.d.ts.map +1 -1
  70. package/dist/api.js +8 -1
  71. package/dist/api.js.map +1 -1
  72. package/dist/collaboration.d.ts +55 -0
  73. package/dist/collaboration.d.ts.map +1 -0
  74. package/dist/collaboration.js +141 -0
  75. package/dist/collaboration.js.map +1 -0
  76. package/dist/index.d.ts +12 -0
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +29 -4
  79. package/dist/index.js.map +1 -1
  80. package/dist/storage.d.ts +2 -0
  81. package/dist/storage.d.ts.map +1 -1
  82. package/dist/storage.js +33 -0
  83. package/dist/storage.js.map +1 -1
  84. package/lambda/api/bootstrap +0 -0
  85. package/lambda/webhook-worker/bootstrap +0 -0
  86. package/package.json +1 -1
  87. package/src/admin-site.ts +20 -1
  88. package/src/api.ts +15 -1
  89. package/src/collaboration.ts +187 -0
  90. package/src/index.ts +44 -4
  91. package/src/sst-env.d.ts +28 -0
  92. package/src/storage.ts +35 -0
  93. package/admin/assets/AllContentPage-CFqEMAl9.js +0 -1
  94. package/admin/assets/AuditPage-BE0XIUl2.js +0 -1
  95. package/admin/assets/BlockEditor-6wqsThJ7.js +0 -179
  96. package/admin/assets/BlockEditor-Cp_wZ2xN.css +0 -1
  97. package/admin/assets/BlockTypeEditPage-CuNJfZw0.js +0 -1
  98. package/admin/assets/BlockTypesPage-BIMBVxBs.js +0 -1
  99. package/admin/assets/CollectionEditPage-BqX_0cC2.js +0 -1
  100. package/admin/assets/ContentEditPage-D3Rvlktk.js +0 -2
  101. package/admin/assets/ContentListPage-zmO8Is4d.js +0 -1
  102. package/admin/assets/CustomBlockPreview-C6HqS4xv.js +0 -479
  103. package/admin/assets/FieldBuilder-36tfpSyM.js +0 -3
  104. package/admin/assets/FilterBar-DhRwTqFv.js +0 -1
  105. package/admin/assets/MediaField-J2TLG_fu.js +0 -1
  106. package/admin/assets/MediaPage-DZZKMGF4.js +0 -1
  107. package/admin/assets/RelationshipPicker-CDFs4TMW.js +0 -1
  108. package/admin/assets/SiteUsersPage-AyJvcVM7.js +0 -1
  109. package/admin/assets/SubmissionEditPage-Brf-DK2X.js +0 -1
  110. package/admin/assets/SubmissionListPage-DNMzQZHS.js +0 -1
  111. package/admin/assets/checkbox-WGrS3sUr.js +0 -1
  112. package/admin/assets/contentStatus-BmaiYVOm.js +0 -1
  113. package/admin/assets/index-Cir9tY_P.js +0 -18
  114. package/admin/assets/index-DACBYsKM.css +0 -1
  115. package/admin/assets/popover-D5_HjjUC.js +0 -1
  116. package/admin/assets/radix-C1kb_NqW.js +0 -51
  117. package/admin/assets/select-_uJYxzeZ.js +0 -1
  118. package/admin/assets/useAdminResolver-D-LlmquD.js +0 -1
  119. package/admin/assets/useContent-e8beBIuq.js +0 -1
  120. package/admin/assets/useContentSearch-DOjveB9t.js +0 -1
  121. package/admin/assets/useDebouncedValue-C-cQUcLG.js +0 -1
  122. package/admin/assets/usePageTitle-BNSba9_L.js +0 -1
  123. package/admin/assets/useSiteUsers-BdnvuM2E.js +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./tanstack-Bs3zYPPV.js";import{u as B,r as x}from"./react-vendor-C2CvUxFh.js";import{u as L,aF as M,aG as q,p as z,aH as G,aI as V,x as J,S as b,D as _,i as $,B as l,aJ as K,k as Q,l as W,m as X,n as Y,I as Z,o as ee,P as se,T as ae,v as i}from"./index-Cir9tY_P.js";import{u as ie}from"./useAdminResolver-D-LlmquD.js";import{T as te,a as ne,b as y,c as p,d as re,e as j}from"./table-DLoIbCQ5.js";import{P as oe,a as le,b as de}from"./popover-D5_HjjUC.js";import{C as ce,a as me,b as ue,c as he,d as xe,e as pe}from"./command-fvBFHye4.js";import{S as je,a as ve,b as ge,c as fe,d as A}from"./select-_uJYxzeZ.js";import{u as be}from"./usePageTitle-BNSba9_L.js";import"./radix-C1kb_NqW.js";function De(){const{host:d}=B(),{user:C}=L(),S=M(),{data:N,isLoading:I}=q(d),{data:T}=z(),c=G(d),m=V(d),n=N?.admins??[],E=T?.items??[],r=S==="admin",v=n.map(s=>s.id),{resolve:w}=ie(v),[P,g]=x.useState(!1),[D,f]=x.useState(!1),[u,h]=x.useState(""),R=J();if(be({title:"Admins"}),I)return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"h-8 w-64"}),Array.from({length:3}).map((s,a)=>e.jsx(b,{className:"h-12 w-full"},a))]});const U=E.filter(s=>!v.includes(s.sub));async function F(s){try{await c.mutateAsync({admins:[...n,{id:s,role:"editor"}]}),i.success("Admin added"),g(!1)}catch(a){i.error("Failed to add admin",{description:a instanceof Error?a.message:void 0})}}async function O(s){if(s.preventDefault(),!!u.trim())try{const a=await m.mutateAsync({email:u.trim()});a.existed?i.success("Existing user added to site"):i.success("Invite email sent",{description:`An invite has been sent to ${a.email}`}),h(""),f(!1)}catch(a){i.error("Failed to invite user",{description:a instanceof Error?a.message:void 0})}}async function H(s){try{await c.mutateAsync({admins:n.filter(a=>a.id!==s)}),i.success("Admin removed")}catch(a){i.error("Failed to remove admin",{description:a instanceof Error?a.message:void 0})}}async function k(s,a){const o=n.map(t=>t.id===s?{...t,role:a}:t);if(!o.some(t=>t.role==="admin")){i.error("At least one admin role is required");return}try{await c.mutateAsync({admins:o}),i.success("Role updated")}catch(t){i.error("Failed to update role",{description:t instanceof Error?t.message:void 0})}}return e.jsxs("div",{children:[!R&&e.jsx("h1",{className:"mb-6 text-2xl font-semibold",children:"Admins"}),r&&e.jsxs("div",{className:"mb-6 flex gap-2",children:[e.jsxs(_,{open:D,onOpenChange:s=>{f(s),s||h("")},children:[e.jsx($,{asChild:!0,children:e.jsxs(l,{children:[e.jsx(K,{className:"mr-2 h-4 w-4"}),"Invite by email"]})}),e.jsxs(Q,{children:[e.jsxs(W,{children:[e.jsx(X,{children:"Invite User to Site"}),e.jsx(Y,{className:"sr-only",children:"Send an invite email to add a user to this site"})]}),e.jsxs("form",{onSubmit:O,className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Enter an email address. If the user doesn't have an account yet, they'll receive an invite email."}),e.jsx(Z,{type:"email",value:u,onChange:s=>h(s.target.value),placeholder:"email@example.com",required:!0}),e.jsx(ee,{children:e.jsx(l,{type:"submit",disabled:m.isPending,children:m.isPending?"Inviting...":"Send Invite"})})]})]})]}),e.jsxs(oe,{open:P,onOpenChange:g,children:[e.jsx(le,{asChild:!0,children:e.jsxs(l,{variant:"outline",children:[e.jsx(se,{className:"mr-2 h-4 w-4"}),"Add existing user"]})}),e.jsx(de,{className:"w-72 p-0",align:"start",children:e.jsxs(ce,{children:[e.jsx(me,{placeholder:"Search users..."}),e.jsxs(ue,{children:[e.jsx(he,{children:"No users found."}),e.jsx(xe,{children:U.map(s=>e.jsx(pe,{value:s.email,onSelect:()=>F(s.sub),children:s.email},s.sub))})]})]})})]})]}),n.length===0?e.jsx("p",{className:"text-muted-foreground",children:"No admins configured."}):e.jsxs(te,{children:[e.jsx(ne,{children:e.jsxs(y,{children:[e.jsx(p,{children:"Email"}),e.jsx(p,{children:"Role"}),r&&e.jsx(p,{})]})}),e.jsx(re,{children:n.map(s=>{const a=s.id===C?.sub;return e.jsxs(y,{children:[e.jsxs(j,{className:"text-sm",children:[w(s.id),a&&e.jsx("span",{className:"ml-2 text-muted-foreground",children:"(you)"})]}),e.jsx(j,{children:r&&!a?e.jsxs(je,{value:s.role,onValueChange:o=>k(s.id,o),children:[e.jsx(ve,{className:"w-28",children:e.jsx(ge,{})}),e.jsxs(fe,{children:[e.jsx(A,{value:"admin",children:"Admin"}),e.jsx(A,{value:"editor",children:"Editor"})]})]}):e.jsx("span",{className:"text-sm capitalize",children:s.role})}),r&&e.jsx(j,{className:"text-right",children:!a&&e.jsx(l,{variant:"ghost",size:"sm",onClick:()=>H(s.id),title:"Remove from site",children:e.jsx(ae,{className:"h-4 w-4"})})})]},s.id)})})]})]})}export{De as AdminsPage};
1
+ import{j as e}from"./tanstack-Bs3zYPPV.js";import{u as H,r as x}from"./react-vendor-C2CvUxFh.js";import{u as L,aN as M,aO as q,p as z,aP as V,aQ as G,x as Q,S as b,D as _,i as $,B as l,aR as J,k as K,l as W,m as X,n as Y,I as Z,o as ee,P as se,T as ae,v as i}from"./index-BA3y7HJs.js";import{u as ie}from"./useAdminResolver-Bljb4XGQ.js";import{T as te,a as ne,b as y,c as p,d as re,e as j}from"./table-Dk7eeOt2.js";import{P as oe,a as le,b as de}from"./popover-BFw_h3j6.js";import{C as ce,a as me,b as ue,c as he,d as xe,e as pe}from"./command-CdzYw11U.js";import{S as je,a as ve,b as ge,c as fe,d as A}from"./select-dX9e6VDt.js";import{u as be}from"./usePageTitle-DYvuJQp6.js";import"./radix-C5ZmWuuL.js";function De(){const{host:d}=H(),{user:C}=L(),N=M(),{data:S,isLoading:I}=q(d),{data:T}=z(),c=V(d),m=G(d),n=S?.admins??[],E=T?.items??[],r=N==="admin",v=n.map(s=>s.id),{resolve:w}=ie(v),[P,g]=x.useState(!1),[D,f]=x.useState(!1),[u,h]=x.useState(""),R=Q();if(be({title:"Admins"}),I)return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"h-8 w-64"}),Array.from({length:3}).map((s,a)=>e.jsx(b,{className:"h-12 w-full"},a))]});const O=E.filter(s=>!v.includes(s.sub));async function U(s){try{await c.mutateAsync({admins:[...n,{id:s,role:"editor"}]}),i.success("Admin added"),g(!1)}catch(a){i.error("Failed to add admin",{description:a instanceof Error?a.message:void 0})}}async function F(s){if(s.preventDefault(),!!u.trim())try{const a=await m.mutateAsync({email:u.trim()});a.existed?i.success("Existing user added to site"):i.success("Invite email sent",{description:`An invite has been sent to ${a.email}`}),h(""),f(!1)}catch(a){i.error("Failed to invite user",{description:a instanceof Error?a.message:void 0})}}async function k(s){try{await c.mutateAsync({admins:n.filter(a=>a.id!==s)}),i.success("Admin removed")}catch(a){i.error("Failed to remove admin",{description:a instanceof Error?a.message:void 0})}}async function B(s,a){const o=n.map(t=>t.id===s?{...t,role:a}:t);if(!o.some(t=>t.role==="admin")){i.error("At least one admin role is required");return}try{await c.mutateAsync({admins:o}),i.success("Role updated")}catch(t){i.error("Failed to update role",{description:t instanceof Error?t.message:void 0})}}return e.jsxs("div",{children:[!R&&e.jsx("h1",{className:"mb-6 text-2xl font-semibold",children:"Admins"}),r&&e.jsxs("div",{className:"mb-6 flex gap-2",children:[e.jsxs(_,{open:D,onOpenChange:s=>{f(s),s||h("")},children:[e.jsx($,{asChild:!0,children:e.jsxs(l,{children:[e.jsx(J,{className:"mr-2 h-4 w-4"}),"Invite by email"]})}),e.jsxs(K,{children:[e.jsxs(W,{children:[e.jsx(X,{children:"Invite User to Site"}),e.jsx(Y,{className:"sr-only",children:"Send an invite email to add a user to this site"})]}),e.jsxs("form",{onSubmit:F,className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Enter an email address. If the user doesn't have an account yet, they'll receive an invite email."}),e.jsx(Z,{type:"email",value:u,onChange:s=>h(s.target.value),placeholder:"email@example.com",required:!0}),e.jsx(ee,{children:e.jsx(l,{type:"submit",disabled:m.isPending,children:m.isPending?"Inviting...":"Send Invite"})})]})]})]}),e.jsxs(oe,{open:P,onOpenChange:g,children:[e.jsx(le,{asChild:!0,children:e.jsxs(l,{variant:"outline",children:[e.jsx(se,{className:"mr-2 h-4 w-4"}),"Add existing user"]})}),e.jsx(de,{className:"w-72 p-0",align:"start",children:e.jsxs(ce,{children:[e.jsx(me,{placeholder:"Search users..."}),e.jsxs(ue,{children:[e.jsx(he,{children:"No users found."}),e.jsx(xe,{children:O.map(s=>e.jsx(pe,{value:s.email,onSelect:()=>U(s.sub),children:s.email},s.sub))})]})]})})]})]}),n.length===0?e.jsx("p",{className:"text-muted-foreground",children:"No admins configured."}):e.jsxs(te,{children:[e.jsx(ne,{children:e.jsxs(y,{children:[e.jsx(p,{children:"Email"}),e.jsx(p,{children:"Role"}),r&&e.jsx(p,{})]})}),e.jsx(re,{children:n.map(s=>{const a=s.id===C?.sub;return e.jsxs(y,{children:[e.jsxs(j,{className:"text-sm",children:[w(s.id),a&&e.jsx("span",{className:"ml-2 text-muted-foreground",children:"(you)"})]}),e.jsx(j,{children:r&&!a?e.jsxs(je,{value:s.role,onValueChange:o=>B(s.id,o),children:[e.jsx(ve,{className:"w-28",children:e.jsx(ge,{})}),e.jsxs(fe,{children:[e.jsx(A,{value:"admin",children:"Admin"}),e.jsx(A,{value:"editor",children:"Editor"})]})]}):e.jsx("span",{className:"text-sm capitalize",children:s.role})}),r&&e.jsx(j,{className:"text-right",children:!a&&e.jsx(l,{variant:"ghost",size:"sm",onClick:()=>k(s.id),title:"Remove from site",children:e.jsx(ae,{className:"h-4 w-4"})})})]},s.id)})})]})]})}export{De as AdminsPage};
@@ -0,0 +1 @@
1
+ import{j as s}from"./tanstack-Bs3zYPPV.js";import{u as H,f as F,m as V,r as j}from"./react-vendor-C2CvUxFh.js";import{u as _,a as q,b as G,c as J}from"./useContent-CW0tm0FY.js";import{m as U}from"./media-url-DIg_vSyf.js";import{w as K,x as O,v as u,S as Q,j as g,y as W}from"./index-BA3y7HJs.js";import{u as X}from"./usePageTitle-DYvuJQp6.js";import{C as Y,c as Z}from"./card-CZTHR2Qa.js";import{C as b}from"./checkbox-DEgzM8H9.js";import{T as ee,a as se,b as T,c as h,d as te,e as m}from"./table-Dk7eeOt2.js";import{f as B}from"./format-C88SDH8g.js";import{B as ne}from"./BulkActionBar--35xjnOP.js";import{P as ae}from"./Pagination-CuHwUPHi.js";import"./radix-C5ZmWuuL.js";import"./select-dX9e6VDt.js";function be(){const{host:i}=H(),P=F(),{collections:R}=K(),w=O();X({title:"Recent"});const[x,d]=V(),r=Number(x.get("page"))||1,N=Number(x.get("perPage"))||20,S=j.useMemo(()=>{const e=x.get("after")||"";return e?e.split(","):[]},[x]),[a,c]=j.useState(new Set),p=j.useCallback(()=>{d(e=>{const n=new URLSearchParams(e);return n.delete("page"),n.delete("perPage"),n.delete("after"),n},{replace:!0}),c(new Set)},[d]),L=r>1?S[r-2]:void 0,{data:o,isLoading:D}=_(i,L,N),v=q(i),C=G(i),k=J(i),I=new Map(R.map(e=>[e.name,e.label])),f=o?.items.map(e=>e.contentId)??[],y=f.length>0&&f.every(e=>a.has(e));function A(e){c(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})}function M(){c(y?new Set:new Set(f))}const z=v.isPending||C.isPending||k.isPending;function $(e){d(n=>{const t=new URLSearchParams(n);return e===1?t.delete("page"):t.set("page",String(e)),t},{replace:!0})}function E(e){d(n=>{const t=new URLSearchParams(n);return t.delete("page"),t.delete("after"),e===20?t.delete("perPage"):t.set("perPage",String(e)),t},{replace:!0}),c(new Set)}return s.jsxs("div",{children:[!w&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h1",{className:"text-2xl font-semibold",children:"All Content"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Recently updated content across all collections."})]}),a.size>0&&s.jsx(ne,{selectedCount:a.size,onPublish:async()=>{const e=[...a],t=(await v.mutateAsync(e)).filter(l=>l.status==="rejected").length;t?u.error(`${t} of ${e.length} failed to publish`):u.success(`${e.length} item(s) published`),p()},onUnpublish:async()=>{const e=[...a],t=(await C.mutateAsync(e)).filter(l=>l.status==="rejected").length;t?u.error(`${t} of ${e.length} failed to unpublish`):u.success(`${e.length} item(s) unpublished`),p()},onDelete:async()=>{const e=[...a],t=(await k.mutateAsync(e)).filter(l=>l.status==="rejected").length;t?u.error(`${t} of ${e.length} failed to delete`):u.success(`${e.length} item(s) deleted`),p()},onClear:()=>c(new Set),isPending:z}),D?s.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((e,n)=>s.jsx(Q,{className:"h-12 w-full"},n))}):o?.items.length?s.jsxs(s.Fragment,{children:[w?s.jsx("div",{className:"grid gap-3","data-testid":"all-content-card-view",children:o.items.map(e=>{const n=e.cover;return s.jsx(Y,{className:W("cursor-pointer gap-0 overflow-hidden py-0 transition-shadow hover:shadow-md",a.has(e.contentId)&&"ring-2 ring-primary"),onClick:()=>P(`/sites/${i}/content/${e.collection}/${e.contentId}?from=recent`),children:s.jsx(Z,{className:"p-3",children:s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n?.url&&s.jsx("img",{src:U(n.url),alt:n.alt??"",className:"h-12 w-12 rounded object-cover flex-shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"font-medium truncate",children:e.title||"Untitled"}),s.jsx(g,{variant:e.publishedAt?"default":"secondary",className:"shrink-0",children:e.publishedAt?"Published":"Draft"})]}),e.slug&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:["/",e.slug]}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx(g,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:I.get(e.collection)??e.collection}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e.publishedAt?B(e.publishedAt):"—"})]})]}),s.jsx(b,{checked:a.has(e.contentId),onCheckedChange:()=>A(e.contentId),onClick:t=>t.stopPropagation(),className:"mt-1"})]})})},e.contentId)})}):s.jsxs(ee,{children:[s.jsx(se,{children:s.jsxs(T,{children:[s.jsx(h,{className:"w-10",children:s.jsx(b,{checked:y,onCheckedChange:M,"aria-label":"Select all"})}),s.jsx(h,{children:"Title"}),s.jsx(h,{children:"Slug"}),s.jsx(h,{children:"Collection"}),s.jsx(h,{children:"Status"}),s.jsx(h,{children:"Updated"})]})}),s.jsx(te,{children:o.items.map(e=>s.jsxs(T,{className:"cursor-pointer",onClick:()=>P(`/sites/${i}/content/${e.collection}/${e.contentId}?from=recent`),children:[s.jsx(m,{onClick:n=>n.stopPropagation(),children:s.jsx(b,{checked:a.has(e.contentId),onCheckedChange:()=>A(e.contentId),"aria-label":`Select ${e.title||"Untitled"}`})}),s.jsx(m,{className:"font-medium",children:s.jsxs("div",{className:"flex items-center gap-3",children:[(()=>{const n=e.cover;return n?.url?s.jsx("img",{src:U(n.url),alt:n.alt??"",className:"h-8 w-8 rounded object-cover flex-shrink-0"}):null})(),s.jsx("span",{children:e.title||"Untitled"})]})}),s.jsx(m,{className:"text-muted-foreground text-sm",children:e.slug||"—"}),s.jsx(m,{children:s.jsx(g,{variant:"outline",children:I.get(e.collection)??e.collection})}),s.jsx(m,{children:s.jsx(g,{variant:e.publishedAt?"default":"secondary",children:e.publishedAt?"Published":"Draft"})}),s.jsx(m,{className:"text-muted-foreground",children:e.publishedAt?B(e.publishedAt):"—"})]},e.contentId))})]}),s.jsx(ae,{page:r,hasNext:!!o?.hasMore,hasPrevious:r>1,onNext:()=>{if(o?.items.length){const e=o.items[o.items.length-1].contentId,n=[...S.slice(0,r-1),e];d(t=>{const l=new URLSearchParams(t);return l.set("page",String(r+1)),l.set("after",n.join(",")),l},{replace:!0})}else $(r+1);c(new Set)},onPrevious:()=>{const e=r-1;e<=1?d(n=>{const t=new URLSearchParams(n);return t.delete("page"),t.delete("after"),t},{replace:!0}):$(e),c(new Set)},perPage:N,onPerPageChange:E})]}):s.jsx("p",{className:"text-muted-foreground",children:"No content yet."})]})}export{be as AllContentPage};
@@ -1 +1 @@
1
- import{u as E,a as A,b as K,j as e}from"./tanstack-Bs3zYPPV.js";import{u as O,r as m}from"./react-vendor-C2CvUxFh.js";import{e as f,x as G,B as i,P as g,S as Q,T as R,D,k as I,l as w,m as P,n as T,I as k,af as $,o as p,L as z,v as x}from"./index-Cir9tY_P.js";import{T as B,a as H,b as C,c as d,d as M,e as u}from"./table-DLoIbCQ5.js";import{f as N}from"./format-C88SDH8g.js";import{u as U}from"./usePageTitle-BNSba9_L.js";import"./radix-C1kb_NqW.js";function J(s){const t=f();return E({queryKey:["sites",s,"api-keys"],queryFn:async()=>({items:(await t.apiFetch(`/v1/admin/sites/${s}/api-keys`)).keys}),enabled:!!s})}function Y(s){const t=f(),n=A();return K({mutationFn:l=>t.apiFetch(`/v1/admin/sites/${s}/api-keys`,{method:"POST",body:JSON.stringify(l)}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",s,"api-keys"]})})}function _(s,t){const n=f(),l=A();return K({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${s}/api-keys/${t}`,{method:"DELETE"}),onSuccess:()=>l.invalidateQueries({queryKey:["sites",s,"api-keys"]})})}function ne(){const{host:s}=O(),{data:t,isLoading:n}=J(s),l=Y(s),[h,r]=m.useState(!1),[b,y]=m.useState(""),[o,j]=m.useState(null),[F,v]=m.useState(null),S=G();U({title:"API Keys",actions:e.jsx(i,{size:"sm",onClick:()=>r(!0),children:e.jsx(g,{className:"h-4 w-4"})})});async function L(a){a.preventDefault();try{const c=await l.mutateAsync({label:b});j(c.key),y("")}catch(c){x.error("Failed to create API key",{description:c instanceof Error?c.message:void 0})}}function q(){o&&(navigator.clipboard.writeText(o),x.success("Copied to clipboard"))}return e.jsxs("div",{children:[!S&&e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"API Keys"}),e.jsxs(i,{onClick:()=>r(!0),children:[e.jsx(g,{className:"mr-2 h-4 w-4"}),"Generate Key"]})]}),n?e.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((a,c)=>e.jsx(Q,{className:"h-12 w-full"},c))}):t?.items.length?e.jsxs(B,{children:[e.jsx(H,{children:e.jsxs(C,{children:[e.jsx(d,{children:"Label"}),e.jsx(d,{children:"Key ID"}),e.jsx(d,{children:"Created"}),e.jsx(d,{children:"Last Used"}),e.jsx(d,{})]})}),e.jsx(M,{children:t.items.map(a=>e.jsxs(C,{children:[e.jsx(u,{className:"font-medium",children:a.label}),e.jsx(u,{className:"font-mono text-xs",children:a.keyId}),e.jsx(u,{className:"text-muted-foreground",children:N(a.createdAt)}),e.jsx(u,{className:"text-muted-foreground",children:a.lastUsedAt?N(a.lastUsedAt):"Never"}),e.jsx(u,{children:e.jsx(i,{variant:"ghost",size:"sm",onClick:()=>v(a.keyId),children:e.jsx(R,{className:"h-4 w-4"})})})]},a.keyId))})]}):e.jsx("p",{className:"text-muted-foreground",children:"No API keys."}),e.jsx(D,{open:h,onOpenChange:a=>{r(a),a||(j(null),y(""))},children:e.jsxs(I,{children:[e.jsxs(w,{children:[e.jsx(P,{children:o?"API Key Generated":"Generate API Key"}),e.jsx(T,{className:"sr-only",children:"Create a new API key for site access"})]}),o?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy this key now. You won't be able to see it again."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{value:o,readOnly:!0,className:"font-mono text-xs"}),e.jsx(i,{variant:"outline",size:"icon",onClick:q,children:e.jsx($,{className:"h-4 w-4"})})]}),e.jsx(p,{children:e.jsx(i,{onClick:()=>{r(!1),j(null)},children:"Done"})})]}):e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{htmlFor:"key-label",children:"Label"}),e.jsx(k,{id:"key-label",value:b,onChange:a=>y(a.target.value),required:!0,autoFocus:!0})]}),e.jsxs(p,{children:[e.jsx(i,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(i,{type:"submit",disabled:l.isPending,children:"Generate"})]})]})]})}),e.jsx(V,{host:s,keyId:F,onClose:()=>v(null)})]})}function V({host:s,keyId:t,onClose:n}){const l=_(s,t??"");async function h(){try{await l.mutateAsync(),x.success("API key revoked"),n()}catch(r){x.error("Failed to revoke",{description:r instanceof Error?r.message:void 0})}}return e.jsx(D,{open:!!t,onOpenChange:()=>n(),children:e.jsxs(I,{children:[e.jsxs(w,{children:[e.jsx(P,{children:"Revoke API key?"}),e.jsx(T,{children:"This action cannot be undone. Any applications using this key will lose access."})]}),e.jsxs(p,{children:[e.jsx(i,{variant:"outline",onClick:n,children:"Cancel"}),e.jsx(i,{variant:"destructive",onClick:h,children:"Revoke"})]})]})})}export{ne as ApiKeysPage};
1
+ import{u as E,a as A,b as K,j as e}from"./tanstack-Bs3zYPPV.js";import{u as O,r as m}from"./react-vendor-C2CvUxFh.js";import{e as f,x as G,B as i,P as g,S as Q,T as R,D,k as I,l as w,m as P,n as T,I as k,ak as $,o as p,L as z,v as x}from"./index-BA3y7HJs.js";import{T as B,a as H,b as C,c as d,d as M,e as u}from"./table-Dk7eeOt2.js";import{f as N}from"./format-C88SDH8g.js";import{u as U}from"./usePageTitle-DYvuJQp6.js";import"./radix-C5ZmWuuL.js";function J(s){const t=f();return E({queryKey:["sites",s,"api-keys"],queryFn:async()=>({items:(await t.apiFetch(`/v1/admin/sites/${s}/api-keys`)).keys}),enabled:!!s})}function Y(s){const t=f(),n=A();return K({mutationFn:l=>t.apiFetch(`/v1/admin/sites/${s}/api-keys`,{method:"POST",body:JSON.stringify(l)}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",s,"api-keys"]})})}function _(s,t){const n=f(),l=A();return K({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${s}/api-keys/${t}`,{method:"DELETE"}),onSuccess:()=>l.invalidateQueries({queryKey:["sites",s,"api-keys"]})})}function ne(){const{host:s}=O(),{data:t,isLoading:n}=J(s),l=Y(s),[h,r]=m.useState(!1),[b,y]=m.useState(""),[o,j]=m.useState(null),[F,v]=m.useState(null),S=G();U({title:"API Keys",actions:e.jsx(i,{size:"sm",onClick:()=>r(!0),children:e.jsx(g,{className:"h-4 w-4"})})});async function L(a){a.preventDefault();try{const c=await l.mutateAsync({label:b});j(c.key),y("")}catch(c){x.error("Failed to create API key",{description:c instanceof Error?c.message:void 0})}}function q(){o&&(navigator.clipboard.writeText(o),x.success("Copied to clipboard"))}return e.jsxs("div",{children:[!S&&e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"API Keys"}),e.jsxs(i,{onClick:()=>r(!0),children:[e.jsx(g,{className:"mr-2 h-4 w-4"}),"Generate Key"]})]}),n?e.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((a,c)=>e.jsx(Q,{className:"h-12 w-full"},c))}):t?.items.length?e.jsxs(B,{children:[e.jsx(H,{children:e.jsxs(C,{children:[e.jsx(d,{children:"Label"}),e.jsx(d,{children:"Key ID"}),e.jsx(d,{children:"Created"}),e.jsx(d,{children:"Last Used"}),e.jsx(d,{})]})}),e.jsx(M,{children:t.items.map(a=>e.jsxs(C,{children:[e.jsx(u,{className:"font-medium",children:a.label}),e.jsx(u,{className:"font-mono text-xs",children:a.keyId}),e.jsx(u,{className:"text-muted-foreground",children:N(a.createdAt)}),e.jsx(u,{className:"text-muted-foreground",children:a.lastUsedAt?N(a.lastUsedAt):"Never"}),e.jsx(u,{children:e.jsx(i,{variant:"ghost",size:"sm",onClick:()=>v(a.keyId),children:e.jsx(R,{className:"h-4 w-4"})})})]},a.keyId))})]}):e.jsx("p",{className:"text-muted-foreground",children:"No API keys."}),e.jsx(D,{open:h,onOpenChange:a=>{r(a),a||(j(null),y(""))},children:e.jsxs(I,{children:[e.jsxs(w,{children:[e.jsx(P,{children:o?"API Key Generated":"Generate API Key"}),e.jsx(T,{className:"sr-only",children:"Create a new API key for site access"})]}),o?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy this key now. You won't be able to see it again."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{value:o,readOnly:!0,className:"font-mono text-xs"}),e.jsx(i,{variant:"outline",size:"icon",onClick:q,children:e.jsx($,{className:"h-4 w-4"})})]}),e.jsx(p,{children:e.jsx(i,{onClick:()=>{r(!1),j(null)},children:"Done"})})]}):e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{htmlFor:"key-label",children:"Label"}),e.jsx(k,{id:"key-label",value:b,onChange:a=>y(a.target.value),required:!0,autoFocus:!0})]}),e.jsxs(p,{children:[e.jsx(i,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(i,{type:"submit",disabled:l.isPending,children:"Generate"})]})]})]})}),e.jsx(V,{host:s,keyId:F,onClose:()=>v(null)})]})}function V({host:s,keyId:t,onClose:n}){const l=_(s,t??"");async function h(){try{await l.mutateAsync(),x.success("API key revoked"),n()}catch(r){x.error("Failed to revoke",{description:r instanceof Error?r.message:void 0})}}return e.jsx(D,{open:!!t,onOpenChange:()=>n(),children:e.jsxs(I,{children:[e.jsxs(w,{children:[e.jsx(P,{children:"Revoke API key?"}),e.jsx(T,{children:"This action cannot be undone. Any applications using this key will lose access."})]}),e.jsxs(p,{children:[e.jsx(i,{variant:"outline",onClick:n,children:"Cancel"}),e.jsx(i,{variant:"destructive",onClick:h,children:"Revoke"})]})]})})}export{ne as ApiKeysPage};
@@ -0,0 +1 @@
1
+ import{u as q,j as e}from"./tanstack-Bs3zYPPV.js";import{L as $,r as u,u as H,m as z}from"./react-vendor-C2CvUxFh.js";import{e as J,J as X,K as G,M as Q,N as Y,B as Z,ay as ee,S as N,x as te,aS as se,aR as A,aT as ae,aU as le,aV as re,aW as ne,aX as oe,aY as de,aZ as ce,a_ as ie,aq as _,a$ as ue,T as x,a3 as m,aM as me,P as T,b0 as D,an as he,b1 as be,b2 as pe,b3 as xe,a8 as fe,b4 as ge,b5 as je}from"./index-BA3y7HJs.js";import{u as ke}from"./useAdminResolver-Bljb4XGQ.js";import{s as L,T as Ie}from"./serializeToText-Zin3gYPm.js";import{h as R}from"./useContent-CW0tm0FY.js";import{f as B,a as ye}from"./format-C88SDH8g.js";import{S as we,a as Ce,b as Ne,c as Se,d as Pe}from"./select-dX9e6VDt.js";import{T as ve,a as Ue,b as M,c as I,d as Ae,e as y}from"./table-Dk7eeOt2.js";import{u as _e}from"./usePageTitle-DYvuJQp6.js";import{P as Te}from"./Pagination-CuHwUPHi.js";import"./radix-C5ZmWuuL.js";function De(s,l){const r=J(),n=new URLSearchParams;l?.action&&n.set("action",l.action),l?.before&&n.set("before",String(l.before)),n.set("limit",String(l.limit));const c=n.toString();return q({queryKey:["sites",s,"audit",l?.action??"",l?.before??"",l?.limit??""],queryFn:()=>r.apiFetch(`/v1/admin/sites/${s}/audit${c?`?${c}`:""}`),enabled:!!s})}const Le={"content.create":"Content Created","content.update":"Content Updated","content.publish":"Content Published","content.unpublish":"Content Unpublished","content.delete":"Content Deleted","content.schedule":"Content Scheduled","content.unschedule":"Content Unscheduled","content.update_publish_date":"Publish Date Changed","content.discard":"Draft Discarded","media.create":"Media Uploaded","media.update":"Media Updated","media.delete":"Media Deleted","media.bulk":"Bulk Media Operation","media.folder.create":"Folder Created","media.folder.update":"Folder Renamed","media.folder.delete":"Folder Deleted","collection.create":"Collection Created","collection.update":"Collection Updated","collection.delete":"Collection Deleted","blocktype.create":"Block Type Created","blocktype.update":"Block Type Updated","blocktype.delete":"Block Type Deleted","webhook.create":"Webhook Created","webhook.update":"Webhook Updated","webhook.delete":"Webhook Deleted","webhook.rotate_secret":"Webhook Secret Rotated","webhook.retry_delivery":"Delivery Retried","apikey.create":"API Key Created","apikey.revoke":"API Key Revoked","site.archived":"Site Archived","site.unarchived":"Site Unarchived","site.purged":"Site Purged","site_user.create":"User Created","site_user.update":"User Updated","site_user.delete":"User Deleted","site_user.change_email":"User Email Changed","site_user.self_register":"User Self-Registered","site_user.self_update":"User Updated Profile"};function Re(s){return!!s?.blockId&&!!s?.prevBlockId&&!!s?.resourceId}function Me({host:s,details:l}){const r=l.resourceId,n=l.collection??"",{data:c}=ee(s,n),{data:a,isLoading:f}=R(s,r,l.blockId??null),{data:i,isLoading:h}=R(s,r,l.prevBlockId??null),b=u.useMemo(()=>c?.fields??[],[c?.fields]),w=u.useMemo(()=>{if(!a)return[];const g={title:a.title,slug:a.slug,snippet:a.snippet,tags:a.tags};return L(b,a.body??{},g)},[a,b]),C=u.useMemo(()=>{if(!i)return[];const g={title:i.title,slug:i.slug,snippet:i.snippet,tags:i.tags};return L(b,i.body??{},g)},[i,b]);return f||h?e.jsxs("div",{className:"space-y-2","data-testid":"diff-loading",children:[e.jsx(N,{className:"h-6 w-24"}),e.jsx(N,{className:"h-40 w-full"})]}):!a||!i?e.jsx("p",{className:"text-muted-foreground text-sm","data-testid":"diff-unavailable",children:"Version data unavailable."}):e.jsxs("div",{"data-testid":"diff-view",children:[e.jsx("h3",{className:"mb-2 text-sm font-medium",children:"Changes"}),e.jsx(Ie,{left:C,right:w,leftLabel:"Before",rightLabel:"After"})]})}function $e({open:s,onOpenChange:l,event:r,host:n,resolveAdmin:c}){if(!r)return null;const a=r.details,f=Le[r.action]??r.action,i=Re(a),h=a?.resourceType==="content"&&a?.resourceId&&a?.collection?`/sites/${n}/content/${a.collection}/${a.resourceId}`:null;return e.jsx(X,{open:s,onOpenChange:l,children:e.jsxs(G,{className:"w-full overflow-y-auto px-6 sm:max-w-lg","data-testid":"audit-drawer",children:[e.jsx(Q,{children:e.jsx(Y,{children:f})}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[a?.title&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Resource"}),e.jsx("dd",{className:"font-medium","data-testid":"drawer-resource",children:a.title})]}),a?.collection&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Collection"}),e.jsx("dd",{children:a.collection})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Admin"}),e.jsx("dd",{children:c(r.adminId)}),e.jsx("dt",{className:"text-muted-foreground",children:"Time"}),e.jsx("dd",{children:B(r.createdAt)}),e.jsx("dt",{className:"text-muted-foreground",children:"Status"}),e.jsx("dd",{children:e.jsx("span",{className:r.status==="success"?"text-green-600":r.status==="failed"?"text-red-600":"text-yellow-600",children:r.status})}),a?.ipAddress&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"IP Address"}),e.jsx("dd",{className:"font-mono text-xs",children:a.ipAddress})]}),a?.extra&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Details"}),e.jsx("dd",{className:"text-muted-foreground",children:a.extra})]})]}),a&&e.jsxs("details",{className:"text-sm","data-testid":"drawer-json",children:[e.jsx("summary",{className:"text-muted-foreground cursor-pointer select-none",children:"Raw details"}),e.jsx("pre",{className:"bg-muted mt-2 overflow-x-auto rounded p-3 text-xs",children:JSON.stringify(a,null,2)})]}),r.errorMsg&&e.jsx("div",{className:"rounded border border-red-200 bg-red-50 p-3 text-sm text-red-800 dark:border-red-900 dark:bg-red-950 dark:text-red-300","data-testid":"drawer-error",children:r.errorMsg}),h&&e.jsx(Z,{variant:"outline",size:"sm",asChild:!0,children:e.jsx($,{to:h,children:"View content"})}),i&&a&&e.jsx("div",{className:"border-t pt-4",children:e.jsx(Me,{host:n,details:a})}),!i&&a?.resourceType==="content"&&e.jsx("p",{className:"text-muted-foreground text-sm","data-testid":"no-changes",children:"No change comparison available for this event."})]})]})})}const Be={"content.create":{label:"Created content",Icon:T},"content.update":{label:"Updated content",Icon:m},"content.publish":{label:"Published content",Icon:je},"content.unpublish":{label:"Unpublished content",Icon:ge},"content.delete":{label:"Deleted content",Icon:x},"content.schedule":{label:"Scheduled content",Icon:fe},"content.unschedule":{label:"Unscheduled content",Icon:xe},"content.update_publish_date":{label:"Changed publish date",Icon:pe},"content.discard":{label:"Discarded draft",Icon:be},"media.create":{label:"Uploaded media",Icon:he},"media.update":{label:"Updated media",Icon:m},"media.delete":{label:"Deleted media",Icon:x},"media.bulk":{label:"Bulk media operation",Icon:_},"media.folder.create":{label:"Created folder",Icon:D},"media.folder.update":{label:"Renamed folder",Icon:m},"media.folder.delete":{label:"Deleted folder",Icon:x},"collection.create":{label:"Created collection",Icon:D},"collection.update":{label:"Updated collection",Icon:m},"collection.delete":{label:"Deleted collection",Icon:x},"blocktype.create":{label:"Created block type",Icon:T},"blocktype.update":{label:"Updated block type",Icon:m},"blocktype.delete":{label:"Deleted block type",Icon:x},"webhook.create":{label:"Created webhook",Icon:me},"webhook.update":{label:"Updated webhook",Icon:m},"webhook.delete":{label:"Deleted webhook",Icon:x},"webhook.rotate_secret":{label:"Rotated webhook secret",Icon:ue},"webhook.retry_delivery":{label:"Retried delivery",Icon:_},"apikey.create":{label:"Created API key",Icon:ie},"apikey.revoke":{label:"Revoked API key",Icon:ce},"site.archived":{label:"Archived site",Icon:de},"site.unarchived":{label:"Unarchived site",Icon:oe},"site.purged":{label:"Purged site",Icon:ne},"site_user.create":{label:"Created user",Icon:A},"site_user.update":{label:"Updated user",Icon:re},"site_user.delete":{label:"Deleted user",Icon:le},"site_user.change_email":{label:"Changed user email",Icon:ae},"site_user.self_register":{label:"User registered",Icon:A},"site_user.self_update":{label:"User updated profile",Icon:se}},Fe=[{label:"All",value:"all"},{label:"Content",value:"content."},{label:"Media",value:"media."},{label:"Collections",value:"collection."},{label:"Block Types",value:"blocktype."},{label:"Webhooks",value:"webhook."},{label:"API Keys",value:"apikey."},{label:"Sites",value:"site."},{label:"Site Users",value:"site_user."}];function Ee(s){return Be[s]??{label:s,Icon:m}}function Oe(s,l){const r=l.resourceType??l.details?.resourceType,n=l.resourceId??l.details?.resourceId;if(!r||!n)return null;switch(r){case"content":{const c=l.details?.collection;return c?`/sites/${s}/content/${c}/${n}`:`/sites/${s}/content`}case"media":return`/sites/${s}/media`;case"collection":return`/sites/${s}/settings/collections`;case"webhook":return`/sites/${s}/settings/webhooks`;case"site_user":return`/sites/${s}/settings/site-users/${n}`;default:return null}}function Ve({status:s}){const l=s==="success"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":s==="failed"?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400":"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400";return e.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l}`,children:s})}function tt(){const{host:s}=H(),[l,r]=z(),n=Number(l.get("page"))||1,c=Number(l.get("perPage"))||20,[a,f]=u.useState("all"),[i,h]=u.useState(null),[b,w]=u.useState(!1),C=u.useMemo(()=>{const t=l.get("before")||"";return t?t.split(","):[]},[l]),g=n>1&&Number(C[n-2])||0,{data:j,isLoading:F}=De(s,{before:g,limit:c}),E=j?.items.map(t=>t.adminId)??[],{resolve:S}=ke(E),O=te(),V=u.useCallback(t=>{h(t),w(!0)},[]);_e({title:"Audit Log"});const K=u.useCallback(()=>{r(t=>{const d=new URLSearchParams(t);return d.delete("page"),d.delete("perPage"),d.delete("before"),d},{replace:!0})},[r]),P=a!=="all"?j?.items.filter(t=>t.action.startsWith(a)):j?.items;function v(t){r(d=>{const o=new URLSearchParams(d);return t===1?o.delete("page"):o.set("page",String(t)),o},{replace:!0})}function W(t){r(d=>{const o=new URLSearchParams(d);return o.delete("page"),o.delete("before"),t===20?o.delete("perPage"):o.set("perPage",String(t)),o},{replace:!0})}return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[!O&&e.jsx("h1",{className:"text-2xl font-semibold",children:"Audit Log"}),e.jsxs(we,{value:a,onValueChange:t=>{f(t),K()},children:[e.jsx(Ce,{className:"w-[180px]","data-testid":"action-filter",children:e.jsx(Ne,{placeholder:"Filter by type"})}),e.jsx(Se,{children:Fe.map(t=>e.jsx(Pe,{value:t.value,children:t.label},t.value))})]})]}),F?e.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((t,d)=>e.jsx(N,{className:"h-12 w-full"},d))}):P?.length?e.jsxs(e.Fragment,{children:[e.jsxs(ve,{children:[e.jsx(Ue,{children:e.jsxs(M,{children:[e.jsx(I,{children:"Action"}),e.jsx(I,{children:"Resource"}),e.jsx(I,{children:"Admin"}),e.jsx(I,{children:"Status"}),e.jsx(I,{children:"Time"})]})}),e.jsx(Ae,{children:P.map(t=>{const{label:d,Icon:o}=Ee(t.action),k=t.details?.title,p=t.details?.collection,U=s?Oe(s,t):null;return e.jsxs(M,{"data-testid":"audit-row",className:"cursor-pointer",onClick:()=>V(t),children:[e.jsx(y,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{className:"text-muted-foreground h-4 w-4 shrink-0"}),e.jsx("span",{className:"font-medium",children:d})]})}),e.jsx(y,{children:k?e.jsxs("div",{className:"flex items-center gap-2",children:[U?e.jsx($,{to:U,className:"text-primary hover:underline",children:k}):e.jsx("span",{children:k}),p&&e.jsx("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-xs",children:p})]}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(y,{className:"text-sm",children:S(t.adminId)}),e.jsx(y,{children:e.jsx(Ve,{status:t.status})}),e.jsx(y,{className:"text-muted-foreground",title:B(t.createdAt),children:ye(t.createdAt)})]},t.eventId)})})]}),e.jsx(Te,{page:n,hasNext:!!j?.hasMore,hasPrevious:n>1,onNext:()=>{const t=j?.items;if(t?.length){const d=t[t.length-1].createdAt,o=[...C.slice(0,n-1),String(d)];r(k=>{const p=new URLSearchParams(k);return p.set("page",String(n+1)),p.set("before",o.join(",")),p},{replace:!0})}else v(n+1)},onPrevious:()=>{const t=n-1;t<=1?r(d=>{const o=new URLSearchParams(d);return o.delete("page"),o.delete("before"),o},{replace:!0}):v(t)},perPage:c,onPerPageChange:W})]}):e.jsx("p",{className:"text-muted-foreground",children:"No audit events."}),e.jsx($e,{open:b,onOpenChange:w,event:i,host:s,resolveAdmin:S})]})}export{tt as AuditPage};
@@ -0,0 +1 @@
1
+ .bn-block-outer{line-height:1.5;transition:margin .2s}.bn-block{flex-direction:column;display:flex}.bn-block-content{width:100%;padding:3px 0;transition:font-size .2s;display:flex}.bn-block-content.ProseMirror-selectednode>*,.ProseMirror-selectednode>.bn-block-content>*{border-radius:4px;outline:4px solid #64a0ff}.bn-block-content:before{content:"";height:0;margin-right:0;transition:all .2s;overflow:visible}.bn-inline-content{white-space:pre-wrap}.bn-block-group .bn-block-group{margin-left:24px}.bn-block-group .bn-block-group>.bn-block-outer{position:relative}.bn-block-group .bn-block-group>.bn-block-outer:not([data-prev-depth-changed]):before{content:" ";height:100%;transition:all .2s .1s;display:inline;position:absolute;left:-20px}.bn-block-group .bn-block-group>.bn-block-outer[data-prev-depth-change="-2"]:before{height:0}.bn-inline-content code{font-family:monospace}[data-prev-depth-change="1"]{--x:1}[data-prev-depth-change="2"]{--x:2}[data-prev-depth-change="3"]{--x:3}[data-prev-depth-change="4"]{--x:4}[data-prev-depth-change="5"]{--x:5}[data-prev-depth-change="-1"]{--x:-1}[data-prev-depth-change="-2"]{--x:-2}[data-prev-depth-change="-3"]{--x:-3}[data-prev-depth-change="-4"]{--x:-4}[data-prev-depth-change="-5"]{--x:-5}.bn-block-outer[data-prev-depth-change]{margin-left:calc(10px * var(--x))}.bn-block-outer[data-prev-depth-change] .bn-block-outer[data-prev-depth-change]{margin-left:0}[data-content-type=heading]{--level:3em}[data-content-type=heading][data-level="2"]{--level:2em}[data-content-type=heading][data-level="3"]{--level:1.3em}[data-content-type=heading][data-level="4"]{--level:1em}[data-content-type=heading][data-level="5"]{--level:.9em}[data-content-type=heading][data-level="6"]{--level:.8em}[data-prev-level="1"]{--prev-level:3em}[data-prev-level="2"]{--prev-level:2em}[data-prev-level="3"]{--prev-level:1.3em}[data-prev-level="4"]{--prev-level:1em}[data-prev-level="5"]{--prev-level:.9em}[data-prev-level="6"]{--prev-level:.8em}.bn-block-outer[data-prev-type=heading]>.bn-block>.bn-block-content{font-size:var(--prev-level);font-weight:700}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=heading],.bn-block-outer:not([data-prev-type])>.bn-block>div[data-type=modification]>div[data-type=modification]>.bn-block-content[data-content-type=heading]{font-size:var(--level);font-weight:700}[data-content-type=quote] blockquote{color:#7d797a;border-left:2px solid #7d797a;margin:0;padding-left:1em}[data-content-type=divider] hr{border:none;border-top:1px solid #7d797a;flex:1;margin:.5em 0}.bn-block-content:before{content:"";margin-right:0}.bn-block-content[data-content-type=numberedListItem]:before{justify-content:center;min-width:24px;padding-right:4px;display:flex}[data-content-type=numberedListItem]{--index:attr(data-index)}[data-prev-type=numberedListItem]{--prev-index:attr(data-prev-index)}.bn-block-outer[data-prev-type=numberedListItem]:not([data-prev-index=none])>.bn-block>.bn-block-content:before{content:var(--prev-index) "."}.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=numberedListItem]:before,.bn-block-outer:not([data-prev-type])>.bn-block>div[data-type=modification]>.bn-block-content[data-content-type=numberedListItem]:before{content:var(--index) "."}.bn-block-content[data-content-type=bulletListItem]:before{justify-content:center;min-width:24px;padding-right:4px;display:flex}.bn-block-content[data-content-type=checkListItem]>div:has(>input){height:24px}.bn-block-content[data-content-type=checkListItem]>div>input{cursor:pointer;margin-left:4px;margin-right:8px;width:12px;height:24px;margin-block:0}.bn-block-content[data-content-type=checkListItem][data-checked=true] .bn-inline-content{text-decoration:line-through}.bn-block-content[data-text-alignment=center]{justify-content:center}.bn-block-content[data-text-alignment=right]{justify-content:flex-end}:is(.bn-block:has(>.bn-block-content>div>.bn-toggle-wrapper[data-show-children=false])>.bn-block-group,.bn-block:has(>.react-renderer>.bn-block-content>div>.bn-toggle-wrapper[data-show-children=false])>.bn-block-group){display:none}.bn-toggle-wrapper{align-items:center;display:flex}.bn-toggle-button{color:var(--bn-colors-editor-text);padding:3px}.bn-toggle-button>svg{width:18px;height:18px}.bn-toggle-wrapper[data-show-children=true] .bn-toggle-button{transform:rotate(90deg)}.bn-toggle-add-block-button{color:var(--bn-colors-side-menu);width:fit-content;margin-left:22px;padding-inline:2px;font-size:16px;font-weight:400}.bn-toggle-button,.bn-toggle-add-block-button{border-radius:var(--bn-border-radius-small);cursor:pointer;-webkit-user-select:none;user-select:none;background:0 0;border:none;display:flex}.bn-toggle-button:hover,.bn-toggle-add-block-button:hover{background-color:var(--bn-colors-hovered-background)}.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before,.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before,.bn-block-outer:not([data-prev-type])>.bn-block>div[data-type=modification]>.bn-block-content[data-content-type=bulletListItem]:before{content:"•"}[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before,[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before,[data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>div[data-type=modification]>.bn-block-content[data-content-type=bulletListItem]:before{content:"◦"}[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer[data-prev-type=bulletListItem]>.bn-block>.bn-block-content:before,[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>.bn-block-content[data-content-type=bulletListItem]:before,[data-content-type=bulletListItem]~.bn-block-group [data-content-type=bulletListItem]~.bn-block-group>.bn-block-outer:not([data-prev-type])>.bn-block>div[data-type=modification]>.bn-block-content[data-content-type=bulletListItem]:before{content:"▪︎"}.bn-block-content[data-content-type=codeBlock]{color:#fff;background-color:#161616;border-radius:8px;position:relative}.bn-block-content[data-content-type=codeBlock]>pre{white-space:pre;tab-size:2;width:100%;margin:0;padding:24px;overflow-x:auto}.bn-block-content[data-content-type=codeBlock]>div{outline:none!important}.bn-block-content[data-content-type=codeBlock]>div>select{appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;color:#fff;opacity:0;background-color:#0000;border:none;font-size:.8em;transition:opacity .3s 1s;position:absolute;top:8px;left:18px;outline:none!important}.bn-block-content[data-content-type=codeBlock]>div>select>option{color:#000}.bn-block-content[data-content-type=codeBlock]:hover>div>select,.bn-block-content[data-content-type=codeBlock]>div>select:focus{opacity:.5;transition-delay:.1s}.bn-block-content[data-content-type=pageBreak]>div{border-top:2px dotted #7d797a;width:100%;height:0;margin-block:11px}@media print{.bn-block-content[data-content-type=pageBreak]>div{page-break-after:always}}[data-file-block] .bn-file-block-content-wrapper{cursor:pointer;-webkit-user-select:none;user-select:none;flex-direction:column;display:flex}:is([data-file-block] .bn-file-block-content-wrapper:has(.bn-add-file-button),[data-file-block] .bn-file-block-content-wrapper:has(.bn-file-name-with-icon)){width:100%}[data-file-block] .bn-add-file-button{color:#7d797a;background-color:#f2f1ee;border-radius:4px;align-items:center;gap:10px;padding:12px;display:flex}.bn-editor[contenteditable=true] [data-file-block] .bn-add-file-button:hover,[data-file-block] .bn-file-name-with-icon:hover,.ProseMirror-selectednode .bn-file-name-with-icon{background-color:#e1e1e1}[data-file-block] .bn-add-file-button-icon,[data-file-block] .bn-file-icon{width:24px;height:24px}[data-file-block] .bn-add-file-button-text{font-size:.9rem}[data-file-block] .bn-file-name-with-icon{border-radius:4px;gap:4px;padding:4px;display:flex}[data-file-block] .bn-file-caption{word-break:break-word;padding-block:4px;font-size:.8em}[data-file-block] .bn-file-caption:empty{padding-block:0}[data-file-block] .bn-resize-handle{cursor:ew-resize;background-color:#000;border:1px solid #fff;border-radius:4px;width:8px;height:30px;position:absolute}[data-file-block] .bn-visual-media-wrapper{align-items:center;max-width:100%;display:flex;position:relative}[data-file-block] .bn-visual-media{border-radius:4px;width:100%}[data-content-type=audio]>.bn-file-block-content-wrapper,.bn-audio{width:100%}.bn-block-content:has(.ProseMirror-trailingBreak:only-child):after{pointer-events:none;max-width:100%;margin-inline:-2px;font-style:italic}.bn-block:has(>.bn-block-content[data-text-color=gray]){color:#9b9a97}.bn-block:has(>.bn-block-content[data-text-color=brown]){color:#64473a}.bn-block:has(>.bn-block-content[data-text-color=red]){color:#e03e3e}.bn-block:has(>.bn-block-content[data-text-color=orange]){color:#d9730d}.bn-block:has(>.bn-block-content[data-text-color=yellow]){color:#dfab01}.bn-block:has(>.bn-block-content[data-text-color=green]){color:#4d6461}.bn-block:has(>.bn-block-content[data-text-color=blue]){color:#0b6e99}.bn-block:has(>.bn-block-content[data-text-color=purple]){color:#6940a5}.bn-block:has(>.bn-block-content[data-text-color=pink]){color:#ad1a72}.bn-block:has(>.bn-block-content[data-background-color=gray]){background-color:#ebeced}.bn-block:has(>.bn-block-content[data-background-color=brown]){background-color:#e9e5e3}.bn-block:has(>.bn-block-content[data-background-color=red]){background-color:#fbe4e4}.bn-block:has(>.bn-block-content[data-background-color=orange]){background-color:#f6e9d9}.bn-block:has(>.bn-block-content[data-background-color=yellow]){background-color:#fbf3db}.bn-block:has(>.bn-block-content[data-background-color=green]){background-color:#ddedea}.bn-block:has(>.bn-block-content[data-background-color=blue]){background-color:#ddebf1}.bn-block:has(>.bn-block-content[data-background-color=purple]){background-color:#eae4f2}.bn-block:has(>.bn-block-content[data-background-color=pink]){background-color:#f4dfeb}[data-text-alignment=left]{text-align:left!important;justify-content:flex-start!important}[data-text-alignment=center]{text-align:center!important;justify-content:center!important}[data-text-alignment=right]{text-align:right!important;justify-content:flex-end!important}[data-text-alignment=justify]{text-align:justify!important;justify-content:flex-start!important}.bn-block-column-list{flex-direction:row;display:flex}.bn-block-column{flex:1;padding:12px 20px;overflow-x:auto}.bn-block-column:first-child{padding-left:0}.bn-block-column:last-child{padding-right:0}.bn-thread-mark:not([data-orphan=true]){background:#ffc80026}.bn-thread-mark .bn-thread-mark-selected{background:#ffc80040}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror td:not([data-colwidth]):not(.column-resize-dragging),.ProseMirror th:not([data-colwidth]):not(.column-resize-dragging){min-width:var(--default-cell-min-width)}.ProseMirror .column-resize-handle{z-index:20;pointer-events:none;background-color:#adf;width:4px;position:absolute;top:0;bottom:0;right:-2px}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;content:"";pointer-events:none;background:#c8c8ff66;position:absolute;inset:0}.bn-editor{font-synthesis:style weight;--N800:#172b4d;--N40:#dfe1e6;outline:none;padding-inline:54px}.bn-comment-editor{width:100%;padding:0}.bn-comment-editor .bn-editor{padding:0}.bn-default-styles p,.bn-default-styles h1,.bn-default-styles h2,.bn-default-styles h3,.bn-default-styles h4,.bn-default-styles h5,.bn-default-styles h6,.bn-default-styles li{font-size:inherit;margin:0;padding:0;min-width:2px!important}.bn-default-styles{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,SF Pro Display,-apple-system,BlinkMacSystemFont,Open Sans,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:400}.bn-table-drop-cursor{z-index:20;pointer-events:none;background-color:#adf;position:absolute}.bn-drag-preview{opacity:.001;padding:10px;position:absolute;top:0;left:0}.bn-editor .bn-collaboration-cursor__base{position:relative}.bn-editor .bn-collaboration-cursor__base .bn-collaboration-cursor__caret{width:2px;position:absolute;top:1px;bottom:-2px;left:-1px}.bn-editor .bn-collaboration-cursor__base .bn-collaboration-cursor__label{pointer-events:none;white-space:nowrap;-webkit-user-select:none;user-select:none;color:#0000;border-radius:0 1.5px 1.5px 0;max-width:4px;max-height:5px;padding:0;font-size:12px;font-style:normal;font-weight:600;line-height:normal;transition:all .2s;position:absolute;top:-1px;left:0;overflow:hidden}.bn-editor .bn-collaboration-cursor__base[data-active] .bn-collaboration-cursor__label{color:#0d0d0d;border-radius:3px 3px 3px 0;max-width:20rem;max-height:1.1rem;padding:.1rem .3rem;transition:all .2s;top:-17px;left:0}.bn-editor [data-content-type=table] .tableWrapper{--bn-table-widget-size:22px;--bn-table-handle-size: 9px ;padding:var(--bn-table-handle-size) var(--bn-table-widget-size) var(--bn-table-widget-size) var(--bn-table-handle-size);width:100%;position:relative;overflow-y:hidden}.bn-editor [data-content-type=table] table{word-break:break-word;width:auto!important}.bn-editor [data-content-type=table] th,.bn-editor [data-content-type=table] td{border:1px solid #ddd;padding:5px 10px}.bn-editor [data-content-type=table] th{text-align:left;font-weight:700}.bn-editor [data-content-type=table] th>p,.bn-editor [data-content-type=table] td>p{min-height:1.5rem}.ProseMirror td,.ProseMirror th{min-width:auto!important}.ProseMirror td:not([colwidth]):not(.column-resize-dragging),.ProseMirror th:not([colwidth]):not(.column-resize-dragging){min-width:var(--default-cell-min-width)!important}.prosemirror-dropcursor-block{transition-property:top,bottom;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.prosemirror-dropcursor-vertical{transition-property:left,right}[data-show-selection]{background-color:highlight;padding:2px 0}.bn-root{--bn-colors-editor-text:#3f3f3f;--bn-colors-editor-background:#fff;--bn-colors-menu-text:#3f3f3f;--bn-colors-menu-background:#fff;--bn-colors-tooltip-text:#3f3f3f;--bn-colors-tooltip-background:#efefef;--bn-colors-hovered-text:#3f3f3f;--bn-colors-hovered-background:#efefef;--bn-colors-selected-text:#fff;--bn-colors-selected-background:#3f3f3f;--bn-colors-disabled-text:#afafaf;--bn-colors-disabled-background:#efefef;--bn-colors-shadow:#cfcfcf;--bn-colors-border:#efefef;--bn-colors-side-menu:#cfcfcf;--bn-colors-highlights-gray-text:#9b9a97;--bn-colors-highlights-gray-background:#ebeced;--bn-colors-highlights-brown-text:#64473a;--bn-colors-highlights-brown-background:#e9e5e3;--bn-colors-highlights-red-text:#e03e3e;--bn-colors-highlights-red-background:#fbe4e4;--bn-colors-highlights-orange-text:#d9730d;--bn-colors-highlights-orange-background:#f6e9d9;--bn-colors-highlights-yellow-text:#dfab01;--bn-colors-highlights-yellow-background:#fbf3db;--bn-colors-highlights-green-text:#4d6461;--bn-colors-highlights-green-background:#ddedea;--bn-colors-highlights-blue-text:#0b6e99;--bn-colors-highlights-blue-background:#ddebf1;--bn-colors-highlights-purple-text:#6940a5;--bn-colors-highlights-purple-background:#eae4f2;--bn-colors-highlights-pink-text:#ad1a72;--bn-colors-highlights-pink-background:#f4dfeb;--bn-font-family:"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--bn-border-radius:6px;--bn-shadow-medium:0 4px 12px var(--bn-colors-shadow);--bn-shadow-light:0 2px 6px var(--bn-colors-border);--bn-border:1px solid var(--bn-colors-border);--bn-border-radius-small:max(var(--bn-border-radius) - 2px, 1px);--bn-border-radius-medium:var(--bn-border-radius);--bn-border-radius-large:max(var(--bn-border-radius) + 2px, 1px)}.bn-root[data-color-scheme=dark]{--bn-colors-editor-text:#cfcfcf;--bn-colors-editor-background:#1f1f1f;--bn-colors-menu-text:#cfcfcf;--bn-colors-menu-background:#1f1f1f;--bn-colors-tooltip-text:#cfcfcf;--bn-colors-tooltip-background:#161616;--bn-colors-hovered-text:#cfcfcf;--bn-colors-hovered-background:#161616;--bn-colors-selected-text:#cfcfcf;--bn-colors-selected-background:#0f0f0f;--bn-colors-disabled-text:#3f3f3f;--bn-colors-disabled-background:#161616;--bn-colors-shadow:#0f0f0f;--bn-colors-border:#161616;--bn-colors-side-menu:#7f7f7f;--bn-colors-highlights-gray-text:#bebdb8;--bn-colors-highlights-gray-background:#9b9a97;--bn-colors-highlights-brown-text:#8e6552;--bn-colors-highlights-brown-background:#64473a;--bn-colors-highlights-red-text:#ec4040;--bn-colors-highlights-red-background:#be3434;--bn-colors-highlights-orange-text:#e3790d;--bn-colors-highlights-orange-background:#b7600a;--bn-colors-highlights-yellow-text:#dfab01;--bn-colors-highlights-yellow-background:#b58b00;--bn-colors-highlights-green-text:#6b8b87;--bn-colors-highlights-green-background:#4d6461;--bn-colors-highlights-blue-text:#0e87bc;--bn-colors-highlights-blue-background:#0b6e99;--bn-colors-highlights-purple-text:#8552d7;--bn-colors-highlights-purple-background:#6940a5;--bn-colors-highlights-pink-text:#da208f;--bn-colors-highlights-pink-background:#ad1a72}.bn-root{font-family:var(--bn-font-family)}.bn-editor{background-color:var(--bn-colors-editor-background);border-radius:var(--bn-border-radius-large);color:var(--bn-colors-editor-text)}.bn-react-node-view-renderer{flex-direction:column;width:100%;display:flex}.bn-block-group .bn-block:not(:has(.bn-toggle-wrapper)) .bn-block-group .bn-block-outer:not([data-prev-depth-changed]):before{border-left:1px solid var(--bn-colors-side-menu)}.bn-block-content:has(.ProseMirror-trailingBreak:only-child):after{color:var(--bn-colors-side-menu)}.bn-root .bn-color-icon{border:var(--bn-border);border-radius:var(--bn-border-radius-small);justify-content:center;align-items:center;display:flex}.bn-error-text{color:red;font-size:12px}[data-style-type=textColor][data-value=gray],[data-text-color=gray]{color:var(--bn-colors-highlights-gray-text)}[data-style-type=textColor][data-value=brown],[data-text-color=brown]{color:var(--bn-colors-highlights-brown-text)}[data-style-type=textColor][data-value=red],[data-text-color=red]{color:var(--bn-colors-highlights-red-text)}[data-style-type=textColor][data-value=orange],[data-text-color=orange]{color:var(--bn-colors-highlights-orange-text)}[data-style-type=textColor][data-value=yellow],[data-text-color=yellow]{color:var(--bn-colors-highlights-yellow-text)}[data-style-type=textColor][data-value=green],[data-text-color=green]{color:var(--bn-colors-highlights-green-text)}[data-style-type=textColor][data-value=blue],[data-text-color=blue]{color:var(--bn-colors-highlights-blue-text)}[data-style-type=textColor][data-value=purple],[data-text-color=purple]{color:var(--bn-colors-highlights-purple-text)}[data-style-type=textColor][data-value=pink],[data-text-color=pink]{color:var(--bn-colors-highlights-pink-text)}[data-style-type=backgroundColor][data-value=gray],[data-background-color=gray]{background-color:var(--bn-colors-highlights-gray-background)}[data-style-type=backgroundColor][data-value=brown],[data-background-color=brown]{background-color:var(--bn-colors-highlights-brown-background)}[data-style-type=backgroundColor][data-value=red],[data-background-color=red]{background-color:var(--bn-colors-highlights-red-background)}[data-style-type=backgroundColor][data-value=orange],[data-background-color=orange]{background-color:var(--bn-colors-highlights-orange-background)}[data-style-type=backgroundColor][data-value=yellow],[data-background-color=yellow]{background-color:var(--bn-colors-highlights-yellow-background)}[data-style-type=backgroundColor][data-value=green],[data-background-color=green]{background-color:var(--bn-colors-highlights-green-background)}[data-style-type=backgroundColor][data-value=blue],[data-background-color=blue]{background-color:var(--bn-colors-highlights-blue-background)}[data-style-type=backgroundColor][data-value=purple],[data-background-color=purple]{background-color:var(--bn-colors-highlights-purple-background)}[data-style-type=backgroundColor][data-value=pink],[data-background-color=pink]{background-color:var(--bn-colors-highlights-pink-background)}.bn-root{--bn-ui-base-z-index:0}.bn-side-menu{height:30px}.bn-side-menu[data-block-type=heading][data-level="1"]{height:78px}.bn-side-menu[data-block-type=heading][data-level="2"]{height:54px}.bn-side-menu[data-block-type=heading][data-level="3"]{height:37px}.bn-side-menu[data-block-type=file]{height:38px}.bn-side-menu[data-block-type=audio]{height:60px}.bn-side-menu[data-url=false]{height:54px}.bn-threads-sidebar{border-radius:var(--bn-border-radius-medium);flex-direction:column;gap:10px;display:flex;overflow:auto}.bn-thread-expand-prompt .mantine-Text-root,.bn-thread .bn-header-text{color:var(--bn-colors-menu-text)}.bn-threads-sidebar .bn-thread .bn-editor{background-color:#0000}.bn-threads-sidebar .bn-thread.selected{background-color:#f5f9fd;border:2px solid #c2dcf8}.dark .bn-threads-sidebar .bn-thread.selected{background-color:#20242a;border:2px solid #23405b}.bn-root em-emoji-picker{max-height:100%}.bn-shadcn svg:not([class*=size-]){width:revert;height:revert}.bn-shadcn svg{pointer-events:all}.bn-shadcn .bn-editor a{color:revert;-webkit-text-decoration:revert;text-decoration:revert}.bn-shadcn .bn-editor:focus-visible{outline:none}.bn-shadcn .bn-side-menu{justify-content:center;align-items:center;display:flex}.bn-shadcn .bn-side-menu .bn-button{height:24px;padding:0}.bn-shadcn .bn-select{max-height:var(--radix-select-content-available-height)}.bn-shadcn .bn-menu-dropdown{max-height:var(--radix-dropdown-menu-content-available-height)}.bn-shadcn .bn-color-picker-dropdown{overflow:auto}.bn-shadcn .bn-extend-button-add-remove-columns{cursor:col-resize}.bn-shadcn .bn-extend-button-add-remove-rows{cursor:row-resize}.bn-shadcn .bn-toolbar{max-width:100vw;overflow-x:auto}.bn-shadcn .bn-comment-actions-wrapper{justify-content:flex-end;display:flex}.bn-shadcn .bn-table-cell-handle{height:12px;padding:0 4px}.bn-shadcn .bn-thread .bn-resolved-text{font-size:14px;font-style:italic}.bn-shadcn .bn-combobox-error{color:var(--bn-colors-highlights-red-background);font-weight:700}