@intentface/ui 0.0.0 → 0.7.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/LICENSE +21 -0
- package/README.md +145 -2
- package/dist/ask-user/ask-user.d.ts +104 -0
- package/dist/ask-user/ask-user.js +245 -0
- package/dist/ask-user/index.d.ts +3 -0
- package/dist/ask-user/index.js +3 -0
- package/dist/ask-user/index.parts.d.ts +1 -0
- package/dist/ask-user/index.parts.js +5 -0
- package/dist/attachments/attachments.d.ts +73 -0
- package/dist/attachments/attachments.js +121 -0
- package/dist/attachments/index.d.ts +3 -0
- package/dist/attachments/index.js +3 -0
- package/dist/attachments/index.parts.d.ts +1 -0
- package/dist/attachments/index.parts.js +5 -0
- package/dist/chip/chip.d.ts +45 -0
- package/dist/chip/chip.js +43 -0
- package/dist/chip/index.d.ts +2 -0
- package/dist/chip/index.js +2 -0
- package/dist/chip/index.parts.d.ts +1 -0
- package/dist/chip/index.parts.js +5 -0
- package/dist/chip-markdown.d.ts +25 -0
- package/dist/chip-markdown.js +54 -0
- package/dist/composer/actions.d.ts +35 -0
- package/dist/composer/actions.js +76 -0
- package/dist/composer/ask-user-machine.d.ts +52 -0
- package/dist/composer/ask-user-machine.js +164 -0
- package/dist/composer/attachments-machine.d.ts +34 -0
- package/dist/composer/attachments-machine.js +91 -0
- package/dist/composer/attachments.d.ts +16 -0
- package/dist/composer/attachments.js +32 -0
- package/dist/composer/command-list.d.ts +49 -0
- package/dist/composer/command-list.js +360 -0
- package/dist/composer/commands.d.ts +28 -0
- package/dist/composer/commands.js +56 -0
- package/dist/composer/container.d.ts +3 -0
- package/dist/composer/container.js +32 -0
- package/dist/composer/controller.d.ts +3 -0
- package/dist/composer/controller.js +6 -0
- package/dist/composer/editor-dom.d.ts +57 -0
- package/dist/composer/editor-dom.js +517 -0
- package/dist/composer/fuzzy.d.ts +4 -0
- package/dist/composer/fuzzy.js +49 -0
- package/dist/composer/index.d.ts +25 -0
- package/dist/composer/index.js +13 -0
- package/dist/composer/index.parts.d.ts +11 -0
- package/dist/composer/index.parts.js +15 -0
- package/dist/composer/internals.d.ts +30 -0
- package/dist/composer/internals.js +102 -0
- package/dist/composer/keyboard.d.ts +61 -0
- package/dist/composer/keyboard.js +75 -0
- package/dist/composer/panel.d.ts +28 -0
- package/dist/composer/panel.js +76 -0
- package/dist/composer/placeholder.d.ts +10 -0
- package/dist/composer/placeholder.js +8 -0
- package/dist/composer/popover.d.ts +12 -0
- package/dist/composer/popover.js +62 -0
- package/dist/composer/prefix-detection.d.ts +23 -0
- package/dist/composer/prefix-detection.js +67 -0
- package/dist/composer/root.d.ts +21 -0
- package/dist/composer/root.js +124 -0
- package/dist/composer/segments.d.ts +108 -0
- package/dist/composer/segments.js +366 -0
- package/dist/composer/store.d.ts +98 -0
- package/dist/composer/store.js +457 -0
- package/dist/composer/textarea.d.ts +39 -0
- package/dist/composer/textarea.js +64 -0
- package/dist/composer/trigger-tracker.d.ts +12 -0
- package/dist/composer/trigger-tracker.js +90 -0
- package/dist/composer/types.d.ts +127 -0
- package/dist/composer/types.js +4 -0
- package/dist/composer/use-composer-editor.d.ts +43 -0
- package/dist/composer/use-composer-editor.js +653 -0
- package/dist/generative/catalog.d.ts +177 -0
- package/dist/generative/catalog.js +20 -0
- package/dist/generative/index.d.ts +26 -0
- package/dist/generative/index.js +20 -0
- package/dist/generative/json-schema.d.ts +45 -0
- package/dist/generative/json-schema.js +216 -0
- package/dist/generative/markdown.d.ts +21 -0
- package/dist/generative/markdown.js +76 -0
- package/dist/generative/tree.d.ts +56 -0
- package/dist/generative/tree.js +365 -0
- package/dist/generative/use-tree.d.ts +12 -0
- package/dist/generative/use-tree.js +64 -0
- package/dist/internal/change-event-details.d.ts +12 -0
- package/dist/internal/change-event-details.js +16 -0
- package/dist/internal/collapsible.d.ts +22 -0
- package/dist/internal/collapsible.js +94 -0
- package/dist/internal/collection.d.ts +32 -0
- package/dist/internal/collection.js +72 -0
- package/dist/internal/iso-layout-effect.d.ts +2 -0
- package/dist/internal/iso-layout-effect.js +6 -0
- package/dist/internal/portal.d.ts +6 -0
- package/dist/internal/portal.js +18 -0
- package/dist/internal/primitive-props.d.ts +4 -0
- package/dist/internal/primitive-props.js +3 -0
- package/dist/internal/render/baseTypes.d.ts +18 -0
- package/dist/internal/render/baseTypes.js +4 -0
- package/dist/internal/render/empty.d.ts +3 -0
- package/dist/internal/render/empty.js +5 -0
- package/dist/internal/render/getReactElementRef.d.ts +5 -0
- package/dist/internal/render/getReactElementRef.js +15 -0
- package/dist/internal/render/getStateAttributesProps.d.ts +4 -0
- package/dist/internal/render/getStateAttributesProps.js +23 -0
- package/dist/internal/render/mergeObjects.d.ts +1 -0
- package/dist/internal/render/mergeObjects.js +14 -0
- package/dist/internal/render/mergeProps.d.ts +55 -0
- package/dist/internal/render/mergeProps.js +183 -0
- package/dist/internal/render/positioning.d.ts +33 -0
- package/dist/internal/render/positioning.js +112 -0
- package/dist/internal/render/reactVersion.d.ts +3 -0
- package/dist/internal/render/reactVersion.js +7 -0
- package/dist/internal/render/resolveClassName.d.ts +8 -0
- package/dist/internal/render/resolveClassName.js +12 -0
- package/dist/internal/render/resolveStyle.d.ts +8 -0
- package/dist/internal/render/resolveStyle.js +12 -0
- package/dist/internal/render/transition.d.ts +47 -0
- package/dist/internal/render/transition.js +259 -0
- package/dist/internal/render/types.d.ts +74 -0
- package/dist/internal/render/types.js +3 -0
- package/dist/internal/render/useMergedRefs.d.ts +21 -0
- package/dist/internal/render/useMergedRefs.js +102 -0
- package/dist/internal/render/useRefWithInit.d.ts +10 -0
- package/dist/internal/render/useRefWithInit.js +12 -0
- package/dist/internal/render/useRender.d.ts +71 -0
- package/dist/internal/render/useRender.js +12 -0
- package/dist/internal/render/useRenderElement.d.ts +62 -0
- package/dist/internal/render/useRenderElement.js +157 -0
- package/dist/internal/render/warn.d.ts +1 -0
- package/dist/internal/render/warn.js +15 -0
- package/dist/internal/safe-polygon.d.ts +21 -0
- package/dist/internal/safe-polygon.js +179 -0
- package/dist/internal/scroll-into-view-within.d.ts +1 -0
- package/dist/internal/scroll-into-view-within.js +26 -0
- package/dist/internal/standard-schema.d.ts +38 -0
- package/dist/internal/standard-schema.js +4 -0
- package/dist/internal/state-mappings.d.ts +8 -0
- package/dist/internal/state-mappings.js +17 -0
- package/dist/internal/use-controlled.d.ts +19 -0
- package/dist/internal/use-controlled.js +33 -0
- package/dist/message/index.d.ts +3 -0
- package/dist/message/index.js +3 -0
- package/dist/message/index.parts.d.ts +1 -0
- package/dist/message/index.parts.js +5 -0
- package/dist/message/message.d.ts +58 -0
- package/dist/message/message.js +93 -0
- package/dist/message-utils.d.ts +55 -0
- package/dist/message-utils.js +79 -0
- package/dist/nav/index.d.ts +4 -0
- package/dist/nav/index.js +5 -0
- package/dist/nav/index.parts.d.ts +3 -0
- package/dist/nav/index.parts.js +7 -0
- package/dist/nav/nav.d.ts +152 -0
- package/dist/nav/nav.js +660 -0
- package/dist/nav/store.d.ts +50 -0
- package/dist/nav/store.js +95 -0
- package/dist/reasoning/index.d.ts +3 -0
- package/dist/reasoning/index.js +3 -0
- package/dist/reasoning/index.parts.d.ts +1 -0
- package/dist/reasoning/index.parts.js +5 -0
- package/dist/reasoning/reasoning.d.ts +38 -0
- package/dist/reasoning/reasoning.js +67 -0
- package/dist/shell/index.d.ts +5 -0
- package/dist/shell/index.js +5 -0
- package/dist/shell/index.parts.d.ts +3 -0
- package/dist/shell/index.parts.js +7 -0
- package/dist/shell/shell.d.ts +108 -0
- package/dist/shell/shell.js +390 -0
- package/dist/shell/store.d.ts +112 -0
- package/dist/shell/store.js +134 -0
- package/dist/steps/index.d.ts +2 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/index.parts.d.ts +1 -0
- package/dist/steps/index.parts.js +5 -0
- package/dist/steps/steps.d.ts +90 -0
- package/dist/steps/steps.js +116 -0
- package/dist/tabs/anchored.d.ts +59 -0
- package/dist/tabs/anchored.js +109 -0
- package/dist/tabs/hover.d.ts +33 -0
- package/dist/tabs/hover.js +169 -0
- package/dist/tabs/index.d.ts +5 -0
- package/dist/tabs/index.js +4 -0
- package/dist/tabs/index.parts.d.ts +4 -0
- package/dist/tabs/index.parts.js +8 -0
- package/dist/tabs/store.d.ts +131 -0
- package/dist/tabs/store.js +248 -0
- package/dist/tabs/tabs.d.ts +217 -0
- package/dist/tabs/tabs.js +458 -0
- package/dist/thread/geometry.d.ts +23 -0
- package/dist/thread/geometry.js +48 -0
- package/dist/thread/index.d.ts +4 -0
- package/dist/thread/index.js +3 -0
- package/dist/thread/index.parts.d.ts +1 -0
- package/dist/thread/index.parts.js +5 -0
- package/dist/thread/stores.d.ts +21 -0
- package/dist/thread/stores.js +63 -0
- package/dist/thread/thread.d.ts +57 -0
- package/dist/thread/thread.js +663 -0
- package/dist/types.d.ts +58 -0
- package/dist/types.js +17 -0
- package/package.json +120 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The minimal part contract. Every part has a `type`; parts this package does
|
|
3
|
+
* not understand (e.g. `step-start`, `dynamic-tool`, future additions) are
|
|
4
|
+
* carried through untouched.
|
|
5
|
+
*/
|
|
6
|
+
export type UnknownPart = {
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
export type TextPart = {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
state?: "streaming" | "done";
|
|
13
|
+
};
|
|
14
|
+
export type ReasoningPart = {
|
|
15
|
+
type: "reasoning";
|
|
16
|
+
text: string;
|
|
17
|
+
state?: "streaming" | "done";
|
|
18
|
+
};
|
|
19
|
+
export type FilePart = {
|
|
20
|
+
type: "file";
|
|
21
|
+
mediaType: string;
|
|
22
|
+
url: string;
|
|
23
|
+
filename?: string;
|
|
24
|
+
};
|
|
25
|
+
export type SourceUrlPart = {
|
|
26
|
+
type: "source-url";
|
|
27
|
+
sourceId: string;
|
|
28
|
+
url: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
};
|
|
31
|
+
export type ToolPartState = "input-streaming" | "input-available" | "output-available" | "output-error";
|
|
32
|
+
export type ToolPart<Input = unknown, Output = unknown> = {
|
|
33
|
+
type: `tool-${string}`;
|
|
34
|
+
toolCallId: string;
|
|
35
|
+
state: ToolPartState;
|
|
36
|
+
input?: Input;
|
|
37
|
+
output?: Output;
|
|
38
|
+
errorText?: string;
|
|
39
|
+
};
|
|
40
|
+
export type DataPart = {
|
|
41
|
+
type: `data-${string}`;
|
|
42
|
+
id?: string;
|
|
43
|
+
data?: unknown;
|
|
44
|
+
};
|
|
45
|
+
export type MessagePart = TextPart | ReasoningPart | FilePart | SourceUrlPart | ToolPart | DataPart | UnknownPart;
|
|
46
|
+
export type ChatMessage<Metadata = unknown, Part extends UnknownPart = MessagePart> = {
|
|
47
|
+
id: string;
|
|
48
|
+
role: string;
|
|
49
|
+
metadata?: Metadata;
|
|
50
|
+
parts: Part[];
|
|
51
|
+
};
|
|
52
|
+
/** Structurally identical to the AI SDK's `ChatStatus`. */
|
|
53
|
+
export type ChatStatus = "submitted" | "streaming" | "ready" | "error";
|
|
54
|
+
export declare const isTextPart: (part: UnknownPart) => part is TextPart;
|
|
55
|
+
export declare const isReasoningPart: (part: UnknownPart) => part is ReasoningPart;
|
|
56
|
+
export declare const isFilePart: (part: UnknownPart) => part is FilePart;
|
|
57
|
+
export declare const isSourceUrlPart: (part: UnknownPart) => part is SourceUrlPart;
|
|
58
|
+
export declare const isToolPart: (part: UnknownPart) => part is ToolPart;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Structural message contract. These types are deliberately framework- and
|
|
2
|
+
// SDK-agnostic: an AI SDK `UIMessage` satisfies `ChatMessage` structurally, so
|
|
3
|
+
// no adapter or translation layer is needed. Extend via the generics.
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Ask-user contract
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Part guards
|
|
9
|
+
//
|
|
10
|
+
// `UnknownPart` sits in the `MessagePart` union, so a raw discriminant check
|
|
11
|
+
// (`part.type === "text"`) cannot narrow. Use these guards instead.
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
export const isTextPart = (part) => part.type === "text";
|
|
14
|
+
export const isReasoningPart = (part) => part.type === "reasoning";
|
|
15
|
+
export const isFilePart = (part) => part.type === "file";
|
|
16
|
+
export const isSourceUrlPart = (part) => part.type === "source-url";
|
|
17
|
+
export const isToolPart = (part) => part.type.startsWith("tool-") && "state" in part && "toolCallId" in part;
|
package/package.json
CHANGED
|
@@ -1,11 +1,127 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentface/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Headless UI primitives — unstyled compound components, hooks, and wire formats for AI chat interfaces and the app shells around them.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"author": "Intentface",
|
|
9
|
+
"homepage": "https://ui.intentface.com",
|
|
6
10
|
"repository": {
|
|
7
11
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/Intentface/intentface-ui.git"
|
|
12
|
+
"url": "git+https://github.com/Intentface/intentface-ui.git",
|
|
13
|
+
"directory": "packages/ui"
|
|
9
14
|
},
|
|
10
|
-
"
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Intentface/intentface-ui/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"react",
|
|
20
|
+
"chat",
|
|
21
|
+
"ai",
|
|
22
|
+
"headless",
|
|
23
|
+
"ui",
|
|
24
|
+
"components",
|
|
25
|
+
"composer",
|
|
26
|
+
"ai-sdk",
|
|
27
|
+
"shell",
|
|
28
|
+
"sidebar",
|
|
29
|
+
"tabs",
|
|
30
|
+
"nav"
|
|
31
|
+
],
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"README.md"
|
|
36
|
+
],
|
|
37
|
+
"exports": {
|
|
38
|
+
"./types": {
|
|
39
|
+
"types": "./dist/types.d.ts",
|
|
40
|
+
"default": "./dist/types.js"
|
|
41
|
+
},
|
|
42
|
+
"./composer": {
|
|
43
|
+
"types": "./dist/composer/index.d.ts",
|
|
44
|
+
"default": "./dist/composer/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./chip": {
|
|
47
|
+
"types": "./dist/chip/index.d.ts",
|
|
48
|
+
"default": "./dist/chip/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./thread": {
|
|
51
|
+
"types": "./dist/thread/index.d.ts",
|
|
52
|
+
"default": "./dist/thread/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./reasoning": {
|
|
55
|
+
"types": "./dist/reasoning/index.d.ts",
|
|
56
|
+
"default": "./dist/reasoning/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./steps": {
|
|
59
|
+
"types": "./dist/steps/index.d.ts",
|
|
60
|
+
"default": "./dist/steps/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./attachments": {
|
|
63
|
+
"types": "./dist/attachments/index.d.ts",
|
|
64
|
+
"default": "./dist/attachments/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./ask-user": {
|
|
67
|
+
"types": "./dist/ask-user/index.d.ts",
|
|
68
|
+
"default": "./dist/ask-user/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./message": {
|
|
71
|
+
"types": "./dist/message/index.d.ts",
|
|
72
|
+
"default": "./dist/message/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./shell": {
|
|
75
|
+
"types": "./dist/shell/index.d.ts",
|
|
76
|
+
"default": "./dist/shell/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./nav": {
|
|
79
|
+
"types": "./dist/nav/index.d.ts",
|
|
80
|
+
"default": "./dist/nav/index.js"
|
|
81
|
+
},
|
|
82
|
+
"./tabs": {
|
|
83
|
+
"types": "./dist/tabs/index.d.ts",
|
|
84
|
+
"default": "./dist/tabs/index.js"
|
|
85
|
+
},
|
|
86
|
+
"./message-utils": {
|
|
87
|
+
"types": "./dist/message-utils.d.ts",
|
|
88
|
+
"default": "./dist/message-utils.js"
|
|
89
|
+
},
|
|
90
|
+
"./chip-markdown": {
|
|
91
|
+
"types": "./dist/chip-markdown.d.ts",
|
|
92
|
+
"default": "./dist/chip-markdown.js"
|
|
93
|
+
},
|
|
94
|
+
"./generative": {
|
|
95
|
+
"types": "./dist/generative/index.d.ts",
|
|
96
|
+
"default": "./dist/generative/index.js"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"scripts": {
|
|
100
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/add-dist-extensions.mjs && node scripts/smoke-dist.mjs",
|
|
101
|
+
"test": "bun test",
|
|
102
|
+
"typecheck": "tsc --noEmit",
|
|
103
|
+
"verify:release": "bun run typecheck && bun test && bun run build && publint",
|
|
104
|
+
"prepack": "bun run build"
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"@floating-ui/dom": "^1.7.6"
|
|
108
|
+
},
|
|
109
|
+
"peerDependencies": {
|
|
110
|
+
"react": "^19.0.0",
|
|
111
|
+
"react-dom": "^19.0.0"
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"@happy-dom/global-registrator": "^20.10.6",
|
|
115
|
+
"@testing-library/react": "^16.3.2",
|
|
116
|
+
"@types/bun": "^1",
|
|
117
|
+
"@types/react": "^19",
|
|
118
|
+
"@types/react-dom": "^19",
|
|
119
|
+
"axe-core": "^4.12.1",
|
|
120
|
+
"publint": "0.3.23",
|
|
121
|
+
"typescript": "^5",
|
|
122
|
+
"zod": "^4.4.3"
|
|
123
|
+
},
|
|
124
|
+
"publishConfig": {
|
|
125
|
+
"access": "public"
|
|
126
|
+
}
|
|
11
127
|
}
|