@sybilion/uilib 1.2.14 → 1.2.16
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/esm/components/ui/Chat/Chat.js +4 -3
- package/dist/esm/components/ui/Chat/Chat.styl.js +2 -2
- package/dist/esm/components/ui/Chat/ChatChrome/ChatChrome.js +20 -3
- package/dist/esm/components/ui/Chat/ChatChrome/ChatChrome.styl.js +2 -2
- package/dist/esm/components/ui/Chat/ChatEmptyState/ChatEmptyState.js +3 -2
- package/dist/esm/components/ui/Chat/ChatEmptyState/ChatEmptyState.styl.js +1 -1
- package/dist/esm/components/ui/Chat/ChatEmptyState/icons/sparkles.svg.js +77 -0
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.js +3 -13
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.styl.js +2 -2
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.js +14 -3
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.styl.js +7 -0
- package/dist/esm/components/ui/Chat/ChatSheet/useChatPanelChromeModel.js +0 -14
- package/dist/esm/components/ui/Page/AppShell/AppShell.styl.js +1 -1
- package/dist/esm/components/ui/Page/PageHeader/PageHeader.styl.js +1 -1
- package/dist/esm/components/ui/Page/PageTabs/PageTabs.styl.js +1 -1
- package/dist/esm/types/src/components/ui/Chat/Chat.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chat/Chat.types.d.ts +3 -2
- package/dist/esm/types/src/components/ui/Chat/ChatChrome/ChatChrome.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chat/ChatChrome/ChatChrome.types.d.ts +0 -1
- package/dist/esm/types/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.d.ts +2 -1
- package/dist/esm/types/src/components/ui/Chat/ChatPrompt/ChatPrompt.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chat/ChatSheet/ChatSelector.d.ts +2 -1
- package/package.json +1 -6
- package/src/components/ui/Chat/Chat.styl +10 -0
- package/src/components/ui/Chat/Chat.styl.d.ts +1 -0
- package/src/components/ui/Chat/Chat.tsx +14 -1
- package/src/components/ui/Chat/Chat.types.ts +3 -2
- package/src/components/ui/Chat/ChatChrome/ChatChrome.styl +10 -12
- package/src/components/ui/Chat/ChatChrome/ChatChrome.styl.d.ts +1 -3
- package/src/components/ui/Chat/ChatChrome/ChatChrome.tsx +24 -5
- package/src/components/ui/Chat/ChatChrome/ChatChrome.types.ts +0 -1
- package/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.styl +5 -5
- package/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.tsx +8 -3
- package/src/components/ui/Chat/ChatEmptyState/icons/sparkles.svg +22 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl +0 -19
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl.d.ts +0 -2
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.tsx +1 -26
- package/src/components/ui/Chat/ChatSheet/ChatSelector.styl +24 -0
- package/src/components/ui/Chat/ChatSheet/ChatSelector.styl.d.ts +10 -0
- package/src/components/ui/Chat/ChatSheet/ChatSelector.tsx +59 -21
- package/src/components/ui/Chat/ChatSheet/useChatPanelChromeModel.tsx +0 -16
- package/src/components/ui/Page/AppShell/AppShell.styl +2 -0
- package/src/components/ui/Page/PageHeader/PageHeader.styl +1 -1
- package/src/components/ui/Page/PageTabs/PageTabs.styl +1 -1
- package/src/docs/index.tsx +3 -1
- package/src/docs/pages/ChatPage.tsx +90 -42
- package/dist/standalone/vite-sybilion-standalone-dev.d.ts +0 -13
- package/dist/standalone/vite-sybilion-standalone-dev.js +0 -49
- package/src/standalone/vite-sybilion-standalone-dev.ts +0 -65
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { UserConfig } from 'vite';
|
|
2
|
-
import { loadEnv } from 'vite';
|
|
3
|
-
|
|
4
|
-
const DEFAULT_PORT = 3000;
|
|
5
|
-
const SYBILION_API_ENV = 'VITE_SYBILION_API_BASE_URL';
|
|
6
|
-
|
|
7
|
-
export type SybilionStandaloneViteDevOptions = {
|
|
8
|
-
mode: string;
|
|
9
|
-
/** Directory containing `.env*` files. @default process.cwd() */
|
|
10
|
-
envDir?: string;
|
|
11
|
-
/** Prefix proxied to Sybilion API (SDK `apiPrefix`). @default `/api` */
|
|
12
|
-
apiPrefix?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
let warnedMissingApiUrl = false;
|
|
16
|
-
|
|
17
|
-
function parsePort(raw: string | undefined): number {
|
|
18
|
-
if (raw == null || raw === '') return DEFAULT_PORT;
|
|
19
|
-
const n = Number.parseInt(raw, 10);
|
|
20
|
-
if (!Number.isFinite(n) || n <= 0 || n > 65_535) return DEFAULT_PORT;
|
|
21
|
-
return n;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function normalizeApiPrefix(apiPrefix: string): string {
|
|
25
|
-
return apiPrefix.startsWith('/') ? apiPrefix : `/${apiPrefix}`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Vite `server` + `preview` fragment for standalone Sybilion SPAs: same-origin `/api` in dev,
|
|
30
|
-
* proxied to `VITE_SYBILION_API_BASE_URL`. Uses `PORT` from env (default `3000`).
|
|
31
|
-
*/
|
|
32
|
-
export function sybilionStandaloneViteDev(
|
|
33
|
-
options: SybilionStandaloneViteDevOptions,
|
|
34
|
-
): Pick<UserConfig, 'server' | 'preview'> {
|
|
35
|
-
const envDir = options.envDir ?? process.cwd();
|
|
36
|
-
const apiPrefix = normalizeApiPrefix(options.apiPrefix ?? '/api');
|
|
37
|
-
const env = loadEnv(options.mode, envDir, '');
|
|
38
|
-
const port = parsePort(env.PORT);
|
|
39
|
-
const target = (env[SYBILION_API_ENV] ?? '').replace(/\/$/, '');
|
|
40
|
-
|
|
41
|
-
const proxy: NonNullable<UserConfig['server']>['proxy'] = {};
|
|
42
|
-
|
|
43
|
-
if (target) {
|
|
44
|
-
proxy[apiPrefix] = {
|
|
45
|
-
target,
|
|
46
|
-
changeOrigin: true,
|
|
47
|
-
secure: true,
|
|
48
|
-
};
|
|
49
|
-
} else if (options.mode === 'development' && !warnedMissingApiUrl) {
|
|
50
|
-
warnedMissingApiUrl = true;
|
|
51
|
-
console.warn(
|
|
52
|
-
`[@sybilion/uilib] ${SYBILION_API_ENV} is not set; API dev proxy disabled.`,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const serverPreview = {
|
|
57
|
-
port,
|
|
58
|
-
proxy,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
server: serverPreview,
|
|
63
|
-
preview: serverPreview,
|
|
64
|
-
};
|
|
65
|
-
}
|