UNPKG

@techdocs/cli

Version:

Utility CLI for managing TechDocs sites in Backstage.

3 lines (2 loc) 2 kB
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[4516],{70048:(P,s,t)=>{t.d(s,{K:()=>a});var i=t(18690);function a(c){return(0,i.g)()}},99538:(P,s,t)=>{t.d(s,{T7:()=>v,TY:()=>g,tN:()=>h});var i=t(31085),a=t(6820),c=t(25862),E=t(43836),y=t(10602);const f=(0,E.tK)("entity-context"),v=n=>{const{children:e,entity:o,loading:d,error:r,refresh:l}=n,u={entity:o,loading:d,error:r,refresh:l};return(0,i.jsx)(f.Provider,{value:(0,y.B)({1:u}),children:(0,i.jsx)(c.Ig,{attributes:{...o?{entityRef:(0,a.U2)(o)}:void 0},children:e})})},m=n=>_jsx(v,{entity:n.entity,loading:!n.entity,error:void 0,refresh:void 0,children:n.children});function h(){const n=(0,E.qO)("entity-context");if(!n)throw new Error("Entity context is not available");const e=n.atVersion(1);if(!e)throw new Error("EntityContext v1 not available");if(!e.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:e.entity}}function g(){const n=(0,E.qO)("entity-context");if(!n)throw new Error("Entity context is not available");const e=n.atVersion(1);if(!e)throw new Error("EntityContext v1 not available");const{entity:o,loading:d,error:r,refresh:l}=e;return{entity:o,loading:d,error:r,refresh:l}}},54516:(P,s,t)=>{t.r(s),t.d(s,{CatalogEntityPage:()=>e});var i=t(31085),a=t(18690),c=t(99538),E=t(70048),y=t(72427),f=t(39837),v=t(29207),m=t(7341),h=t(14041),g=t(28966);const n=()=>{const{kind:o,namespace:d,name:r}=(0,E.K)(v.s),l=(0,a.Zp)(),u=(0,y.gf)(f.m),A=(0,y.gf)(m.v),{value:x,error:O,loading:R,retry:C}=(0,g.A)(()=>A.getEntityByRef({kind:o,namespace:d,name:r}),[A,o,d,r]);return(0,h.useEffect)(()=>{r||(u.post(new Error("No name provided!")),l("/"))},[u,l,O,R,x,r]),{entity:x,loading:R,error:O,refresh:C}};function e(){return(0,i.jsx)(c.T7,{...n(),children:(0,i.jsx)(a.sv,{})})}}}]);})(); //# sourceMappingURL=4516.a9b528f6.chunk.js.map