@k2b/ui 0.26.0 → 0.27.0
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/browser/chat/ChatComposer.js +811 -406
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-behavior.js +4 -0
- package/dist/browser/chat/chat-behavior.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +14 -0
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/command-search.js +170 -0
- package/dist/browser/chat/command-search.js.map +1 -0
- package/dist/browser/chat/composer-document.js +1 -1
- package/dist/browser/chat/composer-document.js.map +1 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +28 -3
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +4 -2
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +43 -12
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +708 -515
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/BottomSheet.js +8 -0
- package/dist/browser/layout/BottomSheet.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +155 -23
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/app-workspace-state.js +5 -1
- package/dist/browser/layout/app-workspace-state.js.map +1 -1
- package/dist/browser/layout/index.js +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +410 -93
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-behavior.js +4 -0
- package/dist/ssr/chat/chat-behavior.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +14 -0
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/command-search.js +170 -0
- package/dist/ssr/chat/command-search.js.map +1 -0
- package/dist/ssr/chat/composer-document.js +1 -1
- package/dist/ssr/chat/composer-document.js.map +1 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +28 -3
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js +4 -2
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +35 -11
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +242 -105
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/BottomSheet.js +8 -0
- package/dist/ssr/layout/BottomSheet.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +155 -23
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/app-workspace-state.js +5 -1
- package/dist/ssr/layout/app-workspace-state.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/chat/ChatComposer.d.ts +44 -2
- package/dist/types/chat/chat-behavior.d.ts +4 -0
- package/dist/types/chat/chat-messages.d.ts +7 -0
- package/dist/types/chat/command-search.d.ts +39 -0
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/inputs/SelectChip.d.ts +4 -0
- package/dist/types/layout/AppWorkspace.d.ts +13 -1
- package/dist/types/layout/BottomSheet.d.ts +8 -0
- package/dist/types/layout/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -5,11 +5,51 @@ export type ChatCommandContext = {
|
|
|
5
5
|
submit: () => void;
|
|
6
6
|
focus: () => void;
|
|
7
7
|
};
|
|
8
|
+
/** An action can cancel and restore its token, or report a short completion message. */
|
|
9
|
+
export type ChatCommandResult = void | "cancelled" | {
|
|
10
|
+
done: string;
|
|
11
|
+
};
|
|
12
|
+
/** A fixed place in the slash list. Sections keep the given order, also while searching. */
|
|
13
|
+
export type ChatCommandSection = {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
/** Rows come from `searchCommands`: loading keeps a heading spinner; empty placeholders reserve the first search or retained rows. */
|
|
17
|
+
searched?: boolean;
|
|
18
|
+
/** Only while searching or narrowed: absent from the overview (empty query), including its loading placeholder. */
|
|
19
|
+
searchOnly?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** First-word narrowing; Tab writes `words[0]` followed by a space. */
|
|
22
|
+
export type ChatCommandScope = {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
words: readonly string[];
|
|
26
|
+
};
|
|
27
|
+
/** Passed as the third argument to `searchCommands`. */
|
|
28
|
+
export type ChatCommandSearch = {
|
|
29
|
+
scope?: string;
|
|
30
|
+
};
|
|
8
31
|
export type ChatCommand = {
|
|
32
|
+
/** Section id; unknown or missing ids render in a trailing part without a heading. */
|
|
33
|
+
section?: string;
|
|
34
|
+
/** Tab writes this scope's first word; a row without an action or mention also narrows on Enter. */
|
|
35
|
+
scope?: string;
|
|
36
|
+
/** Absent from the overview; appears when searched, including its unavailable reason. */
|
|
37
|
+
hiddenUntilSearch?: boolean;
|
|
38
|
+
/** Application name, searchable but not displayed. */
|
|
39
|
+
app?: string;
|
|
40
|
+
/** Stable row key for option ids, marking and de-duplication. Defaults to `name`. */
|
|
41
|
+
id?: string;
|
|
9
42
|
name: string;
|
|
10
43
|
description: string;
|
|
11
44
|
icon?: string;
|
|
12
|
-
|
|
45
|
+
/** Extra search words, for example in German and English. */
|
|
46
|
+
keywords?: readonly string[];
|
|
47
|
+
/** Unavailable now; this short reason replaces the description. */
|
|
48
|
+
reason?: string;
|
|
49
|
+
/** Shown in the status line while the action runs. */
|
|
50
|
+
busyLabel?: string;
|
|
51
|
+
/** Failures restore an unchanged draft and appear once in the status line, without calling `onError`. */
|
|
52
|
+
action?: (context: ChatCommandContext) => ChatCommandResult | Promise<ChatCommandResult>;
|
|
13
53
|
/** Selecting a reference inserts its display name and retains its opaque payload. */
|
|
14
54
|
mention?: ChatAttachment;
|
|
15
55
|
label?: string;
|
|
@@ -54,7 +94,9 @@ export type ChatComposerProps = {
|
|
|
54
94
|
/** Compact application-owned details immediately after the model selector. */
|
|
55
95
|
modelDetails?: JSX.Element;
|
|
56
96
|
commands?: readonly ChatCommand[];
|
|
57
|
-
|
|
97
|
+
commandSections?: readonly ChatCommandSection[];
|
|
98
|
+
commandScopes?: readonly ChatCommandScope[];
|
|
99
|
+
searchCommands?: (query: string, signal: AbortSignal, search: ChatCommandSearch) => Promise<readonly ChatCommand[]>;
|
|
58
100
|
mentions?: readonly ChatMention[];
|
|
59
101
|
onMentionsChange?: (mentions: readonly ChatMention[]) => void;
|
|
60
102
|
/** Shared surface above the editor; suggestions temporarily replace this content. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChatCommand } from "./ChatComposer";
|
|
1
2
|
import type { ChatAction } from "./types";
|
|
2
3
|
export declare const nextChatCommandIndex: (index: number, length: number, direction: 1 | -1) => number;
|
|
3
4
|
export declare const isChatNearBottom: (scrollHeight: number, scrollTop: number, clientHeight: number, threshold?: number) => boolean;
|
|
@@ -39,3 +40,6 @@ export declare const conversationEnterAction: (key: ChatEnterKey, context: {
|
|
|
39
40
|
touchOnly: boolean;
|
|
40
41
|
inCodeBlock: boolean;
|
|
41
42
|
}) => "send" | "newline";
|
|
43
|
+
/** Case- and accent-insensitive text for command discovery. */
|
|
44
|
+
export declare const foldChatSearchText: (text: string) => string;
|
|
45
|
+
export declare const chatCommandKey: (command: ChatCommand) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const chatMessages: import("@k2b/stdlib").Catalog<{
|
|
2
|
+
commandFailed: string;
|
|
2
3
|
attachments: string;
|
|
3
4
|
assistant: string;
|
|
4
5
|
addToChat: string;
|
|
@@ -7,6 +8,12 @@ declare const chatMessages: import("@k2b/stdlib").Catalog<{
|
|
|
7
8
|
chat: string;
|
|
8
9
|
chooseModel: string;
|
|
9
10
|
commands: string;
|
|
11
|
+
commandsNothingFound: ({ query }: {
|
|
12
|
+
query: string;
|
|
13
|
+
}) => string;
|
|
14
|
+
commandSuggestions: ({ count }: {
|
|
15
|
+
count: number;
|
|
16
|
+
}) => string;
|
|
10
17
|
dropFilesToAttach: string;
|
|
11
18
|
conversation: string;
|
|
12
19
|
jumpToLatest: string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ChatCommand, ChatCommandScope, ChatCommandSection } from "./ChatComposer";
|
|
2
|
+
type Rank = {
|
|
3
|
+
rank: number;
|
|
4
|
+
highlight?: readonly [number, number];
|
|
5
|
+
};
|
|
6
|
+
export declare const rankChatCommand: (command: ChatCommand, query: string) => Rank | null;
|
|
7
|
+
export declare function resolveChatCommandScope(word: string, scopes: readonly ChatCommandScope[]): ChatCommandScope | undefined;
|
|
8
|
+
export declare function parseChatCommandQuery(query: string, scopes: readonly ChatCommandScope[]): {
|
|
9
|
+
scope?: ChatCommandScope;
|
|
10
|
+
query: string;
|
|
11
|
+
};
|
|
12
|
+
export type ChatCommandRow = {
|
|
13
|
+
command: ChatCommand;
|
|
14
|
+
server: boolean;
|
|
15
|
+
highlight?: readonly [number, number];
|
|
16
|
+
};
|
|
17
|
+
type Group = {
|
|
18
|
+
section?: ChatCommandSection;
|
|
19
|
+
scopeTitle?: string;
|
|
20
|
+
rows: ChatCommandRow[];
|
|
21
|
+
loading: boolean;
|
|
22
|
+
placeholder: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function chatCommandListModel(input: {
|
|
25
|
+
query: string;
|
|
26
|
+
scopes?: readonly ChatCommandScope[];
|
|
27
|
+
sections?: readonly ChatCommandSection[];
|
|
28
|
+
commands: readonly ChatCommand[];
|
|
29
|
+
searchResults: readonly ChatCommand[];
|
|
30
|
+
searchResultsFresh: boolean;
|
|
31
|
+
searchSettled: boolean;
|
|
32
|
+
searching: boolean;
|
|
33
|
+
}): {
|
|
34
|
+
scope?: ChatCommandScope;
|
|
35
|
+
groups: Group[];
|
|
36
|
+
rows: ChatCommandRow[];
|
|
37
|
+
empty: boolean;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import { ChatComposer } from "./ChatComposer";
|
|
|
6
6
|
import { ChatActivity, ChatContextUsage, ChatMessage } from "./ChatPrimitives";
|
|
7
7
|
import { ChatRoot } from "./ChatRoot";
|
|
8
8
|
import { ChatTimeline } from "./ChatTimeline";
|
|
9
|
-
export type { ChatCommand, ChatCommandContext, ChatComposerProps, ChatFileSelection, ChatPasteHandler } from "./ChatComposer";
|
|
9
|
+
export type { ChatCommand, ChatCommandContext, ChatCommandResult, ChatCommandScope, ChatCommandSearch, ChatCommandSection, ChatComposerProps, ChatFileSelection, ChatPasteHandler, } from "./ChatComposer";
|
|
10
10
|
export type { ChatActivityProps, ChatContextUsageProps, ChatMessageProps } from "./ChatPrimitives";
|
|
11
11
|
export { formatChatTokens } from "./ChatPrimitives";
|
|
12
12
|
export type { ChatRootProps } from "./ChatRoot";
|
|
@@ -21,6 +21,10 @@ export type SelectChipProps<T extends string | number = string> = ValueFieldProp
|
|
|
21
21
|
/** Exact menu width as a CSS length. Without it the menu sizes to its options, at least `10rem`. */
|
|
22
22
|
menuWidth?: string;
|
|
23
23
|
name?: string;
|
|
24
|
+
/** Shows that a change from this chip is saving: the chip stays in place with
|
|
25
|
+
* its size, cannot be opened, is marked busy, and shows a spinner where its
|
|
26
|
+
* chevron (or, icon-only, its icon) is. */
|
|
27
|
+
loading?: boolean;
|
|
24
28
|
};
|
|
25
29
|
export declare function SelectChip<T extends string | number = string>(props: SelectChipProps<T>): JSX.Element;
|
|
26
30
|
export default SelectChip;
|
|
@@ -9,7 +9,7 @@ export type AppWorkspaceProps = {
|
|
|
9
9
|
/** A host with its own phone chrome can use the full canvas below 48rem (768 px). */
|
|
10
10
|
mobileSurface?: "contained" | "flush";
|
|
11
11
|
/** Removes the workspace's own border, radius, and shadow for an overview that is the page itself.
|
|
12
|
-
* A host may frame the outermost workspace as its app card, as Cloud does from
|
|
12
|
+
* A host may frame the outermost workspace as its app card, as Cloud does from 1024 px on signed-in pages. */
|
|
13
13
|
flat?: boolean;
|
|
14
14
|
resizable?: boolean;
|
|
15
15
|
/**
|
|
@@ -41,6 +41,10 @@ export type AppWorkspaceMainProps = {
|
|
|
41
41
|
/** `"content"` centers the children as one reading column with the shared page width on large screens. */
|
|
42
42
|
width?: "full" | "content";
|
|
43
43
|
mobilePane?: string;
|
|
44
|
+
/** Levels in DOM order, shallowest first. The URL selects the deepest level by id. */
|
|
45
|
+
level?: string;
|
|
46
|
+
/** Enhanced navigation for the back step; otherwise it is a document link. */
|
|
47
|
+
onLevelNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;
|
|
44
48
|
scroll?: boolean;
|
|
45
49
|
scrollFade?: boolean;
|
|
46
50
|
scrollPreserveKey?: string | false;
|
|
@@ -49,6 +53,12 @@ export type AppWorkspaceMainProps = {
|
|
|
49
53
|
export type AppWorkspaceMainPaneProps = {
|
|
50
54
|
id: string;
|
|
51
55
|
label: string;
|
|
56
|
+
/** Levels mode: URL selecting this level. Required except on the last level. */
|
|
57
|
+
href?: string;
|
|
58
|
+
/** Quiet one-line text below the level title. */
|
|
59
|
+
description?: JSX.Element;
|
|
60
|
+
/** Controls at the end of the level head. */
|
|
61
|
+
actions?: JSX.Element;
|
|
52
62
|
surface?: "default" | "navigation";
|
|
53
63
|
open?: boolean;
|
|
54
64
|
resizable?: boolean;
|
|
@@ -68,6 +78,8 @@ export type AppWorkspaceDetailProps = {
|
|
|
68
78
|
id: string;
|
|
69
79
|
class?: string;
|
|
70
80
|
width?: AppWorkspaceDetailWidth;
|
|
81
|
+
/** Below 48rem, a full page without sheet gestures for a destination such as chat info; defaults to "sheet". */
|
|
82
|
+
phone?: "sheet" | "page";
|
|
71
83
|
viewTransitionName?: string;
|
|
72
84
|
resizable?: boolean;
|
|
73
85
|
minWidth?: number;
|
|
@@ -9,6 +9,14 @@ export declare const bottomSheetOptions: {
|
|
|
9
9
|
contentClassName: string;
|
|
10
10
|
initialFocus: typeof sheetInitialFocus;
|
|
11
11
|
};
|
|
12
|
+
/** A sheet on phones and a centered dialog from 48rem up, for decisions and forms; menus keep
|
|
13
|
+
* `bottomSheetOptions`. The stylesheet picks the mode with the phone media query, so the first
|
|
14
|
+
* frame is already right and a rotation or resize switches it in place, without a remount. */
|
|
15
|
+
export declare const bottomSheetAdaptiveOptions: {
|
|
16
|
+
contentClassName: string;
|
|
17
|
+
initialFocus: typeof sheetInitialFocus;
|
|
18
|
+
panelClassName: string;
|
|
19
|
+
};
|
|
12
20
|
export type BottomSheetProps = {
|
|
13
21
|
children: JSX.Element;
|
|
14
22
|
/** Pass dialogCore's render context requestDismiss, never the completion callback. */
|
|
@@ -6,7 +6,7 @@ export type { AppWorkspaceControllerOptions } from "./app-workspace-controller";
|
|
|
6
6
|
export { installAppWorkspaceController } from "./app-workspace-controller";
|
|
7
7
|
export type { AppWorkspaceLayoutState, AppWorkspaceResizeKind, } from "./app-workspace-state";
|
|
8
8
|
export { APP_WORKSPACE_DETAIL_DEFAULT, APP_WORKSPACE_DETAIL_MAX, APP_WORKSPACE_DETAIL_MIN, APP_WORKSPACE_DRAWER_DEFAULT, APP_WORKSPACE_DRAWER_MAX, APP_WORKSPACE_DRAWER_MIN, APP_WORKSPACE_MAIN_MIN, APP_WORKSPACE_MAIN_MIN_HEIGHT, APP_WORKSPACE_PANE_DEFAULT, APP_WORKSPACE_PANE_MAX, APP_WORKSPACE_PANE_MIN, APP_WORKSPACE_SIDEBAR_COLLAPSE_THRESHOLD, APP_WORKSPACE_SIDEBAR_COLLAPSED, APP_WORKSPACE_SIDEBAR_DEFAULT, APP_WORKSPACE_SIDEBAR_MAX, APP_WORKSPACE_SIDEBAR_MIN, appWorkspaceLayoutStyle, appWorkspacePanelVariable, appWorkspaceResizeLimits, normalizeAppWorkspaceLayoutState, parseAppWorkspaceLayoutState, resolveAppWorkspaceSidebarWidth, safeAppWorkspacePanelId, serializeAppWorkspaceLayoutState, shouldCollapseAppWorkspaceSidebar, } from "./app-workspace-state";
|
|
9
|
-
export { type BottomSheetProps, bottomSheetOptions, default as BottomSheet } from "./BottomSheet";
|
|
9
|
+
export { type BottomSheetProps, bottomSheetAdaptiveOptions, bottomSheetOptions, default as BottomSheet } from "./BottomSheet";
|
|
10
10
|
export type { DataPanelProps } from "./DataPanel";
|
|
11
11
|
export { DataPanel } from "./DataPanel";
|
|
12
12
|
export type { DetailPanelActionButtonProps, DetailPanelActionLinkProps, DetailPanelActionProps, DetailPanelActionSecondary, DetailPanelBodyProps, DetailPanelGroupProps, DetailPanelHeaderProps, DetailPanelProps, DetailPanelSectionProps, DetailPanelSummaryProps, DetailPanelTone, } from "./DetailPanel";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Production-ready components for SolidJS applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"check:declarations": "bun run scripts/check-declarations.ts",
|
|
38
38
|
"fixture:build": "bun run build && NODE_ENV=production bun run fixture/scripts/build.ts",
|
|
39
39
|
"fixture:typecheck": "tsc -p fixture/tsconfig.json --noEmit --pretty false",
|
|
40
|
-
"test": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' src scripts && bun run scripts/check-packed-consumer.ts",
|
|
40
|
+
"test": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' src scripts test/browser.browser.test.ts && bun run scripts/check-packed-consumer.ts",
|
|
41
41
|
"typecheck": "tsc --checkers 2 -p tsconfig.json --noEmit --pretty false && bun run check:declarations && bun run typecheck:dom",
|
|
42
42
|
"typecheck:dom": "tsc -p test/tsconfig.json --noEmit --pretty false",
|
|
43
43
|
"prepack": "bun run build"
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"qr-scanner": "1.4.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@k2b/ssr": "^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0",
|
|
54
|
+
"@k2b/ssr": "^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0",
|
|
55
55
|
"solid-js": "^1.9.10"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@babel/core": "8.0.6",
|
|
59
59
|
"@babel/preset-typescript": "8.0.1",
|
|
60
|
-
"@k2b/ssr": "0.
|
|
60
|
+
"@k2b/ssr": "0.17.0",
|
|
61
61
|
"@types/babel__core": "7.20.5",
|
|
62
62
|
"@types/bun": "1.4.2",
|
|
63
63
|
"axe-core": "4.11.0",
|