Skip to content

Commit

Permalink
Feat: supports OSS Chat with Orama Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
raiindev committed Nov 25, 2024
1 parent 65357d8 commit eac8041
Show file tree
Hide file tree
Showing 14 changed files with 1,189 additions and 1,014 deletions.
3 changes: 2 additions & 1 deletion apps/demo-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"@orama/react-components": "workspace:*"
"@orama/react-components": "workspace:*",
"@oramacloud/client": "^2.1.4"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
1 change: 1 addition & 0 deletions apps/demo-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { OramaChatBox, OramaSearchBox, OramaSearchButton } from '@orama/react-components'
import './App.css'
import { OramaClient } from "@oramacloud/client"

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@orama/wc-components": "workspace:*",
"@oramacloud/client": "1.3.15",
"@oramacloud/client": "^2.1.0",
"@storybook/preview-api": "^8.2.9",
"@storybook/web-components": "^8.2.3"
},
Expand Down
19 changes: 7 additions & 12 deletions apps/storybook/stories/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export type DemoIndexConfig = Record<string, Components.OramaSearchBox>
const demoIndexes: DemoIndexConfig = {
orama: {
open: true,
index: {
api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J',
endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd',
},
// Uncomment this line to use the OramaClient instance and comment the index prop
// clientInstance: new OramaClient({
// index: {
// api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J',
// endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd',
// }),
// },
// Uncomment this line to use the OramaClient instance and comment the index prop
clientInstance: new OramaClient({
api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J',
endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd',
}),
placeholder: 'What do you want to learn about Orama?',
sourceBaseUrl: 'https://docs.orama.com',
sourcesMap: {
Expand All @@ -28,11 +28,6 @@ const demoIndexes: DemoIndexConfig = {
description: 'content',
section: 'category',
},
highlight: {
caseSensitive: false,
HTMLTag: 'b',
CSSClass: 'font-bold',
},
},
recipes: {
open: true,
Expand Down
5 changes: 4 additions & 1 deletion apps/storybook/stories/public/orama-search-box.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ const Template = ({
facetProperty,
themeConfig,
index,
clientInstance,
sourceBaseUrl,
sourcesMap,
highlight,
resultMap,
}) => {
return html`<div>
Expand All @@ -93,6 +93,7 @@ const Template = ({
.colorScheme=${colorScheme}
.themeConfig=${themeConfig || preset.themeConfig}
.index=${index || preset.index}
.clientInstance=${clientInstance || preset.clientInstance}
.instance=${preset.instance}
.suggestions=${suggestions || preset?.suggestions}
.sourceBaseUrl=${sourceBaseUrl || preset?.sourceBaseUrl}
Expand All @@ -119,6 +120,7 @@ const TemplateAsEmbed = ({
resultMap,
themeConfig,
index,
clientInstance,
sourceBaseURL,
suggestions,
sourcesMap,
Expand All @@ -132,6 +134,7 @@ const TemplateAsEmbed = ({
.colorScheme=${colorScheme}
.themeConfig=${themeConfig || preset.themeConfig}
.index=${index || preset.index}
.clientInstance=${clientInstance || preset.clientInstance}
.instance=${preset.instance}
.suggestions=${suggestions || preset?.suggestions}
.sourceBaseUrl=${sourceBaseURL || preset?.sourceBaseUrl}
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-stencil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"types": "dist/types/index.d.ts",
"dependencies": {
"@orama/highlight": "^0.1.6",
"@orama/orama": "^2.0.23",
"@orama/orama": "^3.0.0",
"@orama/switch": "^3.0.0",
"@oramacloud/client": "^2.1.0",
"@phosphor-icons/webcomponents": "^2.1.5",
"@stencil/core": "^4.19.0",
Expand Down
Loading

0 comments on commit eac8041

Please sign in to comment.