openchad-react 1.0.1 → 1.0.13
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/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +39 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -185,14 +185,16 @@ interface DefaultTab {
|
|
|
185
185
|
icon: string;
|
|
186
186
|
tabs: Tab[];
|
|
187
187
|
}
|
|
188
|
-
interface
|
|
188
|
+
interface Project {
|
|
189
189
|
defaultTab: DefaultTab;
|
|
190
190
|
appRegistry?: Record<string, React__default.ComponentType<AppInfo>>;
|
|
191
191
|
iconRegistry?: Record<string, LucideIcon>;
|
|
192
|
+
projectName: string;
|
|
193
|
+
projectIcon: React__default.ComponentType;
|
|
192
194
|
size?: number[];
|
|
193
195
|
}
|
|
194
196
|
declare function Container({ Apps }: {
|
|
195
|
-
Apps:
|
|
197
|
+
Apps: Project;
|
|
196
198
|
}): react_jsx_runtime.JSX.Element;
|
|
197
199
|
|
|
198
200
|
declare function usePython(): {
|
|
@@ -217,6 +219,8 @@ interface MessageState {
|
|
|
217
219
|
context: string;
|
|
218
220
|
}
|
|
219
221
|
|
|
222
|
+
declare const OpenChadIcon: () => react_jsx_runtime.JSX.Element;
|
|
223
|
+
|
|
220
224
|
declare function generateIdFromString(input: string): string;
|
|
221
225
|
declare const useTool: <T>() => (tool: string, parameters: Record<string, any>) => Promise<void | T | AsyncGenerator<T, void, unknown>>;
|
|
222
226
|
declare const useDatabase: <T>(tb: string, options?: {
|
|
@@ -243,4 +247,4 @@ declare const useGlobal: <T = Record<string, unknown>>(tb: string, options?: {
|
|
|
243
247
|
initialValue?: T;
|
|
244
248
|
}) => UseGlobalReturn<T>;
|
|
245
249
|
|
|
246
|
-
export { type AppInfo, type
|
|
250
|
+
export { type AppInfo, Container, type MessageState, OpenChadIcon, type Project, generateIdFromString, useDatabase, useElementSize, useFile, useFolder, useGlobal, usePython, useTool };
|
package/dist/index.d.ts
CHANGED
|
@@ -185,14 +185,16 @@ interface DefaultTab {
|
|
|
185
185
|
icon: string;
|
|
186
186
|
tabs: Tab[];
|
|
187
187
|
}
|
|
188
|
-
interface
|
|
188
|
+
interface Project {
|
|
189
189
|
defaultTab: DefaultTab;
|
|
190
190
|
appRegistry?: Record<string, React__default.ComponentType<AppInfo>>;
|
|
191
191
|
iconRegistry?: Record<string, LucideIcon>;
|
|
192
|
+
projectName: string;
|
|
193
|
+
projectIcon: React__default.ComponentType;
|
|
192
194
|
size?: number[];
|
|
193
195
|
}
|
|
194
196
|
declare function Container({ Apps }: {
|
|
195
|
-
Apps:
|
|
197
|
+
Apps: Project;
|
|
196
198
|
}): react_jsx_runtime.JSX.Element;
|
|
197
199
|
|
|
198
200
|
declare function usePython(): {
|
|
@@ -217,6 +219,8 @@ interface MessageState {
|
|
|
217
219
|
context: string;
|
|
218
220
|
}
|
|
219
221
|
|
|
222
|
+
declare const OpenChadIcon: () => react_jsx_runtime.JSX.Element;
|
|
223
|
+
|
|
220
224
|
declare function generateIdFromString(input: string): string;
|
|
221
225
|
declare const useTool: <T>() => (tool: string, parameters: Record<string, any>) => Promise<void | T | AsyncGenerator<T, void, unknown>>;
|
|
222
226
|
declare const useDatabase: <T>(tb: string, options?: {
|
|
@@ -243,4 +247,4 @@ declare const useGlobal: <T = Record<string, unknown>>(tb: string, options?: {
|
|
|
243
247
|
initialValue?: T;
|
|
244
248
|
}) => UseGlobalReturn<T>;
|
|
245
249
|
|
|
246
|
-
export { type AppInfo, type
|
|
250
|
+
export { type AppInfo, Container, type MessageState, OpenChadIcon, type Project, generateIdFromString, useDatabase, useElementSize, useFile, useFolder, useGlobal, usePython, useTool };
|
package/dist/index.js
CHANGED
|
@@ -1106,6 +1106,19 @@ function EmptyDescription({ className, ...props }) {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
);
|
|
1108
1108
|
}
|
|
1109
|
+
function EmptyContent({ className, ...props }) {
|
|
1110
|
+
return /* @__PURE__ */ runtime.jsx(
|
|
1111
|
+
"div",
|
|
1112
|
+
{
|
|
1113
|
+
"data-slot": "empty-content",
|
|
1114
|
+
className: cn(
|
|
1115
|
+
"flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",
|
|
1116
|
+
className
|
|
1117
|
+
),
|
|
1118
|
+
...props
|
|
1119
|
+
}
|
|
1120
|
+
);
|
|
1121
|
+
}
|
|
1109
1122
|
var HoverCardContent = React21__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ runtime.jsx(
|
|
1110
1123
|
HoverCardPrimitive__namespace.Content,
|
|
1111
1124
|
{
|
|
@@ -6144,6 +6157,8 @@ function SearchDialogBody({ workspace, isOpen, setOpen }) {
|
|
|
6144
6157
|
] });
|
|
6145
6158
|
}
|
|
6146
6159
|
function Sidebar({
|
|
6160
|
+
projectName,
|
|
6161
|
+
ProjectIcon,
|
|
6147
6162
|
showMcpDialog,
|
|
6148
6163
|
setShowMcpDialog,
|
|
6149
6164
|
workspace,
|
|
@@ -6435,23 +6450,10 @@ function Sidebar({
|
|
|
6435
6450
|
"relative left-1 h-8 w-8 rounded-md flex items-center justify-center text-zinc-800 dark:text-zinc-100 font-bold pointer-events-auto",
|
|
6436
6451
|
isCollapsedSidebar && "group-hover:opacity-0"
|
|
6437
6452
|
),
|
|
6438
|
-
children: /* @__PURE__ */ runtime.
|
|
6439
|
-
"svg",
|
|
6440
|
-
{
|
|
6441
|
-
className: "w-5 h-5 stroke-[15px] stroke-accent",
|
|
6442
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
6443
|
-
viewBox: "0 0 657 657",
|
|
6444
|
-
children: [
|
|
6445
|
-
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "M173 84h6a167 167 0 0 1 80 34l3 2a428 428 0 0 0 21 15l4 4 2 1a462 462 0 0 0 17 14c8 8 17 15 24 24l14 15 6 6 2 2c3 3 3 3 3 6l-8 7-3 3-2 1-8 6-4 1c-4-1-5-3-8-6a2267 2267 0 0 0-4-5l-9-9-10-11-21-21c-3-1-5-4-7-6-17-14-17-14-36-26-3 0-5 2-7 4l-2 2-2 2-2 2a968 968 0 0 0-17 19l-2 2a4081 4081 0 0 0-25 34l8 6 3 2a257 257 0 0 1 27 22 208 208 0 0 1 31 31 296 296 0 0 1 32 39 359 359 0 0 1 26 40 393 393 0 0 1 64 185c3 31-3 67-23 92a71 71 0 0 1-51 24 153 153 0 0 1-50-8l-6-2-1-3a1041 1041 0 0 1 9 1l8 1a65 65 0 0 0 51-13l4-1 1-2c1-4 3-6 6-9 5-6 8-13 10-21l2-5c20-49-4-118-23-164a332 332 0 0 0-16-32c-5-11-12-22-18-32l-2-2a356 356 0 0 0-50-67l-2 2-7 7c-12 11-12 11-22 23l-8 10-18 21 6 8 11 13 2 3a1365 1365 0 0 1 7 10c35 49 64 114 55 175-2 16-9 31-22 40l-5 3-2 2c-14 7-31 4-45 0a156 156 0 0 1-54-33 215 215 0 0 1-30-29 291 291 0 0 1-51-79c-14-29-25-61-26-93v-4c-1-22 2-44 17-60 10-10 21-14 35-14 29 0 54 16 75 34l5 4 7 6a82 82 0 0 0 14-18l2-2c10-15 21-29 33-41l4-8-24-20-2-2-19-13-3-2-19-10-2-1c-24-11-49-16-74-8-16 6-27 18-34 34l-8 24-2-1a121 121 0 0 1 26-69c4-6 8-10 15-13l2-2c7-4 13-6 20-7l3-1a105 105 0 0 1 67 13l3 1h7l3-4 2-3 2-2 3-3 10-14c10-14 21-26 33-38-11-11-36-16-52-18l-2-1c-9-1-18-1-27 1h-4c-13 2-22 8-33 15l-6 2 7-11 3-4 2-1 3-4a78 78 0 0 1 72-22ZM31 339c-8 11-12 23-12 37v3c-1 51 23 100 52 139l2 3c15 20 33 37 53 51l3 2c15 10 34 16 53 13 10-2 17-7 23-16 6-10 9-20 9-32v-3c1-58-29-114-66-156l-2-3-28-26-2-2c-22-17-62-36-85-10Z" }),
|
|
6446
|
-
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "m344 57 7 5a199 199 0 0 1 35 27l12 10a134 134 0 0 1 24 22l6 7 18 20 13-5c14-7 28-13 43-17l3-2 16-2 4 5a2136 2136 0 0 0 38 54l8 14a267 267 0 0 1 22 42c21 43 35 90 37 138v20a124 124 0 0 1-9 43c-3 12-9 23-15 34l-2-1 4-13a116 116 0 0 0 7-37 373 373 0 0 0-59-212l-2-3a476970923 476970923 0 0 0-12-21l-24-33c-8 2-15 5-22 9l-3 1-26 13 10 14 17 25 11 19a362 362 0 0 1 29 55l1 2c25 54 44 114 42 174v4c-1 18-3 34-9 51v3c-3 9-7 17-14 24l-6 9c-7 9-17 16-27 22 0-4 0-5 3-8l2-3 2-2c18-24 23-50 24-79v-24c-1-22-5-43-10-65v-3l-15-45-1 1a378 378 0 0 1-58 34l-3 2-5 3 2 4c11 30 19 63 22 95v2c3 36 3 83-21 113l-5 5-4 6c-4 5-9 9-15 12l-2 1c-12 8-25 12-39 12v-3l5-3c12-7 22-14 30-26l2-4c5-7 8-14 10-21l1-2c3-10 5-19 6-30l1-7a356 356 0 0 0-54-210 248 248 0 0 0-27-45l-3-5-2-4-2-2-1-7 4-3 2-1 3-2 5-3 3-2 8-5c4 2 5 4 8 8l2 3a236496 236496 0 0 1 16 27l1 2 4 7a136 136 0 0 1 12 22l1 4a1318 1318 0 0 0 11 21l2 4 1 3 1 4a8549 8549 0 0 0 60-35l2-2 2-1 4-1a272 272 0 0 0-15-33l-1-3a404 404 0 0 0-31-53c-7-12-15-24-24-35l-9-13a335 335 0 0 0-43-49 242 242 0 0 0-37-34c-6-5-12-11-19-15l-2-1a981 981 0 0 0-53-30h-2c-9-4-18-7-28-8l-9-2c-16-3-31 0-46 3l-1-3c12-7 24-12 37-14l3-1c37-6 77 9 108 29ZM88 421c23 16 39 41 45 68 2 10 3 21-2 31-3 5-7 7-13 8-12 1-21-4-30-12l-2-2c-19-15-33-41-36-65-1-9-1-17 4-25l2-3c9-8 22-5 32 0Z" }),
|
|
6447
|
-
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "m459 47 10 4 2 1 5 4 2 1a703 703 0 0 1 58 40l19 19 4 5c8 8 15 17 21 26l2 2c20 29 36 61 46 95l1 3c9 31 9 64 11 95h-3v-3a344 344 0 0 0-54-161l-2-3a2024 2024 0 0 0-7-12l-21-29-5-5a210 210 0 0 0-25-29 146 146 0 0 0-24-23c-9-8-18-14-28-20l-12-8v-2Z" }),
|
|
6448
|
-
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "M329 16a182 182 0 0 1 119 38c6 3 11 8 16 13l11 9 12 10-1 3c-15 5-15 5-21 2-4-2-7-6-10-9l-9-8-8-7c-9-8-20-14-30-20l-6-4c-7-5-15-8-23-12h-2c-14-6-28-9-43-11l-6-1 1-3Z" })
|
|
6449
|
-
]
|
|
6450
|
-
}
|
|
6451
|
-
)
|
|
6453
|
+
children: /* @__PURE__ */ runtime.jsx(ProjectIcon, {})
|
|
6452
6454
|
}
|
|
6453
6455
|
),
|
|
6454
|
-
/* @__PURE__ */ runtime.jsx(Aspan, { isCollapsed: isCollapsedSidebar, className: "text-lg opacity-0 text-zinc-900 dark:text-gray-200 font-funnel", children:
|
|
6456
|
+
/* @__PURE__ */ runtime.jsx(Aspan, { isCollapsed: isCollapsedSidebar, className: "text-lg opacity-0 text-zinc-900 dark:text-gray-200 font-funnel", children: projectName }),
|
|
6455
6457
|
/* @__PURE__ */ runtime.jsx("div", { className: "ml-auto pointer-events-none", children: /* @__PURE__ */ runtime.jsx(
|
|
6456
6458
|
"button",
|
|
6457
6459
|
{
|
|
@@ -10503,6 +10505,7 @@ function SelectWorkspace({ workspaces, setWorkspace }) {
|
|
|
10503
10505
|
/* @__PURE__ */ runtime.jsx(EmptyTitle, { className: clsx9__default.default(isSmallHeight && "text-base"), children: "No Workspaces Yet" }),
|
|
10504
10506
|
!isSmallHeight && /* @__PURE__ */ runtime.jsx(EmptyDescription, { children: "You haven't created any workspaces yet. Get started by creating your first workspace." })
|
|
10505
10507
|
] }),
|
|
10508
|
+
/* @__PURE__ */ runtime.jsx(EmptyContent, { children: /* @__PURE__ */ runtime.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ runtime.jsx(Button, { onClick: () => setIsCreating(true), size: isSmallHeight ? "sm" : "default", children: "Create Workspace" }) }) }),
|
|
10506
10509
|
/* @__PURE__ */ runtime.jsx(Button, { variant: "link", asChild: true, className: "text-muted-foreground", size: "sm", children: /* @__PURE__ */ runtime.jsxs("a", { onClick: (e) => {
|
|
10507
10510
|
e.preventDefault();
|
|
10508
10511
|
if (isTauri6) {
|
|
@@ -11528,6 +11531,8 @@ function Container({ Apps: Apps2 }) {
|
|
|
11528
11531
|
/* @__PURE__ */ runtime.jsx("aside", { className: "items-start x hidden md:flex bg-[hsl(var(--bg))] relative z-10", children: /* @__PURE__ */ runtime.jsx(
|
|
11529
11532
|
Sidebar,
|
|
11530
11533
|
{
|
|
11534
|
+
projectName: Apps2.projectName,
|
|
11535
|
+
ProjectIcon: Apps2.projectIcon,
|
|
11531
11536
|
workspace,
|
|
11532
11537
|
setIsSwitchWorkspace,
|
|
11533
11538
|
showSearchDialog,
|
|
@@ -11945,6 +11950,24 @@ function Container({ Apps: Apps2 }) {
|
|
|
11945
11950
|
] })
|
|
11946
11951
|
] });
|
|
11947
11952
|
}
|
|
11953
|
+
var OpenChadIcon = () => {
|
|
11954
|
+
return /* @__PURE__ */ runtime.jsxs(
|
|
11955
|
+
"svg",
|
|
11956
|
+
{
|
|
11957
|
+
className: "w-5 h-5 stroke-[15px] stroke-accent",
|
|
11958
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11959
|
+
viewBox: "0 0 657 657",
|
|
11960
|
+
children: [
|
|
11961
|
+
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "M173 84h6a167 167 0 0 1 80 34l3 2a428 428 0 0 0 21 15l4 4 2 1a462 462 0 0 0 17 14c8 8 17 15 24 24l14 15 6 6 2 2c3 3 3 3 3 6l-8 7-3 3-2 1-8 6-4 1c-4-1-5-3-8-6a2267 2267 0 0 0-4-5l-9-9-10-11-21-21c-3-1-5-4-7-6-17-14-17-14-36-26-3 0-5 2-7 4l-2 2-2 2-2 2a968 968 0 0 0-17 19l-2 2a4081 4081 0 0 0-25 34l8 6 3 2a257 257 0 0 1 27 22 208 208 0 0 1 31 31 296 296 0 0 1 32 39 359 359 0 0 1 26 40 393 393 0 0 1 64 185c3 31-3 67-23 92a71 71 0 0 1-51 24 153 153 0 0 1-50-8l-6-2-1-3a1041 1041 0 0 1 9 1l8 1a65 65 0 0 0 51-13l4-1 1-2c1-4 3-6 6-9 5-6 8-13 10-21l2-5c20-49-4-118-23-164a332 332 0 0 0-16-32c-5-11-12-22-18-32l-2-2a356 356 0 0 0-50-67l-2 2-7 7c-12 11-12 11-22 23l-8 10-18 21 6 8 11 13 2 3a1365 1365 0 0 1 7 10c35 49 64 114 55 175-2 16-9 31-22 40l-5 3-2 2c-14 7-31 4-45 0a156 156 0 0 1-54-33 215 215 0 0 1-30-29 291 291 0 0 1-51-79c-14-29-25-61-26-93v-4c-1-22 2-44 17-60 10-10 21-14 35-14 29 0 54 16 75 34l5 4 7 6a82 82 0 0 0 14-18l2-2c10-15 21-29 33-41l4-8-24-20-2-2-19-13-3-2-19-10-2-1c-24-11-49-16-74-8-16 6-27 18-34 34l-8 24-2-1a121 121 0 0 1 26-69c4-6 8-10 15-13l2-2c7-4 13-6 20-7l3-1a105 105 0 0 1 67 13l3 1h7l3-4 2-3 2-2 3-3 10-14c10-14 21-26 33-38-11-11-36-16-52-18l-2-1c-9-1-18-1-27 1h-4c-13 2-22 8-33 15l-6 2 7-11 3-4 2-1 3-4a78 78 0 0 1 72-22ZM31 339c-8 11-12 23-12 37v3c-1 51 23 100 52 139l2 3c15 20 33 37 53 51l3 2c15 10 34 16 53 13 10-2 17-7 23-16 6-10 9-20 9-32v-3c1-58-29-114-66-156l-2-3-28-26-2-2c-22-17-62-36-85-10Z" }),
|
|
11962
|
+
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "m344 57 7 5a199 199 0 0 1 35 27l12 10a134 134 0 0 1 24 22l6 7 18 20 13-5c14-7 28-13 43-17l3-2 16-2 4 5a2136 2136 0 0 0 38 54l8 14a267 267 0 0 1 22 42c21 43 35 90 37 138v20a124 124 0 0 1-9 43c-3 12-9 23-15 34l-2-1 4-13a116 116 0 0 0 7-37 373 373 0 0 0-59-212l-2-3a476970923 476970923 0 0 0-12-21l-24-33c-8 2-15 5-22 9l-3 1-26 13 10 14 17 25 11 19a362 362 0 0 1 29 55l1 2c25 54 44 114 42 174v4c-1 18-3 34-9 51v3c-3 9-7 17-14 24l-6 9c-7 9-17 16-27 22 0-4 0-5 3-8l2-3 2-2c18-24 23-50 24-79v-24c-1-22-5-43-10-65v-3l-15-45-1 1a378 378 0 0 1-58 34l-3 2-5 3 2 4c11 30 19 63 22 95v2c3 36 3 83-21 113l-5 5-4 6c-4 5-9 9-15 12l-2 1c-12 8-25 12-39 12v-3l5-3c12-7 22-14 30-26l2-4c5-7 8-14 10-21l1-2c3-10 5-19 6-30l1-7a356 356 0 0 0-54-210 248 248 0 0 0-27-45l-3-5-2-4-2-2-1-7 4-3 2-1 3-2 5-3 3-2 8-5c4 2 5 4 8 8l2 3a236496 236496 0 0 1 16 27l1 2 4 7a136 136 0 0 1 12 22l1 4a1318 1318 0 0 0 11 21l2 4 1 3 1 4a8549 8549 0 0 0 60-35l2-2 2-1 4-1a272 272 0 0 0-15-33l-1-3a404 404 0 0 0-31-53c-7-12-15-24-24-35l-9-13a335 335 0 0 0-43-49 242 242 0 0 0-37-34c-6-5-12-11-19-15l-2-1a981 981 0 0 0-53-30h-2c-9-4-18-7-28-8l-9-2c-16-3-31 0-46 3l-1-3c12-7 24-12 37-14l3-1c37-6 77 9 108 29ZM88 421c23 16 39 41 45 68 2 10 3 21-2 31-3 5-7 7-13 8-12 1-21-4-30-12l-2-2c-19-15-33-41-36-65-1-9-1-17 4-25l2-3c9-8 22-5 32 0Z" }),
|
|
11963
|
+
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "m459 47 10 4 2 1 5 4 2 1a703 703 0 0 1 58 40l19 19 4 5c8 8 15 17 21 26l2 2c20 29 36 61 46 95l1 3c9 31 9 64 11 95h-3v-3a344 344 0 0 0-54-161l-2-3a2024 2024 0 0 0-7-12l-21-29-5-5a210 210 0 0 0-25-29 146 146 0 0 0-24-23c-9-8-18-14-28-20l-12-8v-2Z" }),
|
|
11964
|
+
/* @__PURE__ */ runtime.jsx("path", { fill: "currentColor", d: "M329 16a182 182 0 0 1 119 38c6 3 11 8 16 13l11 9 12 10-1 3c-15 5-15 5-21 2-4-2-7-6-10-9l-9-8-8-7c-9-8-20-14-30-20l-6-4c-7-5-15-8-23-12h-2c-14-6-28-9-43-11l-6-1 1-3Z" })
|
|
11965
|
+
]
|
|
11966
|
+
}
|
|
11967
|
+
);
|
|
11968
|
+
};
|
|
11969
|
+
|
|
11970
|
+
// index.ts
|
|
11948
11971
|
function generateIdFromString(input) {
|
|
11949
11972
|
return "tb_" + jsSha256.sha256(input).slice(0, 32);
|
|
11950
11973
|
}
|
|
@@ -11971,6 +11994,7 @@ var useGlobal3 = (tb, options) => {
|
|
|
11971
11994
|
};
|
|
11972
11995
|
|
|
11973
11996
|
exports.Container = Container;
|
|
11997
|
+
exports.OpenChadIcon = OpenChadIcon;
|
|
11974
11998
|
exports.generateIdFromString = generateIdFromString;
|
|
11975
11999
|
exports.useDatabase = useDatabase;
|
|
11976
12000
|
exports.useElementSize = useElementSize;
|