Skip to content

Commit

Permalink
Merge branch 'main' into feat/adds-orama-oss-support
Browse files Browse the repository at this point in the history
  • Loading branch information
g-francesca committed Oct 31, 2024
2 parents 53a204d + 2c445a0 commit 8ca2442
Show file tree
Hide file tree
Showing 38 changed files with 380 additions and 245 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,11 @@
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
89 changes: 63 additions & 26 deletions apps/storybook/stories/public/orama-search-box.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ const meta: Meta<Components.OramaSearchBox & { preset: keyof DemoIndexConfig }>
},
},
},
chatPlaceholder: {
searchPlaceholder: {
control: { type: 'text' },
table: {
type: {
summary: 'string',
},
defaultValue: { summary: '' },
},
},
searchPlaceholder: {
chatPlaceholder: {
control: { type: 'text' },
table: {
type: {
summary: 'string',
},
defaultValue: { summary: 'Search...' },
defaultValue: { summary: '' },
},
},
colorScheme: {
Expand All @@ -64,59 +66,95 @@ const meta: Meta<Components.OramaSearchBox & { preset: keyof DemoIndexConfig }>
}
export default meta

const Template = ({ preset, chatPlaceholder, searchPlaceholder, colorScheme, disableChat }) => {
const Template = ({
preset,
chatPlaceholder,
searchPlaceholder,
colorScheme,
disableChat,
suggestions,
open,
facetProperty,
themeConfig,
index,
sourceBaseUrl,
sourcesMap,
highlight,
resultMap,
}) => {
return html`<div>
<div style="width: 240px">
<orama-search-button>Search...</orama-search-button>
</div>
<orama-search-box
.open=${preset?.open}
.facetProperty=${preset?.facetProperty}
.resultMap=${preset?.resultMap}
.open=${open || preset?.open}
.facetProperty=${facetProperty || preset?.facetProperty}
.resultMap=${resultMap || preset?.resultMap}
.colorScheme=${colorScheme}
.themeConfig=${preset.themeConfig}
.index=${preset.index}
.themeConfig=${themeConfig || preset.themeConfig}
.index=${index || preset.index}
.instance=${preset.instance}
.suggestions=${preset?.suggestions}
.sourceBaseUrl=${preset?.sourceBaseUrl}
.sourcesMap=${preset?.sourcesMap}
.suggestions=${suggestions || preset?.suggestions}
.sourceBaseUrl=${sourceBaseUrl || preset?.sourceBaseUrl}
.sourcesMap=${sourcesMap || preset?.sourcesMap}
.disableChat=${disableChat}
.chatPlaceholder=${chatPlaceholder}
.searchPlaceholder=${searchPlaceholder}
.highlight=${preset?.highlight}
.highlightTitle=${preset?.highlightTitle}
.highlightDescription=${preset?.highlightDescription}
.linksTarget=${preset?.linksTarget}
.placeholder=${preset?.placeholder}
.searchParams=${preset?.searchParams}
></orama-search-box></div>`
}

const TemplateAsEmbed = ({ preset, chatPlaceholder, searchPlaceholder, colorScheme, disableChat }) => {
const TemplateAsEmbed = ({
preset,
chatPlaceholder,
searchPlaceholder,
colorScheme,
disableChat,
open,
facetProperty,
resultMap,
themeConfig,
index,
sourceBaseURL,
suggestions,
sourcesMap,
}) => {
return html`<div style="height: 420px">
<orama-search-box
layout="embed"
.open=${preset?.open}
.facetProperty=${preset?.facetProperty}
.resultMap=${preset?.resultMap}
.open=${open || preset?.open}
.facetProperty=${facetProperty || preset?.facetProperty}
.resultMap=${resultMap || preset?.resultMap}
.colorScheme=${colorScheme}
.themeConfig=${preset.themeConfig}
.index=${preset.index}
.themeConfig=${themeConfig || preset.themeConfig}
.index=${index || preset.index}
.instance=${preset.instance}
.suggestions=${preset?.suggestions}
.sourceBaseUrl=${preset?.sourceBaseUrl}
.sourcesMap=${preset?.sourcesMap}
.suggestions=${suggestions || preset?.suggestions}
.sourceBaseUrl=${sourceBaseURL || preset?.sourceBaseUrl}
.sourcesMap=${sourcesMap || preset?.sourcesMap}
.disableChat=${disableChat}
.chatPlaceholder=${chatPlaceholder}
.searchPlaceholder=${searchPlaceholder}
.highlightTitle=${preset?.highlightTitle}
.highlightDescription=${preset?.highlightDescription}
.linksTarget=${preset?.linksTarget}
.placeholder=${preset?.placeholder}
.searchParams=${preset?.searchParams}
></orama-search-box>
</div>`
}

type Story = StoryObj<Components.OramaSearchBox & { preset: keyof DemoIndexConfig }>

export const SearchBox: Story = {
export const SearchBoxAsModal: Story = {
render: Template as any,
args: {
preset: 'orama',
colorScheme: 'light',
searchPlaceholder: 'Search...',
chatPlaceholder: 'Ask me anything...',
disableChat: false,
},
}
Expand All @@ -126,7 +164,6 @@ export const SearchBoxAsEmbed: Story = {
args: {
preset: 'orama',
colorScheme: 'light',
searchPlaceholder: 'Search...',
chatPlaceholder: 'Ask me anything...',
disableChat: false,
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "stencil-design-system",
"version": "0.1.5",
"version": "0.1.11",
"scripts": {
"build": "pnpm convert-scss-to-js && turbo run build",
"build:storybook": "turbo run build --filter=storybook",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-stencil-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@orama/angular-components",
"version": "0.1.5",
"version": "0.1.11",
"description": "Angular components for Orama Cloud",
"license": "Apache-2.0",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orama/angular-components",
"version": "0.1.5",
"version": "0.1.11",
"peerDependencies": {
"@angular/common": "^16.1.0",
"@angular/core": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-stencil-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orama/react-components",
"version": "0.1.5",
"version": "0.1.11",
"description": "React components for Orama Cloud",
"license": "Apache-2.0",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const OramaChatAssistentMessage = /*@__PURE__*/createReactComponent<JSX.O
export const OramaChatBox = /*@__PURE__*/createReactComponent<JSX.OramaChatBox, HTMLOramaChatBoxElement>('orama-chat-box');
export const OramaChatButton = /*@__PURE__*/createReactComponent<JSX.OramaChatButton, HTMLOramaChatButtonElement>('orama-chat-button');
export const OramaChatMessagesContainer = /*@__PURE__*/createReactComponent<JSX.OramaChatMessagesContainer, HTMLOramaChatMessagesContainerElement>('orama-chat-messages-container');
export const OramaChatSuggestions = /*@__PURE__*/createReactComponent<JSX.OramaChatSuggestions, HTMLOramaChatSuggestionsElement>('orama-chat-suggestions');
export const OramaChatUserMessage = /*@__PURE__*/createReactComponent<JSX.OramaChatUserMessage, HTMLOramaChatUserMessageElement>('orama-chat-user-message');
export const OramaDotsLoader = /*@__PURE__*/createReactComponent<JSX.OramaDotsLoader, HTMLOramaDotsLoaderElement>('orama-dots-loader');
export const OramaEmbed = /*@__PURE__*/createReactComponent<JSX.OramaEmbed, HTMLOramaEmbedElement>('orama-embed');
Expand All @@ -31,6 +30,7 @@ export const OramaSearchButton = /*@__PURE__*/createReactComponent<JSX.OramaSear
export const OramaSearchResults = /*@__PURE__*/createReactComponent<JSX.OramaSearchResults, HTMLOramaSearchResultsElement>('orama-search-results');
export const OramaSlidingPanel = /*@__PURE__*/createReactComponent<JSX.OramaSlidingPanel, HTMLOramaSlidingPanelElement>('orama-sliding-panel');
export const OramaSources = /*@__PURE__*/createReactComponent<JSX.OramaSources, HTMLOramaSourcesElement>('orama-sources');
export const OramaSuggestions = /*@__PURE__*/createReactComponent<JSX.OramaSuggestions, HTMLOramaSuggestionsElement>('orama-suggestions');
export const OramaText = /*@__PURE__*/createReactComponent<JSX.OramaText, HTMLOramaTextElement>('orama-text');
export const OramaTextarea = /*@__PURE__*/createReactComponent<JSX.OramaTextarea, HTMLOramaTextareaElement>('orama-textarea');
export const OramaToggler = /*@__PURE__*/createReactComponent<JSX.OramaToggler, HTMLOramaTogglerElement>('orama-toggler');
25 changes: 14 additions & 11 deletions packages/ui-stencil-vue/lib/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ export const OramaChatMessagesContainer = /*@__PURE__*/ defineContainer<JSX.Oram
]);


export const OramaChatSuggestions = /*@__PURE__*/ defineContainer<JSX.OramaChatSuggestions>('orama-chat-suggestions', undefined, [
'suggestions',
'as',
'icon',
'suggestionClicked'
]);


export const OramaChatUserMessage = /*@__PURE__*/ defineContainer<JSX.OramaChatUserMessage>('orama-chat-user-message', undefined, [
'interaction'
]);
Expand Down Expand Up @@ -144,7 +136,8 @@ export const OramaSearch = /*@__PURE__*/ defineContainer<JSX.OramaSearch>('orama
'linksTarget',
'linksRel',
'disableChat',
'highlight'
'highlightTitle',
'highlightDescription'
]);


Expand All @@ -162,7 +155,8 @@ export const OramaSearchBox = /*@__PURE__*/ defineContainer<JSX.OramaSearchBox>(
'sourcesMap',
'disableChat',
'layout',
'highlight',
'highlightTitle',
'highlightDescription',
'placeholder',
'chatPlaceholder',
'searchPlaceholder',
Expand All @@ -189,7 +183,8 @@ export const OramaSearchResults = /*@__PURE__*/ defineContainer<JSX.OramaSearchR
'setChatTerm',
'loading',
'error',
'highlight',
'highlightTitle',
'highlightDescription',
'oramaItemClick'
]);

Expand All @@ -211,6 +206,14 @@ export const OramaSources = /*@__PURE__*/ defineContainer<JSX.OramaSources>('ora
]);


export const OramaSuggestions = /*@__PURE__*/ defineContainer<JSX.OramaSuggestions>('orama-suggestions', undefined, [
'suggestions',
'as',
'icon',
'suggestionClicked'
]);


export const OramaText = /*@__PURE__*/ defineContainer<JSX.OramaText>('orama-text', undefined, [
'as',
'styledAs',
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-stencil-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orama/vue-components",
"version": "0.1.5",
"version": "0.1.11",
"description": "Vue components for Orama Cloud",
"license": "Apache-2.0",
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-stencil/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orama/wc-components",
"version": "0.1.5",
"version": "0.1.11",
"description": "UI web components for Orama Cloud",
"license": "Apache-2.0",
"repository": {
Expand Down
Loading

0 comments on commit 8ca2442

Please sign in to comment.