Skip to content

Commit

Permalink
docs(headless): typedoc beta note for ssr-commerce
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmarceau committed Feb 14, 2025
1 parent d1f0e7b commit 90706f1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/headless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ The `@coveo/headless` package exposes several entry points.

The entry point from which you will import Coveo Headless resources depends on the engine type you are using:

| Engine type | Entry point |
| --------------------- | -------------------------------- |
| Search engine | `@coveo/headless` |
| Search SSR engine | `@coveo/headless/ssr` |
| CaseAssist engine | `@coveo/headless/case-assist` |
| Commerce engine | `@coveo/headless/commerce` |
| Commerce SSR engine | `@coveo/headless/ssr-commerce`  |
| Insight engine | `@coveo/headless/insight` |
| Recommendation engine | `@coveo/headless/recommendation` |
| Engine type | Entry point |
| ---------------------------------- | -------------------------------- |
| Search engine | `@coveo/headless` |
| Search SSR engine | `@coveo/headless/ssr` |
| CaseAssist engine | `@coveo/headless/case-assist` |
| Commerce engine | `@coveo/headless/commerce` |
| Commerce SSR engine (in open beta) | `@coveo/headless/ssr-commerce` |
| Insight engine | `@coveo/headless/insight` |
| Recommendation engine | `@coveo/headless/recommendation` |

## Contributing

Expand Down
4 changes: 4 additions & 0 deletions packages/headless/typedoc/lib/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {fileURLToPath} from 'node:url';
// eslint-disable-next-line n/no-unpublished-import
import {Application, JSX, RendererEvent, Converter} from 'typedoc';
import {insertAtomicSearchBox} from './insertAtomicSearchBox.js';
import {insertBetaNote} from './insertBetaNote.js';
import {insertCoveoLogo} from './insertCoveoLogo.js';
import {insertCustomComments} from './insertCustomComments.js';
import {insertOneTrust} from './insertOneTrust.js';
Expand Down Expand Up @@ -39,6 +40,9 @@ export function load(app: Application) {
<script>
<JSX.Raw html={`(${insertOneTrust.toString()})();`} />
</script>
<script>
<JSX.Raw html={`(${insertBetaNote.toString()})();`} />
</script>
<script>
<JSX.Raw
html={`(${insertCoveoLogo.toString()})('${event.relativeURL('assets')}');`}
Expand Down
17 changes: 17 additions & 0 deletions packages/headless/typedoc/lib/insertBetaNote.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export function insertBetaNote() {
document.addEventListener('DOMContentLoaded', () => {
const breadcrumbs = document.querySelector('ul.tsd-breadcrumb');
if (breadcrumbs) {
const IsSSRCommercePage = Array.from(
breadcrumbs.querySelectorAll('a')
).find((link) => link.textContent?.trim() === 'SSR Commerce');

if (IsSSRCommercePage) {
const h1Element = document.querySelector('h1');
if (h1Element) {
h1Element.textContent += ' (Open Beta)';
}
}
}
});
}

0 comments on commit 90706f1

Please sign in to comment.