* feat(sidepanel): Add sidepanel component for Ask AI (#2792) * feat(sidepanel): Initial working Sidepanel implementation * fix: circleci config * fix: set proper sidepanel export * Sidepanel props updates, conversation screen updates * Started mobile work * Style prompt input and header for mobile * fixes prompt input height, adds more translations, mobile updates, fixes panel height calculations * finish mobile, adds dark theme, minor fixes * fix: lock * Add missing titles to buttons * Have most recent conversation be at the bottom of the exchange list, scroll to newest conversation * fix: versions * move to floating variant being default for Sidepanel --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com> * feat(sidepanel): Sidepanel/Modal hybrid mode (#2799) * feat(sidepanel): Initial working Sidepanel implementation * fix: circleci config * fix: set proper sidepanel export * Sidepanel props updates, conversation screen updates * Started mobile work * Style prompt input and header for mobile * fixes prompt input height, adds more translations, mobile updates, fixes panel height calculations * finish mobile, adds dark theme, minor fixes * fix: lock * Add missing titles to buttons * Have most recent conversation be at the bottom of the exchange list, scroll to newest conversation * feat(sidepanel): Allow hybrid mode for Sidepanel and Modal * fix: yarn.lock * fix: tests - dont send new chat message from modal while in hybrid mode * Make docsearch core a true dependency * Cleanup handling the registered views Set --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com> * feat(sidepanel): Add sidepanel-js package for CDN (#2800) * feat(sidepanel): Initial working Sidepanel implementation * fix: circleci config * fix: set proper sidepanel export * Sidepanel props updates, conversation screen updates * Started mobile work * Style prompt input and header for mobile * fixes prompt input height, adds more translations, mobile updates, fixes panel height calculations * finish mobile, adds dark theme, minor fixes * fix: lock * Add missing titles to buttons * Have most recent conversation be at the bottom of the exchange list, scroll to newest conversation * feat(sidepanel): Add sidepanel-js package for CDN * fix: ci * fix: yarn.lock --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com> * feat(sidepanel): Sidepanel UI/UX tweaks (#2808) * fix(umd): Fixes global names for packages in UMD builds * chore: Update tsdeclaration files, update directory field in package json files * feat(sidepanel): Add Sidepanel documentation (#2811) * feat(sidepanel): Add Sidepanel documentation * Minor fixes and updates * Hybrid mode update * fix: hardcode yarn cache key for now --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com>
117 lines
2.9 KiB
JavaScript
117 lines
2.9 KiB
JavaScript
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import replace from '@rollup/plugin-replace';
|
|
import { dts } from 'rollup-plugin-dts';
|
|
|
|
import { plugins } from '../../rollup.base.config';
|
|
import { getBundleBanner } from '../../scripts/getBundleBanner';
|
|
|
|
import pkg from './package.json';
|
|
|
|
const sourcePlugins = [
|
|
commonjs(),
|
|
...plugins,
|
|
replace({
|
|
preventAssignment: true,
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
}),
|
|
];
|
|
|
|
function sourceOutput(fileName) {
|
|
return [
|
|
{
|
|
globals: {
|
|
react: 'React',
|
|
'react-dom': 'ReactDOM',
|
|
'@docsearch/core': 'DocSearchCore',
|
|
},
|
|
file: `dist/umd/${fileName}`,
|
|
format: 'umd',
|
|
sourcemap: true,
|
|
name: 'DocSearchReact',
|
|
banner: getBundleBanner(pkg),
|
|
},
|
|
{ dir: 'dist/esm', format: 'es' },
|
|
];
|
|
}
|
|
|
|
const externalPackages = ['react', 'react-dom', '@docsearch/core'];
|
|
|
|
export default [
|
|
{
|
|
input: 'src/index.ts',
|
|
external: externalPackages,
|
|
output: sourceOutput('index.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'src/DocSearchButton.tsx',
|
|
external: externalPackages,
|
|
output: sourceOutput('DocsearchButton.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'src/DocSearchModal.tsx',
|
|
external: externalPackages,
|
|
output: sourceOutput('DocSearchModal.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'src/useDocSearchKeyboardEvents.ts',
|
|
external: externalPackages,
|
|
output: sourceOutput('useDocSearchKeyboardEvents.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'src/useTheme.tsx',
|
|
external: externalPackages,
|
|
output: sourceOutput('useTheme.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'src/version.ts',
|
|
output: sourceOutput('version.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'src/Sidepanel.tsx',
|
|
external: externalPackages,
|
|
output: sourceOutput('Sidepanel.js'),
|
|
plugins: sourcePlugins,
|
|
},
|
|
{
|
|
input: 'dist/esm/types/index.d.ts',
|
|
output: [{ file: 'dist/esm/index.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
{
|
|
input: 'dist/esm/types/DocSearchModal.d.ts',
|
|
output: [{ file: 'dist/esm/DocSearchModal.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
{
|
|
input: 'dist/esm/types/DocSearchButton.d.ts',
|
|
output: [{ file: 'dist/esm/DocSearchButton.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
{
|
|
input: 'dist/esm/types/useDocSearchKeyboardEvents.d.ts',
|
|
output: [{ file: 'dist/esm/useDocSearchKeyboardEvents.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
{
|
|
input: 'dist/esm/types/useTheme.d.ts',
|
|
output: [{ file: 'dist/esm/useTheme.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
{
|
|
input: 'dist/esm/types/version.d.ts',
|
|
output: [{ file: 'dist/esm/version.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
{
|
|
input: 'dist/esm/types/Sidepanel.d.ts',
|
|
output: [{ file: 'dist/esm/Sidepanel.d.ts', format: 'es' }],
|
|
plugins: [dts()],
|
|
},
|
|
];
|