@redocly/framework 1.0.0-next.6 → 1.0.0-next.7
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/dist/bundler/build/run.js +1 -1
- package/dist/bundler/build/vite-config.js +2 -2
- package/dist/bundler/dev/dev-content-build.js +1 -0
- package/dist/bundler/dev/dev-problems.js +1 -1
- package/dist/bundler/dev/dev-reporter.js +1 -1
- package/dist/bundler/dev/routes/dev-content-build-route.js +1 -0
- package/dist/bundler/dev/routes/dev-problems-route.js +1 -1
- package/dist/bundler/dev/routes/source-sync-route.js +1 -1
- package/dist/bundler/dev/run.js +1 -1
- package/dist/bundler/dev/runtime-app.js +1 -1
- package/dist/bundler/dev/vite-chunk-url.js +1 -1
- package/dist/bundler/user-markdoc-schema.js +1 -1
- package/dist/bundler/vite-config.base.js +2 -2
- package/dist/cli/commands/build.js +1 -1
- package/dist/cli/commands/dev.js +1 -1
- package/dist/cli/commands/ingest.js +1 -1
- package/dist/cli/commands/translate.js +2 -2
- package/dist/cli/dev-console/{sweep.js → content-build.js} +1 -1
- package/dist/cli/dev-console/index.js +1 -1
- package/dist/cli/dev-console/lines.js +2 -2
- package/dist/cli/dev-console/plain.js +1 -1
- package/dist/cli/dev-console/tui.js +2 -2
- package/dist/cli/log-output/index.js +1 -1
- package/dist/cli/validate-react-pages.js +1 -1
- package/dist/client/ai-search/use-ai-search.js +1 -1
- package/dist/client/analytics-page-view.js +1 -1
- package/dist/client/app.js +3 -3
- package/dist/client/client-entry.js +1 -1
- package/dist/client/contexts.js +1 -1
- package/dist/client/dev-problems/ProblemsBar.js +61 -11
- package/dist/client/dev-problems/build-segment.js +1 -0
- package/dist/client/dev-problems/index.js +1 -1
- package/dist/client/dev-problems/use-dev-problems.js +1 -1
- package/dist/client/feedback.js +1 -1
- package/dist/client/l10n/ssr-l10n.js +1 -1
- package/dist/client/l10n/use-l10n-config.js +1 -1
- package/dist/client/products.js +1 -1
- package/dist/client/review/ReviewBar.js +50 -50
- package/dist/client/review/use-review.js +1 -1
- package/dist/client/sidebar/SidebarDataProvider.js +1 -1
- package/dist/client/sidebar/drilldown.js +1 -1
- package/dist/client/ssr.js +1 -1
- package/dist/client/telemetry/config.js +1 -1
- package/dist/client/theme-logo.js +1 -1
- package/dist/client/use-entity-revisions.js +1 -1
- package/dist/client/use-page-versions.js +1 -1
- package/dist/client/use-search.js +1 -1
- package/dist/client/webmcp/tools/shared.js +1 -1
- package/dist/client/webmcp/tools/site-tools.js +1 -1
- package/dist/client/webmcp/use-webmcp-tools.js +1 -1
- package/dist/content-layer/config.d.ts +2 -1
- package/dist/content-layer/config.js +1 -1
- package/dist/content-layer/database/invalidation.js +26 -26
- package/dist/content-layer/ingest/finalize-phase.js +1 -1
- package/dist/content-layer/ingest/git-last-modified.js +3 -3
- package/dist/content-layer/ingest/l10n-warnings.js +1 -1
- package/dist/content-layer/ingest/normalize-artifacts.js +1 -1
- package/dist/content-layer/ingest/run.js +1 -1
- package/dist/content-layer/ingest/search-sync.js +1 -1
- package/dist/content-layer/link-checker/load-view.js +1 -1
- package/dist/content-layer/link-checker/validate.js +1 -1
- package/dist/content-layer/markdown/client/markdown-text.js +1 -1
- package/dist/content-layer/markdown/constants/builtin-tags.js +1 -1
- package/dist/content-layer/markdown/constants/markdown-text-tag-set.js +1 -1
- package/dist/content-layer/markdown/constants/tag-sets.js +1 -1
- package/dist/content-layer/markdown/nodes/fence.js +1 -1
- package/dist/content-layer/markdown/nodes/heading.js +1 -1
- package/dist/content-layer/markdown/nodes/table.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/json-schema.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc-resolvers/operation-samples.js +1 -1
- package/dist/content-layer/markdown/resolve/markdoc.js +1 -1
- package/dist/content-layer/markdown/resolve/references.js +1 -1
- package/dist/content-layer/markdown/search/to-markdown.js +2 -2
- package/dist/content-layer/markdown/server/render.js +1 -1
- package/dist/content-layer/markdown/tags/variant.js +1 -1
- package/dist/content-layer/markdown/utils/parse-cache.js +1 -1
- package/dist/content-layer/materialization/static-files.js +1 -1
- package/dist/content-layer/plugins/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/template.js +2 -2
- package/dist/content-layer/plugins/internal/api-docs/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-docs.js +13 -13
- package/dist/content-layer/plugins/internal/api-docs/server/options.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/spec-download.js +1 -1
- package/dist/content-layer/plugins/internal/api-functions/server/dispatch.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/banner.js +1 -1
- package/dist/content-layer/plugins/internal/app-data/index.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/client/use-catalog-classic.js +1 -1
- package/dist/content-layer/plugins/internal/catalog-classic/index.js +1 -1
- package/dist/content-layer/plugins/internal/index.js +1 -1
- package/dist/content-layer/plugins/internal/l10n/index.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/client/template.js +1 -1
- package/dist/content-layer/plugins/internal/markdoc/index.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/ignored-routes.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/agent-card.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/audit.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/auth.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/form-page.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/site-branding.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/elicitation.js +6 -6
- package/dist/content-layer/plugins/internal/mcp/server/gateway/index.js +2 -2
- package/dist/content-layer/plugins/internal/mcp/server/mcp-server.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/authorize.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/discovery.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/server-card.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/server-info.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/pages-navigation.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/search.js +2 -2
- package/dist/content-layer/plugins/internal/mock/server/handler.js +1 -1
- package/dist/content-layer/plugins/internal/react-page/index.js +1 -1
- package/dist/content-layer/plugins/internal/scorecard-classic/index.js +1 -1
- package/dist/content-layer/plugins/internal/sidebar/bundle.js +1 -1
- package/dist/content-layer/plugins/internal/sidebar/index.js +2 -2
- package/dist/content-layer/plugins/internal/skills/index.js +1 -1
- package/dist/content-layer/plugins/project/load.js +2 -2
- package/dist/content-layer/plugins/utils/link-access.js +1 -1
- package/dist/content-layer/templates/template-set.js +1 -1
- package/dist/content-layer/versions/redirect.js +1 -1
- package/dist/content-layer/versions/resolve.js +1 -1
- package/dist/server/app.js +3 -3
- package/dist/server/ask-ai/route.js +1 -1
- package/dist/server/auth/middleware.js +1 -1
- package/dist/server/auth/request.js +1 -1
- package/dist/server/auth/routes.js +1 -1
- package/dist/server/content.js +12 -12
- package/dist/server/cors-proxy/handler.js +1 -1
- package/dist/server/feedback/route.js +1 -1
- package/dist/server/lambda-entry.js +1 -1
- package/dist/server/manifest-assets.js +4 -4
- package/dist/server/node-entry.js +1 -1
- package/dist/server/page-handlers.js +1 -1
- package/dist/server/plugin-context.js +1 -1
- package/dist/server/redirects.js +1 -1
- package/dist/server/search/route.js +1 -1
- package/dist/server/seo-tags.js +2 -2
- package/dist/server/sitemap.js +1 -1
- package/dist/server/static-files/serve.js +1 -1
- package/dist/server/telemetry/mock-server-events.js +1 -0
- package/dist/server/telemetry/redirect-event.js +1 -0
- package/dist/server/telemetry/sender.js +1 -1
- package/dist/shared/constants/content-update.js +1 -1
- package/dist/shared/constants/dev-content-build.js +1 -0
- package/dist/shared/constants/dev-problems.js +1 -1
- package/dist/shared/constants/dev-source-sync.js +1 -1
- package/dist/shared/constants/system-routes.js +1 -1
- package/dist/shared/rbac/l10n-rules.js +1 -1
- package/dist/shared/rbac/team-templates.js +1 -1
- package/dist/shared/types/search.d.ts +7 -2
- package/dist/shared/utils/l10n.js +1 -1
- package/dist/shared/utils/routes/file-path-to-route-slug.js +1 -1
- package/package.json +22 -2
- package/dist/bundler/dev/__tests__/reset-content-update-state.js +0 -1
- package/dist/bundler/dev/materialization-sweeper.js +0 -1
- package/dist/client/dev-problems/sweep-segment.js +0 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/__tests__/fake-kv.js +0 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/__tests__/secret-store-fixture.js +0 -1
- package/dist/server/__tests__/rbac-fixture.js +0 -1
- package/dist/server/__tests__/test-session.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext as t}from"../contexts.js";import{changedPageNavigation as n,filterChangedPages as r,isSamePage as i}from"./changed-pages.js";import{reviewTimeline as a}from"./timeline.js";import{useBarPosition as o}from"./use-bar-position.js";import{useReview as s}from"./use-review.js";import{createContext as c,useContext as l,useEffect as u,useRef as d,useState as f}from"react";import p,{css as m}from"styled-components";import{Button as h}from"@redocly/theme/components/Button/Button";import{breakpoints as g}from"@redocly/theme/core/utils";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTimeAgo as b}from"@redocly/theme/core/hooks";import{Spinner as x}from"@redocly/theme/icons/Spinner/Spinner";import{Link as S}from"@redocly/theme/components/Link/Link";import{linkCss as C}from"@redocly/theme/components/Markdown/styles/links";import{Segmented as w}from"@redocly/theme/components/Segmented/Segmented";import{Tag as T}from"@redocly/theme/components/Tag/Tag";import{Tooltip as E}from"@redocly/theme/components/Tooltip/Tooltip";import{ChatIcon as ee}from"@redocly/theme/icons/ChatIcon/ChatIcon";import{CheckmarkIcon as te}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{CloseIcon as D}from"@redocly/theme/icons/CloseIcon/CloseIcon";import{ChevronLeftIcon as O}from"@redocly/theme/icons/ChevronLeftIcon/ChevronLeftIcon";import{ChevronRightIcon as k}from"@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";import{DraggableIcon as ne}from"@redocly/theme/icons/DraggableIcon/DraggableIcon";import{SearchIcon as A}from"@redocly/theme/icons/SearchIcon/SearchIcon";import{TrashCanIcon as j}from"@redocly/theme/icons/TrashCanIcon/TrashCanIcon";import{WarningAltIcon as re}from"@redocly/theme/icons/WarningAltIcon/WarningAltIcon";const M=[{value:`all`,label:`All`},{value:`modified`,label:`Modified`},{value:`added`,label:`Added`},{value:`removed`,label:`Removed`}],N=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘ Enter`:`Ctrl Enter`,P={added:`Added`,modified:`Modified`,removed:`Removed`},F={APPROVED:`approved`,REQUESTED_CHANGES:`requested changes on`,COMMENTED:`commented on`},I=c(`middle`);function L({children:e,...t}){let n=l(I);return/* @__PURE__ */ v(E,{...t,placement:`top`,fallbackPlacements:[],arrowPosition:n===`middle`?`center`:n,children:e})}function R(){let n=l(t),{state:r,error:a,submitting:c,addComment:d,deleteComment:p}=s(),{barRef:m,slot:g,dragging:b,style:S,onDragStart:C}=o(),[w,T]=f(!1),[E,O]=f(!1),[k,A]=f(0);if(u(()=>{if(!w&&!E)return;let e=e=>{e.key===`Escape`&&(E?O(!1):T(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[w,E]),window.self!==window.top)return null;let j=n?.slug??`/`,M=n?.auth?.loginUrl,N=r?.signedIn?r.pullRequest:null,P=w&&N!==null,F=N?.pageComments.filter(e=>!e.replyToId&&!e.isResolved&&i(e.pageSlug,j)).length??0,R=/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(B,{children:/* @__PURE__ */ v(L,{tip:`Drag to move`,disabled:b,children:/* @__PURE__ */ v(pe,{type:`button`,"aria-label":`Drag the review bar`,onPointerDown:C,$dragging:b,children:/* @__PURE__ */ v(ne,{size:`16px`,color:`var(--icon-color-secondary)`})})})}),r===null&&!a&&/* @__PURE__ */ v(V,{children:/* @__PURE__ */ v(x,{size:`16px`,color:`var(--icon-color-secondary)`})}),r?.signedIn===!1&&M&&/* @__PURE__ */ v(h,{variant:`primary`,onClick:()=>window.location.assign(e(`${M}?redirectTo=${encodeURIComponent(n?.path??`/`)}`)),children:`Log in to review`}),r?.signedIn&&!N&&/* @__PURE__ */ v(U,{children:`No open pull request`}),N&&/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ y(B,{children:[/* @__PURE__ */ v(L,{tip:`${N.title} — open in Platform`,children:/* @__PURE__ */ y(h,{variant:`text`,to:N.url,external:!0,children:[`#`,N.number]})}),/* @__PURE__ */ v(H,{})]}),/* @__PURE__ */ v(se,{pullRequest:N,currentSlug:j,open:E,onToggle:()=>{A(m.current?.getBoundingClientRect().top??0),O(e=>!e)}}),P?/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(de,{}),/* @__PURE__ */ v(L,{tip:`Close`,children:/* @__PURE__ */ v(h,{variant:`text`,icon:/* @__PURE__ */ v(D,{color:`currentColor`}),"aria-label":`Close the review`,onClick:()=>T(!1)})})]}):/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(H,{}),/* @__PURE__ */ v(L,{tip:N.decision===`APPROVED`?`You approved`:N.decision===`REQUESTED_CHANGES`?`You requested changes`:`Comment on pages, then finish your review in Platform`,children:/* @__PURE__ */ y(h,{variant:`primary`,"aria-expanded":!1,onClick:()=>{O(!1),T(!0)},icon:N.decision===`APPROVED`?/* @__PURE__ */ v(te,{color:`currentColor`}):N.decision===`REQUESTED_CHANGES`?/* @__PURE__ */ v(D,{color:`currentColor`}):void 0,children:[`Review`,F>0&&/* @__PURE__ */ y(Oe,{"aria-label":`${F} open comments on this page`,children:[/* @__PURE__ */ v(ee,{size:`12px`,color:`currentColor`}),F]})]})})]})]}),a&&/* @__PURE__ */ v(L,{tip:a,children:/* @__PURE__ */ v(V,{role:`alert`,"aria-label":a,children:/* @__PURE__ */ v(re,{size:`16px`,color:`var(--color-error-base)`})})})]});return/* @__PURE__ */ v(I.Provider,{value:g,children:/* @__PURE__ */ y(le,{ref:m,style:S,$dragging:b,$expanded:P,"data-testid":`review-bar`,children:[P?/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(ue,{children:R}),/* @__PURE__ */ v(fe,{children:/* @__PURE__ */ v(ie,{pullRequest:N,currentSlug:j,submitting:c,onComment:e=>d({pageSlug:j,text:e}),onDelete:p})})]}):R,E&&N&&/* @__PURE__ */ v(he,{$slot:g,style:{maxHeight:`min(50vh, calc(${k}px - 2 * var(--spacing-xs)))`},children:/* @__PURE__ */ v(ce,{pages:N.changedPages??[],currentSlug:j,onOpen:()=>O(!1)})})]})})}function ie({pullRequest:e,currentSlug:t,submitting:n,onComment:r,onDelete:i}){let a=e.pageComments.filter(e=>e.isPending).length;return/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(ae,{pullRequest:e,currentSlug:t,submitting:n,onSubmit:r,onDelete:i}),/* @__PURE__ */ y(De,{children:[/* @__PURE__ */ v(q,{children:a===0?`Comments are posted when you finish your review.`:`${a} pending ${a===1?`comment`:`comments`}`}),e.url&&/* @__PURE__ */ v(L,{tip:`Approve or request changes in Platform`,children:/* @__PURE__ */ v(h,{variant:`primary`,to:`${e.url}/review?finishReview=true`,external:!0,children:`Finish review`})})]})]})}function ae({pullRequest:e,currentSlug:t,submitting:n,onSubmit:r,onDelete:o}){let[s,c]=f(``),[l,p]=f(!1),m=d(null),g=!n&&s.trim()!==``,b=a(e).filter(e=>l||e.kind===`comment`&&i(e.comment.pageSlug,t));u(()=>{m.current?.scrollTo({top:m.current.scrollHeight})},[b.length]);let x=n=>{if(i(n,t))return/* @__PURE__ */ v(X,{children:`this page`});let r=e.changedPages?.find(e=>i(e.slug,n));return/* @__PURE__ */ v(Be,{to:n,languageInsensitive:!0,children:r?.name||n})};return/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(ke,{children:/* @__PURE__ */ v(w,{size:`small`,value:l,onChange:({value:e})=>p(e),options:[{value:!1,label:`This page`},{value:!0,label:`All pages`}]})}),b.length===0?/* @__PURE__ */ v(Ae,{children:l?`No reviews or comments yet.`:`No comments on this page yet.`}):/* @__PURE__ */ v(je,{ref:m,children:b.map(e=>e.kind===`review`?/* @__PURE__ */ v(z,{author:e.review.author,createdAt:e.review.createdAt,action:/* @__PURE__ */ y(_,{children:[F[e.review.status],` `,/* @__PURE__ */ v(X,{children:`the pull request`})]}),text:e.review.comment},e.review.id):/* @__PURE__ */ v(z,{author:e.comment.author,createdAt:e.comment.createdAt,action:/* @__PURE__ */ y(_,{children:[`commented on `,x(e.comment.pageSlug)]}),text:e.comment.comment,tag:e.comment.isPending?/* @__PURE__ */ v(T,{children:`Pending`}):e.comment.isResolved&&/* @__PURE__ */ v(T,{children:`Resolved`}),aside:e.comment.isPending&&/* @__PURE__ */ v(L,{tip:`Delete pending comment`,children:/* @__PURE__ */ v(h,{variant:`text`,size:`small`,icon:/* @__PURE__ */ v(j,{color:`currentColor`}),"aria-label":`Delete pending comment`,disabled:n,onClick:()=>void o(e.comment.id)})}),children:e.replies.length>0&&/* @__PURE__ */ v(Me,{children:e.replies.map(e=>/* @__PURE__ */ v(z,{author:e.author,createdAt:e.createdAt,action:`replied`,text:e.comment},e.id))})},e.comment.id))}),/* @__PURE__ */ v(ge,{onSubmit:async e=>{e.preventDefault(),g&&await r(s.trim())&&c(``)},children:/* @__PURE__ */ y(_e,{children:[/* @__PURE__ */ v(ve,{autoFocus:!0,rows:2,placeholder:`Comment on this page`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),/* @__PURE__ */ y(ye,{children:[/* @__PURE__ */ v(q,{children:N}),/* @__PURE__ */ v(h,{type:`submit`,size:`small`,disabled:!g,children:`Comment`})]})]})})]})}function z({author:e,createdAt:t,action:n,text:r,tag:i,aside:a,children:o}){let{format:s}=b();return/* @__PURE__ */ y(Ne,{children:[e.avatarUrl?/* @__PURE__ */ v(Pe,{src:e.avatarUrl,alt:``}):/* @__PURE__ */ v(Fe,{"aria-hidden":!0,children:oe(e.name)}),/* @__PURE__ */ y(Ie,{children:[/* @__PURE__ */ y(Le,{children:[/* @__PURE__ */ v(`strong`,{children:e.name||`Someone`}),/* @__PURE__ */ v(Re,{dateTime:t,children:s(new Date(t))}),i]}),/* @__PURE__ */ v(ze,{children:n}),r&&/* @__PURE__ */ v(Ve,{children:r}),o]}),a]})}function oe(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)||`?`}function se({pullRequest:e,currentSlug:t,open:r,onToggle:i}){if(e.changedPages===null)return/* @__PURE__ */ v(L,{tip:`Platform has not compared this preview with production yet`,children:/* @__PURE__ */ v(U,{children:`…`})});if(e.changedPages.length===0)return/* @__PURE__ */ v(L,{tip:`No page content changed; navigation, styles, or config can still differ`,children:/* @__PURE__ */ v(U,{children:`No changed pages`})});let{openable:a,index:o,previous:s,next:c}=n(e.changedPages,t);return/* @__PURE__ */ y(me,{children:[/* @__PURE__ */ v(L,{tip:s?`Previous: ${s.name||s.slug}`:``,disabled:!s,children:/* @__PURE__ */ v(h,{variant:`text`,icon:/* @__PURE__ */ v(O,{color:`currentColor`}),to:s?.slug,languageInsensitive:!0,disabled:!s,"aria-label":`Previous changed page`})}),/* @__PURE__ */ v(L,{tip:`Changed pages`,disabled:r,children:/* @__PURE__ */ v(h,{variant:`text`,onClick:i,"aria-expanded":r,children:o>=0?`${o+1}/${a.length}`:`${a.length} changed`})}),/* @__PURE__ */ v(L,{tip:c?`Next: ${c.name||c.slug}`:``,disabled:!c,children:/* @__PURE__ */ v(h,{variant:`text`,icon:/* @__PURE__ */ v(k,{color:`currentColor`}),to:c?.slug,languageInsensitive:!0,disabled:!c,"aria-label":`Next changed page`})})]})}function ce({pages:e,currentSlug:t,onOpen:a}){let[o,s]=f(``),[c,l]=f(`all`),p=e.length>5,m=r(e,c,o),h=m.slice(0,500),[g,b]=f(()=>Math.max(h.findIndex(e=>i(e.slug,t)),0)),x=d(null),{openable:S,index:C}=n(e,t);return u(()=>{x.current?.querySelector(`[data-active]`)?.scrollIntoView({block:`nearest`})},[g,o,c]),/* @__PURE__ */ y(_,{children:[p&&/* @__PURE__ */ y(be,{children:[/* @__PURE__ */ y(xe,{children:[/* @__PURE__ */ v(A,{size:`16px`,color:`var(--icon-color-secondary)`}),/* @__PURE__ */ v(Se,{autoFocus:!0,"aria-label":`Search changed pages`,placeholder:`Search ${e.length} changed pages`,value:o,onChange:e=>{s(e.target.value),b(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;b(e=>Math.min(Math.max(e+t,0),h.length-1))}else e.key===`Enter`&&(e.preventDefault(),x.current?.querySelector(`[data-active] a`)?.click())}})]}),/* @__PURE__ */ v(Ce,{children:/* @__PURE__ */ v(w,{size:`small`,value:c,onChange:({value:e})=>{l(e),b(0)},options:M.map(({value:t,label:n})=>({value:t,label:n,element:/* @__PURE__ */ y(_,{children:[n,` `,/* @__PURE__ */ v(we,{children:r(e,t,``).length})]})}))})})]}),/* @__PURE__ */ y(He,{ref:x,children:[h.map((e,n)=>{let r=i(e.slug,t),o=/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ y(We,{children:[/* @__PURE__ */ v(Q,{children:e.name||e.slug}),e.name&&e.name!==e.slug&&/* @__PURE__ */ v(Ge,{children:e.slug})]}),r?/* @__PURE__ */ v($,{children:`Current`}):!p&&e.mode&&/* @__PURE__ */ v($,{children:P[e.mode]})]});return/* @__PURE__ */ v(`li`,{"data-active":p&&n===g?``:void 0,children:e.mode===`removed`?/* @__PURE__ */ v(Ke,{children:o}):/* @__PURE__ */ v(Ue,{to:e.slug,languageInsensitive:!0,onClick:a,$current:r,children:o})},e.slug)}),h.length===0&&/* @__PURE__ */ v(J,{children:`No changed pages match.`})]}),m.length>h.length&&/* @__PURE__ */ y(J,{children:[`Showing `,h.length,` of `,m.length,` changed pages. Search to narrow them down.`]}),p&&/* @__PURE__ */ y(Te,{children:[/* @__PURE__ */ v(`span`,{children:C>=0?`Page ${C+1} of ${S.length}`:`${S.length} changed pages`}),/* @__PURE__ */ v(B,{children:/* @__PURE__ */ y(Ee,{children:[/* @__PURE__ */ v(K,{children:`↑`}),` `,/* @__PURE__ */ v(K,{children:`↓`}),` to move · `,/* @__PURE__ */ v(K,{children:`Enter`}),` to open`]})})]})]})}const le=p.div`
|
|
1
|
+
import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext as t}from"../contexts.js";import{changedPageNavigation as n,filterChangedPages as r,isSamePage as i}from"./changed-pages.js";import{reviewTimeline as a}from"./timeline.js";import{useBarPosition as o}from"./use-bar-position.js";import{useReview as s}from"./use-review.js";import{createContext as c,useContext as l,useEffect as u,useRef as d,useState as f}from"react";import p,{css as m}from"styled-components";import{Button as h}from"@redocly/theme/components/Button/Button";import{breakpoints as g}from"@redocly/theme/core/utils";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTimeAgo as b}from"@redocly/theme/core/hooks";import{Link as x}from"@redocly/theme/components/Link/Link";import{linkCss as S}from"@redocly/theme/components/Markdown/styles/links";import{Segmented as C}from"@redocly/theme/components/Segmented/Segmented";import{Tag as w}from"@redocly/theme/components/Tag/Tag";import{Tooltip as T}from"@redocly/theme/components/Tooltip/Tooltip";import{ChatIcon as ee}from"@redocly/theme/icons/ChatIcon/ChatIcon";import{CheckmarkIcon as te}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{CloseIcon as E}from"@redocly/theme/icons/CloseIcon/CloseIcon";import{ChevronLeftIcon as D}from"@redocly/theme/icons/ChevronLeftIcon/ChevronLeftIcon";import{ChevronRightIcon as O}from"@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";import{DraggableIcon as ne}from"@redocly/theme/icons/DraggableIcon/DraggableIcon";import{SearchIcon as k}from"@redocly/theme/icons/SearchIcon/SearchIcon";import{Spinner as re}from"@redocly/theme/icons/Spinner/Spinner";import{TrashCanIcon as A}from"@redocly/theme/icons/TrashCanIcon/TrashCanIcon";import{WarningAltIcon as ie}from"@redocly/theme/icons/WarningAltIcon/WarningAltIcon";const j=[{value:`all`,label:`All`},{value:`modified`,label:`Modified`},{value:`added`,label:`Added`},{value:`removed`,label:`Removed`}],M=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘ Enter`:`Ctrl Enter`,N={added:`Added`,modified:`Modified`,removed:`Removed`},P={APPROVED:`approved`,REQUESTED_CHANGES:`requested changes on`,COMMENTED:`commented on`},F=c(`middle`);function I({children:e,...t}){let n=l(F);return/* @__PURE__ */ v(T,{...t,placement:`top`,fallbackPlacements:[],arrowPosition:n===`middle`?`center`:n,children:e})}function L(){let n=l(t),{state:r,error:a,submitting:c,addComment:d,deleteComment:p}=s(),{barRef:m,slot:g,dragging:b,style:x,onDragStart:S}=o(),[C,w]=f(!1),[T,D]=f(!1),[O,k]=f(0);if(u(()=>{if(!C&&!T)return;let e=e=>{e.key===`Escape`&&(T?D(!1):w(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[C,T]),window.self!==window.top)return null;let A=n?.slug??`/`,j=n?.auth?.loginUrl,M=r?.signedIn?r.pullRequest:null,N=C&&M!==null,P=M?.pageComments.filter(e=>!e.replyToId&&!e.isResolved&&i(e.pageSlug,A)).length??0,L=/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(z,{children:/* @__PURE__ */ v(I,{tip:`Drag to move`,disabled:b,children:/* @__PURE__ */ v(me,{type:`button`,"aria-label":`Drag the review bar`,onPointerDown:S,$dragging:b,children:/* @__PURE__ */ v(ne,{size:`16px`,color:`var(--icon-color-secondary)`})})})}),r===null&&!a&&/* @__PURE__ */ v(B,{children:/* @__PURE__ */ v(re,{size:`16px`,color:`var(--icon-color-secondary)`})}),r?.signedIn===!1&&j&&/* @__PURE__ */ v(h,{variant:`primary`,onClick:()=>window.location.assign(e(`${j}?redirectTo=${encodeURIComponent(n?.path??`/`)}`)),children:`Log in to review`}),r?.signedIn&&!M&&/* @__PURE__ */ v(H,{children:`No open pull request`}),M&&/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ y(z,{children:[/* @__PURE__ */ v(I,{tip:`${M.title} — open in Platform`,children:/* @__PURE__ */ y(h,{variant:`text`,to:M.url,external:!0,children:[`#`,M.number]})}),/* @__PURE__ */ v(V,{})]}),/* @__PURE__ */ v(ce,{pullRequest:M,currentSlug:A,open:T,onToggle:()=>{k(m.current?.getBoundingClientRect().top??0),D(e=>!e)}}),N?/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(fe,{}),/* @__PURE__ */ v(I,{tip:`Close`,children:/* @__PURE__ */ v(h,{variant:`text`,icon:/* @__PURE__ */ v(E,{color:`currentColor`}),"aria-label":`Close the review`,onClick:()=>w(!1)})})]}):/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(V,{}),/* @__PURE__ */ v(I,{tip:M.decision===`APPROVED`?`You approved`:M.decision===`REQUESTED_CHANGES`?`You requested changes`:`Comment on pages, then finish your review in Platform`,children:/* @__PURE__ */ y(h,{variant:`primary`,"aria-expanded":!1,onClick:()=>{D(!1),w(!0)},icon:M.decision===`APPROVED`?/* @__PURE__ */ v(te,{color:`currentColor`}):M.decision===`REQUESTED_CHANGES`?/* @__PURE__ */ v(E,{color:`currentColor`}):void 0,children:[`Review`,P>0&&/* @__PURE__ */ y(ke,{"aria-label":`${P} open comments on this page`,children:[/* @__PURE__ */ v(ee,{size:`12px`,color:`currentColor`}),P]})]})})]})]}),a&&/* @__PURE__ */ v(I,{tip:a,children:/* @__PURE__ */ v(B,{role:`alert`,"aria-label":a,children:/* @__PURE__ */ v(ie,{size:`16px`,color:`var(--color-error-base)`})})})]});return/* @__PURE__ */ v(F.Provider,{value:g,children:/* @__PURE__ */ y(ue,{ref:m,style:x,$dragging:b,$expanded:N,"data-testid":`review-bar`,children:[N?/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(de,{children:L}),/* @__PURE__ */ v(pe,{children:/* @__PURE__ */ v(ae,{pullRequest:M,currentSlug:A,submitting:c,onComment:e=>d({pageSlug:A,text:e}),onDelete:p})})]}):L,T&&M&&/* @__PURE__ */ v(ge,{$slot:g,style:{maxHeight:`min(50vh, calc(${O}px - 2 * var(--spacing-xs)))`},children:/* @__PURE__ */ v(le,{pages:M.changedPages??[],currentSlug:A,onOpen:()=>D(!1)})})]})})}function ae({pullRequest:e,currentSlug:t,submitting:n,onComment:r,onDelete:i}){let a=e.pageComments.filter(e=>e.isPending).length;return/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(oe,{pullRequest:e,currentSlug:t,submitting:n,onSubmit:r,onDelete:i}),/* @__PURE__ */ y(Oe,{children:[/* @__PURE__ */ v(K,{children:a===0?`Comments are posted when you finish your review.`:`${a} pending ${a===1?`comment`:`comments`}`}),e.url&&/* @__PURE__ */ v(I,{tip:`Approve or request changes in Platform`,children:/* @__PURE__ */ v(h,{variant:`primary`,to:`${e.url}/review?finishReview=true`,external:!0,children:`Finish review`})})]})]})}function oe({pullRequest:e,currentSlug:t,submitting:n,onSubmit:r,onDelete:o}){let[s,c]=f(``),[l,p]=f(!1),m=d(null),g=!n&&s.trim()!==``,b=a(e).filter(e=>l||e.kind===`comment`&&i(e.comment.pageSlug,t));u(()=>{m.current?.scrollTo({top:m.current.scrollHeight})},[b.length]);let x=n=>{if(i(n,t))return/* @__PURE__ */ v(X,{children:`this page`});let r=e.changedPages?.find(e=>i(e.slug,n));return/* @__PURE__ */ v(Be,{to:n,languageInsensitive:!0,children:r?.name||n})};return/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(Ae,{children:/* @__PURE__ */ v(C,{size:`small`,value:l,onChange:({value:e})=>p(e),options:[{value:!1,label:`This page`},{value:!0,label:`All pages`}]})}),b.length===0?/* @__PURE__ */ v(je,{children:l?`No reviews or comments yet.`:`No comments on this page yet.`}):/* @__PURE__ */ v(Me,{ref:m,children:b.map(e=>e.kind===`review`?/* @__PURE__ */ v(R,{author:e.review.author,createdAt:e.review.createdAt,action:/* @__PURE__ */ y(_,{children:[P[e.review.status],` `,/* @__PURE__ */ v(X,{children:`the pull request`})]}),text:e.review.comment},e.review.id):/* @__PURE__ */ v(R,{author:e.comment.author,createdAt:e.comment.createdAt,action:/* @__PURE__ */ y(_,{children:[`commented on `,x(e.comment.pageSlug)]}),text:e.comment.comment,tag:e.comment.isPending?/* @__PURE__ */ v(w,{children:`Pending`}):e.comment.isResolved&&/* @__PURE__ */ v(w,{children:`Resolved`}),aside:e.comment.isPending&&/* @__PURE__ */ v(I,{tip:`Delete pending comment`,children:/* @__PURE__ */ v(h,{variant:`text`,size:`small`,icon:/* @__PURE__ */ v(A,{color:`currentColor`}),"aria-label":`Delete pending comment`,disabled:n,onClick:()=>void o(e.comment.id)})}),children:e.replies.length>0&&/* @__PURE__ */ v(Ne,{children:e.replies.map(e=>/* @__PURE__ */ v(R,{author:e.author,createdAt:e.createdAt,action:`replied`,text:e.comment},e.id))})},e.comment.id))}),/* @__PURE__ */ v(_e,{onSubmit:async e=>{e.preventDefault(),g&&await r(s.trim())&&c(``)},children:/* @__PURE__ */ y(ve,{children:[/* @__PURE__ */ v(ye,{autoFocus:!0,rows:2,placeholder:`Comment on this page`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),/* @__PURE__ */ y(be,{children:[/* @__PURE__ */ v(K,{children:M}),/* @__PURE__ */ v(h,{type:`submit`,size:`small`,disabled:!g,children:`Comment`})]})]})})]})}function R({author:e,createdAt:t,action:n,text:r,tag:i,aside:a,children:o}){let{format:s}=b();return/* @__PURE__ */ y(Pe,{children:[e.avatarUrl?/* @__PURE__ */ v(Fe,{src:e.avatarUrl,alt:``}):/* @__PURE__ */ v(Ie,{"aria-hidden":!0,children:se(e.name)}),/* @__PURE__ */ y(Le,{children:[/* @__PURE__ */ y(Re,{children:[/* @__PURE__ */ v(`strong`,{children:e.name||`Someone`}),/* @__PURE__ */ v(Y,{dateTime:t,children:s(new Date(t))}),i]}),/* @__PURE__ */ v(ze,{children:n}),r&&/* @__PURE__ */ v(Ve,{children:r}),o]}),a]})}function se(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)||`?`}function ce({pullRequest:e,currentSlug:t,open:r,onToggle:i}){if(e.changedPages===null)return/* @__PURE__ */ v(I,{tip:`Platform has not compared this preview with production yet`,children:/* @__PURE__ */ v(H,{children:`…`})});if(e.changedPages.length===0)return/* @__PURE__ */ v(I,{tip:`No page content changed; navigation, styles, or config can still differ`,children:/* @__PURE__ */ v(H,{children:`No changed pages`})});let{openable:a,index:o,previous:s,next:c}=n(e.changedPages,t);return/* @__PURE__ */ y(he,{children:[/* @__PURE__ */ v(I,{tip:s?`Previous: ${s.name||s.slug}`:``,disabled:!s,children:/* @__PURE__ */ v(h,{variant:`text`,icon:/* @__PURE__ */ v(D,{color:`currentColor`}),to:s?.slug,languageInsensitive:!0,disabled:!s,"aria-label":`Previous changed page`})}),/* @__PURE__ */ v(I,{tip:`Changed pages`,disabled:r,children:/* @__PURE__ */ v(h,{variant:`text`,onClick:i,"aria-expanded":r,children:o>=0?`${o+1}/${a.length}`:`${a.length} changed`})}),/* @__PURE__ */ v(I,{tip:c?`Next: ${c.name||c.slug}`:``,disabled:!c,children:/* @__PURE__ */ v(h,{variant:`text`,icon:/* @__PURE__ */ v(O,{color:`currentColor`}),to:c?.slug,languageInsensitive:!0,disabled:!c,"aria-label":`Next changed page`})})]})}function le({pages:e,currentSlug:t,onOpen:a}){let[o,s]=f(``),[c,l]=f(`all`),p=e.length>5,m=r(e,c,o),h=m.slice(0,500),[g,b]=f(()=>Math.max(h.findIndex(e=>i(e.slug,t)),0)),x=d(null),{openable:S,index:w}=n(e,t);return u(()=>{x.current?.querySelector(`[data-active]`)?.scrollIntoView({block:`nearest`})},[g,o,c]),/* @__PURE__ */ y(_,{children:[p&&/* @__PURE__ */ y(xe,{children:[/* @__PURE__ */ y(Se,{children:[/* @__PURE__ */ v(k,{size:`16px`,color:`var(--icon-color-secondary)`}),/* @__PURE__ */ v(Ce,{autoFocus:!0,"aria-label":`Search changed pages`,placeholder:`Search ${e.length} changed pages`,value:o,onChange:e=>{s(e.target.value),b(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;b(e=>Math.min(Math.max(e+t,0),h.length-1))}else e.key===`Enter`&&(e.preventDefault(),x.current?.querySelector(`[data-active] a`)?.click())}})]}),/* @__PURE__ */ v(we,{children:/* @__PURE__ */ v(C,{size:`small`,value:c,onChange:({value:e})=>{l(e),b(0)},options:j.map(({value:t,label:n})=>({value:t,label:n,element:/* @__PURE__ */ y(_,{children:[n,` `,/* @__PURE__ */ v(Te,{children:r(e,t,``).length})]})}))})})]}),/* @__PURE__ */ y(He,{ref:x,children:[h.map((e,n)=>{let r=i(e.slug,t),o=/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ y(We,{children:[/* @__PURE__ */ v(Q,{children:e.name||e.slug}),e.name&&e.name!==e.slug&&/* @__PURE__ */ v(Ge,{children:e.slug})]}),r?/* @__PURE__ */ v($,{children:`Current`}):!p&&e.mode&&/* @__PURE__ */ v($,{children:N[e.mode]})]});return/* @__PURE__ */ v(`li`,{"data-active":p&&n===g?``:void 0,children:e.mode===`removed`?/* @__PURE__ */ v(Ke,{children:o}):/* @__PURE__ */ v(Ue,{to:e.slug,languageInsensitive:!0,onClick:a,$current:r,children:o})},e.slug)}),h.length===0&&/* @__PURE__ */ v(q,{children:`No changed pages match.`})]}),m.length>h.length&&/* @__PURE__ */ y(q,{children:[`Showing `,h.length,` of `,m.length,` changed pages. Search to narrow them down.`]}),p&&/* @__PURE__ */ y(Ee,{children:[/* @__PURE__ */ v(`span`,{children:w>=0?`Page ${w+1} of ${S.length}`:`${S.length} changed pages`}),/* @__PURE__ */ v(z,{children:/* @__PURE__ */ y(De,{children:[/* @__PURE__ */ v(G,{children:`↑`}),` `,/* @__PURE__ */ v(G,{children:`↓`}),` to move · `,/* @__PURE__ */ v(G,{children:`Enter`}),` to open`]})})]})]})}const ue=p.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: var(--spacing-lg);
|
|
4
4
|
display: inline-flex;
|
|
@@ -25,27 +25,27 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
25
25
|
max-height: 70vh;
|
|
26
26
|
white-space: normal;
|
|
27
27
|
`}
|
|
28
|
-
`,
|
|
28
|
+
`,de=p.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
gap: var(--spacing-xxs);
|
|
32
32
|
white-space: nowrap;
|
|
33
|
-
`,
|
|
33
|
+
`,fe=p.span`
|
|
34
34
|
flex: 1;
|
|
35
|
-
`,
|
|
35
|
+
`,pe=p.div`
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
min-height: 0;
|
|
39
39
|
border-top: 1px solid var(--border-color-secondary);
|
|
40
40
|
user-select: text;
|
|
41
41
|
cursor: auto;
|
|
42
|
-
`,
|
|
42
|
+
`,z=p.span`
|
|
43
43
|
display: contents;
|
|
44
44
|
|
|
45
45
|
@media screen and (max-width: ${g.small}) {
|
|
46
46
|
display: none;
|
|
47
47
|
}
|
|
48
|
-
`,
|
|
48
|
+
`,me=p.button`
|
|
49
49
|
display: inline-flex;
|
|
50
50
|
align-items: center;
|
|
51
51
|
align-self: stretch;
|
|
@@ -54,21 +54,21 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
54
54
|
background: transparent;
|
|
55
55
|
touch-action: none;
|
|
56
56
|
cursor: ${({$dragging:e})=>e?`grabbing`:`grab`};
|
|
57
|
-
`,
|
|
57
|
+
`,B=p.span`
|
|
58
58
|
display: inline-flex;
|
|
59
59
|
padding: 0 var(--spacing-xs);
|
|
60
|
-
`,
|
|
60
|
+
`,he=p.span`
|
|
61
61
|
display: inline-flex;
|
|
62
62
|
align-items: center;
|
|
63
|
-
`,
|
|
63
|
+
`,V=p.span`
|
|
64
64
|
align-self: stretch;
|
|
65
65
|
width: 1px;
|
|
66
66
|
margin: var(--spacing-xs) 0;
|
|
67
67
|
background: var(--border-color-secondary);
|
|
68
|
-
`,
|
|
68
|
+
`,H=p.span`
|
|
69
69
|
padding: 0 var(--spacing-xs);
|
|
70
70
|
color: var(--text-color-description);
|
|
71
|
-
`,
|
|
71
|
+
`,ge=p.div`
|
|
72
72
|
position: absolute;
|
|
73
73
|
display: flex;
|
|
74
74
|
flex-direction: column;
|
|
@@ -84,10 +84,10 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
84
84
|
white-space: normal;
|
|
85
85
|
user-select: text;
|
|
86
86
|
cursor: auto;
|
|
87
|
-
`,
|
|
87
|
+
`,_e=p.form`
|
|
88
88
|
padding: var(--spacing-xs);
|
|
89
89
|
border-top: 1px solid var(--border-color-secondary);
|
|
90
|
-
`,
|
|
90
|
+
`,U=m`
|
|
91
91
|
border: 1px solid var(--input-border-color);
|
|
92
92
|
border-radius: var(--input-border-radius);
|
|
93
93
|
background: var(--input-bg-color);
|
|
@@ -100,7 +100,7 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
100
100
|
border-color: var(--text-color-disabled);
|
|
101
101
|
box-shadow: 0 0 0 2px var(--border-color-secondary);
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
103
|
+
`,W=m`
|
|
104
104
|
border: 0;
|
|
105
105
|
outline: none;
|
|
106
106
|
background: transparent;
|
|
@@ -110,40 +110,40 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
110
110
|
&::placeholder {
|
|
111
111
|
color: var(--input-content-placeholder-color);
|
|
112
112
|
}
|
|
113
|
-
`,
|
|
114
|
-
${
|
|
113
|
+
`,ve=p.div`
|
|
114
|
+
${U}
|
|
115
115
|
display: flex;
|
|
116
116
|
flex-direction: column;
|
|
117
117
|
padding: var(--spacing-xxs) var(--spacing-xs);
|
|
118
|
-
`,
|
|
119
|
-
${
|
|
118
|
+
`,ye=p.textarea`
|
|
119
|
+
${W}
|
|
120
120
|
box-sizing: border-box;
|
|
121
121
|
width: 100%;
|
|
122
122
|
padding: var(--spacing-xxs);
|
|
123
123
|
resize: none;
|
|
124
|
-
`,
|
|
124
|
+
`,be=p.div`
|
|
125
125
|
display: flex;
|
|
126
126
|
align-items: center;
|
|
127
127
|
justify-content: flex-end;
|
|
128
128
|
gap: var(--spacing-xs);
|
|
129
|
-
`,
|
|
129
|
+
`,xe=p.div`
|
|
130
130
|
display: flex;
|
|
131
131
|
flex-direction: column;
|
|
132
132
|
gap: var(--spacing-xs);
|
|
133
133
|
padding: var(--spacing-xs);
|
|
134
134
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
135
|
-
`,
|
|
136
|
-
${
|
|
135
|
+
`,Se=p.label`
|
|
136
|
+
${U}
|
|
137
137
|
display: flex;
|
|
138
138
|
align-items: center;
|
|
139
139
|
gap: var(--spacing-xs);
|
|
140
140
|
padding: var(--spacing-xxs) var(--spacing-sm);
|
|
141
|
-
`,
|
|
142
|
-
${
|
|
141
|
+
`,Ce=p.input`
|
|
142
|
+
${W}
|
|
143
143
|
flex: 1;
|
|
144
144
|
min-width: 0;
|
|
145
145
|
padding: 0;
|
|
146
|
-
`,
|
|
146
|
+
`,we=p.div`
|
|
147
147
|
> div {
|
|
148
148
|
width: 100%;
|
|
149
149
|
}
|
|
@@ -152,9 +152,9 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
152
152
|
flex: 1 1 auto;
|
|
153
153
|
padding-inline: var(--spacing-xs);
|
|
154
154
|
}
|
|
155
|
-
`,
|
|
155
|
+
`,Te=p.span`
|
|
156
156
|
color: var(--text-color-description);
|
|
157
|
-
`,
|
|
157
|
+
`,Ee=p.div`
|
|
158
158
|
display: flex;
|
|
159
159
|
align-items: center;
|
|
160
160
|
justify-content: space-between;
|
|
@@ -164,39 +164,39 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
164
164
|
color: var(--text-color-description);
|
|
165
165
|
font-size: var(--font-size-sm);
|
|
166
166
|
line-height: var(--line-height-sm);
|
|
167
|
-
`,
|
|
167
|
+
`,De=p.span`
|
|
168
168
|
white-space: nowrap;
|
|
169
|
-
`,
|
|
169
|
+
`,G=p.kbd`
|
|
170
170
|
padding: 0 var(--spacing-xxs);
|
|
171
171
|
border-radius: var(--border-radius-sm);
|
|
172
172
|
background: var(--border-color-secondary);
|
|
173
173
|
color: var(--text-color-secondary);
|
|
174
174
|
font: inherit;
|
|
175
|
-
`,
|
|
175
|
+
`,K=p.div`
|
|
176
176
|
color: var(--text-color-description);
|
|
177
177
|
font-size: var(--font-size-sm);
|
|
178
178
|
line-height: var(--line-height-sm);
|
|
179
|
-
`,
|
|
179
|
+
`,Oe=p.div`
|
|
180
180
|
display: flex;
|
|
181
181
|
align-items: center;
|
|
182
182
|
justify-content: space-between;
|
|
183
183
|
gap: var(--spacing-sm);
|
|
184
184
|
padding: var(--spacing-xs);
|
|
185
185
|
border-top: 1px solid var(--border-color-secondary);
|
|
186
|
-
`,
|
|
186
|
+
`,ke=p.span`
|
|
187
187
|
display: inline-flex;
|
|
188
188
|
align-items: center;
|
|
189
189
|
gap: var(--spacing-xxs);
|
|
190
190
|
margin-left: var(--spacing-xs);
|
|
191
|
-
`,
|
|
191
|
+
`,q=p(K)`
|
|
192
192
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
193
|
-
`,
|
|
193
|
+
`,Ae=p.div`
|
|
194
194
|
padding: var(--spacing-xs);
|
|
195
195
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
196
|
-
`,
|
|
196
|
+
`,je=p.div`
|
|
197
197
|
padding: var(--spacing-sm);
|
|
198
198
|
color: var(--text-color-description);
|
|
199
|
-
`,
|
|
199
|
+
`,Me=p.ol`
|
|
200
200
|
display: flex;
|
|
201
201
|
flex-direction: column;
|
|
202
202
|
gap: var(--spacing-md);
|
|
@@ -205,37 +205,37 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
205
205
|
padding: var(--spacing-xs);
|
|
206
206
|
overflow: auto;
|
|
207
207
|
list-style: none;
|
|
208
|
-
`,
|
|
208
|
+
`,Ne=p.ul`
|
|
209
209
|
display: flex;
|
|
210
210
|
flex-direction: column;
|
|
211
211
|
gap: var(--spacing-sm);
|
|
212
212
|
margin: var(--spacing-sm) 0 0;
|
|
213
213
|
padding: 0;
|
|
214
214
|
list-style: none;
|
|
215
|
-
`,
|
|
215
|
+
`,Pe=p.li`
|
|
216
216
|
display: flex;
|
|
217
217
|
align-items: flex-start;
|
|
218
218
|
gap: var(--spacing-xs);
|
|
219
|
-
`,
|
|
219
|
+
`,J=m`
|
|
220
220
|
flex: none;
|
|
221
221
|
width: 24px;
|
|
222
222
|
height: 24px;
|
|
223
223
|
border-radius: 50%;
|
|
224
|
-
`,
|
|
225
|
-
${
|
|
224
|
+
`,Fe=p.img`
|
|
225
|
+
${J}
|
|
226
226
|
object-fit: cover;
|
|
227
|
-
`,
|
|
228
|
-
${
|
|
227
|
+
`,Ie=p.span`
|
|
228
|
+
${J}
|
|
229
229
|
display: inline-flex;
|
|
230
230
|
align-items: center;
|
|
231
231
|
justify-content: center;
|
|
232
232
|
background: var(--border-color-secondary);
|
|
233
233
|
color: var(--text-color-secondary);
|
|
234
234
|
font-size: var(--font-size-sm);
|
|
235
|
-
`,
|
|
235
|
+
`,Le=p.div`
|
|
236
236
|
flex: 1;
|
|
237
237
|
min-width: 0;
|
|
238
|
-
`,
|
|
238
|
+
`,Re=p.div`
|
|
239
239
|
display: flex;
|
|
240
240
|
flex-wrap: wrap;
|
|
241
241
|
align-items: center;
|
|
@@ -245,7 +245,7 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
245
245
|
color: var(--text-color-primary);
|
|
246
246
|
font-weight: var(--font-weight-semibold);
|
|
247
247
|
}
|
|
248
|
-
`,
|
|
248
|
+
`,Y=p.time`
|
|
249
249
|
color: var(--text-color-description);
|
|
250
250
|
font-size: var(--font-size-sm);
|
|
251
251
|
`,ze=p.div`
|
|
@@ -256,8 +256,8 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
256
256
|
`,X=p.span`
|
|
257
257
|
color: var(--text-color-primary);
|
|
258
258
|
font-weight: var(--font-weight-medium);
|
|
259
|
-
`,Be=p(
|
|
260
|
-
${
|
|
259
|
+
`,Be=p(x)`
|
|
260
|
+
${S}
|
|
261
261
|
`,Ve=p.p`
|
|
262
262
|
margin: var(--spacing-xxs) 0 0;
|
|
263
263
|
color: var(--text-color-primary);
|
|
@@ -283,7 +283,7 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
283
283
|
border-radius: var(--dropdown-menu-item-border-radius);
|
|
284
284
|
color: var(--dropdown-menu-item-color);
|
|
285
285
|
text-decoration: none;
|
|
286
|
-
`,Ue=p(
|
|
286
|
+
`,Ue=p(x)`
|
|
287
287
|
${Z}
|
|
288
288
|
background: ${({$current:e})=>e?`var(--dropdown-menu-item-bg-color-active)`:`transparent`};
|
|
289
289
|
|
|
@@ -318,4 +318,4 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
318
318
|
${Q} {
|
|
319
319
|
text-decoration: line-through;
|
|
320
320
|
}
|
|
321
|
-
`;export{
|
|
321
|
+
`;export{L as ReviewBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{withPathPrefix as e}from"../../shared/path-prefix.js";import{REVIEW_ROUTE_PATH as t}from"../../shared/constants/review.js";import{useCallback as n,useEffect as r,useState as i}from"react";function a(e,t){let n=t?.error;return typeof n==`string`?n:`Request failed with ${e.status}.`}function o(){let[o,s]=i(null),[c,l]=i(null),[u,d]=i(!1);r(()=>{let n=!1,r=()=>void fetch(e(t),{headers:{accept:`application/json`}}).then(async e=>{let t=await e.json().catch(()=>null);n||(t&&`signedIn`in t?s(t):l(a(e,t)))}).catch(()=>{n||l(`Could not load the review.`)});return r(),window.addEventListener(`focus`,r),()=>{n=!0,window.removeEventListener(`focus`,r)}},[]);let f=n(async(t,n)=>{d(!0),l(null);try{let r=await fetch(e(t),n),i=await r.json().catch(()=>null);return i&&`signedIn`in i?(s(i),i.signedIn):(l(a(r,i)),!1)}catch{return l(`Could not reach the server.`),!1}finally{d(!1)}},[]);return{state:o,error:c,submitting:u,addComment:n(e=>f(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),[f]),deleteComment:n(e=>f(`${t}/comments/${encodeURIComponent(e)}`,{method:`DELETE`}),[f])}}export{o as useReview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{EMPTY_SIDEBAR_DATA as e,PageContext as t,SidebarDataContext as n}from"../contexts.js";import{useL10nHref as r}from"../l10n/use-l10n-href.js";import{SIDEBAR_BACK_LINK_ROUTE_DEP_KEY as i,SIDEBAR_BREADCRUMBS_ROUTE_DEP_KEY as a}from"../../shared/constants/route-deps.js";import{localizeSidebar as o}from"./localize.js";import{resolveSidebarData as s}from"./resolve-sidebar-data.js";import c,{useContext as l}from"react";import{useLocation as u}from"react-router";import{jsx as d}from"react/jsx-runtime";function f({loaderData:f,children:m}){let h=f.__sidebar,g=f[i],_=f[a],v=l(t),{pathname:y}=u(),b=r(),x=c.useMemo(()=>o(h,b),[h,b]),S=c.useMemo(()=>g?{...g,link:b(g.link)}:void 0,[g,b]),C=c.useMemo(()=>_?.map(e=>({...e,link:b(e.link)})),[_,b]),w=c.useMemo(()=>({...s({sidebar:x,page:v,pathname:y}),backLink:S,breadcrumbs:C}),[x,v,y,S,C]),T=p(w),E=c.useRef(e);return E.current.key!==T&&(E.current={key:T,...w}),/* @__PURE__ */ d(n.Provider,{value:E.current,children:m})}function p(e){return JSON.stringify([e.items??null,e.backLink??null,e.breadcrumbs??null,e.tabs?.map(e=>[e.tabId,e.label,e.link,e.menu?.map(e=>[e.tabId,e.label,e.link])])??null,e.activeTab?.tabId??null,e.activeMenuEntry?.tabId??null])}export{f as SidebarDataProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getMenuItemType as e}from"@redocly/theme/core/utils";import{MenuItemType as t}from"@redocly/theme/core/constants";function n(e,t,n){return{active:e.link===n&&!e.external,hasActiveSubItem:t.some(e=>e.active||e.hasActiveSubItem)}}function r(e,t){return e.map(e=>{let i=r(e.items,t);return{...e,items:i,...n(e,i,t)}})}function i(e,t){let{item:n}=e;return r([...n.link?[{...n,items:[],menuStyle:void 0,separatorLine:!1}]:[],...n.items],t)}function a(n,r=[]){for(let i of n)if(i.active||i.hasActiveSubItem){if(e(i)===t.DrillDown&&r.push({item:i}),i.hasActiveSubItem)return a(i.items,r);if(i.active)return r}return r}export{i as getDrilldownPanelItems,a as getInitialDrilldownStack,n as resolveActiveState,r as withActiveState};
|
package/dist/client/ssr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{stripPathPrefix as e}from"../shared/path-prefix.js";import{L10nContext as t}from"./l10n/l10n-context.js";import{DEFAULT_LOCALE_PLACEHOLDER as n}from"../shared/constants/l10n/defaults.js";import"../shared/utils/l10n.js";import{routableLocales as r}from"../shared/utils/l10n/routable-locales.js";import{getL10nAppData as i}from"./l10n/use-l10n-config.js";import{productClassName as a}from"../shared/products.js";import{findPageProduct as o}from"./products.js";import{ThemeGlobalStylesheetCollector as s,themeGlobalStyleTag as c}from"./ThemeGlobalStyle.js";import{translationPackChunk as l}from"../shared/constants/l10n/default-translations.js";import{translationPackCode as u}from"../shared/utils/l10n/build-i18n-config.js";import{htmlLang as d}from"./l10n/html-lang.js";import{createServerApp as f,loadPageDependencies as p}from"./app.js";import{streamPage as m}from"./ssr-stream.js";import{createSsrL10nContext as h}from"./l10n/ssr-l10n.js";import{getLocaleFromPathname as g}from"@redocly/theme/core/utils";import{jsx as _}from"react/jsx-runtime";import"virtual:realm-markdoc-schema";import"virtual:realm-server-fns";import{serverRoutes as v}from"virtual:realm-server-routes";import{serverModules as y}from"virtual:realm-server-modules";import{mcpTools as b}from"virtual:realm-mcp-tools";async function x(v,y,b,x){let{Template:S,loaderData:C}=await p(v,{resolvedLoaderData:y,ssr:!0}),w=i(C),T=new URL(b,`http://localhost`).pathname,E=w?.defaultLocale||n,D=g(T,E,r(w)),O=o(C,e(T)??T),k=O?a(O.name):void 0,A=null;try{A=await h(w,D)}catch(e){console.error(`Realm: translations failed to load; rendering untranslated chrome.`,e)}let j=d(D),M=u(w,D),N=M===void 0?void 0:l(M),P,F=await m(async e=>{let n=await f({page:v,loaderData:C,Template:e,url:b});return globalThis.SSR_HOSTNAME=x??``,/* @__PURE__ */ _(s.Provider,{value:e=>P=e,children:/* @__PURE__ */ _(t.Provider,{value:A,children:n})})},S);return{...F,styleTags:c(P)+F.styleTags,lang:j,translationPack:N,htmlClass:k}}export{b as mcpTools,x as render,y as serverModules,v as serverRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{withPathPrefix as e}from"../../shared/path-prefix.js";import{telemetryServiceVersion as t}from"../../shared/telemetry-service-version.js";import{OTEL_TRACES_ROUTE_PATH as n}from"../../shared/constants/telemetry.js";const r=process.env.REDOCLY_TELEMETRY===`on`;function i(){return new URL(e(n),window.location.origin).toString()}function a(){if(typeof window<`u`)return{collectorUrl:i(),disabled:!r,serviceVersion:t()}}export{r as CLIENT_TELEMETRY_ENABLED,a as apiDocsTelemetryConfig,i as clientTelemetryCollectorUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getPathPrefix as e,withPathPrefix as t,withPathPrefixForSrcSet as n}from"../shared/path-prefix.js";import{isObject as r}from"../shared/utils/is-object.js";function i(a){return e()===``||!Array.isArray(a)?a:a.map(e=>{if(!r(e))return e;let a={...e};return typeof e.icon==`string`&&(a.icon=t(e.icon)),typeof e.srcSet==`string`&&(a.srcSet=n(e.srcSet)),Array.isArray(e.items)&&(a.items=i(e.items)),a})}function a(i){let{logo:a}=i;if(e()===``||!r(a))return i;let o={...a};return typeof a.image==`string`&&(o.image=t(a.image)),typeof a.favicon==`string`&&(o.favicon=t(a.favicon)),typeof a.srcSet==`string`&&(o.srcSet=n(a.srcSet)),{...i,logo:o}}export{i as prefixNavbarIconUrls,a as prefixThemeLogoUrls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{LoaderDataContext as e}from"./contexts.js";import{REVISIONS_ROUTE_DEP_KEY as t}from"../shared/constants/revisions.js";import{useContext as n}from"react";const r={entityKey:null,items:[]};function i(e){let n=e[t];return!n||!Array.isArray(n.items)?r:{entityKey:typeof n.entityKey==`string`?n.entityKey:null,items:n.items}}function a(e){let{entityKey:t,items:n}=i(e);return!!t&&n.length>0}function o(t){let{items:r}=i(n(e));return{query:{data:void 0,isLoading:!1,isError:!1},items:r}}export{a as hasEntityRevisions,i as selectEntityRevisions,o as useFetchCatalogEntityRevisions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{PageContext as e,SidebarDataContext as t}from"./contexts.js";import{compareVersions as n,toPhysicalVersionedSlug as r,toPublicVersionedSlug as i,versionRoutePrefix as a}from"../shared/constants/versions.js";import{useContext as o,useMemo as s}from"react";const c=[];function l(e){return{name:typeof e?.version==`string`?e.version:void 0,group:typeof e?.versionGroup==`string`?e.versionGroup:void 0}}function u(e,t){let{name:o,group:s}=l(t);if(s===void 0||o===void 0)return c;let u=/* @__PURE__ */ new Map,d=e=>{for(let t of e){if(typeof t!=`object`||!t)continue;let e=t;if(e.versionGroup===s&&typeof e.version==`string`&&typeof e.link==`string`){let t=u.get(e.version);t||(t={firstLink:e.link,isDefault:!1,links:/* @__PURE__ */ new Set},u.set(e.version,t)),t.links.add(e.link),e.isDefaultVersion===!0&&(t.isDefault=!0),t.label===void 0&&typeof e.versionLabel==`string`&&(t.label=e.versionLabel)}Array.isArray(e.items)&&d(e.items)}};if(d(e??[]),u.size===0)return c;let f=t?.slug??``,p=r(f,s,o),m=p===null?null:p.slice(a(s,o).length),h=(e,t)=>{if(m===null)return t.firstLink;let n=i(`${a(s,e)}${m}`,s,e,t.isDefault);return t.links.has(n)?n:t.firstLink};return[...u.entries()].sort(([e],[t])=>n(t,e)).map(([e,t])=>({version:e,label:t.label??e,link:e===o?f:h(e,t),default:t.isDefault,active:e===o,folderId:e}))}function d(){let n=o(t),r=o(e);return{versions:s(()=>u(n.allItems??n.items,r),[n,r])}}export{l as selectActiveVersion,u as selectPageVersions,d as usePageVersionsImpl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SEARCH_GROUP_FACET_FIELD as e,readSearchAppData as t}from"../shared/search/facets.js";import{
|
|
1
|
+
import{SEARCH_GROUP_FACET_FIELD as e,readSearchAppData as t}from"../shared/search/facets.js";import{withPathPrefix as n}from"../shared/path-prefix.js";import{APP_DATA_LOADER_KEY as r}from"../shared/constants/app-data.js";import{readAppData as i}from"../shared/utils/app-data.js";import{LoaderDataContext as a,PageContext as o}from"./contexts.js";import{useL10nConfig as s}from"./l10n/use-l10n-config.js";import{telemetry as c}from"./telemetry/telemetry.js";import{selectActiveVersion as l}from"./use-page-versions.js";import{SEARCH_FACETS_ROUTE_PATH as u,SEARCH_ROUTE_PATH as d}from"../shared/constants/search.js";import{useCallback as f,useContext as p,useEffect as m,useMemo as h,useRef as g,useState as _}from"react";import{getBaseDataAttributes as v}from"@redocly/theme/core/utils";import{SEARCH_DEBOUNCE_TIME_MS as ee}from"@redocly/theme/core/constants";import{SearchSessionContext as y}from"@redocly/theme/core/contexts";async function b(e,t,r){let i=await fetch(n(e),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:r});if(!i.ok)throw Error(i.statusText||`Search request failed (${i.status})`);return await i.json()}function x(e,t){return b(d,e,t)}function S(e){return Object.fromEntries(e.map(e=>[e.field,e.values]))}function C(e,t){return b(u,e,t)}function w(e){return i(e).theme?.aiAssistant?.hide===!1}function T(){let e=p(a),t=p(o);return{askAi:w(e)&&t?.aiAvailable===!0}}function E(e){return e.filter(e=>e.values.length>0).map(({field:e,values:t})=>({field:e,values:[...t]}))}function D(){let e=p(o),{currentLocale:t,defaultLocale:n}=s(),r=t===n?void 0:t,{name:i,group:a}=l(e);return h(()=>({locale:r,version:a!==void 0&&i!==void 0?{group:a,version:i}:void 0}),[r,a,i])}function te(e){if(!(!e||e.indexed>=e.total))return`Dev mode: ${e.indexed} of ${e.total} pages indexed. A page is indexed once it is opened or built.`}const O=(e,t)=>e.map(e=>({...e,isCounterVisible:t}));function k(n,i){let o=i===!1,{askAi:s}=T(),l=p(a),u=p(y)?.searchSessionId,d=D(),b=h(()=>t(l[r]),[l]),[w,k]=_(``),[A,ne]=_([]),[re,j]=_({}),[M,N]=_({}),[P,F]=_({}),[I,L]=_({}),[R,z]=_(!1),[B,V]=_(null),[H,U]=_(),[W,G]=_(!1),K=g(null),q=g(null),J=g(!1),Y=h(()=>E(A),[A]),X=Y.length>0,Z=f(()=>{q.current=null,j({}),N({}),L({})},[]),Q=f((e,t,n)=>{K.current?.abort();let r=new AbortController;return K.current=r,z(!0),V(null),x(e,r.signal).then(e=>{r.signal.aborted||t(e)}).catch(e=>{r.signal.aborted||(V(e instanceof Error?e.message:`Search request failed`),n())}).finally(()=>{r.signal.aborted||z(!1)})},[]),$=f(async e=>{let t=e.trim();if(t===``&&!X){K.current?.abort(),J.current=!1,Z(),G(!1),V(null),z(!1);return}let r={query:t,...d,filter:Y,product:n};J.current=!0,await Q(r,i=>{J.current=!1,q.current=r,j(i.documents),N(i.facets??{}),L(i.groupCounts??{}),U(i.partial),G(!0),t.length>1&&c.sendSearchQueryMessage([{...v(`searchQuery`,`search`),query:e,resultCount:Object.values(i.documents).reduce((e,t)=>e+t.length,0).toString(),...u?{searchSessionId:u}:{},...n?{product:n}:{}}])},()=>{J.current=!1,Z()})},[d,Y,X,Q,Z,n,u]),ie=f(e=>{let t=typeof e==`function`?e(void 0):e,n=q.current;t&&n&&!J.current&&Q({...n,loadMore:t},e=>{let n=e.documents[t.groupKey]??[];j(e=>({...e,[t.groupKey]:[...e[t.groupKey]??[],...n]})),L(t=>({...t,...e.groupCounts}))},()=>{})},[Q]);m(()=>{if(i)return;(w.trim()!==``||X)&&z(!0);let e=setTimeout(()=>{$(w)},ee);return()=>clearTimeout(e)},[w,i,X,$]),m(()=>{if(!b.advanced||!o)return;let e=new AbortController;return C({...d,product:n},e.signal).then(e=>F(S(e))).catch(()=>{e.signal.aborted||F({})}),()=>e.abort()},[b.advanced,o,d,n]),m(()=>()=>K.current?.abort(),[]);let ae=f(async()=>{await $(w)},[w,$]),oe=h(()=>b.facets.map(e=>({...e,values:W?O(M[e.field]??[],!0):O(P[e.field]??[],!1)})),[b.facets,W,M,P]);return{advancedSearch:b.advanced,askAi:s,facets:oe,filter:A,groupCounts:I,groupField:e,isSearchLoading:R,items:re,query:w,searchError:B,setFilter:ne,setLoadMore:ie,setQuery:k,retrySearch:ae,notice:te(H)}}function A(e){let n=D(),i=p(a),o=h(()=>t(i[r]).facets.find(t=>t.field===e),[i,e]),[s,c]=_(null),[l,u]=_(null);return m(()=>{if(l===null){c(null);return}let t=new AbortController;return C({...n,field:e,query:l.query,filter:E(l.filter),facetQuery:l.facetQuery},t.signal).then(t=>{c(o?{...o,values:O(S(t)[e]??[],!0)}:null)}).catch(()=>{t.signal.aborted||c(null)}),()=>t.abort()},[e,n,l,o]),{searchFacet:s,setSearchFacet:c,setSearchFacetQuery:u}}export{x as fetchSearch,C as fetchSearchFacets,A as useFacetQuery,k as useSearch,T as useSearchFeatures,D as useSearchScope};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{stripPathPrefix as e}from"../../../shared/path-prefix.js";import{normalizeRouteSlug as t}from"../../../shared/utils/routes/normalize-route-slug.js";import{markdownCopyUrl as n}from"../../../shared/utils/routes/markdown-copy-url.js";import{splitUrlSuffix as r}from"../../../shared/utils/routes/split-url-suffix.js";function i(i){let{path:a}=r(i);return n(t(e(a)??a))}const a=`https://site.invalid`;function o(e){let t=e.trim();if(!t.startsWith(`/`))return;let n=URL.parse(t,a);if(n?.origin===a)return`${n.pathname}${n.search}${n.hash}`}async function s(e){let t=await fetch(e,{headers:{accept:`text/plain`}});if(t.ok&&!t.headers.get(`content-type`)?.startsWith(`text/html`))return await t.text()}function c(e,t,n){let r=typeof e==`number`?e:Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(Math.floor(r),n)}export{c as clampLimit,s as fetchText,i as markdownPathForRoute,o as toSitePath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as e}from"../../../shared/utils/is-object.js";import{FEEDBACK_ROUTE_PATH as t}from"../../../shared/constants/feedback.js";import{SEARCH_ROUTE_PATH as n}from"../../../shared/constants/search.js";import{
|
|
1
|
+
import{isObject as e}from"../../../shared/utils/is-object.js";import{FEEDBACK_ROUTE_PATH as t}from"../../../shared/constants/feedback.js";import{SEARCH_ROUTE_PATH as n}from"../../../shared/constants/search.js";import{clampLimit as r,fetchText as i,markdownPathForRoute as a,toSitePath as o}from"./shared.js";import{SKILLS_INDEX_SLUG as s}from"../../../content-layer/plugins/utils/skill-paths.js";import{agentErrorResult as c,agentJsonResult as l,agentTextResult as u,collectOperations as d}from"@redocly/api-docs/lib/services/agent-tools/index.js";function f(e){return[...e.feedbackHidden?[]:[y(e)],{name:`get_current_page`,title:`Get current page`,description:`Report which documentation page the user is looking at right now, including the product and version in scope and whether it is an API reference page. Call this first so an answer matches what is on screen.`,inputSchema:{type:`object`,properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0},execute:async()=>p(e)},{name:`search_docs`,title:`Search documentation`,description:`Search this documentation site and return matching pages with their titles and URLs. Use it to find the page that answers a question before reading it.`,inputSchema:{type:`object`,properties:{query:{type:`string`,description:`What to search for`},limit:{type:`integer`,description:`Maximum number of results, 10 by default`}},required:[`query`],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async t=>m(e,t)},{name:`read_page`,title:`Read a page`,description:`Return the full Markdown source of a documentation page. Omit the url to read the page the user is currently on.`,inputSchema:{type:`object`,properties:{url:{type:`string`,description:`Site-relative page path, for example /guides/quickstart`}},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async t=>h(e,t)},{name:`get_site_overview`,title:`Get site overview`,description:`Return the outline of this documentation site: its sections and the pages inside them, limited to what the current user may see. Use it to orient before searching.`,inputSchema:{type:`object`,properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async()=>g(e)},{name:`read_skill`,title:`Read an agent skill`,description:`List the agent skills this site publishes, or read one by name. A skill explains how to carry out a task against the documented product.`,inputSchema:{type:`object`,properties:{name:{type:`string`,description:`Skill name; omit to list every skill`}},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:async t=>v(e,t)},{name:`navigate_page`,title:`Open a page`,description:`Move the browser tab to another page of this documentation site, so the user sees what an answer is based on. Accepts site-relative paths only.`,inputSchema:{type:`object`,properties:{url:{type:`string`,description:`Site-relative page path, optionally with a #section anchor`}},required:[`url`],additionalProperties:!1},annotations:{readOnlyHint:!1},execute:async t=>x(e,t)}]}async function p(e){let t=e.versions.find(e=>e.active);return l({url:e.pathname,title:e.pageTitle??document.title,locale:e.locale,product:e.product,version:t?.label??t?.version,isApiReference:!!e.apiDocs,...e.apiDocs?{apiBasePath:e.withPrefix(e.apiDocs.baseSlug),apiSpecType:e.apiDocs.store.specType,operationCount:d(e.apiDocs.items).length}:{}})}async function m(e,t){let i=typeof t.query==`string`?t.query.trim():``;if(!i)return c(`Provide a query to search for.`);let a=r(t.limit,10,50),o={query:i,...e.searchScope},s=await fetch(e.sitePathUrl(n),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(o)});if(!s.ok)return c(`Search failed with status ${s.status}.`);let{documents:d}=await s.json(),f=Object.entries(d).flatMap(([e,t])=>t.map(({document:t})=>({section:e,document:t}))).slice(0,a).map(({section:t,document:n})=>({title:n.title,url:e.withPrefix(n.url),section:t,method:n.httpMethod?.toUpperCase(),path:n.httpMethod?n.httpPath:void 0,deprecated:n.deprecated?!0:void 0,snippet:n.text.slice(0,300)}));return f.length?l({query:i,resultCount:f.length,results:f}):u(`No documentation pages matched "${i}".`)}async function h(e,t){let n=typeof t.url==`string`&&t.url.trim()?t.url.trim():e.pathname,r=o(n);if(!r)return c(`Provide a site-relative path that starts with "/".`);let s=await i(e.routeUrl(a(r)));return s?u(s):c(`${r} has no Markdown version. Either the path is wrong, or the page is built from code rather than Markdown. Use search_docs to find a documentation page.`)}async function g(e){let t=_(e.sidebarItems,e.withPrefix,0);if(t.length)return l({product:e.product,pages:t});let n=await i(e.sitePathUrl(`/llms.txt`));return n?u(n):c(`This site publishes no navigation tree.`)}function _(t,n,r){if(r>=3)return[];let i=[];for(let a of t){if(!e(a))continue;let t=typeof a.label==`string`?a.label:``,o=typeof a.link==`string`?a.link:void 0;if(!t&&!o)continue;let s=Array.isArray(a.items)?_(a.items,n,r+1):[];i.push({title:t,...o?{url:n(o)}:{},...s.length?{pages:s}:{}})}return i}async function v(t,n){let r=await fetch(t.sitePathUrl(s),{headers:{accept:`application/json`}});if(!r.ok)return c(`This site does not publish agent skills.`);let a=await r.json(),o=e(a)&&Array.isArray(a.skills)?a.skills:[],d=typeof n.name==`string`?n.name.trim():``;if(!d)return l({skills:o.map(e=>({name:e.name,description:e.description}))});let f=o.find(e=>e.name.toLowerCase()===d.toLowerCase());if(!f){let e=o.map(e=>e.name).join(`, `);return c(`No skill named "${d}". Available skills: ${e||`none`}.`)}let p=await i(t.routeUrl(f.url));return p?u(p):c(`The "${f.name}" skill could not be read.`)}function y(e){return{name:`leave_feedback`,title:`Leave feedback on a page`,description:`Report that a documentation page is wrong, outdated, confusing or incomplete. Use it only when the user agrees, and summarize the problem in their words. Reports reach the team that owns the page.`,inputSchema:{type:`object`,properties:{summary:{type:`string`,description:`One sentence naming the problem`},details:{type:`string`,description:`What is wrong and what the page should say`},url:{type:`string`,description:`Site-relative path of the page; the current page by default`}},required:[`summary`],additionalProperties:!1},annotations:{readOnlyHint:!1,consequentialHint:!0},execute:async t=>b(e,t)}}async function b(e,n){let r=typeof n.summary==`string`?n.summary.trim():``;if(!r)return c(`Describe the problem in one sentence.`);let i=typeof n.details==`string`?n.details.trim():``,a=typeof n.url==`string`&&n.url.trim()?n.url.trim():e.pathname,s=o(a);if(!s)return c(`Provide a site-relative path that starts with "/".`);let l=await fetch(e.sitePathUrl(t),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({component:`comment`,path:e.routeUrl(s),comment:i?`${r}\n\n${i}`:r,agent:`webmcp-browser-agent`,origin:`mcp`})});return l.ok?u(`Thanks. The feedback about ${s} reached the documentation team.`):c(l.status===403||l.status===404?`Feedback cannot be left for ${s}.`:`Feedback could not be sent, status ${l.status}.`)}async function x(e,t){let n=typeof t.url==`string`?o(t.url):void 0;return n?(await e.navigate(n),u(`Opened ${n}.`)):c(`Provide a site-relative path that starts with "/". This tool cannot leave the documentation site.`)}export{f as buildSiteTools};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stripPathPrefix as e,withPathPrefix as t}from"../../shared/path-prefix.js";import{
|
|
1
|
+
import{stripPathPrefix as e,withPathPrefix as t}from"../../shared/path-prefix.js";import{LoaderDataContext as n,PageContext as r,SidebarDataContext as i}from"../contexts.js";import{useL10nConfig as a}from"../l10n/use-l10n-config.js";import{useCurrentProduct as o}from"../ProductsProvider.js";import{telemetry as s}from"../telemetry/telemetry.js";import{API_DOCS_RENDER_DEP_KEY as c}from"../../content-layer/plugins/internal/api-docs/server/shared.js";import{usePageVersionsImpl as l}from"../use-page-versions.js";import{useSearchScope as u}from"../use-search.js";import{rebaseItemLinks as d}from"../../content-layer/plugins/internal/api-docs/client/rebase-item-links.js";import{buildApiTools as f}from"./tools/api-tools.js";import{buildSiteTools as p}from"./tools/site-tools.js";import{useContext as m,useEffect as h,useRef as g}from"react";import{useLocation as _,useNavigate as v}from"react-router";import{useThemeConfig as y}from"@redocly/theme/core/hooks";import{registerAgentTools as b}from"@redocly/api-docs/lib/services/agent-tools/index.js";import{getModelContext as x}from"@redocly/api-docs/lib/services/agent-tools/webmcp.js";function S(){let s=_(),d=v(),{currentLocale:S}=a(),w=u(),{versions:E}=l(),D=m(i).items,O=o(),k=m(r),A=m(n)[c],j=k?.slug.toLowerCase(),M=y().feedback?.hide===!0,N=k?.metadata?.seo,P={pathname:t(s.pathname),pageTitle:N?.title,locale:S,searchScope:w,product:O?.name??O?.slug,versions:E,sidebarItems:D??[],feedbackHidden:M,navigate:async t=>{let{pathname:n,search:r,hash:i}=new URL(t,window.location.origin);await d({pathname:e(n)??n,search:r,hash:i})},withPrefix:t,routeUrl:e=>new URL(e,window.location.origin).toString(),sitePathUrl:e=>new URL(t(e),window.location.origin).toString()},F=g(P);Object.assign(F.current,P),h(()=>{let e=new AbortController;return b(p(F.current),e.signal,T(`site`)),()=>e.abort()},[M]),h(()=>{if(!x())return;let e=F.current,t=C(A,j);if(e.apiDocs=t,!t)return;let n=new AbortController;return b(f(e,t),n.signal,T(`apiReference`)),()=>{n.abort(),e.apiDocs=void 0}},[A,j])}function C(e,t){if(Array.isArray(e?.items)&&t!==void 0)return{items:e.basePath===t?e.items:d(e.items,e.basePath,t),store:e.store,baseSlug:t}}const w={id:`agentTools`,object:`feature`,uri:`urn:redocly:realm:ui:feature:agentTools`};function T(e){return{registered:t=>s.sendAgentToolsRegisteredMessage([{...w,toolCount:t,scope:e}]),called:(e,t)=>s.sendAgentToolCalledMessage([{...w,toolName:e,outcome:t}])}}export{S as useWebMcpTools};
|
|
@@ -81,7 +81,8 @@ export declare function deepMergeConfig(base: ConfigObject, override: ConfigObje
|
|
|
81
81
|
* `access.rbac` `{folder}` rules are written per team directory,
|
|
82
82
|
* `access.rbac.content` and `redirects` cover every content locale, `access.requiresLogin`
|
|
83
83
|
* follows the rbac rules when `access.rbac` is set, and the `PUBLIC_*` environment is
|
|
84
|
-
* attached
|
|
84
|
+
* attached, and the first Apigee adapter of `developerOnboarding` moves to `redocly.apigee` (a
|
|
85
|
+
* `redocly.apigee` value wins). `report` receives one problem per removed, ignored, or deprecated setting.
|
|
85
86
|
* `pluginSchemas` checks the root key of each plugin id it names.
|
|
86
87
|
*/
|
|
87
88
|
export declare function normalizeRedoclyConfig(config: Record<string, unknown>, options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toJsonObject as e,toJsonValue as t}from"./database/utils/json.js";import{
|
|
1
|
+
import{toJsonObject as e,toJsonValue as t}from"./database/utils/json.js";import{listL10nDirs as n,resolveLocaleContext as r}from"../shared/utils/l10n.js";import{hashContentBytes as i}from"../shared/utils/content-hash.js";import{getProcessEnv as a,getPublicEnv as o,resolveRedoclyEnvironment as s,sanitizeBranchName as c}from"../shared/public-env.js";import{isClosedToAnonymous as l,parseRbacConfigData as u}from"../shared/rbac/engine.js";import{readProjectEnv as d}from"../shared/project-env.js";import{expandConfigRbacForL10n as f}from"../shared/rbac/l10n-rules.js";import{expandConfigRbacTeamTemplates as p,listTeamDirs as m,teamTemplatePrefixes as h}from"../shared/rbac/team-templates.js";import{resolveContentPath as g}from"../shared/utils/resolve-content-path.js";import{resolveConfigRedirects as _}from"./config-redirects.js";import{NESTED_CONFIG_SCHEMA as v,realmConfigSchema as y,sanitizeConfig as b}from"./config-schema.js";import{hashEffectiveConfig as x,resolveSiteConfig as S}from"./database/site-config.js";import{applyEnforcedAccess as C}from"./enforced-access.js";import{applyPlanGates as w}from"./plan-gates.js";import{resolve as T}from"node:path";import{interpolateEnvVariables as E}from"@redocly/config";import D from"js-yaml";const O=[`redocly.yaml`,`redocly.yml`],k=`redocly.yaml`;async function A(e,t,r={}){let o=await ae(e,t),s=a();if(!o){let e=[],t=C(w($(),s,t=>e.push({code:`configuration/ignored`,message:t})),s);return{absolutePath:null,config:t,siteConfig:t,path:null,hash:null,refs:[],problems:e}}let c=await t.readBinaryFile(o.absolutePath),l=[],u=[],f=[],p=F(new TextDecoder().decode(c),o.path),g=[],_=d(s),v={contentDir:e,fs:t,env:_,refs:f,warnings:l,errors:u},y=Q(await H(await R(await I(p,{...v,deprecations:g}),``,v),v)),b={filePath:o.path},x=[],T=W(y.access)?y.access.rbac:void 0,E=J(y,{dirLocales:await n(e,t),teamDirs:await m(e,t,h(W(T)?T:{})),env:_,pluginSchemas:r,report:e=>x.push({...e,location:b})}),D=C(w(E,s,e=>x.push({code:`configuration/ignored`,message:e,location:b})),s),{config:O,unsetVars:k}=S(D,_);for(let e of k)l.push(`The config references process.env.${e}, which is not set.`);let A=[...l.map(e=>({code:`configuration/ignored`,message:e,location:b})),...[...new Set(g)].map(e=>({code:`configuration/deprecated`,message:e,location:b})),...u.map(e=>({code:`configuration/invalid`,severity:`error`,message:e,location:b})),...x];return{...o,config:O,siteConfig:D,hash:await i(c),refs:f,problems:A}}function j(e,t){return x(e)!==t}async function ee(e){if(e.context.configLoaded&&e.force!==!0)return{absolutePath:e.context.configFilePath?T(e.context.contentDir,e.context.configFilePath):null,config:e.context.config,siteConfig:e.context.siteConfig,path:e.context.configFilePath,hash:e.context.configHash,refs:e.context.configRefs,problems:[]};let t=Object.fromEntries(e.context.pluginRegistry.list().flatMap(e=>e.configSchema?[[e.id,e.configSchema]]:[])),n=await A(e.context.contentDir,e.context.platform.fs,t);return e.context.config=n.config,e.context.siteConfig=n.siteConfig,e.context.configFilePath=n.path,e.context.configHash=n.hash,e.context.configRefs=n.refs,e.context.configLoaded=!0,n}function M(e,t){let n=E(F(e,t),d(a())).value,{value:r,problems:i}=b(v,n);for(let e of i)e.location={filePath:t};return{config:r,problems:i}}function N(e){return e.endsWith(`/${k}`)}async function P(e){let t=[];for(let n of e.paths)try{let r=await e.fs.readFile(T(e.contentDir,n));t.push(...M(r,n).problems)}catch(e){let r=e instanceof Error?e.message:String(e);t.push({code:`configuration/invalid`,message:`The config cannot be read: ${r}`,location:{filePath:n}})}return t}function F(t,n){let r=D.load(t);if(r==null)return{};try{return e(r)}catch(e){throw Error(`Expected ${n} to contain a YAML object.`,{cause:e})}}async function I(e,t){let{env:n,...r}=e;if(!W(n))return e;let i=t.env.PUBLIC_REDOCLY_BRANCH_NAME,a=[...i?[`branch.${c(i)}`]:[],s(t.env.REDOCLY_ENV)],o=e=>t.deprecations.push(e),l=X(r,o);for(let e of a){let r=await L(n[e],e,t);r&&(l=U(l,X(r,o)))}return l}async function L(e,t,n){if(!W(e))return null;if(typeof e.$ref!=`string`)return e;let{$ref:r,...i}=e,a=`env.${t}`,o=z(await B(r,a,n),i,a,n);return W(o)?o:null}async function R(e,t,n){if(Array.isArray(e))return Promise.all(e.map((e,r)=>R(e,`${t}[${r}]`,n)));if(!W(e))return e;if(typeof e.$ref==`string`){let{$ref:r,...i}=e;return z(await B(r,t,n),await R(i,t,n),t,n)}let r={};for(let[i,a]of Object.entries(e))r[i]=await R(a,t===``?i:`${t}.${i}`,n);return r}function z(e,t,n,r){if(Object.keys(t).length===0)return e;if(W(e))return{...e,...t};if(e==null)return t;let i=Array.isArray(e)?`list`:`scalar`;return r.warnings.push(`${n===``?`The config`:n} has keys next to a $ref to a ${i}; only the referenced file applies.`),e}function B(e,n,r){return V(e,`${n} $ref`,r,e=>t(D.load(e)))}async function V(e,t,n,r,a=`warning`){let o=a===`error`?n.errors:n.warnings,s=g(e,O[0]);if(s===null)return o.push(`${t} "${e}" escapes the content root.`),null;try{let e=await n.fs.readBinaryFile(T(n.contentDir,s));return n.refs.push({path:s,hash:await i(e)}),r(new TextDecoder().decode(e))}catch(n){let r=n instanceof Error?n.message:String(n);return o.push(`Cannot read ${t} "${e}": ${r}`),null}}async function H(e,t){let{seo:n}=e;if(!W(n)||!W(n.llmstxt)||!W(n.llmstxt.details))return e;let{path:r,...i}=n.llmstxt.details;if(typeof r!=`string`)return e;let a=null;i.content===void 0?a=await V(E(r,t.env).value,`seo.llmstxt.details.path`,t,e=>e,`error`):t.errors.push(`seo.llmstxt.details.path and seo.llmstxt.details.content are mutually exclusive; the path is ignored.`);let o={...n.llmstxt,details:a===null?i:{...i,path:r,content:a}};return{...e,seo:{...n,llmstxt:o}}}function U(e,t){let n={...e};for(let[e,r]of Object.entries(t)){if(e===`__proto__`||e===`constructor`||e===`prototype`)continue;let t=n[e];n[e]=W(t)&&W(r)?U(t,r):r}return n}function W(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const G=[`hide`,`name`,`ignore`,`publicEndpoint`],K=`redocly.apigee`,q=[`requiresLogin`,`rbac`,`sso`,`idps`,`logoutReturnUrl`,`residency`];function J(e,t={}){let n=t.report??(()=>{}),i=t.dirLocales??[],a=X(e,e=>n({code:`configuration/deprecated`,message:e}));W(a.mcp)&&a.mcp.docs!==void 0&&n({code:`configuration/deprecated`,message:`The 'mcp.docs' property is deprecated. Use the 'mcp' properties instead.`});let s=b(y(t.pluginSchemas??{}),a,{env:t.env});for(let e of s.problems)n(e);let{redirects:c,access:l,...u}=f(p(Y(s.value,t.env),t.teamDirs??{},n),i),d={...u,publicEnv:o()};l&&(d.access=ie(l,n));let m=_(c,r(u.l10n,i));return m&&(d.redirects=m),d}function Y(e,t){if(!t)return e;let n={...e};for(let r of[`access`,`l10n`,`redirects`])r in e&&(n[r]=E(e[r],t).value);return n}function X(e,t){return te(re(ne(Q(e),t)),t)}function te(e,t){let{developerOnboarding:n}=e;if(!W(n)||!Array.isArray(n.adapters))return e;let r=n.adapters.find(e=>W(e)&&(e.type===`APIGEE_X`||e.type===`APIGEE_EDGE`));if(!W(r)||(t(`The Apigee adapter in 'developerOnboarding' is deprecated. Add the Apigee plugin and move the adapter to 'redocly.apigee'.`),e[K]!==void 0))return e;let{type:i,ignoreApiProducts:a,allowApiProductsOutsideCatalog:o,...s}=r,c={};return a!==void 0&&(c.exclude=a),o!==void 0&&(c.allowOutsideCatalog=o),{...e,[K]:{...s,apiProducts:c}}}function ne(e,t){let n=e;e.reunite!==void 0&&(t(`The 'reunite' property is deprecated. Use 'platform' instead.`),e.platform!==void 0&&e.platform!==null&&t(`Both 'platform' and 'reunite' are set. 'reunite' is ignored, so remove it.`),n=Z(e));let{access:r}=n;return W(r)&&W(r.rbac)&&r.rbac.reunite!==void 0&&(t(`The 'access.rbac.reunite' property is deprecated. Use 'access.rbac.platform' instead.`),n={...n,access:{...r,rbac:Z(r.rbac)}}),n}function Z(e){let{reunite:t,...n}=e;return{...n,platform:e.platform??t}}function re(e){let{mcp:t}=e;if(!W(t))return e;let{docs:n,...r}=t;if(!W(n))return e;let i={...n};for(let e of G){let t=n[e];delete i[e],t!==void 0&&(r[e]===void 0||r[e]===null||e===`hide`&&t===!0)&&(r[e]=t)}return{...e,mcp:{...r,docs:i}}}function Q(e){let t=q.map(t=>[t,e[t]]).filter(([,e])=>e!==void 0);if(t.length===0)return e;let n={...e},r=W(e.access)?{...e.access}:{};for(let[e,i]of t)delete n[e],(r[e]===void 0||r[e]===null)&&(r[e]=i);return{...n,access:r}}function ie(e,t){let n=e.rbac?u(e.rbac,e=>t({code:`configuration/invalid`,message:e})):null;return n?(e.requiresLogin===!0&&t({code:`configuration/ignored`,message:`access.requiresLogin is ignored because access.rbac is also configured — the two are mutually exclusive. Remove one.`}),{...e,requiresLogin:l(n)}):e}async function ae(e,t){for(let n of O){let r=T(e,n);if(await t.exists(r))return{absolutePath:r,path:n}}return null}function $(){return J({})}export{k as NESTED_CONFIG_FILENAME,O as REDOCLY_CONFIG_FILENAMES,$ as createEmptyRealmConfig,U as deepMergeConfig,j as isConfigChanged,N as isNestedConfigPath,ee as loadContentLayerConfig,A as loadRedoclyConfig,J as normalizeRedoclyConfig,M as parseNestedConfig,P as readNestedConfigProblems};
|