@tomny-dev/uzi 0.18.0 → 0.18.1-pr.123.431.1.8beb2bb
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/README.md +6 -0
- package/dist/index85.js +4 -2
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +4 -1
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +1 -1
- package/dist/index87.cjs.map +1 -1
- package/dist/style.css +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,6 +69,12 @@ in browser components. See [Cloudflare integration](packages/cloudflare/README.m
|
|
|
69
69
|
and [platform architecture](docs/architecture/cloudflare-platform.md).
|
|
70
70
|
The package is intentionally private until its first consumer and release workflow are validated.
|
|
71
71
|
|
|
72
|
+
A runnable [Workers + D1 + Uzi example](examples/cloudflare-app/README.md) now
|
|
73
|
+
illustrates a real app API and migration. GitHub-hosted reusable
|
|
74
|
+
[quality](.github/workflows/cloudflare-quality.yml) and
|
|
75
|
+
[deployment](.github/workflows/cloudflare-deploy.yml) workflows live alongside
|
|
76
|
+
it; deployments must be invoked explicitly from a downstream repository.
|
|
77
|
+
|
|
72
78
|
## Documentation
|
|
73
79
|
|
|
74
80
|
- [Getting Started](docs/getting-started.md) — Installation, styles, and first components
|
package/dist/index85.js
CHANGED
|
@@ -13,6 +13,7 @@ var description = "uzi-ai-chat-dock-module__description__afqW-";
|
|
|
13
13
|
var actions = "uzi-ai-chat-dock-module__actions__rGPJb";
|
|
14
14
|
var content = "uzi-ai-chat-dock-module__content__t-hes";
|
|
15
15
|
var backdrop = "uzi-ai-chat-dock-module__backdrop__Z-yVb";
|
|
16
|
+
var expandButton = "uzi-ai-chat-dock-module__expandButton__5MxCk";
|
|
16
17
|
var ai_chat_dock_module_default = {
|
|
17
18
|
dock,
|
|
18
19
|
launcher,
|
|
@@ -27,9 +28,10 @@ var ai_chat_dock_module_default = {
|
|
|
27
28
|
description,
|
|
28
29
|
actions,
|
|
29
30
|
content,
|
|
30
|
-
backdrop
|
|
31
|
+
backdrop,
|
|
32
|
+
expandButton
|
|
31
33
|
};
|
|
32
34
|
//#endregion
|
|
33
|
-
export { actions, avatar, backdrop, content, ai_chat_dock_module_default as default, description, dock, header, iconButton, identity, launcher, launcherText, panel, title, titles };
|
|
35
|
+
export { actions, avatar, backdrop, content, ai_chat_dock_module_default as default, description, dock, expandButton, header, iconButton, identity, launcher, launcherText, panel, title, titles };
|
|
34
36
|
|
|
35
37
|
//# sourceMappingURL=index85.js.map
|
package/dist/index85.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index85.js","names":[],"sources":["../src/components/ai-chat/ai-chat-dock.module.css"],"sourcesContent":[".dock {\n position: relative;\n z-index: 100;\n}\n\n.launcher {\n position: fixed;\n right: max(1.25rem, env(safe-area-inset-right));\n bottom: calc(1.25rem + env(safe-area-inset-bottom));\n z-index: 100;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.6rem;\n min-height: 3.5rem;\n padding: 0.7rem 1.1rem;\n border: 1px solid var(--border);\n border-radius: 999px;\n background: var(--primary);\n color: var(--primary-foreground);\n box-shadow: 0 6px 24px color-mix(in srgb, var(--foreground) 20%, transparent);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.launcher:hover { filter: brightness(0.95); }\n.launcher:focus-visible, .iconButton:focus-visible {\n outline: 2px solid var(--ring, var(--primary));\n outline-offset: 2px;\n}\n.launcherText { white-space: nowrap; }\n.panel {\n position: fixed;\n z-index: 101;\n box-sizing: border-box;\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: min(26.25rem, calc(100vw - 2rem));\n height: min(42rem, calc(100dvh - 2rem - env(safe-area-inset-bottom)));\n min-height: 0;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border);\n border-radius: 1rem;\n background: var(--background);\n color: var(--foreground);\n box-shadow: 0 12px 44px color-mix(in srgb, var(--foreground) 22%, transparent);\n overflow: hidden;\n}\n.panel[hidden] { display: none !important; }\n.panel[data-expanded='true'] {\n width: min(72rem, calc(100vw - 2rem));\n height: calc(100dvh - 2rem - env(safe-area-inset-bottom));\n}\n.header {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n min-height: 3.75rem;\n padding: 0.6rem 0.85rem;\n gap: 0.75rem;\n border-bottom: 1px solid var(--border);\n background: var(--background);\n}\n.identity { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }\n.avatar {\n display: grid;\n flex: none;\n place-items: center;\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 0.7rem;\n background: color-mix(in srgb, var(--primary) 12%, var(--background));\n color: var(--primary);\n}\n.titles { display: flex; min-width: 0; flex-direction: column; gap: 0.08rem; }\n.title { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.description { font-size: 0.72rem; color: var(--muted-foreground); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.actions { display: flex; flex: none; align-items: center; gap: 0.25rem; }\n.iconButton {\n display: grid;\n place-items: center;\n height: 2rem;\n width: 2rem;\n background: transparent;\n border: 0;\n border-radius: 0.5rem;\n color: var(--muted-foreground);\n cursor: pointer;\n}\n.iconButton:hover { background: var(--muted); color: var(--foreground); }\n.content { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }\n.content > * { flex: 1; min-height: 0; min-width: 0; }\n.backdrop { display: none; }\n\n@media (max-width: 640px) {\n .launcher {\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: 3.5rem;\n height: 3.5rem;\n min-width: 3.5rem;\n padding: 0;\n }\n .actions .
|
|
1
|
+
{"version":3,"file":"index85.js","names":[],"sources":["../src/components/ai-chat/ai-chat-dock.module.css"],"sourcesContent":[".dock {\n position: relative;\n z-index: 100;\n}\n\n.launcher {\n position: fixed;\n right: max(1.25rem, env(safe-area-inset-right));\n bottom: calc(1.25rem + env(safe-area-inset-bottom));\n z-index: 100;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.6rem;\n min-height: 3.5rem;\n padding: 0.7rem 1.1rem;\n border: 1px solid var(--border);\n border-radius: 999px;\n background: var(--primary);\n color: var(--primary-foreground);\n box-shadow: 0 6px 24px color-mix(in srgb, var(--foreground) 20%, transparent);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.launcher:hover { filter: brightness(0.95); }\n.launcher:focus-visible, .iconButton:focus-visible {\n outline: 2px solid var(--ring, var(--primary));\n outline-offset: 2px;\n}\n.launcherText { white-space: nowrap; }\n.panel {\n position: fixed;\n z-index: 101;\n box-sizing: border-box;\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: min(26.25rem, calc(100vw - 2rem));\n height: min(42rem, calc(100dvh - 2rem - env(safe-area-inset-bottom)));\n min-height: 0;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border);\n border-radius: 1rem;\n background: var(--background);\n color: var(--foreground);\n box-shadow: 0 12px 44px color-mix(in srgb, var(--foreground) 22%, transparent);\n overflow: hidden;\n}\n.panel[hidden] { display: none !important; }\n.panel[data-expanded='true'] {\n width: min(72rem, calc(100vw - 2rem));\n height: calc(100dvh - 2rem - env(safe-area-inset-bottom));\n}\n.header {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n min-height: 3.75rem;\n padding: 0.6rem 0.85rem;\n gap: 0.75rem;\n border-bottom: 1px solid var(--border);\n background: var(--background);\n}\n.identity { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }\n.avatar {\n display: grid;\n flex: none;\n place-items: center;\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 0.7rem;\n background: color-mix(in srgb, var(--primary) 12%, var(--background));\n color: var(--primary);\n}\n.titles { display: flex; min-width: 0; flex-direction: column; gap: 0.08rem; }\n.title { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.description { font-size: 0.72rem; color: var(--muted-foreground); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.actions { display: flex; flex: none; align-items: center; gap: 0.25rem; }\n.iconButton {\n display: grid;\n place-items: center;\n height: 2rem;\n width: 2rem;\n background: transparent;\n border: 0;\n border-radius: 0.5rem;\n color: var(--muted-foreground);\n cursor: pointer;\n}\n.iconButton:hover { background: var(--muted); color: var(--foreground); }\n.content { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }\n.content > * { flex: 1; min-height: 0; min-width: 0; }\n.backdrop { display: none; }\n\n@media (max-width: 640px) {\n .launcher {\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: 3.5rem;\n height: 3.5rem;\n min-width: 3.5rem;\n padding: 0;\n }\n /* New chat precedes Expand in the header; hide only Expand on mobile. */\n .actions .expandButton { display: none; }\n .launcherText { display: none; }\n .backdrop { display: block; position: fixed; z-index: 100; inset: 0; background: color-mix(in srgb, var(--foreground) 35%, transparent); }\n .panel, .panel[data-expanded='true'] {\n inset: 0;\n width: 100vw;\n height: 100dvh;\n border: 0;\n border-radius: 0;\n }\n .header { padding-top: max(0.6rem, env(safe-area-inset-top)); }\n .content { padding-bottom: env(safe-area-inset-bottom); }\n}\n"],"mappings":""}
|
package/dist/index86.cjs
CHANGED
|
@@ -13,6 +13,7 @@ var description = "uzi-ai-chat-dock-module__description__afqW-";
|
|
|
13
13
|
var actions = "uzi-ai-chat-dock-module__actions__rGPJb";
|
|
14
14
|
var content = "uzi-ai-chat-dock-module__content__t-hes";
|
|
15
15
|
var backdrop = "uzi-ai-chat-dock-module__backdrop__Z-yVb";
|
|
16
|
+
var expandButton = "uzi-ai-chat-dock-module__expandButton__5MxCk";
|
|
16
17
|
var ai_chat_dock_module_default = {
|
|
17
18
|
dock,
|
|
18
19
|
launcher,
|
|
@@ -27,7 +28,8 @@ var ai_chat_dock_module_default = {
|
|
|
27
28
|
description,
|
|
28
29
|
actions,
|
|
29
30
|
content,
|
|
30
|
-
backdrop
|
|
31
|
+
backdrop,
|
|
32
|
+
expandButton
|
|
31
33
|
};
|
|
32
34
|
//#endregion
|
|
33
35
|
exports.actions = actions;
|
|
@@ -37,6 +39,7 @@ exports.content = content;
|
|
|
37
39
|
exports.default = ai_chat_dock_module_default;
|
|
38
40
|
exports.description = description;
|
|
39
41
|
exports.dock = dock;
|
|
42
|
+
exports.expandButton = expandButton;
|
|
40
43
|
exports.header = header;
|
|
41
44
|
exports.iconButton = iconButton;
|
|
42
45
|
exports.identity = identity;
|
package/dist/index86.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index86.cjs","names":[],"sources":["../src/components/ai-chat/ai-chat-dock.module.css"],"sourcesContent":[".dock {\n position: relative;\n z-index: 100;\n}\n\n.launcher {\n position: fixed;\n right: max(1.25rem, env(safe-area-inset-right));\n bottom: calc(1.25rem + env(safe-area-inset-bottom));\n z-index: 100;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.6rem;\n min-height: 3.5rem;\n padding: 0.7rem 1.1rem;\n border: 1px solid var(--border);\n border-radius: 999px;\n background: var(--primary);\n color: var(--primary-foreground);\n box-shadow: 0 6px 24px color-mix(in srgb, var(--foreground) 20%, transparent);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.launcher:hover { filter: brightness(0.95); }\n.launcher:focus-visible, .iconButton:focus-visible {\n outline: 2px solid var(--ring, var(--primary));\n outline-offset: 2px;\n}\n.launcherText { white-space: nowrap; }\n.panel {\n position: fixed;\n z-index: 101;\n box-sizing: border-box;\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: min(26.25rem, calc(100vw - 2rem));\n height: min(42rem, calc(100dvh - 2rem - env(safe-area-inset-bottom)));\n min-height: 0;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border);\n border-radius: 1rem;\n background: var(--background);\n color: var(--foreground);\n box-shadow: 0 12px 44px color-mix(in srgb, var(--foreground) 22%, transparent);\n overflow: hidden;\n}\n.panel[hidden] { display: none !important; }\n.panel[data-expanded='true'] {\n width: min(72rem, calc(100vw - 2rem));\n height: calc(100dvh - 2rem - env(safe-area-inset-bottom));\n}\n.header {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n min-height: 3.75rem;\n padding: 0.6rem 0.85rem;\n gap: 0.75rem;\n border-bottom: 1px solid var(--border);\n background: var(--background);\n}\n.identity { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }\n.avatar {\n display: grid;\n flex: none;\n place-items: center;\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 0.7rem;\n background: color-mix(in srgb, var(--primary) 12%, var(--background));\n color: var(--primary);\n}\n.titles { display: flex; min-width: 0; flex-direction: column; gap: 0.08rem; }\n.title { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.description { font-size: 0.72rem; color: var(--muted-foreground); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.actions { display: flex; flex: none; align-items: center; gap: 0.25rem; }\n.iconButton {\n display: grid;\n place-items: center;\n height: 2rem;\n width: 2rem;\n background: transparent;\n border: 0;\n border-radius: 0.5rem;\n color: var(--muted-foreground);\n cursor: pointer;\n}\n.iconButton:hover { background: var(--muted); color: var(--foreground); }\n.content { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }\n.content > * { flex: 1; min-height: 0; min-width: 0; }\n.backdrop { display: none; }\n\n@media (max-width: 640px) {\n .launcher {\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: 3.5rem;\n height: 3.5rem;\n min-width: 3.5rem;\n padding: 0;\n }\n .actions .
|
|
1
|
+
{"version":3,"file":"index86.cjs","names":[],"sources":["../src/components/ai-chat/ai-chat-dock.module.css"],"sourcesContent":[".dock {\n position: relative;\n z-index: 100;\n}\n\n.launcher {\n position: fixed;\n right: max(1.25rem, env(safe-area-inset-right));\n bottom: calc(1.25rem + env(safe-area-inset-bottom));\n z-index: 100;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.6rem;\n min-height: 3.5rem;\n padding: 0.7rem 1.1rem;\n border: 1px solid var(--border);\n border-radius: 999px;\n background: var(--primary);\n color: var(--primary-foreground);\n box-shadow: 0 6px 24px color-mix(in srgb, var(--foreground) 20%, transparent);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.launcher:hover { filter: brightness(0.95); }\n.launcher:focus-visible, .iconButton:focus-visible {\n outline: 2px solid var(--ring, var(--primary));\n outline-offset: 2px;\n}\n.launcherText { white-space: nowrap; }\n.panel {\n position: fixed;\n z-index: 101;\n box-sizing: border-box;\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: min(26.25rem, calc(100vw - 2rem));\n height: min(42rem, calc(100dvh - 2rem - env(safe-area-inset-bottom)));\n min-height: 0;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border);\n border-radius: 1rem;\n background: var(--background);\n color: var(--foreground);\n box-shadow: 0 12px 44px color-mix(in srgb, var(--foreground) 22%, transparent);\n overflow: hidden;\n}\n.panel[hidden] { display: none !important; }\n.panel[data-expanded='true'] {\n width: min(72rem, calc(100vw - 2rem));\n height: calc(100dvh - 2rem - env(safe-area-inset-bottom));\n}\n.header {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n min-height: 3.75rem;\n padding: 0.6rem 0.85rem;\n gap: 0.75rem;\n border-bottom: 1px solid var(--border);\n background: var(--background);\n}\n.identity { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }\n.avatar {\n display: grid;\n flex: none;\n place-items: center;\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 0.7rem;\n background: color-mix(in srgb, var(--primary) 12%, var(--background));\n color: var(--primary);\n}\n.titles { display: flex; min-width: 0; flex-direction: column; gap: 0.08rem; }\n.title { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.description { font-size: 0.72rem; color: var(--muted-foreground); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.actions { display: flex; flex: none; align-items: center; gap: 0.25rem; }\n.iconButton {\n display: grid;\n place-items: center;\n height: 2rem;\n width: 2rem;\n background: transparent;\n border: 0;\n border-radius: 0.5rem;\n color: var(--muted-foreground);\n cursor: pointer;\n}\n.iconButton:hover { background: var(--muted); color: var(--foreground); }\n.content { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }\n.content > * { flex: 1; min-height: 0; min-width: 0; }\n.backdrop { display: none; }\n\n@media (max-width: 640px) {\n .launcher {\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n width: 3.5rem;\n height: 3.5rem;\n min-width: 3.5rem;\n padding: 0;\n }\n /* New chat precedes Expand in the header; hide only Expand on mobile. */\n .actions .expandButton { display: none; }\n .launcherText { display: none; }\n .backdrop { display: block; position: fixed; z-index: 100; inset: 0; background: color-mix(in srgb, var(--foreground) 35%, transparent); }\n .panel, .panel[data-expanded='true'] {\n inset: 0;\n width: 100vw;\n height: 100dvh;\n border: 0;\n border-radius: 0;\n }\n .header { padding-top: max(0.6rem, env(safe-area-inset-top)); }\n .content { padding-bottom: env(safe-area-inset-bottom); }\n}\n"],"mappings":""}
|
package/dist/index86.js
CHANGED
|
@@ -195,7 +195,7 @@ function AIChatDock({ title, description, launcherLabel, showLauncher = true, pa
|
|
|
195
195
|
}),
|
|
196
196
|
/* @__PURE__ */ jsx("button", {
|
|
197
197
|
type: "button",
|
|
198
|
-
className: ai_chat_dock_module_default.iconButton
|
|
198
|
+
className: `${ai_chat_dock_module_default.iconButton} ${ai_chat_dock_module_default.expandButton}`,
|
|
199
199
|
"aria-label": isExpanded ? `Collapse ${title}` : `Expand ${title}`,
|
|
200
200
|
title: isExpanded ? "Collapse" : "Expand",
|
|
201
201
|
onClick: () => changeExpanded(!isExpanded),
|
package/dist/index86.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index86.js","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={styles.iconButton}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,SAAS,MAAM;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,eAAe;CACxE,MAAM,SAAS,QAAQ;CACvB,MAAM,aAAa,YAAY;CAC/B,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,cAAc,OAA0B,IAAI;CAClD,MAAM,WAAW,OAAoB,IAAI;CACzC,MAAM,YAAY,OAA2B,IAAI;CACjD,MAAM,UAAU,OAAO,KAAK;CAE5B,MAAM,cAAc,SAAkB;EACpC,IAAI,SAAS,KAAA,GAAW,gBAAgB,IAAI;EAC5C,eAAe,IAAI;CACrB;CAEA,MAAM,kBAAkB,SAAkB;EACxC,IAAI,aAAa,KAAA,GAAW,oBAAoB,IAAI;EACpD,mBAAmB,IAAI;EACvB,IAAI,QAAQ,CAAC,QAAQ,WAAW,IAAI;CACtC;CAEA,gBAAgB;EACd,IAAI,OAAO,OAAO,eAAe,YAAY;EAC7C,MAAM,QAAQ,OAAO,WAAW,oBAAoB;EACpD,MAAM,eAAe,UAAU,MAAM,OAAO;EAC5C,OAAO;EACP,MAAM,iBAAiB,UAAU,MAAM;EACvC,a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D;SAAK,OAAM;SAAK,QAAO;SAAK,SAAQ;SAAY,MAAK;SAAO,QAAO;SAAe,aAAY;SAC5F,eAAc;SAAQ,gBAAe;SAAQ,eAAY;mBAAO,oBAAC,QAAD,EAAM,GAAE,yCAA0C,CAAA;QAAM,CAAA;OAEtH,CAAA;OACR,oBAAC,UAAD;QAAQ,MAAK;QAAS,WAAW,4BAAO;QACtC,cAAY,SAAS;QAAS,OAAM;QACpC,eAAe,WAAW,KAAK;kBAC/B,oBAAC,OAAD;SAAK,OAAM;SAAK,QAAO;SAAK,SAAQ;SAAY,MAAK;SAAO,QAAO;SACjE,aAAY;SAAI,eAAc;SAAQ,eAAY;mBAAO,oBAAC,QAAD,EAAM,GAAE,uBAAwB,CAAA;QAAM,CAAA;OAC3F,CAAA;MACL;OACC;QACR,oBAAC,OAAD;KAAK,WAAW,4BAAO;KAAU;IAAc,CAAA,CACxC;;EACN;;AAET"}
|
|
1
|
+
{"version":3,"file":"index86.js","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={`${styles.iconButton} ${styles.expandButton}`}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,SAAS,MAAM;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,eAAe;CACxE,MAAM,SAAS,QAAQ;CACvB,MAAM,aAAa,YAAY;CAC/B,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,cAAc,OAA0B,IAAI;CAClD,MAAM,WAAW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.jsx)("button", {
|
|
197
197
|
type: "button",
|
|
198
|
-
className: require_ai_chat_dock_module.default.iconButton
|
|
198
|
+
className: `${require_ai_chat_dock_module.default.iconButton} ${require_ai_chat_dock_module.default.expandButton}`,
|
|
199
199
|
"aria-label": isExpanded ? `Collapse ${title}` : `Expand ${title}`,
|
|
200
200
|
title: isExpanded ? "Collapse" : "Expand",
|
|
201
201
|
onClick: () => changeExpanded(!isExpanded),
|
package/dist/index87.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index87.cjs","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={styles.iconButton}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,UAAA,GAAA,MAAA,MAAA,CAAe;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,oBAAA,GAAA,MAAA,SAAA,CAA4B,WAAW;CAC5D,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,SAAA,CAAgC,eAAe;CACxE,MAAM,SAAS,QAAQ;CACvB,MAAM,aAAa,YAAY;CAC/B,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,SAAA,CAAsB,KAAK;CAC1C,MAAM,eAAA,GAAA,MAAA,OAAA,CAAwC,IAAI;CAClD,MAAM,YAAA,GAAA,MAAA,OAAA,CAA+B,IAAI;CACzC,MAAM,aAAA,GAAA,MAAA,OAAA,CAAuC,IAAI;CACjD,MAAM,WAAA,GAAA,MAAA,OAAA,CAAiB,KAAK;CAE5B,MAAM,cAAc,SAAkB;EACpC,IAAI,SAAS,KA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AO,QAAO;SAAe,aAAY;SAC5F,eAAc;SAAQ,gBAAe;SAAQ,eAAY;mBAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,GAAE,yCAA0C,CAAA;QAAM,CAAA;OAEtH,CAAA;OACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;QAAQ,MAAK;QAAS,WAAW,4BAAA,QAAO;QACtC,cAAY,SAAS;QAAS,OAAM;QACpC,eAAe,WAAW,KAAK;kBAC/B,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;SAAK,OAAM;SAAK,QAAO;SAAK,SAAQ;SAAY,MAAK;SAAO,QAAO;SACjE,aAAY;SAAI,eAAc;SAAQ,eAAY;mBAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,GAAE,uBAAwB,CAAA;QAAM,CAAA;OAC3F,CAAA;MACL;OACC;QACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KAAK,WAAW,4BAAA,QAAO;KAAU;IAAc,CAAA,CACxC;;EACN;;AAET"}
|
|
1
|
+
{"version":3,"file":"index87.cjs","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={`${styles.iconButton} ${styles.expandButton}`}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,UAAA,GAAA,MAAA,MAAA,CAAe;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,oBAAA,GAAA,MAAA,SAAA,CAA4B,WAAW;CAC5D,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,SAAA,CAAgC,eAAe;CAC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the header; hide only Expand on mobile. */
|
|
4159
|
+
.uzi-ai-chat-dock-module__actions__rGPJb .uzi-ai-chat-dock-module__expandButton__5MxCk { display: none; }
|
|
4159
4160
|
.uzi-ai-chat-dock-module__launcherText__eb6OK { display: none; }
|
|
4160
4161
|
.uzi-ai-chat-dock-module__backdrop__Z-yVb { display: block; position: fixed; z-index: 100; inset: 0; background: color-mix(in srgb, var(--foreground) 35%, transparent); }
|
|
4161
4162
|
.uzi-ai-chat-dock-module__panel__4ig-u, .uzi-ai-chat-dock-module__panel__4ig-u[data-expanded='true'] {
|