@redocly/framework 1.0.0-next.7 → 1.0.0-next.8
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/output-metadata.js +1 -1
- package/dist/bundler/build/run.js +1 -1
- package/dist/bundler/build/vite-config.js +2 -2
- 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/args.js +1 -1
- 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/index.js +1 -1
- 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 +2 -7
- package/dist/client/client-entry.js +1 -1
- package/dist/client/contexts.js +1 -1
- package/dist/client/dev-problems/ProblemsBar.js +26 -16
- 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 +163 -69
- package/dist/client/review/login-url.js +1 -0
- 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-bar-position.js +1 -0
- 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/api-outputs.js +1 -1
- package/dist/content-layer/config-schema.js +1 -1
- package/dist/content-layer/config.js +1 -1
- package/dist/content-layer/database/files.js +1 -1
- package/dist/content-layer/database/finalize.js +1 -1
- package/dist/content-layer/database/invalidation.js +26 -26
- package/dist/content-layer/database/origins.js +1 -1
- package/dist/content-layer/database/problems.d.ts +2 -0
- package/dist/content-layer/database/problems.js +1 -1
- package/dist/content-layer/database/reset.js +1 -1
- package/dist/content-layer/database/schema.d.ts +17 -0
- package/dist/content-layer/database/schema.js +1 -1
- package/dist/content-layer/ingest/finalize-phase.js +1 -1
- package/dist/content-layer/ingest/hash.js +1 -1
- 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/ingest/sync.js +1 -1
- package/dist/content-layer/link-checker/delta.js +1 -1
- package/dist/content-layer/link-checker/fingerprint.js +1 -1
- package/dist/content-layer/link-checker/load-view.js +1 -1
- package/dist/content-layer/link-checker/run-build.js +1 -1
- package/dist/content-layer/link-checker/validate.js +1 -1
- package/dist/content-layer/link-checker/view.js +1 -1
- package/dist/content-layer/loaders/context.js +1 -1
- package/dist/content-layer/loaders/define.d.ts +3 -0
- package/dist/content-layer/markdown/client/JsonSchemaTag.js +1 -1
- package/dist/content-layer/markdown/client/code-highlight-notation.js +3 -3
- package/dist/content-layer/markdown/client/markdoc-components.js +2 -2
- 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/audience-tag.d.ts +1 -5
- package/dist/content-layer/markdown/resolve/audience-tag.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/search/to-sections.d.ts +1 -1
- package/dist/content-layer/markdown/search/to-sections.js +1 -1
- package/dist/content-layer/markdown/server/render.js +1 -1
- package/dist/content-layer/markdown/tags/html.d.ts +2 -2
- package/dist/content-layer/markdown/tags/html.js +1 -1
- package/dist/content-layer/markdown/tags/openapi.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/entity.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/event-handlers.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/client/template.js +11 -3
- package/dist/content-layer/plugins/internal/api-docs/index.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-definition.d.ts +21 -11
- package/dist/content-layer/plugins/internal/api-docs/server/build-definition.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/build-sidebar.js +1 -1
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-decorator.d.ts +1 -4
- package/dist/content-layer/plugins/internal/api-docs/server/markdown-decorator.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-functions/server/access.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.d.ts +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/constants.d.ts +17 -0
- package/dist/content-layer/plugins/internal/mcp/constants.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/content-tools.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/codemode/capabilities.js +6 -6
- package/dist/content-layer/plugins/internal/mcp/server/codemode/constants.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/codemode/discover.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/codemode/prompts.js +8 -8
- package/dist/content-layer/plugins/internal/mcp/server/custom-tools.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/allowed-http-methods.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/api-call-operations.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/call-api.js +2 -0
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/form-page.js +10 -10
- package/dist/content-layer/plugins/internal/mcp/server/gateway/credentials-page/outcome-pages.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/fetch/fetch-bridge.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/ssrf-guard.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/fetch/upstream-detail.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/gateway/index.js +3 -3
- package/dist/content-layer/plugins/internal/mcp/server/gateway/tool-list.js +1 -0
- package/dist/content-layer/plugins/internal/mcp/server/gateway/tools.js +4 -4
- package/dist/content-layer/plugins/internal/mcp/server/gateway/upstream-auth-scheme.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/handler.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/mcp-server.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/mcp-telemetry.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/callback.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/discovery.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/token.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/oauth/tokens.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/skills-resources.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-catalog.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi-document.js +1 -1
- package/dist/content-layer/plugins/internal/mcp/server/tools/openapi.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/pages.js +2 -2
- package/dist/content-layer/plugins/internal/mcp/server/tools/schemas.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.d.ts +2 -1
- package/dist/content-layer/plugins/internal/sidebar/index.js +2 -2
- package/dist/content-layer/plugins/internal/sidebar/subtree.js +1 -1
- package/dist/content-layer/plugins/internal/skills/index.js +1 -1
- package/dist/content-layer/plugins/internal/skills/server/routes.js +1 -1
- package/dist/content-layer/plugins/project/load.js +2 -2
- package/dist/content-layer/plugins/types/markdoc.d.ts +2 -0
- package/dist/content-layer/plugins/utils/link-access.js +1 -1
- package/dist/content-layer/plugins/utils/route-index.js +1 -1
- package/dist/content-layer/problems/codes.js +1 -1
- package/dist/content-layer/search/postings/fragment-field.d.ts +2 -0
- package/dist/content-layer/search/postings/fragment-field.js +1 -1
- package/dist/content-layer/search/postings/postings-store.js +1 -1
- package/dist/content-layer/server/database.js +1 -1
- package/dist/content-layer/static/registry.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/content-layer/versions/version-groups.d.ts +5 -1
- package/dist/content-layer/versions/version-groups.js +1 -1
- package/dist/server/app.js +3 -3
- package/dist/server/ask-ai/route.js +1 -1
- package/dist/server/auth/access-config.js +1 -1
- package/dist/server/auth/gate.js +1 -1
- package/dist/server/auth/middleware.js +1 -1
- package/dist/server/auth/oidc.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 +2 -2
- package/dist/server/plugin-context.js +1 -1
- package/dist/server/review/route.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/subprocess/child-entry.js +1 -1
- package/dist/server/subprocess/host.js +1 -1
- package/dist/shared/constants/manifest-version.d.ts +3 -1
- package/dist/shared/constants/openapi-operation-methods.d.ts +2 -0
- package/dist/shared/constants/openapi-operation-methods.js +1 -0
- package/dist/shared/constants/review.d.ts +5 -0
- package/dist/shared/constants/review.js +1 -1
- package/dist/shared/constants/system-routes.js +1 -1
- package/dist/shared/load-dot-env.js +1 -1
- package/dist/shared/rbac/api-docs.d.ts +2 -1
- package/dist/shared/rbac/api-docs.js +1 -1
- package/dist/shared/rbac/engine.d.ts +12 -9
- package/dist/shared/rbac/engine.js +0 -0
- package/dist/shared/rbac/filter.js +1 -1
- package/dist/shared/rbac/l10n-rules.js +1 -1
- package/dist/shared/rbac/route-scope.d.ts +1 -1
- package/dist/shared/rbac/team-templates.js +1 -1
- package/dist/shared/types/auth.d.ts +1 -0
- package/dist/shared/types/config.d.ts +1 -0
- package/dist/shared/utils/l10n.js +1 -1
- package/dist/shared/utils/routes/file-path-to-route-slug.js +1 -1
- package/drizzle/20261111152552_page_markdown_rbac_scope/migration.sql +1 -0
- package/package.json +6 -5
- package/dist/client/review/use-bar-position.js +0 -1
|
@@ -1,10 +1,32 @@
|
|
|
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`
|
|
1
|
+
import{PageContext as e}from"../contexts.js";import{useBarPosition as t}from"../use-bar-position.js";import{changedPageNavigation as n,filterChangedPages as r,isSamePage as i}from"./changed-pages.js";import{reviewLoginUrl as a}from"./login-url.js";import{reviewTimeline as o}from"./timeline.js";import{useReview as s}from"./use-review.js";import{createContext as c,useCallback as l,useContext as u,useEffect as d,useRef as f,useState as p}from"react";import m,{css as h,keyframes as g}from"styled-components";import{Button as _}from"@redocly/theme/components/Button/Button";import{breakpoints as v,hiddenWhileMobileMenuOpen as y}from"@redocly/theme/core/utils";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{useTimeAgo as C}from"@redocly/theme/core/hooks";import{DraggableIcon as ee}from"@redocly/theme/icons/DraggableIcon/DraggableIcon";import{Spinner as te}from"@redocly/theme/icons/Spinner/Spinner";import{Link as w}from"@redocly/theme/components/Link/Link";import{linkCss as T}from"@redocly/theme/components/Markdown/styles/links";import{Segmented as E}from"@redocly/theme/components/Segmented/Segmented";import{Tag as D}from"@redocly/theme/components/Tag/Tag";import{Tooltip as O}from"@redocly/theme/components/Tooltip/Tooltip";import{ChatIcon as ne}from"@redocly/theme/icons/ChatIcon/ChatIcon";import{CheckmarkIcon as re}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{CloseIcon as k}from"@redocly/theme/icons/CloseIcon/CloseIcon";import{ChevronLeftIcon as A}from"@redocly/theme/icons/ChevronLeftIcon/ChevronLeftIcon";import{ChevronRightIcon as ie}from"@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";import{MinimizeIcon as ae}from"@redocly/theme/icons/MinimizeIcon/MinimizeIcon";import{SearchIcon as oe}from"@redocly/theme/icons/SearchIcon/SearchIcon";import{TrashCanIcon as j}from"@redocly/theme/icons/TrashCanIcon/TrashCanIcon";import{WarningAltIcon as se}from"@redocly/theme/icons/WarningAltIcon/WarningAltIcon";const M=`realm.review-bar-used`,N=[{value:`all`,label:`All`},{value:`modified`,label:`Modified`},{value:`added`,label:`Added`},{value:`removed`,label:`Removed`}],P=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘ Enter`:`Ctrl Enter`,F={added:`Added`,modified:`Modified`,removed:`Removed`},I={APPROVED:`approved`,REQUESTED_CHANGES:`requested changes on`,COMMENTED:`commented on`},L=c(`middle`);function ce(){try{return localStorage.getItem(M)===`1`}catch{return!1}}function R(){try{localStorage.setItem(M,`1`)}catch{}}function z({children:e,...t}){let n=u(L);return/* @__PURE__ */ x(O,{...t,placement:`top`,fallbackPlacements:[],arrowPosition:n===`middle`?`center`:n,children:e})}function B(){let n=u(e),{state:r,error:o,submitting:c,addComment:f,deleteComment:m}=s(),[h,g]=p(null),{barRef:v,slot:y,dragging:C,style:w,onDragStart:T}=t({storageKey:`realm.review-bar-slot`,defaultSlot:`middle`,frozen:h!==null}),[E,D]=p(!1),[O,A]=p(!1),[ie,oe]=p(0),[j,M]=p(ce),N=l(()=>{let e=v.current?.getBoundingClientRect().width;!e||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?M(!0):g(e)},[v]);if(d(()=>{if(j||h!==null||E||O)return;let e=e=>{e.target instanceof Node&&v.current?.contains(e.target)||N()};return window.addEventListener(`wheel`,e,{passive:!0}),window.addEventListener(`touchmove`,e,{passive:!0}),()=>{window.removeEventListener(`wheel`,e),window.removeEventListener(`touchmove`,e)}},[j,h,E,O,v,N]),d(()=>{if(!E&&!O)return;let e=e=>{e.key===`Escape`&&(O?A(!1):D(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,O]),window.self!==window.top)return null;let P=n?.slug??`/`,F=n?.auth?.loginUrl,I=r?.signedIn?r.pullRequest:null,B=E&&I!==null,V=I?.pageComments.filter(e=>!e.replyToId&&!e.isResolved&&i(e.pageSlug,P)).length??0,H=/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(z,{tip:`Drag to move`,disabled:C,children:/* @__PURE__ */ x(xe,{type:`button`,"aria-label":`Drag the review bar`,onPointerDown:T,$dragging:C,children:/* @__PURE__ */ x(ee,{size:`16px`,color:`var(--icon-color-secondary)`})})}),r===null&&!o&&/* @__PURE__ */ x(q,{children:/* @__PURE__ */ x(te,{size:`16px`,color:`var(--icon-color-secondary)`})}),r?.signedIn===!1&&F&&/* @__PURE__ */ x(_,{variant:`primary`,onClick:()=>{R(),window.location.assign(a(F,n?.path??`/`))},children:`Log in to review`}),r?.signedIn&&!I&&/* @__PURE__ */ x(Y,{children:`No open pull request`}),I&&/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ S(K,{children:[/* @__PURE__ */ x(z,{tip:`${I.title} — open in Platform`,children:/* @__PURE__ */ S(_,{variant:`text`,to:I.url,external:!0,children:[`#`,I.number]})}),/* @__PURE__ */ x(J,{})]}),/* @__PURE__ */ x(ue,{pullRequest:I,currentSlug:P,open:O,onToggle:()=>{R(),oe(v.current?.getBoundingClientRect().top??0),A(e=>!e)}}),B?/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(ye,{}),/* @__PURE__ */ x(z,{tip:`Close`,children:/* @__PURE__ */ x(_,{variant:`text`,icon:/* @__PURE__ */ x(k,{color:`currentColor`}),"aria-label":`Close the review`,onClick:()=>D(!1)})})]}):/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(J,{}),/* @__PURE__ */ x(z,{tip:I.decision===`APPROVED`?`You approved`:I.decision===`REQUESTED_CHANGES`?`You requested changes`:`Comment on pages, then finish your review in Platform`,children:/* @__PURE__ */ S(_,{variant:`primary`,"aria-expanded":!1,onClick:()=>{R(),A(!1),D(!0)},icon:I.decision===`APPROVED`?/* @__PURE__ */ x(re,{color:`currentColor`}):I.decision===`REQUESTED_CHANGES`?/* @__PURE__ */ x(k,{color:`currentColor`}):void 0,children:[`Review`,V>0&&/* @__PURE__ */ S(Ie,{"aria-label":`${V} open comments on this page`,children:[/* @__PURE__ */ x(ne,{size:`12px`,color:`currentColor`}),V]})]})})]})]}),o&&/* @__PURE__ */ x(z,{tip:o,children:/* @__PURE__ */ x(q,{role:`alert`,"aria-label":o,children:/* @__PURE__ */ x(se,{size:`16px`,color:`var(--color-error-base)`})})}),!B&&/* @__PURE__ */ x(z,{tip:`Collapse`,children:/* @__PURE__ */ x(_,{variant:`text`,icon:/* @__PURE__ */ x(ae,{color:`currentColor`}),"aria-label":`Collapse the review bar`,onClick:()=>{R(),A(!1),N()}})})]}),U=o??(r?.signedIn===!1?`Log in to review`:r?.signedIn&&!I?`No open pull request`:`Review`),W=/* @__PURE__ */ x(z,{tip:U,children:/* @__PURE__ */ S(ge,{type:`button`,"aria-label":U,"aria-expanded":!1,onClick:()=>{R(),M(!1)},children:[/* @__PURE__ */ x(ne,{size:`18px`,color:`var(--icon-color-primary)`}),o?/* @__PURE__ */ x(G,{role:`alert`,$tone:`error`}):r?.signedIn===!1&&F?/* @__PURE__ */ x(G,{$tone:`info`}):V>0?/* @__PURE__ */ x(_e,{children:V}):null]})});return/* @__PURE__ */ x(L.Provider,{value:y,children:/* @__PURE__ */ S(he,{ref:v,style:h===null?w:{...w,"--review-bar-collapse-from":`${h}px`},$dragging:C,$expanded:B,$collapsed:j,$collapsing:h!==null,onAnimationEnd:e=>{e.target===e.currentTarget&&h!==null&&(g(null),M(!0))},"data-testid":`review-bar`,children:[j?W:B?/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(ve,{children:H}),/* @__PURE__ */ x(be,{children:/* @__PURE__ */ x(le,{pullRequest:I,currentSlug:P,submitting:c,onComment:e=>f({pageSlug:P,text:e}),onDelete:m})})]}):H,!j&&O&&I&&/* @__PURE__ */ x(Ce,{$slot:y,style:{maxHeight:`min(50vh, calc(${ie}px - 2 * var(--spacing-xs)))`},children:/* @__PURE__ */ x(de,{pages:I.changedPages??[],currentSlug:P,onOpen:()=>A(!1)})})]})})}function le({pullRequest:e,currentSlug:t,submitting:n,onComment:r,onDelete:i}){let a=e.pageComments.filter(e=>e.isPending).length;return/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(V,{pullRequest:e,currentSlug:t,submitting:n,onSubmit:r,onDelete:i}),/* @__PURE__ */ S(Fe,{children:[/* @__PURE__ */ x($,{children:a===0?`Comments are posted when you finish your review.`:`${a} pending ${a===1?`comment`:`comments`}`}),e.url&&/* @__PURE__ */ x(z,{tip:`Approve or request changes in Platform`,children:/* @__PURE__ */ x(_,{variant:`primary`,to:`${e.url}/review?finishReview=true`,external:!0,children:`Finish review`})})]})]})}function V({pullRequest:e,currentSlug:t,submitting:n,onSubmit:r,onDelete:a}){let[s,c]=p(``),[l,u]=p(!1),m=f(null),h=!n&&s.trim()!==``,g=o(e).filter(e=>l||e.kind===`comment`&&i(e.comment.pageSlug,t));d(()=>{m.current?.scrollTo({top:m.current.scrollHeight})},[g.length]);let v=n=>{if(i(n,t))return/* @__PURE__ */ x(Xe,{children:`this page`});let r=e.changedPages?.find(e=>i(e.slug,n));return/* @__PURE__ */ x(Ze,{to:n,languageInsensitive:!0,children:r?.name||n})};return/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(Re,{children:/* @__PURE__ */ x(E,{size:`small`,value:l,onChange:({value:e})=>u(e),options:[{value:!1,label:`This page`},{value:!0,label:`All pages`}]})}),g.length===0?/* @__PURE__ */ x(ze,{children:l?`No reviews or comments yet.`:`No comments on this page yet.`}):/* @__PURE__ */ x(Be,{ref:m,children:g.map(e=>e.kind===`review`?/* @__PURE__ */ x(H,{author:e.review.author,createdAt:e.review.createdAt,action:/* @__PURE__ */ S(b,{children:[I[e.review.status],` `,/* @__PURE__ */ x(Xe,{children:`the pull request`})]}),text:e.review.comment},e.review.id):/* @__PURE__ */ x(H,{author:e.comment.author,createdAt:e.comment.createdAt,action:/* @__PURE__ */ S(b,{children:[`commented on `,v(e.comment.pageSlug)]}),text:e.comment.comment,tag:e.comment.isPending?/* @__PURE__ */ x(D,{children:`Pending`}):e.comment.isResolved&&/* @__PURE__ */ x(D,{children:`Resolved`}),aside:e.comment.isPending&&/* @__PURE__ */ x(z,{tip:`Delete pending comment`,children:/* @__PURE__ */ x(_,{variant:`text`,size:`small`,icon:/* @__PURE__ */ x(j,{color:`currentColor`}),"aria-label":`Delete pending comment`,disabled:n,onClick:()=>void a(e.comment.id)})}),children:e.replies.length>0&&/* @__PURE__ */ x(Ve,{children:e.replies.map(e=>/* @__PURE__ */ x(H,{author:e.author,createdAt:e.createdAt,action:`replied`,text:e.comment},e.id))})},e.comment.id))}),/* @__PURE__ */ x(we,{onSubmit:async e=>{e.preventDefault(),h&&await r(s.trim())&&c(``)},children:/* @__PURE__ */ S(Te,{children:[/* @__PURE__ */ x(Ee,{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__ */ S(De,{children:[/* @__PURE__ */ x($,{children:P}),/* @__PURE__ */ x(_,{type:`submit`,size:`small`,disabled:!h,children:`Comment`})]})]})})]})}function H({author:e,createdAt:t,action:n,text:r,tag:i,aside:a,children:o}){let{format:s}=C();return/* @__PURE__ */ S(He,{children:[e.avatarUrl?/* @__PURE__ */ x(We,{src:e.avatarUrl,alt:``}):/* @__PURE__ */ x(Ge,{"aria-hidden":!0,children:U(e.name)}),/* @__PURE__ */ S(Ke,{children:[/* @__PURE__ */ S(qe,{children:[/* @__PURE__ */ x(`strong`,{children:e.name||`Someone`}),/* @__PURE__ */ x(Je,{dateTime:t,children:s(new Date(t))}),i]}),/* @__PURE__ */ x(Ye,{children:n}),r&&/* @__PURE__ */ x(Qe,{children:r}),o]}),a]})}function U(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)||`?`}function ue({pullRequest:e,currentSlug:t,open:r,onToggle:i}){if(e.changedPages===null)return/* @__PURE__ */ x(z,{tip:`Platform has not compared this preview with production yet`,children:/* @__PURE__ */ x(Y,{children:`…`})});if(e.changedPages.length===0)return/* @__PURE__ */ x(z,{tip:`No page content changed; navigation, styles, or config can still differ`,children:/* @__PURE__ */ x(Y,{children:`No changed pages`})});let{openable:a,index:o,previous:s,next:c}=n(e.changedPages,t);return/* @__PURE__ */ S(Se,{children:[/* @__PURE__ */ x(z,{tip:s?`Previous: ${s.name||s.slug}`:``,disabled:!s,children:/* @__PURE__ */ x(_,{variant:`text`,icon:/* @__PURE__ */ x(A,{color:`currentColor`}),to:s?.slug,languageInsensitive:!0,disabled:!s,"aria-label":`Previous changed page`})}),/* @__PURE__ */ x(z,{tip:`Changed pages`,disabled:r,children:/* @__PURE__ */ x(_,{variant:`text`,onClick:i,"aria-expanded":r,children:o>=0?`${o+1}/${a.length}`:`${a.length} changed`})}),/* @__PURE__ */ x(z,{tip:c?`Next: ${c.name||c.slug}`:``,disabled:!c,children:/* @__PURE__ */ x(_,{variant:`text`,icon:/* @__PURE__ */ x(ie,{color:`currentColor`}),to:c?.slug,languageInsensitive:!0,disabled:!c,"aria-label":`Next changed page`})})]})}function de({pages:e,currentSlug:t,onOpen:a}){let[o,s]=p(``),[c,l]=p(`all`),u=e.length>5,m=r(e,c,o),h=m.slice(0,500),[g,_]=p(()=>Math.max(h.findIndex(e=>i(e.slug,t)),0)),v=f(null),{openable:y,index:C}=n(e,t);return d(()=>{v.current?.querySelector(`[data-active]`)?.scrollIntoView({block:`nearest`})},[g,o,c]),/* @__PURE__ */ S(b,{children:[u&&/* @__PURE__ */ S(Oe,{children:[/* @__PURE__ */ S(ke,{children:[/* @__PURE__ */ x(oe,{size:`16px`,color:`var(--icon-color-secondary)`}),/* @__PURE__ */ x(Ae,{autoFocus:!0,"aria-label":`Search changed pages`,placeholder:`Search ${e.length} changed pages`,value:o,onChange:e=>{s(e.target.value),_(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;_(e=>Math.min(Math.max(e+t,0),h.length-1))}else e.key===`Enter`&&(e.preventDefault(),v.current?.querySelector(`[data-active] a`)?.click())}})]}),/* @__PURE__ */ x(je,{children:/* @__PURE__ */ x(E,{size:`small`,value:c,onChange:({value:e})=>{l(e),_(0)},options:N.map(({value:t,label:n})=>({value:t,label:n,element:/* @__PURE__ */ S(b,{children:[n,` `,/* @__PURE__ */ x(Me,{children:r(e,t,``).length})]})}))})})]}),/* @__PURE__ */ S($e,{ref:v,children:[h.map((e,n)=>{let r=i(e.slug,t),o=/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ S(nt,{children:[/* @__PURE__ */ x(rt,{children:e.name||e.slug}),e.name&&e.name!==e.slug&&/* @__PURE__ */ x(it,{children:e.slug})]}),r?/* @__PURE__ */ x(at,{children:`Current`}):!u&&e.mode&&/* @__PURE__ */ x(at,{children:F[e.mode]})]});return/* @__PURE__ */ x(`li`,{"data-active":u&&n===g?``:void 0,children:e.mode===`removed`?/* @__PURE__ */ x(ot,{children:o}):/* @__PURE__ */ x(tt,{to:e.slug,languageInsensitive:!0,onClick:a,$current:r,children:o})},e.slug)}),h.length===0&&/* @__PURE__ */ x(Le,{children:`No changed pages match.`})]}),m.length>h.length&&/* @__PURE__ */ S(Le,{children:[`Showing `,h.length,` of `,m.length,` changed pages. Search to narrow them down.`]}),u&&/* @__PURE__ */ S(Ne,{children:[/* @__PURE__ */ x(`span`,{children:C>=0?`Page ${C+1} of ${y.length}`:`${y.length} changed pages`}),/* @__PURE__ */ x(K,{children:/* @__PURE__ */ S(Pe,{children:[/* @__PURE__ */ x(Q,{children:`↑`}),` `,/* @__PURE__ */ x(Q,{children:`↓`}),` to move · `,/* @__PURE__ */ x(Q,{children:`Enter`}),` to open`]})})]})]})}const W=g`
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
`,fe=g`
|
|
6
|
+
to {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
`,pe=g`
|
|
10
|
+
from {
|
|
11
|
+
width: var(--review-bar-collapse-from);
|
|
12
|
+
}
|
|
13
|
+
to {
|
|
14
|
+
width: var(--ai-assistant-button-icon-size);
|
|
15
|
+
border-radius: calc(var(--ai-assistant-button-icon-size) / 2);
|
|
16
|
+
}
|
|
17
|
+
`,me=g`
|
|
18
|
+
from {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
transform: scale(0.6);
|
|
21
|
+
}
|
|
22
|
+
`,he=m.div`
|
|
2
23
|
position: fixed;
|
|
3
|
-
bottom: var(--
|
|
24
|
+
bottom: var(--ai-assistant-button-bottom);
|
|
4
25
|
display: inline-flex;
|
|
5
26
|
align-items: center;
|
|
6
27
|
gap: var(--spacing-xxs);
|
|
7
|
-
|
|
28
|
+
min-height: var(--ai-assistant-button-text-height);
|
|
29
|
+
padding: calc(var(--spacing-xxs) - 1px);
|
|
8
30
|
border: 1px solid var(--border-color-secondary);
|
|
9
31
|
border-radius: var(--border-radius-xl);
|
|
10
32
|
background: var(--bg-color-raised);
|
|
@@ -16,36 +38,108 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
16
38
|
user-select: none;
|
|
17
39
|
z-index: var(--z-index-raised);
|
|
18
40
|
cursor: ${({$dragging:e})=>e?`grabbing`:`default`};
|
|
41
|
+
${y}
|
|
42
|
+
|
|
43
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
44
|
+
& > * {
|
|
45
|
+
animation: ${W} 160ms ease-out;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
19
48
|
|
|
20
|
-
${({$expanded:e})=>e&&
|
|
49
|
+
${({$expanded:e})=>e&&h`
|
|
21
50
|
flex-direction: column;
|
|
22
51
|
align-items: stretch;
|
|
23
52
|
width: 480px;
|
|
24
|
-
max-width: calc(100vw - 2 * var(--spacing-
|
|
53
|
+
max-width: calc(100vw - 2 * var(--spacing-xl));
|
|
25
54
|
max-height: 70vh;
|
|
26
55
|
white-space: normal;
|
|
27
56
|
`}
|
|
28
|
-
|
|
57
|
+
|
|
58
|
+
${({$collapsed:e})=>e&&h`
|
|
59
|
+
width: var(--ai-assistant-button-icon-size);
|
|
60
|
+
height: var(--ai-assistant-button-icon-size);
|
|
61
|
+
padding: 0;
|
|
62
|
+
border-radius: var(--ai-assistant-button-border-radius-icon);
|
|
63
|
+
|
|
64
|
+
& > * {
|
|
65
|
+
flex: 1;
|
|
66
|
+
align-self: stretch;
|
|
67
|
+
}
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
${({$collapsing:e})=>e&&h`
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
|
|
73
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
74
|
+
animation: ${pe} 220ms ease-in-out forwards;
|
|
75
|
+
|
|
76
|
+
& > * {
|
|
77
|
+
animation: ${fe} 120ms ease-in forwards;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`}
|
|
81
|
+
`,ge=m.button`
|
|
82
|
+
position: relative;
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
flex: 1;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
border: 0;
|
|
88
|
+
border-radius: var(--ai-assistant-button-border-radius-icon);
|
|
89
|
+
padding: 0;
|
|
90
|
+
background: transparent;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
|
|
93
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
94
|
+
animation: ${me} 180ms ease-out;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:hover {
|
|
98
|
+
background: var(--bg-color-hover);
|
|
99
|
+
}
|
|
100
|
+
`,G=m.span`
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: var(--spacing-xs);
|
|
103
|
+
right: var(--spacing-xs);
|
|
104
|
+
width: 8px;
|
|
105
|
+
height: 8px;
|
|
106
|
+
border-radius: 50%;
|
|
107
|
+
background: ${({$tone:e})=>e===`error`?`var(--color-error-base)`:`var(--color-info-base)`};
|
|
108
|
+
box-shadow: 0 0 0 2px var(--bg-color-raised);
|
|
109
|
+
`,_e=m.span`
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: calc(-1 * var(--spacing-xxs));
|
|
112
|
+
right: calc(-1 * var(--spacing-xxs));
|
|
113
|
+
min-width: 16px;
|
|
114
|
+
height: 16px;
|
|
115
|
+
padding: 0 var(--spacing-xxs);
|
|
116
|
+
border-radius: var(--border-radius-lg);
|
|
117
|
+
background: var(--color-info-base);
|
|
118
|
+
color: var(--color-static-white);
|
|
119
|
+
font-size: var(--font-size-sm);
|
|
120
|
+
line-height: 16px;
|
|
121
|
+
text-align: center;
|
|
122
|
+
`,ve=m.div`
|
|
29
123
|
display: flex;
|
|
30
124
|
align-items: center;
|
|
31
125
|
gap: var(--spacing-xxs);
|
|
32
126
|
white-space: nowrap;
|
|
33
|
-
`,
|
|
127
|
+
`,ye=m.span`
|
|
34
128
|
flex: 1;
|
|
35
|
-
`,
|
|
129
|
+
`,be=m.div`
|
|
36
130
|
display: flex;
|
|
37
131
|
flex-direction: column;
|
|
38
132
|
min-height: 0;
|
|
39
133
|
border-top: 1px solid var(--border-color-secondary);
|
|
40
134
|
user-select: text;
|
|
41
135
|
cursor: auto;
|
|
42
|
-
`,
|
|
136
|
+
`,K=m.span`
|
|
43
137
|
display: contents;
|
|
44
138
|
|
|
45
|
-
@media screen and (max-width: ${
|
|
139
|
+
@media screen and (max-width: ${v.small}) {
|
|
46
140
|
display: none;
|
|
47
141
|
}
|
|
48
|
-
`,
|
|
142
|
+
`,xe=m.button`
|
|
49
143
|
display: inline-flex;
|
|
50
144
|
align-items: center;
|
|
51
145
|
align-self: stretch;
|
|
@@ -54,26 +148,26 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
54
148
|
background: transparent;
|
|
55
149
|
touch-action: none;
|
|
56
150
|
cursor: ${({$dragging:e})=>e?`grabbing`:`grab`};
|
|
57
|
-
`,
|
|
151
|
+
`,q=m.span`
|
|
58
152
|
display: inline-flex;
|
|
59
153
|
padding: 0 var(--spacing-xs);
|
|
60
|
-
`,
|
|
154
|
+
`,Se=m.span`
|
|
61
155
|
display: inline-flex;
|
|
62
156
|
align-items: center;
|
|
63
|
-
`,
|
|
157
|
+
`,J=m.span`
|
|
64
158
|
align-self: stretch;
|
|
65
159
|
width: 1px;
|
|
66
160
|
margin: var(--spacing-xs) 0;
|
|
67
161
|
background: var(--border-color-secondary);
|
|
68
|
-
`,
|
|
162
|
+
`,Y=m.span`
|
|
69
163
|
padding: 0 var(--spacing-xs);
|
|
70
164
|
color: var(--text-color-description);
|
|
71
|
-
`,
|
|
165
|
+
`,Ce=m.div`
|
|
72
166
|
position: absolute;
|
|
73
167
|
display: flex;
|
|
74
168
|
flex-direction: column;
|
|
75
169
|
bottom: calc(100% + var(--spacing-xs));
|
|
76
|
-
${({$slot:e})=>e===`left`?`left: 0;`:e===`right`?`right:
|
|
170
|
+
${({$slot:e})=>e===`left`?`left: 0;`:e===`right`?`right: calc(-1 * var(--bar-right-inset, 0px));`:`left: 50%; transform: translateX(-50%);`}
|
|
77
171
|
width: 360px;
|
|
78
172
|
max-width: calc(100vw - 2 * var(--spacing-lg));
|
|
79
173
|
overflow: hidden;
|
|
@@ -84,10 +178,10 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
84
178
|
white-space: normal;
|
|
85
179
|
user-select: text;
|
|
86
180
|
cursor: auto;
|
|
87
|
-
`,
|
|
181
|
+
`,we=m.form`
|
|
88
182
|
padding: var(--spacing-xs);
|
|
89
183
|
border-top: 1px solid var(--border-color-secondary);
|
|
90
|
-
`,
|
|
184
|
+
`,X=h`
|
|
91
185
|
border: 1px solid var(--input-border-color);
|
|
92
186
|
border-radius: var(--input-border-radius);
|
|
93
187
|
background: var(--input-bg-color);
|
|
@@ -100,7 +194,7 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
100
194
|
border-color: var(--text-color-disabled);
|
|
101
195
|
box-shadow: 0 0 0 2px var(--border-color-secondary);
|
|
102
196
|
}
|
|
103
|
-
`,
|
|
197
|
+
`,Z=h`
|
|
104
198
|
border: 0;
|
|
105
199
|
outline: none;
|
|
106
200
|
background: transparent;
|
|
@@ -110,40 +204,40 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
110
204
|
&::placeholder {
|
|
111
205
|
color: var(--input-content-placeholder-color);
|
|
112
206
|
}
|
|
113
|
-
`,
|
|
114
|
-
${
|
|
207
|
+
`,Te=m.div`
|
|
208
|
+
${X}
|
|
115
209
|
display: flex;
|
|
116
210
|
flex-direction: column;
|
|
117
211
|
padding: var(--spacing-xxs) var(--spacing-xs);
|
|
118
|
-
`,
|
|
119
|
-
${
|
|
212
|
+
`,Ee=m.textarea`
|
|
213
|
+
${Z}
|
|
120
214
|
box-sizing: border-box;
|
|
121
215
|
width: 100%;
|
|
122
216
|
padding: var(--spacing-xxs);
|
|
123
217
|
resize: none;
|
|
124
|
-
`,
|
|
218
|
+
`,De=m.div`
|
|
125
219
|
display: flex;
|
|
126
220
|
align-items: center;
|
|
127
221
|
justify-content: flex-end;
|
|
128
222
|
gap: var(--spacing-xs);
|
|
129
|
-
`,
|
|
223
|
+
`,Oe=m.div`
|
|
130
224
|
display: flex;
|
|
131
225
|
flex-direction: column;
|
|
132
226
|
gap: var(--spacing-xs);
|
|
133
227
|
padding: var(--spacing-xs);
|
|
134
228
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
135
|
-
`,
|
|
136
|
-
${
|
|
229
|
+
`,ke=m.label`
|
|
230
|
+
${X}
|
|
137
231
|
display: flex;
|
|
138
232
|
align-items: center;
|
|
139
233
|
gap: var(--spacing-xs);
|
|
140
234
|
padding: var(--spacing-xxs) var(--spacing-sm);
|
|
141
|
-
`,
|
|
142
|
-
${
|
|
235
|
+
`,Ae=m.input`
|
|
236
|
+
${Z}
|
|
143
237
|
flex: 1;
|
|
144
238
|
min-width: 0;
|
|
145
239
|
padding: 0;
|
|
146
|
-
`,
|
|
240
|
+
`,je=m.div`
|
|
147
241
|
> div {
|
|
148
242
|
width: 100%;
|
|
149
243
|
}
|
|
@@ -152,9 +246,9 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
152
246
|
flex: 1 1 auto;
|
|
153
247
|
padding-inline: var(--spacing-xs);
|
|
154
248
|
}
|
|
155
|
-
`,
|
|
249
|
+
`,Me=m.span`
|
|
156
250
|
color: var(--text-color-description);
|
|
157
|
-
`,
|
|
251
|
+
`,Ne=m.div`
|
|
158
252
|
display: flex;
|
|
159
253
|
align-items: center;
|
|
160
254
|
justify-content: space-between;
|
|
@@ -164,39 +258,39 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
164
258
|
color: var(--text-color-description);
|
|
165
259
|
font-size: var(--font-size-sm);
|
|
166
260
|
line-height: var(--line-height-sm);
|
|
167
|
-
`,
|
|
261
|
+
`,Pe=m.span`
|
|
168
262
|
white-space: nowrap;
|
|
169
|
-
`,
|
|
263
|
+
`,Q=m.kbd`
|
|
170
264
|
padding: 0 var(--spacing-xxs);
|
|
171
265
|
border-radius: var(--border-radius-sm);
|
|
172
266
|
background: var(--border-color-secondary);
|
|
173
267
|
color: var(--text-color-secondary);
|
|
174
268
|
font: inherit;
|
|
175
|
-
|
|
269
|
+
`,$=m.div`
|
|
176
270
|
color: var(--text-color-description);
|
|
177
271
|
font-size: var(--font-size-sm);
|
|
178
272
|
line-height: var(--line-height-sm);
|
|
179
|
-
`,
|
|
273
|
+
`,Fe=m.div`
|
|
180
274
|
display: flex;
|
|
181
275
|
align-items: center;
|
|
182
276
|
justify-content: space-between;
|
|
183
277
|
gap: var(--spacing-sm);
|
|
184
278
|
padding: var(--spacing-xs);
|
|
185
279
|
border-top: 1px solid var(--border-color-secondary);
|
|
186
|
-
`,
|
|
280
|
+
`,Ie=m.span`
|
|
187
281
|
display: inline-flex;
|
|
188
282
|
align-items: center;
|
|
189
283
|
gap: var(--spacing-xxs);
|
|
190
284
|
margin-left: var(--spacing-xs);
|
|
191
|
-
`,
|
|
285
|
+
`,Le=m($)`
|
|
192
286
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
193
|
-
`,
|
|
287
|
+
`,Re=m.div`
|
|
194
288
|
padding: var(--spacing-xs);
|
|
195
289
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
196
|
-
`,
|
|
290
|
+
`,ze=m.div`
|
|
197
291
|
padding: var(--spacing-sm);
|
|
198
292
|
color: var(--text-color-description);
|
|
199
|
-
`,
|
|
293
|
+
`,Be=m.ol`
|
|
200
294
|
display: flex;
|
|
201
295
|
flex-direction: column;
|
|
202
296
|
gap: var(--spacing-md);
|
|
@@ -205,37 +299,37 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
205
299
|
padding: var(--spacing-xs);
|
|
206
300
|
overflow: auto;
|
|
207
301
|
list-style: none;
|
|
208
|
-
`,
|
|
302
|
+
`,Ve=m.ul`
|
|
209
303
|
display: flex;
|
|
210
304
|
flex-direction: column;
|
|
211
305
|
gap: var(--spacing-sm);
|
|
212
306
|
margin: var(--spacing-sm) 0 0;
|
|
213
307
|
padding: 0;
|
|
214
308
|
list-style: none;
|
|
215
|
-
`,
|
|
309
|
+
`,He=m.li`
|
|
216
310
|
display: flex;
|
|
217
311
|
align-items: flex-start;
|
|
218
312
|
gap: var(--spacing-xs);
|
|
219
|
-
`,
|
|
313
|
+
`,Ue=h`
|
|
220
314
|
flex: none;
|
|
221
315
|
width: 24px;
|
|
222
316
|
height: 24px;
|
|
223
317
|
border-radius: 50%;
|
|
224
|
-
`,
|
|
225
|
-
${
|
|
318
|
+
`,We=m.img`
|
|
319
|
+
${Ue}
|
|
226
320
|
object-fit: cover;
|
|
227
|
-
`,
|
|
228
|
-
${
|
|
321
|
+
`,Ge=m.span`
|
|
322
|
+
${Ue}
|
|
229
323
|
display: inline-flex;
|
|
230
324
|
align-items: center;
|
|
231
325
|
justify-content: center;
|
|
232
326
|
background: var(--border-color-secondary);
|
|
233
327
|
color: var(--text-color-secondary);
|
|
234
328
|
font-size: var(--font-size-sm);
|
|
235
|
-
`,
|
|
329
|
+
`,Ke=m.div`
|
|
236
330
|
flex: 1;
|
|
237
331
|
min-width: 0;
|
|
238
|
-
`,
|
|
332
|
+
`,qe=m.div`
|
|
239
333
|
display: flex;
|
|
240
334
|
flex-wrap: wrap;
|
|
241
335
|
align-items: center;
|
|
@@ -245,25 +339,25 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
245
339
|
color: var(--text-color-primary);
|
|
246
340
|
font-weight: var(--font-weight-semibold);
|
|
247
341
|
}
|
|
248
|
-
`,
|
|
342
|
+
`,Je=m.time`
|
|
249
343
|
color: var(--text-color-description);
|
|
250
344
|
font-size: var(--font-size-sm);
|
|
251
|
-
`,
|
|
345
|
+
`,Ye=m.div`
|
|
252
346
|
overflow: hidden;
|
|
253
347
|
color: var(--text-color-secondary);
|
|
254
348
|
text-overflow: ellipsis;
|
|
255
349
|
white-space: nowrap;
|
|
256
|
-
`,
|
|
350
|
+
`,Xe=m.span`
|
|
257
351
|
color: var(--text-color-primary);
|
|
258
352
|
font-weight: var(--font-weight-medium);
|
|
259
|
-
`,
|
|
260
|
-
${
|
|
261
|
-
`,
|
|
353
|
+
`,Ze=m(w)`
|
|
354
|
+
${T}
|
|
355
|
+
`,Qe=m.p`
|
|
262
356
|
margin: var(--spacing-xxs) 0 0;
|
|
263
357
|
color: var(--text-color-primary);
|
|
264
358
|
white-space: pre-wrap;
|
|
265
359
|
overflow-wrap: anywhere;
|
|
266
|
-
|
|
360
|
+
`,$e=m.ul`
|
|
267
361
|
flex: 1;
|
|
268
362
|
min-height: 0;
|
|
269
363
|
margin: 0;
|
|
@@ -274,7 +368,7 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
274
368
|
li[data-active] > * {
|
|
275
369
|
background: var(--dropdown-menu-item-bg-color-hover);
|
|
276
370
|
}
|
|
277
|
-
`,
|
|
371
|
+
`,et=h`
|
|
278
372
|
display: flex;
|
|
279
373
|
align-items: center;
|
|
280
374
|
justify-content: space-between;
|
|
@@ -283,39 +377,39 @@ import{withPathPrefix as e}from"../../shared/path-prefix.js";import{PageContext
|
|
|
283
377
|
border-radius: var(--dropdown-menu-item-border-radius);
|
|
284
378
|
color: var(--dropdown-menu-item-color);
|
|
285
379
|
text-decoration: none;
|
|
286
|
-
`,
|
|
287
|
-
${
|
|
380
|
+
`,tt=m(w)`
|
|
381
|
+
${et}
|
|
288
382
|
background: ${({$current:e})=>e?`var(--dropdown-menu-item-bg-color-active)`:`transparent`};
|
|
289
383
|
|
|
290
384
|
&:hover {
|
|
291
385
|
background: var(--dropdown-menu-item-bg-color-hover);
|
|
292
386
|
color: var(--dropdown-menu-item-color-hover);
|
|
293
387
|
}
|
|
294
|
-
`,
|
|
388
|
+
`,nt=m.span`
|
|
295
389
|
display: flex;
|
|
296
390
|
flex-direction: column;
|
|
297
391
|
min-width: 0;
|
|
298
|
-
`,
|
|
392
|
+
`,rt=m.span`
|
|
299
393
|
overflow: hidden;
|
|
300
394
|
text-overflow: ellipsis;
|
|
301
395
|
white-space: nowrap;
|
|
302
|
-
`,
|
|
396
|
+
`,it=m.span`
|
|
303
397
|
overflow: hidden;
|
|
304
398
|
color: var(--text-color-description);
|
|
305
399
|
font-size: var(--font-size-sm);
|
|
306
400
|
line-height: var(--line-height-sm);
|
|
307
401
|
text-overflow: ellipsis;
|
|
308
402
|
white-space: nowrap;
|
|
309
|
-
|
|
403
|
+
`,at=m.span`
|
|
310
404
|
flex: none;
|
|
311
405
|
color: var(--text-color-description);
|
|
312
406
|
font-size: var(--font-size-sm);
|
|
313
407
|
line-height: var(--line-height-sm);
|
|
314
|
-
`,
|
|
315
|
-
${
|
|
408
|
+
`,ot=m.span`
|
|
409
|
+
${et}
|
|
316
410
|
color: var(--dropdown-menu-item-color-disabled);
|
|
317
411
|
|
|
318
|
-
${
|
|
412
|
+
${rt} {
|
|
319
413
|
text-decoration: line-through;
|
|
320
414
|
}
|
|
321
|
-
`;export{
|
|
415
|
+
`;export{B as ReviewBar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PLATFORM_LOGIN_PARAM as e}from"../../shared/constants/review.js";import{withPathPrefix as t}from"../../shared/path-prefix.js";function n(n,r){return t(`${n}?redirectTo=${encodeURIComponent(r)}&${e}=true`)}export{n as reviewLoginUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{REVIEW_ROUTE_PATH as e}from"../../shared/constants/review.js";import{withPathPrefix as t}from"../../shared/path-prefix.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(t(e),{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(e,n)=>{d(!0),l(null);try{let r=await fetch(t(e),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(t=>f(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),[f]),deleteComment:n(t=>f(`${e}/comments/${encodeURIComponent(t)}`,{method:`DELETE`}),[f])}}export{o as useReview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{SIDEBAR_BACK_LINK_ROUTE_DEP_KEY as e,SIDEBAR_BREADCRUMBS_ROUTE_DEP_KEY as t}from"../../shared/constants/route-deps.js";import{EMPTY_SIDEBAR_DATA as n,PageContext as r,SidebarDataContext as i}from"../contexts.js";import{useL10nHref as a}from"../l10n/use-l10n-href.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[e],_=f[t],v=l(r),{pathname:y}=u(),b=a(),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(n);return E.current.key!==T&&(E.current={key:T,...w}),/* @__PURE__ */ d(i.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{MenuItemType as e}from"@redocly/theme/core/constants";import{getMenuItemType as t}from"@redocly/theme/core/utils";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(t(i)===e.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{DEFAULT_LOCALE_PLACEHOLDER as e}from"../shared/constants/l10n/defaults.js";import"../shared/utils/l10n.js";import{stripPathPrefix as t}from"../shared/path-prefix.js";import{L10nContext as n}from"./l10n/l10n-context.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||e,D=g(T,E,r(w)),O=o(C,t(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 t=await f({page:v,loaderData:C,Template:e,url:b});return globalThis.SSR_HOSTNAME=x??``,/* @__PURE__ */ _(s.Provider,{value:e=>P=e,children:/* @__PURE__ */ _(n.Provider,{value:A,children:t})})},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{OTEL_TRACES_ROUTE_PATH as e}from"../../shared/constants/telemetry.js";import{withPathPrefix as t}from"../../shared/path-prefix.js";import{telemetryServiceVersion as n}from"../../shared/telemetry-service-version.js";const r=process.env.REDOCLY_TELEMETRY===`on`;function i(){return new URL(t(e),window.location.origin).toString()}function a(){if(typeof window<`u`)return{collectorUrl:i(),disabled:!r,serviceVersion:n()}}export{r as CLIENT_TELEMETRY_ENABLED,a as apiDocsTelemetryConfig,i as clientTelemetryCollectorUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isObject as e}from"../shared/utils/is-object.js";import{getPathPrefix as t,withPathPrefix as n,withPathPrefixForSrcSet as r}from"../shared/path-prefix.js";function i(a){return t()===``||!Array.isArray(a)?a:a.map(t=>{if(!e(t))return t;let a={...t};return typeof t.icon==`string`&&(a.icon=n(t.icon)),typeof t.srcSet==`string`&&(a.srcSet=r(t.srcSet)),Array.isArray(t.items)&&(a.items=i(t.items)),a})}function a(i){let{logo:a}=i;if(t()===``||!e(a))return i;let o={...a};return typeof a.image==`string`&&(o.image=n(a.image)),typeof a.favicon==`string`&&(o.favicon=n(a.favicon)),typeof a.srcSet==`string`&&(o.srcSet=r(a.srcSet)),{...i,logo:o}}export{i as prefixNavbarIconUrls,a as prefixThemeLogoUrls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as e,useEffect as t,useLayoutEffect as n,useRef as r,useState as i}from"react";const a=[`left`,`middle`,`right`];function o(e,t){try{let n=localStorage.getItem(e);return a.includes(n)?n:t}catch{return t}}function s(e,t,n){let r=32+t/2,i=window.innerWidth-n-t/2;return e===`left`?r:e===`right`?i:Math.max(r,Math.min(window.innerWidth/2,i))}function c({storageKey:c,defaultSlot:l,frozen:u=!1}){let d=r(null),[f,p]=i(()=>o(c,l)),[m,h]=i(!1),[g,_]=i(null),[v,y]=i(32),[b,x]=i(null),S=r(0),C=r(null),w=e(()=>d.current?.getBoundingClientRect().width??0,[]);n(()=>{if(u)return;let e=d.current,t=document.querySelector(`[data-component-name="Buttons/AIAssistantButton"]`),n=()=>{let e=t?.getBoundingClientRect(),n=e&&e.width>0?window.innerWidth-e.left+8:32,r=w()<=window.innerWidth-32-n?n:32;y(r),x(s(`middle`,w(),r))};n();let r=new ResizeObserver(n);return e&&r.observe(e),t&&r.observe(t),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n)}},[w,u]),t(()=>{if(!m)return;let e=e=>{let t=w(),n=Math.min(Math.max(e.clientX-S.current,s(`left`,t,v)),s(`right`,t,v));C.current=n,_(n)},t=()=>{let e=C.current??0,t=w(),n=[...a].sort((n,r)=>Math.abs(s(n,t,v)-e)-Math.abs(s(r,t,v)-e))[0];p(n);try{localStorage.setItem(c,n)}catch{}C.current=null,_(null),h(!1)};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[m,w,c,v]);let T=e(e=>{let t=d.current?.getBoundingClientRect();if(e.button!==0||!t)return;let n=t.left+t.width/2;S.current=e.clientX-n,C.current=n,_(n),h(!0),e.preventDefault()},[]);return{barRef:d,slot:f,dragging:m,style:g===null?f===`left`?{left:`32px`}:f===`right`?{right:`${v}px`,"--bar-right-inset":`${v-32}px`}:{left:b===null?`50%`:`${b}px`,transform:`translateX(-50%)`}:{left:`${g}px`,transform:`translateX(-50%)`},onDragStart:T}}export{c as useBarPosition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{REVISIONS_ROUTE_DEP_KEY as e}from"../shared/constants/revisions.js";import{LoaderDataContext as t}from"./contexts.js";import{useContext as n}from"react";const r={entityKey:null,items:[]};function i(t){let n=t[e];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(e){let{items:r}=i(n(t));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{compareVersions as e,toPhysicalVersionedSlug as t,toPublicVersionedSlug as n,versionRoutePrefix as r}from"../shared/constants/versions.js";import{PageContext as i,SidebarDataContext as a}from"./contexts.js";import{selectEntityRevisions as o}from"./use-entity-revisions.js";import{useContext as s,useMemo as c}from"react";const l=[];function u(e){return{name:typeof e?.version==`string`?e.version:void 0,group:typeof e?.versionGroup==`string`?e.versionGroup:void 0}}function d(i,a){let{name:o,group:s}=u(a);if(s===void 0||o===void 0)return l;let c=/* @__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=c.get(e.version);t||(t={firstLink:e.link,isDefault:!1,links:/* @__PURE__ */ new Set},c.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(i??[]),c.size===0)return l;let f=a?.slug??``,p=t(f,s,o),m=p===null?null:p.slice(r(s,o).length),h=(e,t)=>{if(m===null)return t.firstLink;let i=n(`${r(s,e)}${m}`,s,e,t.isDefault);return t.links.has(i)?i:t.firstLink};return[...c.entries()].sort(([t],[n])=>e(n,t)).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 f(e,t){let{name:n,group:i}=u(t);return i===void 0||n===void 0?[]:o(e).items.flatMap(({version:e})=>typeof e==`string`&&e!==n?[r(i,e)]:[])}function p(){let e=s(a),t=s(i);return{versions:c(()=>d(e.allItems??e.items,t),[e,t])}}export{u as selectActiveVersion,f as selectOtherVersionRoutes,d as selectPageVersions,p 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{SEARCH_FACETS_ROUTE_PATH as n,SEARCH_ROUTE_PATH as r}from"../shared/constants/search.js";import{APP_DATA_LOADER_KEY as i}from"../shared/constants/app-data.js";import{withPathPrefix as a}from"../shared/path-prefix.js";import{readAppData as o}from"../shared/utils/app-data.js";import{LoaderDataContext as s,PageContext as c}from"./contexts.js";import{useL10nConfig as l}from"./l10n/use-l10n-config.js";import{telemetry as u}from"./telemetry/telemetry.js";import{selectActiveVersion as d}from"./use-page-versions.js";import{SEARCH_DEBOUNCE_TIME_MS as f}from"@redocly/theme/core/constants";import{useCallback as p,useContext as m,useEffect as h,useMemo as g,useRef as _,useState as v}from"react";import{getBaseDataAttributes as y}from"@redocly/theme/core/utils";import{SearchSessionContext as b}from"@redocly/theme/core/contexts";async function x(e,t,n){let r=await fetch(a(e),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:n});if(!r.ok)throw Error(r.statusText||`Search request failed (${r.status})`);return await r.json()}function S(e,t){return x(r,e,t)}function C(e){return Object.fromEntries(e.map(e=>[e.field,e.values]))}function w(e,t){return x(n,e,t)}function T(e){return o(e).theme?.aiAssistant?.hide===!1}function E(){let e=m(s),t=m(c);return{askAi:T(e)&&t?.aiAvailable===!0}}function D(e){return e.filter(e=>e.values.length>0).map(({field:e,values:t})=>({field:e,values:[...t]}))}function O(){let e=m(c),{currentLocale:t,defaultLocale:n}=l(),r=t===n?void 0:t,{name:i,group:a}=d(e);return g(()=>({locale:r,version:a!==void 0&&i!==void 0?{group:a,version:i}:void 0}),[r,a,i])}function k(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 A=(e,t)=>e.map(e=>({...e,isCounterVisible:t}));function j(n,r){let a=r===!1,{askAi:o}=E(),c=m(s),l=m(b)?.searchSessionId,d=O(),x=g(()=>t(c[i]),[c]),[T,j]=v(``),[M,N]=v([]),[ee,P]=v({}),[F,I]=v({}),[L,R]=v({}),[z,B]=v({}),[V,H]=v(!1),[te,U]=v(null),[ne,re]=v(),[W,G]=v(!1),K=_(null),q=_(null),J=_(!1),Y=g(()=>D(M),[M]),X=Y.length>0,Z=p(()=>{q.current=null,P({}),I({}),B({})},[]),Q=p((e,t,n)=>{K.current?.abort();let r=new AbortController;return K.current=r,H(!0),U(null),S(e,r.signal).then(e=>{r.signal.aborted||t(e)}).catch(e=>{r.signal.aborted||(U(e instanceof Error?e.message:`Search request failed`),n())}).finally(()=>{r.signal.aborted||H(!1)})},[]),$=p(async e=>{let t=e.trim();if(t===``&&!X){K.current?.abort(),J.current=!1,Z(),G(!1),U(null),H(!1);return}let r={query:t,...d,filter:Y,product:n};J.current=!0,await Q(r,i=>{J.current=!1,q.current=r,P(i.documents),I(i.facets??{}),B(i.groupCounts??{}),re(i.partial),G(!0),t.length>1&&u.sendSearchQueryMessage([{...y(`searchQuery`,`search`),query:e,resultCount:Object.values(i.documents).reduce((e,t)=>e+t.length,0).toString(),...l?{searchSessionId:l}:{},...n?{product:n}:{}}])},()=>{J.current=!1,Z()})},[d,Y,X,Q,Z,n,l]),ie=p(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]??[];P(e=>({...e,[t.groupKey]:[...e[t.groupKey]??[],...n]})),B(t=>({...t,...e.groupCounts}))},()=>{})},[Q]);h(()=>{if(r)return;(T.trim()!==``||X)&&H(!0);let e=setTimeout(()=>{$(T)},f);return()=>clearTimeout(e)},[T,r,X,$]),h(()=>{if(!x.advanced||!a)return;let e=new AbortController;return w({...d,product:n},e.signal).then(e=>R(C(e))).catch(()=>{e.signal.aborted||R({})}),()=>e.abort()},[x.advanced,a,d,n]),h(()=>()=>K.current?.abort(),[]);let ae=p(async()=>{await $(T)},[T,$]),oe=g(()=>x.facets.map(e=>({...e,values:W?A(F[e.field]??[],!0):A(L[e.field]??[],!1)})),[x.facets,W,F,L]);return{advancedSearch:x.advanced,askAi:o,facets:oe,filter:M,groupCounts:z,groupField:e,isSearchLoading:V,items:ee,query:T,searchError:te,setFilter:N,setLoadMore:ie,setQuery:j,retrySearch:ae,notice:k(ne)}}function M(e){let n=O(),r=m(s),a=g(()=>t(r[i]).facets.find(t=>t.field===e),[r,e]),[o,c]=v(null),[l,u]=v(null);return h(()=>{if(l===null){c(null);return}let t=new AbortController;return w({...n,field:e,query:l.query,filter:D(l.filter),facetQuery:l.facetQuery},t.signal).then(t=>{c(a?{...a,values:A(C(t)[e]??[],!0)}:null)}).catch(()=>{t.signal.aborted||c(null)}),()=>t.abort()},[e,n,l,a]),{searchFacet:o,setSearchFacet:c,setSearchFacetQuery:u}}export{S as fetchSearch,w as fetchSearchFacets,M as useFacetQuery,j as useSearch,E as useSearchFeatures,O as useSearchScope};
|