@page-speed/agent-everywhere 0.7.0 → 0.8.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/README.md +5 -0
- package/dist/index.cjs +91 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +91 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,6 +195,11 @@ Every region is independently optional and controllable:
|
|
|
195
195
|
optional attach affordance (`onAttach`), and a circular send button. Pass
|
|
196
196
|
`composer={false}` to drop it, a node to replace it, or `onComposerSubmit`
|
|
197
197
|
to intercept submits.
|
|
198
|
+
- **Loading states**: render `<AgentWorkspaceSkeleton/>` while the page's data
|
|
199
|
+
loads — it mirrors the workspace geometry (panel rails, header, dock) with
|
|
200
|
+
pulsing placeholders so the resolved layout doesn't shift. Pass `children`
|
|
201
|
+
for a custom center skeleton, and `leftPanel={false}` / `rightPanel={false}`
|
|
202
|
+
/ `composer={false}` to match the page's configuration.
|
|
198
203
|
- **Programmatic control** from anywhere inside: `useAgentWorkspace()` exposes
|
|
199
204
|
`toggleLeftPanel`, `setRightPanelOpen`, `openConversation`,
|
|
200
205
|
`closeConversation`, and friends for dynamic layout scenarios.
|
package/dist/index.cjs
CHANGED
|
@@ -9011,6 +9011,96 @@ function AgentWorkspace({
|
|
|
9011
9011
|
}
|
|
9012
9012
|
) });
|
|
9013
9013
|
}
|
|
9014
|
+
var Pulse = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("animate-pulse rounded-md bg-muted", className) });
|
|
9015
|
+
var PanelSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
9016
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center justify-between px-4 pb-2 pt-4", children: [
|
|
9017
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-5 w-28" }),
|
|
9018
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "size-8 rounded-lg" })
|
|
9019
|
+
] }),
|
|
9020
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 grow space-y-4 overflow-hidden px-4 py-3", children: [3, 6].map((rows, section) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
9021
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-3 w-24" }),
|
|
9022
|
+
Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
9023
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "size-4 shrink-0 rounded-full" }),
|
|
9024
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 grow space-y-1.5", children: [
|
|
9025
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-3.5 w-3/4" }),
|
|
9026
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-3 w-1/2" })
|
|
9027
|
+
] })
|
|
9028
|
+
] }, i))
|
|
9029
|
+
] }, section)) }),
|
|
9030
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 space-y-2 border-t border-border px-4 py-3", children: [
|
|
9031
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-3 w-full" }),
|
|
9032
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-3 w-2/3" })
|
|
9033
|
+
] })
|
|
9034
|
+
] });
|
|
9035
|
+
var DefaultContentSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-6", children: [
|
|
9036
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9037
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-8 w-40" }),
|
|
9038
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-8 w-28" }),
|
|
9039
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "ml-auto h-8 w-20" })
|
|
9040
|
+
] }),
|
|
9041
|
+
Array.from({ length: 9 }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-10 w-full" }, i))
|
|
9042
|
+
] });
|
|
9043
|
+
function AgentWorkspaceSkeleton({
|
|
9044
|
+
leftPanel = true,
|
|
9045
|
+
rightPanel = true,
|
|
9046
|
+
leftPanelWidth = 320,
|
|
9047
|
+
rightPanelWidth = 460,
|
|
9048
|
+
showHeader = true,
|
|
9049
|
+
composer = true,
|
|
9050
|
+
children,
|
|
9051
|
+
className
|
|
9052
|
+
}) {
|
|
9053
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9054
|
+
"div",
|
|
9055
|
+
{
|
|
9056
|
+
"data-workspace-skeleton": "",
|
|
9057
|
+
className: cn(
|
|
9058
|
+
"flex h-full w-full overflow-hidden bg-background text-foreground",
|
|
9059
|
+
className
|
|
9060
|
+
),
|
|
9061
|
+
children: [
|
|
9062
|
+
leftPanel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9063
|
+
"aside",
|
|
9064
|
+
{
|
|
9065
|
+
"aria-hidden": true,
|
|
9066
|
+
className: "hidden h-full shrink-0 overflow-hidden border-r border-border lg:block",
|
|
9067
|
+
style: { width: leftPanelWidth },
|
|
9068
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PanelSkeleton, {})
|
|
9069
|
+
}
|
|
9070
|
+
),
|
|
9071
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-w-0 grow flex-col", children: [
|
|
9072
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-2.5", children: [
|
|
9073
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
9074
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "hidden size-8 rounded-lg lg:block" }),
|
|
9075
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "size-7 rounded-md" }),
|
|
9076
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
9077
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-4 w-36" }),
|
|
9078
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-3 w-20" })
|
|
9079
|
+
] })
|
|
9080
|
+
] }),
|
|
9081
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
9082
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-8 w-20 rounded-md" }),
|
|
9083
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "size-8 rounded-lg" }),
|
|
9084
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "size-8 rounded-lg" }),
|
|
9085
|
+
/* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "hidden size-8 rounded-lg lg:block" })
|
|
9086
|
+
] })
|
|
9087
|
+
] }),
|
|
9088
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 grow overflow-hidden", children: children ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultContentSkeleton, {}) }),
|
|
9089
|
+
composer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto w-full max-w-3xl", children: /* @__PURE__ */ jsxRuntime.jsx(Pulse, { className: "h-[52px] w-full rounded-2xl" }) }) })
|
|
9090
|
+
] }),
|
|
9091
|
+
rightPanel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9092
|
+
"aside",
|
|
9093
|
+
{
|
|
9094
|
+
"aria-hidden": true,
|
|
9095
|
+
className: "hidden h-full shrink-0 overflow-hidden border-l border-border lg:block",
|
|
9096
|
+
style: { width: rightPanelWidth },
|
|
9097
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PanelSkeleton, {})
|
|
9098
|
+
}
|
|
9099
|
+
)
|
|
9100
|
+
]
|
|
9101
|
+
}
|
|
9102
|
+
);
|
|
9103
|
+
}
|
|
9014
9104
|
|
|
9015
9105
|
exports.AgentAvatar = AgentAvatar;
|
|
9016
9106
|
exports.AgentComposer = AgentComposer;
|
|
@@ -9021,6 +9111,7 @@ exports.AgentSurface = AgentSurface;
|
|
|
9021
9111
|
exports.AgentWorkspace = AgentWorkspace;
|
|
9022
9112
|
exports.AgentWorkspaceComposer = AgentWorkspaceComposer;
|
|
9023
9113
|
exports.AgentWorkspacePanelToggle = AgentWorkspacePanelToggle;
|
|
9114
|
+
exports.AgentWorkspaceSkeleton = AgentWorkspaceSkeleton;
|
|
9024
9115
|
exports.AllocationBreakdown = AllocationBreakdown;
|
|
9025
9116
|
exports.AnalyticsDashboard = AnalyticsDashboard;
|
|
9026
9117
|
exports.Avatar = Avatar;
|