@vantageos/mosaic-blocks 0.5.34-alpha → 0.5.35-alpha
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 +4 -4
- package/dist/index.cjs +1185 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1055 -7
- package/dist/index.d.ts +1055 -7
- package/dist/index.js +1166 -68
- package/dist/index.js.map +1 -1
- package/package.json +28 -21
- package/r/mosaic-accordion.json +19 -0
- package/registry.json +144 -0
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { AlertDialog } from '@base-ui/react/alert-dialog';
|
|
|
29
29
|
import { Popover } from '@base-ui/react/popover';
|
|
30
30
|
|
|
31
31
|
// src/version.ts
|
|
32
|
-
var version = "0.5.
|
|
32
|
+
var version = "0.5.35-alpha";
|
|
33
33
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
34
34
|
return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
35
35
|
}
|
|
@@ -796,7 +796,9 @@ function MosaicThemeToggle({
|
|
|
796
796
|
"aria-pressed": isDark,
|
|
797
797
|
onClick: handleToggle,
|
|
798
798
|
className: cn12(
|
|
799
|
-
"inline-flex size-9 items-center justify-center rounded-full border border-
|
|
799
|
+
"inline-flex size-9 items-center justify-center rounded-full border border-border",
|
|
800
|
+
"bg-secondary text-foreground transition-colors hover:bg-accent",
|
|
801
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
800
802
|
className
|
|
801
803
|
),
|
|
802
804
|
children: isDark ? /* @__PURE__ */ jsxs(
|
|
@@ -2198,7 +2200,11 @@ function MosaicCombobox({
|
|
|
2198
2200
|
disabled,
|
|
2199
2201
|
name,
|
|
2200
2202
|
emptyMessage,
|
|
2201
|
-
className
|
|
2203
|
+
className,
|
|
2204
|
+
side,
|
|
2205
|
+
align,
|
|
2206
|
+
collisionBoundary,
|
|
2207
|
+
collisionPadding
|
|
2202
2208
|
}) {
|
|
2203
2209
|
const [inputValue, setInputValue] = React30.useState("");
|
|
2204
2210
|
const filter = Combobox.useFilter({ sensitivity: "base" });
|
|
@@ -2230,39 +2236,46 @@ function MosaicCombobox({
|
|
|
2230
2236
|
)
|
|
2231
2237
|
}
|
|
2232
2238
|
),
|
|
2233
|
-
/* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(
|
|
2234
|
-
Combobox.
|
|
2239
|
+
/* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(
|
|
2240
|
+
Combobox.Positioner,
|
|
2235
2241
|
{
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2242
|
+
sideOffset: 4,
|
|
2243
|
+
side,
|
|
2244
|
+
align,
|
|
2245
|
+
collisionBoundary,
|
|
2246
|
+
collisionPadding,
|
|
2247
|
+
children: /* @__PURE__ */ jsx(
|
|
2248
|
+
Combobox.Popup,
|
|
2249
|
+
{
|
|
2250
|
+
className: cn35(
|
|
2251
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border",
|
|
2252
|
+
"bg-popover p-1 text-popover-foreground shadow-md",
|
|
2253
|
+
"origin-[var(--transform-origin)]",
|
|
2254
|
+
"transition-[transform,scale,opacity]",
|
|
2255
|
+
"data-[open]:scale-100 data-[open]:opacity-100",
|
|
2256
|
+
"data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
|
|
2257
|
+
"data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
|
|
2258
|
+
),
|
|
2259
|
+
children: /* @__PURE__ */ jsx(Combobox.List, { children: filteredItems.length === 0 ? /* @__PURE__ */ jsx(Combobox.Empty, { className: "py-2 text-center text-sm text-muted-foreground", children: emptyMessage }) : filteredItems.map((item) => /* @__PURE__ */ jsx(
|
|
2260
|
+
Combobox.Item,
|
|
2261
|
+
{
|
|
2262
|
+
value: item.value,
|
|
2263
|
+
disabled: item.disabled,
|
|
2264
|
+
className: cn35(
|
|
2265
|
+
"relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5",
|
|
2266
|
+
"text-sm text-popover-foreground outline-none",
|
|
2267
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
2268
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
2269
|
+
"data-[selected]:font-medium"
|
|
2270
|
+
),
|
|
2271
|
+
children: item.label
|
|
2272
|
+
},
|
|
2273
|
+
item.value
|
|
2274
|
+
)) })
|
|
2275
|
+
}
|
|
2276
|
+
)
|
|
2264
2277
|
}
|
|
2265
|
-
) })
|
|
2278
|
+
) })
|
|
2266
2279
|
] })
|
|
2267
2280
|
}
|
|
2268
2281
|
);
|
|
@@ -2303,7 +2316,11 @@ function MosaicModelSelector({
|
|
|
2303
2316
|
emptyMessage,
|
|
2304
2317
|
disabled,
|
|
2305
2318
|
name,
|
|
2306
|
-
className
|
|
2319
|
+
className,
|
|
2320
|
+
side,
|
|
2321
|
+
align,
|
|
2322
|
+
collisionBoundary,
|
|
2323
|
+
collisionPadding
|
|
2307
2324
|
}) {
|
|
2308
2325
|
const [inputValue, setInputValue] = React30.useState("");
|
|
2309
2326
|
const filter = Combobox.useFilter({ sensitivity: "base" });
|
|
@@ -2342,40 +2359,47 @@ function MosaicModelSelector({
|
|
|
2342
2359
|
}
|
|
2343
2360
|
),
|
|
2344
2361
|
value != null && value in labelMap && inputValue === "" && /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute inset-y-0 left-3 flex items-center text-sm text-foreground", children: labelMap[value] }),
|
|
2345
|
-
/* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(
|
|
2346
|
-
Combobox.
|
|
2362
|
+
/* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(
|
|
2363
|
+
Combobox.Positioner,
|
|
2347
2364
|
{
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2365
|
+
sideOffset: 4,
|
|
2366
|
+
side,
|
|
2367
|
+
align,
|
|
2368
|
+
collisionBoundary,
|
|
2369
|
+
collisionPadding,
|
|
2370
|
+
children: /* @__PURE__ */ jsx(
|
|
2371
|
+
Combobox.Popup,
|
|
2372
|
+
{
|
|
2373
|
+
className: cn36(
|
|
2374
|
+
"z-50 min-w-[16rem] overflow-hidden rounded-md border border-border",
|
|
2375
|
+
"bg-popover p-1 text-popover-foreground shadow-md",
|
|
2376
|
+
"origin-[var(--transform-origin)]",
|
|
2377
|
+
"transition-[transform,scale,opacity]",
|
|
2378
|
+
"data-[open]:scale-100 data-[open]:opacity-100",
|
|
2379
|
+
"data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
|
|
2380
|
+
"data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
|
|
2381
|
+
),
|
|
2382
|
+
children: /* @__PURE__ */ jsx(Combobox.List, { children: filteredModels.length === 0 ? /* @__PURE__ */ jsx(Combobox.Empty, { className: "py-2 text-center text-sm text-muted-foreground", children: emptyMessage }) : filteredModels.map((model) => /* @__PURE__ */ jsxs(
|
|
2383
|
+
Combobox.Item,
|
|
2384
|
+
{
|
|
2385
|
+
value: model.value,
|
|
2386
|
+
disabled: model.disabled,
|
|
2387
|
+
className: modelSelectorItemVariants({ className: void 0 }),
|
|
2388
|
+
children: [
|
|
2389
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2390
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: model.label }),
|
|
2391
|
+
model.badge && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs text-secondary-foreground", children: model.badge })
|
|
2392
|
+
] }),
|
|
2393
|
+
model.description && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: model.description }),
|
|
2394
|
+
model.meta && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: model.meta })
|
|
2395
|
+
]
|
|
2396
|
+
},
|
|
2397
|
+
model.value
|
|
2398
|
+
)) })
|
|
2399
|
+
}
|
|
2400
|
+
)
|
|
2377
2401
|
}
|
|
2378
|
-
) })
|
|
2402
|
+
) })
|
|
2379
2403
|
] })
|
|
2380
2404
|
}
|
|
2381
2405
|
);
|
|
@@ -17102,6 +17126,1080 @@ function MosaicEditableCell({
|
|
|
17102
17126
|
}
|
|
17103
17127
|
MosaicEditableCell.displayName = "MosaicEditableCell";
|
|
17104
17128
|
|
|
17105
|
-
|
|
17129
|
+
// src/components/artifact-canvas-adapter/normalize.ts
|
|
17130
|
+
var KNOWN_TYPES = ["document", "data-table", "checklist", "chart"];
|
|
17131
|
+
function isArtifactType(value) {
|
|
17132
|
+
return KNOWN_TYPES.includes(value);
|
|
17133
|
+
}
|
|
17134
|
+
function titleFromData(data) {
|
|
17135
|
+
return typeof data.title === "string" ? data.title : "";
|
|
17136
|
+
}
|
|
17137
|
+
function normalizeFromAiSdkArtifacts(source) {
|
|
17138
|
+
if (!source.activeId) return null;
|
|
17139
|
+
const entry = source.artifacts.find((a) => a.id === source.activeId);
|
|
17140
|
+
if (!entry) return null;
|
|
17141
|
+
if (!isArtifactType(entry.type)) return null;
|
|
17142
|
+
return {
|
|
17143
|
+
id: entry.id,
|
|
17144
|
+
type: entry.type,
|
|
17145
|
+
title: titleFromData(entry.data),
|
|
17146
|
+
data: entry.data
|
|
17147
|
+
};
|
|
17148
|
+
}
|
|
17149
|
+
function normalizeFromMcpToolResult(source) {
|
|
17150
|
+
const resourceUri = source.toolResult?._meta?.ui?.resourceUri;
|
|
17151
|
+
if (!resourceUri) return null;
|
|
17152
|
+
const segments = resourceUri.split("/").filter(Boolean);
|
|
17153
|
+
const typeSegment = segments[segments.length - 1];
|
|
17154
|
+
if (!typeSegment || !isArtifactType(typeSegment)) return null;
|
|
17155
|
+
const data = source.toolResult.structuredContent ?? {};
|
|
17156
|
+
const id = typeof data.id === "string" ? data.id : resourceUri;
|
|
17157
|
+
return {
|
|
17158
|
+
id,
|
|
17159
|
+
type: typeSegment,
|
|
17160
|
+
title: titleFromData(data),
|
|
17161
|
+
data
|
|
17162
|
+
};
|
|
17163
|
+
}
|
|
17164
|
+
function normalizeArtifact(source) {
|
|
17165
|
+
if (source.kind === "ai-sdk-artifacts") return normalizeFromAiSdkArtifacts(source);
|
|
17166
|
+
if (source.kind === "mcp-ui") return normalizeFromMcpToolResult(source);
|
|
17167
|
+
return null;
|
|
17168
|
+
}
|
|
17169
|
+
function cn117(...classes) {
|
|
17170
|
+
return classes.filter(Boolean).join(" ");
|
|
17171
|
+
}
|
|
17172
|
+
function MosaicArtifactCanvasAdapter({
|
|
17173
|
+
source,
|
|
17174
|
+
isOpen,
|
|
17175
|
+
onToggle,
|
|
17176
|
+
onClose,
|
|
17177
|
+
labels,
|
|
17178
|
+
className,
|
|
17179
|
+
ref
|
|
17180
|
+
}) {
|
|
17181
|
+
const artifact = source ? normalizeArtifact(source) : null;
|
|
17182
|
+
return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "artifact-canvas-adapter", className: cn117("relative", className), children: [
|
|
17183
|
+
/* @__PURE__ */ jsx(
|
|
17184
|
+
"button",
|
|
17185
|
+
{
|
|
17186
|
+
type: "button",
|
|
17187
|
+
"data-slot": "artifact-canvas-toggle",
|
|
17188
|
+
"aria-label": labels.toggleLabel,
|
|
17189
|
+
"aria-expanded": isOpen,
|
|
17190
|
+
onClick: onToggle,
|
|
17191
|
+
className: cn117(
|
|
17192
|
+
"inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium",
|
|
17193
|
+
"outline-none transition-colors",
|
|
17194
|
+
"focus-visible:ring-ring focus-visible:ring-[3px]",
|
|
17195
|
+
"bg-muted text-muted-foreground hover:text-foreground"
|
|
17196
|
+
),
|
|
17197
|
+
children: labels.toggleLabel
|
|
17198
|
+
}
|
|
17199
|
+
),
|
|
17200
|
+
isOpen && /* @__PURE__ */ jsxs(
|
|
17201
|
+
"section",
|
|
17202
|
+
{
|
|
17203
|
+
"aria-label": labels.toolbarHeading,
|
|
17204
|
+
"data-slot": "artifact-canvas",
|
|
17205
|
+
className: cn117(
|
|
17206
|
+
"mt-2 flex flex-col rounded-lg border border-border bg-background",
|
|
17207
|
+
"shadow-xs"
|
|
17208
|
+
),
|
|
17209
|
+
children: [
|
|
17210
|
+
/* @__PURE__ */ jsxs(
|
|
17211
|
+
"div",
|
|
17212
|
+
{
|
|
17213
|
+
"data-slot": "artifact-canvas-toolbar",
|
|
17214
|
+
className: "flex items-center justify-between border-border border-b px-4 py-2",
|
|
17215
|
+
children: [
|
|
17216
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: labels.toolbarHeading }),
|
|
17217
|
+
/* @__PURE__ */ jsx(
|
|
17218
|
+
"button",
|
|
17219
|
+
{
|
|
17220
|
+
type: "button",
|
|
17221
|
+
"aria-label": labels.closeLabel,
|
|
17222
|
+
onClick: onClose,
|
|
17223
|
+
className: cn117(
|
|
17224
|
+
"rounded-md p-1 outline-none transition-colors",
|
|
17225
|
+
"focus-visible:ring-ring focus-visible:ring-[3px]",
|
|
17226
|
+
"hover:bg-muted"
|
|
17227
|
+
),
|
|
17228
|
+
children: labels.closeLabel
|
|
17229
|
+
}
|
|
17230
|
+
)
|
|
17231
|
+
]
|
|
17232
|
+
}
|
|
17233
|
+
),
|
|
17234
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "artifact-canvas-body", className: "flex-1 p-4", children: [
|
|
17235
|
+
!source && /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
17236
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-muted-foreground", children: labels.emptyTitle }),
|
|
17237
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-muted-foreground/70 text-sm", children: labels.emptyBody })
|
|
17238
|
+
] }),
|
|
17239
|
+
source && !artifact && /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
17240
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-muted-foreground", children: labels.notFoundTitle }),
|
|
17241
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-muted-foreground/70 text-sm", children: labels.notFoundBody })
|
|
17242
|
+
] }),
|
|
17243
|
+
artifact && /* @__PURE__ */ jsx("div", { "data-slot": "artifact-canvas-artifact", "data-artifact-type": artifact.type, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
17244
|
+
/* @__PURE__ */ jsx(
|
|
17245
|
+
"span",
|
|
17246
|
+
{
|
|
17247
|
+
"data-slot": "artifact-canvas-type-badge",
|
|
17248
|
+
className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17249
|
+
children: labels.typeLabel(artifact.type)
|
|
17250
|
+
}
|
|
17251
|
+
),
|
|
17252
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-base", children: artifact.title })
|
|
17253
|
+
] }) })
|
|
17254
|
+
] })
|
|
17255
|
+
]
|
|
17256
|
+
}
|
|
17257
|
+
)
|
|
17258
|
+
] });
|
|
17259
|
+
}
|
|
17260
|
+
MosaicArtifactCanvasAdapter.displayName = "MosaicArtifactCanvasAdapter";
|
|
17261
|
+
function cn118(...classes) {
|
|
17262
|
+
return classes.filter(Boolean).join(" ");
|
|
17263
|
+
}
|
|
17264
|
+
function MosaicArtifactDocument({
|
|
17265
|
+
data,
|
|
17266
|
+
labels,
|
|
17267
|
+
className,
|
|
17268
|
+
ref
|
|
17269
|
+
}) {
|
|
17270
|
+
const sortedSections = data.sections ? [...data.sections].sort((a, b) => a.order - b.order) : [];
|
|
17271
|
+
return /* @__PURE__ */ jsxs(
|
|
17272
|
+
"div",
|
|
17273
|
+
{
|
|
17274
|
+
ref,
|
|
17275
|
+
"data-slot": "artifact-document",
|
|
17276
|
+
className: cn118(
|
|
17277
|
+
"flex h-full flex-col rounded-lg border border-border bg-background",
|
|
17278
|
+
className
|
|
17279
|
+
),
|
|
17280
|
+
children: [
|
|
17281
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-border border-b px-4 py-3", children: [
|
|
17282
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
17283
|
+
/* @__PURE__ */ jsx("h3", { className: "truncate font-medium text-base", children: data.title }),
|
|
17284
|
+
/* @__PURE__ */ jsx(
|
|
17285
|
+
"span",
|
|
17286
|
+
{
|
|
17287
|
+
"data-slot": "artifact-document-type-badge",
|
|
17288
|
+
className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17289
|
+
children: labels.typeBadgeLabel
|
|
17290
|
+
}
|
|
17291
|
+
)
|
|
17292
|
+
] }),
|
|
17293
|
+
data.metadata?.updatedAt && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground text-xs", children: labels.updatedLabel(new Date(data.metadata.updatedAt).toLocaleDateString()) })
|
|
17294
|
+
] }),
|
|
17295
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto p-6", children: /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed", children: data.content || labels.emptyContentMessage }) }),
|
|
17296
|
+
sortedSections.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border-border border-t p-4", children: [
|
|
17297
|
+
/* @__PURE__ */ jsx("h4", { className: "mb-3 font-medium text-sm", children: labels.sectionsHeading }),
|
|
17298
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-2", children: sortedSections.map((section) => /* @__PURE__ */ jsxs(
|
|
17299
|
+
"li",
|
|
17300
|
+
{
|
|
17301
|
+
"data-slot": "artifact-document-section",
|
|
17302
|
+
className: "flex items-center gap-2 rounded bg-muted/50 p-2",
|
|
17303
|
+
children: [
|
|
17304
|
+
/* @__PURE__ */ jsx("span", { className: "h-4 w-1 shrink-0 rounded-full bg-primary" }),
|
|
17305
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: section.title }),
|
|
17306
|
+
/* @__PURE__ */ jsx("span", { className: "ml-auto rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.charsLabel(section.content.length) })
|
|
17307
|
+
]
|
|
17308
|
+
},
|
|
17309
|
+
section.id
|
|
17310
|
+
)) })
|
|
17311
|
+
] }),
|
|
17312
|
+
data.metadata?.tags && data.metadata.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "border-border border-t p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
17313
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: labels.tagsLabel }),
|
|
17314
|
+
data.metadata.tags.map((tag) => /* @__PURE__ */ jsx(
|
|
17315
|
+
"span",
|
|
17316
|
+
{
|
|
17317
|
+
"data-slot": "artifact-document-tag",
|
|
17318
|
+
className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17319
|
+
children: tag
|
|
17320
|
+
},
|
|
17321
|
+
tag
|
|
17322
|
+
))
|
|
17323
|
+
] }) })
|
|
17324
|
+
]
|
|
17325
|
+
}
|
|
17326
|
+
);
|
|
17327
|
+
}
|
|
17328
|
+
MosaicArtifactDocument.displayName = "MosaicArtifactDocument";
|
|
17329
|
+
function cn119(...classes) {
|
|
17330
|
+
return classes.filter(Boolean).join(" ");
|
|
17331
|
+
}
|
|
17332
|
+
function MosaicArtifactDataTable({
|
|
17333
|
+
data,
|
|
17334
|
+
labels,
|
|
17335
|
+
className,
|
|
17336
|
+
ref
|
|
17337
|
+
}) {
|
|
17338
|
+
return /* @__PURE__ */ jsxs(
|
|
17339
|
+
"div",
|
|
17340
|
+
{
|
|
17341
|
+
ref,
|
|
17342
|
+
"data-slot": "artifact-data-table",
|
|
17343
|
+
className: cn119(
|
|
17344
|
+
"flex h-full flex-col rounded-lg border border-border bg-background",
|
|
17345
|
+
className
|
|
17346
|
+
),
|
|
17347
|
+
children: [
|
|
17348
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-border border-b px-4 py-3", children: [
|
|
17349
|
+
/* @__PURE__ */ jsx("h3", { className: "font-medium text-base", children: data.title }),
|
|
17350
|
+
/* @__PURE__ */ jsx(
|
|
17351
|
+
"span",
|
|
17352
|
+
{
|
|
17353
|
+
"data-slot": "artifact-data-table-type-badge",
|
|
17354
|
+
className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17355
|
+
children: labels.typeBadgeLabel
|
|
17356
|
+
}
|
|
17357
|
+
),
|
|
17358
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.rowsColsLabel(data.rows.length, data.columns.length) })
|
|
17359
|
+
] }),
|
|
17360
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsx(
|
|
17361
|
+
MosaicDataTable,
|
|
17362
|
+
{
|
|
17363
|
+
columns: data.columns.map((column) => ({
|
|
17364
|
+
key: column.id,
|
|
17365
|
+
header: column.name,
|
|
17366
|
+
render: (row) => {
|
|
17367
|
+
const value = row[column.id];
|
|
17368
|
+
if (column.type === "boolean") {
|
|
17369
|
+
return /* @__PURE__ */ jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs", children: value ? labels.yesLabel : labels.noLabel });
|
|
17370
|
+
}
|
|
17371
|
+
if (column.type === "number") {
|
|
17372
|
+
return /* @__PURE__ */ jsx("span", { className: "font-mono", children: String(value ?? "") });
|
|
17373
|
+
}
|
|
17374
|
+
return String(value ?? "");
|
|
17375
|
+
}
|
|
17376
|
+
})),
|
|
17377
|
+
rows: data.rows,
|
|
17378
|
+
emptyMessage: labels.emptyMessage
|
|
17379
|
+
}
|
|
17380
|
+
) })
|
|
17381
|
+
]
|
|
17382
|
+
}
|
|
17383
|
+
);
|
|
17384
|
+
}
|
|
17385
|
+
MosaicArtifactDataTable.displayName = "MosaicArtifactDataTable";
|
|
17386
|
+
function cn120(...classes) {
|
|
17387
|
+
return classes.filter(Boolean).join(" ");
|
|
17388
|
+
}
|
|
17389
|
+
var CHART_COLORS = [
|
|
17390
|
+
"var(--color-chart-1, #8884d8)",
|
|
17391
|
+
"var(--color-chart-2, #82ca9d)",
|
|
17392
|
+
"var(--color-chart-3, #ffc658)",
|
|
17393
|
+
"var(--color-chart-4, #ff7300)",
|
|
17394
|
+
"var(--color-chart-5, #00c2ff)"
|
|
17395
|
+
];
|
|
17396
|
+
function seriesKeys(rows, xAxisKey) {
|
|
17397
|
+
return Object.keys(rows[0] ?? {}).filter((key) => key !== xAxisKey);
|
|
17398
|
+
}
|
|
17399
|
+
function renderChart(data, labels, recharts) {
|
|
17400
|
+
const {
|
|
17401
|
+
BarChart,
|
|
17402
|
+
Bar,
|
|
17403
|
+
LineChart,
|
|
17404
|
+
Line,
|
|
17405
|
+
PieChart,
|
|
17406
|
+
Pie,
|
|
17407
|
+
Cell,
|
|
17408
|
+
XAxis,
|
|
17409
|
+
YAxis,
|
|
17410
|
+
CartesianGrid,
|
|
17411
|
+
Tooltip: Tooltip2,
|
|
17412
|
+
Legend,
|
|
17413
|
+
ResponsiveContainer
|
|
17414
|
+
} = recharts;
|
|
17415
|
+
const xAxisKey = data.config?.xAxis ?? Object.keys(data.data[0] ?? {})[0] ?? "";
|
|
17416
|
+
const colors = data.config?.colors ?? CHART_COLORS;
|
|
17417
|
+
if (data.type === "bar") {
|
|
17418
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(BarChart, { data: data.data, margin: { top: 20, right: 30, left: 20, bottom: 5 }, children: [
|
|
17419
|
+
data.config?.grid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
17420
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey }),
|
|
17421
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
17422
|
+
/* @__PURE__ */ jsx(Tooltip2, {}),
|
|
17423
|
+
data.config?.legend && /* @__PURE__ */ jsx(Legend, {}),
|
|
17424
|
+
seriesKeys(data.data, xAxisKey).map((key, index) => /* @__PURE__ */ jsx(Bar, { dataKey: key, fill: colors[index % colors.length] }, key))
|
|
17425
|
+
] }) });
|
|
17426
|
+
}
|
|
17427
|
+
if (data.type === "line") {
|
|
17428
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(LineChart, { data: data.data, margin: { top: 20, right: 30, left: 20, bottom: 5 }, children: [
|
|
17429
|
+
data.config?.grid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
17430
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey }),
|
|
17431
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
17432
|
+
/* @__PURE__ */ jsx(Tooltip2, {}),
|
|
17433
|
+
data.config?.legend && /* @__PURE__ */ jsx(Legend, {}),
|
|
17434
|
+
seriesKeys(data.data, xAxisKey).map((key, index) => /* @__PURE__ */ jsx(
|
|
17435
|
+
Line,
|
|
17436
|
+
{
|
|
17437
|
+
type: "monotone",
|
|
17438
|
+
dataKey: key,
|
|
17439
|
+
stroke: colors[index % colors.length],
|
|
17440
|
+
strokeWidth: 2
|
|
17441
|
+
},
|
|
17442
|
+
key
|
|
17443
|
+
))
|
|
17444
|
+
] }) });
|
|
17445
|
+
}
|
|
17446
|
+
if (data.type === "pie") {
|
|
17447
|
+
const nameKey = Object.keys(data.data[0] ?? {})[0] ?? "name";
|
|
17448
|
+
const valueKey = Object.keys(data.data[0] ?? {})[1] ?? "value";
|
|
17449
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(PieChart, { children: [
|
|
17450
|
+
/* @__PURE__ */ jsx(Pie, { data: data.data, cx: "50%", cy: "50%", outerRadius: 80, dataKey: valueKey, children: data.data.map((entry, index) => /* @__PURE__ */ jsx(Cell, { fill: colors[index % colors.length] }, String(entry[nameKey] ?? index))) }),
|
|
17451
|
+
/* @__PURE__ */ jsx(Tooltip2, {}),
|
|
17452
|
+
data.config?.legend && /* @__PURE__ */ jsx(Legend, {})
|
|
17453
|
+
] }) });
|
|
17454
|
+
}
|
|
17455
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-muted-foreground text-sm", children: labels.unsupportedTypeMessage(data.type) });
|
|
17456
|
+
}
|
|
17457
|
+
function MosaicArtifactChart({
|
|
17458
|
+
data,
|
|
17459
|
+
labels,
|
|
17460
|
+
recharts,
|
|
17461
|
+
className,
|
|
17462
|
+
ref
|
|
17463
|
+
}) {
|
|
17464
|
+
return /* @__PURE__ */ jsxs(
|
|
17465
|
+
"div",
|
|
17466
|
+
{
|
|
17467
|
+
ref,
|
|
17468
|
+
"data-slot": "artifact-chart",
|
|
17469
|
+
className: cn120(
|
|
17470
|
+
"flex h-full flex-col rounded-lg border border-border bg-background",
|
|
17471
|
+
className
|
|
17472
|
+
),
|
|
17473
|
+
children: [
|
|
17474
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-border border-b px-4 py-3", children: [
|
|
17475
|
+
/* @__PURE__ */ jsx("h3", { className: "font-medium text-base", children: data.title }),
|
|
17476
|
+
/* @__PURE__ */ jsx(
|
|
17477
|
+
"span",
|
|
17478
|
+
{
|
|
17479
|
+
"data-slot": "artifact-chart-type-badge",
|
|
17480
|
+
className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17481
|
+
children: labels.typeBadgeLabel(data.type)
|
|
17482
|
+
}
|
|
17483
|
+
),
|
|
17484
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.pointsLabel(data.data.length) })
|
|
17485
|
+
] }),
|
|
17486
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-64 flex-1 p-6", children: recharts ? renderChart(data, labels, recharts) : /* @__PURE__ */ jsx(
|
|
17487
|
+
"div",
|
|
17488
|
+
{
|
|
17489
|
+
"data-slot": "artifact-chart-unavailable",
|
|
17490
|
+
className: "flex h-full items-center justify-center text-muted-foreground text-sm",
|
|
17491
|
+
children: labels.unavailableMessage
|
|
17492
|
+
}
|
|
17493
|
+
) }),
|
|
17494
|
+
(data.metadata?.dataSource || data.metadata?.description) && /* @__PURE__ */ jsx("div", { className: "border-border border-t px-4 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-muted-foreground text-xs", children: [
|
|
17495
|
+
data.metadata?.dataSource && /* @__PURE__ */ jsx("span", { children: data.metadata.dataSource }),
|
|
17496
|
+
data.metadata?.description && /* @__PURE__ */ jsx("span", { children: data.metadata.description })
|
|
17497
|
+
] }) })
|
|
17498
|
+
]
|
|
17499
|
+
}
|
|
17500
|
+
);
|
|
17501
|
+
}
|
|
17502
|
+
MosaicArtifactChart.displayName = "MosaicArtifactChart";
|
|
17503
|
+
function cn121(...classes) {
|
|
17504
|
+
return classes.filter(Boolean).join(" ");
|
|
17505
|
+
}
|
|
17506
|
+
function MosaicArtifactChecklist({
|
|
17507
|
+
data,
|
|
17508
|
+
labels,
|
|
17509
|
+
className,
|
|
17510
|
+
ref
|
|
17511
|
+
}) {
|
|
17512
|
+
const completedCount = data.items.filter((item) => item.completed).length;
|
|
17513
|
+
const totalCount = data.items.length;
|
|
17514
|
+
const progress = totalCount > 0 ? completedCount / totalCount * 100 : 0;
|
|
17515
|
+
return /* @__PURE__ */ jsxs(
|
|
17516
|
+
"div",
|
|
17517
|
+
{
|
|
17518
|
+
ref,
|
|
17519
|
+
"data-slot": "artifact-checklist",
|
|
17520
|
+
className: cn121(
|
|
17521
|
+
"flex h-full flex-col rounded-lg border border-border bg-background",
|
|
17522
|
+
className
|
|
17523
|
+
),
|
|
17524
|
+
children: [
|
|
17525
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-border border-b px-4 py-3", children: [
|
|
17526
|
+
/* @__PURE__ */ jsx("h3", { className: "font-medium text-base", children: data.title }),
|
|
17527
|
+
/* @__PURE__ */ jsx(
|
|
17528
|
+
"span",
|
|
17529
|
+
{
|
|
17530
|
+
"data-slot": "artifact-checklist-type-badge",
|
|
17531
|
+
className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17532
|
+
children: labels.typeBadgeLabel
|
|
17533
|
+
}
|
|
17534
|
+
),
|
|
17535
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.progressLabel(completedCount, totalCount) })
|
|
17536
|
+
] }),
|
|
17537
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3 border-border border-b bg-muted/20 p-4", children: [
|
|
17538
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-between text-sm", children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: labels.completedOfTotalLabel(completedCount, totalCount, Math.round(progress)) }) }),
|
|
17539
|
+
/* @__PURE__ */ jsx(MosaicProgress, { value: progress, "aria-label": labels.typeBadgeLabel }),
|
|
17540
|
+
data.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: data.description })
|
|
17541
|
+
] }),
|
|
17542
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto p-4", children: totalCount === 0 ? /* @__PURE__ */ jsx("p", { className: "py-8 text-center text-muted-foreground text-sm", children: labels.emptyMessage }) : /* @__PURE__ */ jsx("ul", { className: "space-y-3", children: data.items.map((item) => /* @__PURE__ */ jsxs(
|
|
17543
|
+
"li",
|
|
17544
|
+
{
|
|
17545
|
+
"data-slot": "artifact-checklist-item",
|
|
17546
|
+
className: cn121(
|
|
17547
|
+
"flex items-start gap-3 rounded-lg border p-3",
|
|
17548
|
+
item.completed ? "border-primary/20 bg-primary/10" : "border-border bg-background"
|
|
17549
|
+
),
|
|
17550
|
+
children: [
|
|
17551
|
+
/* @__PURE__ */ jsx(
|
|
17552
|
+
"span",
|
|
17553
|
+
{
|
|
17554
|
+
"aria-hidden": "true",
|
|
17555
|
+
className: cn121(
|
|
17556
|
+
"mt-0.5 h-4 w-4 shrink-0 rounded border-2",
|
|
17557
|
+
item.completed ? "border-primary bg-primary" : "border-muted-foreground"
|
|
17558
|
+
)
|
|
17559
|
+
}
|
|
17560
|
+
),
|
|
17561
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
17562
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
17563
|
+
/* @__PURE__ */ jsx(
|
|
17564
|
+
"span",
|
|
17565
|
+
{
|
|
17566
|
+
className: cn121(
|
|
17567
|
+
"text-sm leading-relaxed",
|
|
17568
|
+
item.completed && "text-muted-foreground line-through"
|
|
17569
|
+
),
|
|
17570
|
+
children: item.text
|
|
17571
|
+
}
|
|
17572
|
+
),
|
|
17573
|
+
item.priority && /* @__PURE__ */ jsx("span", { className: "shrink-0 rounded-full border border-border px-2 py-0.5 text-xs", children: labels.priorityLabel(item.priority) })
|
|
17574
|
+
] }),
|
|
17575
|
+
item.notes && /* @__PURE__ */ jsx("p", { className: "mt-2 rounded bg-muted/50 p-2 text-muted-foreground text-xs", children: item.notes })
|
|
17576
|
+
] })
|
|
17577
|
+
]
|
|
17578
|
+
},
|
|
17579
|
+
item.id
|
|
17580
|
+
)) }) }),
|
|
17581
|
+
data.metadata?.category && /* @__PURE__ */ jsx("div", { className: "border-border border-t bg-muted/20 px-4 py-3 text-muted-foreground text-xs", children: data.metadata.category })
|
|
17582
|
+
]
|
|
17583
|
+
}
|
|
17584
|
+
);
|
|
17585
|
+
}
|
|
17586
|
+
MosaicArtifactChecklist.displayName = "MosaicArtifactChecklist";
|
|
17587
|
+
function cn122(...classes) {
|
|
17588
|
+
return classes.filter(Boolean).join(" ");
|
|
17589
|
+
}
|
|
17590
|
+
function SearchIcon10() {
|
|
17591
|
+
return /* @__PURE__ */ jsxs(
|
|
17592
|
+
"svg",
|
|
17593
|
+
{
|
|
17594
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17595
|
+
width: "16",
|
|
17596
|
+
height: "16",
|
|
17597
|
+
viewBox: "0 0 24 24",
|
|
17598
|
+
fill: "none",
|
|
17599
|
+
stroke: "currentColor",
|
|
17600
|
+
strokeWidth: "2",
|
|
17601
|
+
strokeLinecap: "round",
|
|
17602
|
+
strokeLinejoin: "round",
|
|
17603
|
+
"aria-hidden": "true",
|
|
17604
|
+
children: [
|
|
17605
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
17606
|
+
/* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
17607
|
+
]
|
|
17608
|
+
}
|
|
17609
|
+
);
|
|
17610
|
+
}
|
|
17611
|
+
function MosaicArtifactLibrary({
|
|
17612
|
+
items,
|
|
17613
|
+
selectedId,
|
|
17614
|
+
onSelect,
|
|
17615
|
+
source,
|
|
17616
|
+
isCanvasOpen,
|
|
17617
|
+
onToggleCanvas,
|
|
17618
|
+
onCloseCanvas,
|
|
17619
|
+
title,
|
|
17620
|
+
searchPlaceholder,
|
|
17621
|
+
searchAriaLabel,
|
|
17622
|
+
emptyMessage,
|
|
17623
|
+
typeLabel,
|
|
17624
|
+
countLabel,
|
|
17625
|
+
adapterLabels,
|
|
17626
|
+
className
|
|
17627
|
+
}) {
|
|
17628
|
+
const [query, setQuery] = React30.useState("");
|
|
17629
|
+
const filtered = React30.useMemo(() => {
|
|
17630
|
+
const q = query.trim().toLowerCase();
|
|
17631
|
+
if (!q) return items;
|
|
17632
|
+
return items.filter((item) => item.title.toLowerCase().includes(q));
|
|
17633
|
+
}, [items, query]);
|
|
17634
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "artifact-library", className: cn122("flex h-full flex-col", className), children: [
|
|
17635
|
+
/* @__PURE__ */ jsxs("div", { className: "border-border border-b px-4 py-3", children: [
|
|
17636
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
17637
|
+
/* @__PURE__ */ jsx("h2", { className: "font-semibold text-lg", children: title }),
|
|
17638
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: countLabel(filtered.length) })
|
|
17639
|
+
] }),
|
|
17640
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
17641
|
+
/* @__PURE__ */ jsx("span", { className: "-translate-y-1/2 absolute top-1/2 left-3 text-muted-foreground", children: /* @__PURE__ */ jsx(SearchIcon10, {}) }),
|
|
17642
|
+
/* @__PURE__ */ jsx(
|
|
17643
|
+
"input",
|
|
17644
|
+
{
|
|
17645
|
+
type: "search",
|
|
17646
|
+
"data-slot": "artifact-library-search",
|
|
17647
|
+
value: query,
|
|
17648
|
+
onChange: (e) => setQuery(e.target.value),
|
|
17649
|
+
placeholder: searchPlaceholder,
|
|
17650
|
+
"aria-label": searchAriaLabel,
|
|
17651
|
+
className: cn122(
|
|
17652
|
+
"w-full rounded-md border border-input bg-background py-2 pr-3 pl-9",
|
|
17653
|
+
"text-sm placeholder:text-muted-foreground",
|
|
17654
|
+
"outline-none focus-visible:ring-[3px] focus-visible:ring-ring"
|
|
17655
|
+
)
|
|
17656
|
+
}
|
|
17657
|
+
)
|
|
17658
|
+
] })
|
|
17659
|
+
] }),
|
|
17660
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [
|
|
17661
|
+
filtered.length === 0 && /* @__PURE__ */ jsx("p", { className: "py-10 text-center text-muted-foreground text-sm", children: emptyMessage }),
|
|
17662
|
+
/* @__PURE__ */ jsx("ul", { "data-slot": "artifact-library-list", className: "space-y-2", children: filtered.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
17663
|
+
"button",
|
|
17664
|
+
{
|
|
17665
|
+
type: "button",
|
|
17666
|
+
"data-slot": "artifact-library-item",
|
|
17667
|
+
"aria-current": selectedId === item.id ? "true" : void 0,
|
|
17668
|
+
onClick: () => onSelect(item.id),
|
|
17669
|
+
className: cn122(
|
|
17670
|
+
"flex w-full items-start justify-between gap-3 rounded-md border border-border px-3 py-2 text-left",
|
|
17671
|
+
"outline-none transition-colors hover:bg-muted",
|
|
17672
|
+
"focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
17673
|
+
selectedId === item.id && "border-primary bg-primary/5"
|
|
17674
|
+
),
|
|
17675
|
+
children: [
|
|
17676
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
17677
|
+
/* @__PURE__ */ jsx("p", { className: "truncate font-medium text-sm", children: item.title }),
|
|
17678
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-muted-foreground text-xs", children: item.updatedAtLabel })
|
|
17679
|
+
] }),
|
|
17680
|
+
/* @__PURE__ */ jsx(
|
|
17681
|
+
"span",
|
|
17682
|
+
{
|
|
17683
|
+
"data-slot": "artifact-library-item-type",
|
|
17684
|
+
className: "shrink-0 rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17685
|
+
children: typeLabel(item.type)
|
|
17686
|
+
}
|
|
17687
|
+
)
|
|
17688
|
+
]
|
|
17689
|
+
}
|
|
17690
|
+
) }, item.id)) })
|
|
17691
|
+
] }),
|
|
17692
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "artifact-library-canvas", className: "border-border border-t p-4", children: /* @__PURE__ */ jsx(
|
|
17693
|
+
MosaicArtifactCanvasAdapter,
|
|
17694
|
+
{
|
|
17695
|
+
source,
|
|
17696
|
+
isOpen: isCanvasOpen,
|
|
17697
|
+
onToggle: onToggleCanvas,
|
|
17698
|
+
onClose: onCloseCanvas,
|
|
17699
|
+
labels: adapterLabels
|
|
17700
|
+
}
|
|
17701
|
+
) })
|
|
17702
|
+
] });
|
|
17703
|
+
}
|
|
17704
|
+
MosaicArtifactLibrary.displayName = "MosaicArtifactLibrary";
|
|
17705
|
+
var artifactSaveAsMemoryFormRootVariants = cva(["flex flex-col gap-4"]);
|
|
17706
|
+
var artifactSaveAsMemoryFormPreviewVariants = cva([
|
|
17707
|
+
"flex items-start gap-3 rounded-md border border-border p-3"
|
|
17708
|
+
]);
|
|
17709
|
+
var artifactSaveAsMemoryFormFieldVariants = cva(["flex flex-col gap-1.5"]);
|
|
17710
|
+
var artifactSaveAsMemoryFormErrorVariants = cva(["text-xs font-medium text-destructive"]);
|
|
17711
|
+
var artifactSaveAsMemoryFormLearningVariants = cva([
|
|
17712
|
+
"flex items-start gap-2 rounded-md border border-border p-2"
|
|
17713
|
+
]);
|
|
17714
|
+
var artifactSaveAsMemoryFormFooterVariants = cva([
|
|
17715
|
+
"flex items-center justify-end gap-3 border-t border-border pt-4"
|
|
17716
|
+
]);
|
|
17717
|
+
var artifactSaveAsMemoryFormButtonVariants = cva(
|
|
17718
|
+
[
|
|
17719
|
+
"inline-flex min-h-9 items-center justify-center gap-2 rounded-md px-4 text-sm font-medium",
|
|
17720
|
+
"transition-colors disabled:cursor-not-allowed disabled:opacity-50"
|
|
17721
|
+
],
|
|
17722
|
+
{
|
|
17723
|
+
variants: {
|
|
17724
|
+
intent: {
|
|
17725
|
+
cancel: "border border-border bg-background hover:bg-muted",
|
|
17726
|
+
save: "border border-transparent bg-primary text-primary-foreground hover:bg-primary/90",
|
|
17727
|
+
ghost: "border border-transparent bg-transparent hover:bg-muted"
|
|
17728
|
+
}
|
|
17729
|
+
},
|
|
17730
|
+
defaultVariants: {
|
|
17731
|
+
intent: "cancel"
|
|
17732
|
+
}
|
|
17733
|
+
}
|
|
17734
|
+
);
|
|
17735
|
+
function cn123(...classes) {
|
|
17736
|
+
return classes.filter(Boolean).join(" ");
|
|
17737
|
+
}
|
|
17738
|
+
function MosaicArtifactSaveAsMemoryForm({
|
|
17739
|
+
artifact,
|
|
17740
|
+
typeLabel,
|
|
17741
|
+
title,
|
|
17742
|
+
onTitleChange,
|
|
17743
|
+
titleLabel,
|
|
17744
|
+
titlePlaceholder,
|
|
17745
|
+
titleError,
|
|
17746
|
+
learnings,
|
|
17747
|
+
onEditLearning,
|
|
17748
|
+
onRemoveLearning,
|
|
17749
|
+
learningsLabel,
|
|
17750
|
+
learningsDescription,
|
|
17751
|
+
editLearningAriaLabel,
|
|
17752
|
+
removeLearningAriaLabel,
|
|
17753
|
+
scope,
|
|
17754
|
+
onScopeChange,
|
|
17755
|
+
scopeLabel,
|
|
17756
|
+
scopeOptions,
|
|
17757
|
+
tags,
|
|
17758
|
+
onAddTag,
|
|
17759
|
+
onRemoveTag,
|
|
17760
|
+
tagsLabel,
|
|
17761
|
+
tagInputPlaceholder,
|
|
17762
|
+
removeTagAriaLabel,
|
|
17763
|
+
suggestedTags,
|
|
17764
|
+
maxTags,
|
|
17765
|
+
isSaving,
|
|
17766
|
+
canSave,
|
|
17767
|
+
onSave,
|
|
17768
|
+
onCancel,
|
|
17769
|
+
saveLabel,
|
|
17770
|
+
savingLabel,
|
|
17771
|
+
cancelLabel,
|
|
17772
|
+
className
|
|
17773
|
+
}) {
|
|
17774
|
+
const titleErrorId = useId();
|
|
17775
|
+
const scopeId = useId();
|
|
17776
|
+
return /* @__PURE__ */ jsxs(
|
|
17777
|
+
"div",
|
|
17778
|
+
{
|
|
17779
|
+
"data-slot": "artifact-save-as-memory-form",
|
|
17780
|
+
className: cn123(artifactSaveAsMemoryFormRootVariants(), className),
|
|
17781
|
+
children: [
|
|
17782
|
+
/* @__PURE__ */ jsx(
|
|
17783
|
+
"div",
|
|
17784
|
+
{
|
|
17785
|
+
"data-slot": "artifact-save-as-memory-form-preview",
|
|
17786
|
+
className: artifactSaveAsMemoryFormPreviewVariants(),
|
|
17787
|
+
children: /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
17788
|
+
/* @__PURE__ */ jsx("p", { className: "truncate font-medium text-sm", children: artifact.title }),
|
|
17789
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 line-clamp-2 text-muted-foreground text-xs", children: artifact.preview || artifact.content }),
|
|
17790
|
+
/* @__PURE__ */ jsx(
|
|
17791
|
+
"span",
|
|
17792
|
+
{
|
|
17793
|
+
"data-slot": "artifact-save-as-memory-form-type",
|
|
17794
|
+
className: "mt-2 inline-block shrink-0 rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
|
|
17795
|
+
children: typeLabel(artifact.type)
|
|
17796
|
+
}
|
|
17797
|
+
)
|
|
17798
|
+
] })
|
|
17799
|
+
}
|
|
17800
|
+
),
|
|
17801
|
+
/* @__PURE__ */ jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
|
|
17802
|
+
/* @__PURE__ */ jsx(
|
|
17803
|
+
"label",
|
|
17804
|
+
{
|
|
17805
|
+
htmlFor: "mosaic-artifact-save-as-memory-title",
|
|
17806
|
+
className: "text-sm font-medium text-foreground",
|
|
17807
|
+
children: titleLabel
|
|
17808
|
+
}
|
|
17809
|
+
),
|
|
17810
|
+
/* @__PURE__ */ jsx(
|
|
17811
|
+
MosaicInput,
|
|
17812
|
+
{
|
|
17813
|
+
id: "mosaic-artifact-save-as-memory-title",
|
|
17814
|
+
value: title,
|
|
17815
|
+
placeholder: titlePlaceholder,
|
|
17816
|
+
onChange: (e) => onTitleChange(e.target.value),
|
|
17817
|
+
"aria-invalid": titleError ? "true" : "false",
|
|
17818
|
+
"aria-describedby": titleError ? titleErrorId : void 0
|
|
17819
|
+
}
|
|
17820
|
+
),
|
|
17821
|
+
titleError && /* @__PURE__ */ jsx("p", { id: titleErrorId, className: artifactSaveAsMemoryFormErrorVariants(), children: titleError })
|
|
17822
|
+
] }),
|
|
17823
|
+
/* @__PURE__ */ jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
|
|
17824
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: learningsLabel }),
|
|
17825
|
+
learningsDescription && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: learningsDescription }),
|
|
17826
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: learnings.map((learning, index) => /* @__PURE__ */ jsxs(
|
|
17827
|
+
"div",
|
|
17828
|
+
{
|
|
17829
|
+
"data-slot": "artifact-save-as-memory-form-learning",
|
|
17830
|
+
className: artifactSaveAsMemoryFormLearningVariants(),
|
|
17831
|
+
children: [
|
|
17832
|
+
/* @__PURE__ */ jsx("p", { className: "flex-1 text-sm", children: learning }),
|
|
17833
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 gap-1", children: [
|
|
17834
|
+
/* @__PURE__ */ jsx(
|
|
17835
|
+
"button",
|
|
17836
|
+
{
|
|
17837
|
+
type: "button",
|
|
17838
|
+
"data-slot": "artifact-save-as-memory-form-learning-edit",
|
|
17839
|
+
onClick: () => onEditLearning(index),
|
|
17840
|
+
"aria-label": editLearningAriaLabel(index),
|
|
17841
|
+
className: artifactSaveAsMemoryFormButtonVariants({ intent: "ghost" }),
|
|
17842
|
+
children: editLearningAriaLabel(index)
|
|
17843
|
+
}
|
|
17844
|
+
),
|
|
17845
|
+
/* @__PURE__ */ jsx(
|
|
17846
|
+
"button",
|
|
17847
|
+
{
|
|
17848
|
+
type: "button",
|
|
17849
|
+
"data-slot": "artifact-save-as-memory-form-learning-remove",
|
|
17850
|
+
onClick: () => onRemoveLearning(index),
|
|
17851
|
+
"aria-label": removeLearningAriaLabel(index),
|
|
17852
|
+
className: artifactSaveAsMemoryFormButtonVariants({ intent: "ghost" }),
|
|
17853
|
+
children: removeLearningAriaLabel(index)
|
|
17854
|
+
}
|
|
17855
|
+
)
|
|
17856
|
+
] })
|
|
17857
|
+
]
|
|
17858
|
+
},
|
|
17859
|
+
`${index}-${learning}`
|
|
17860
|
+
)) })
|
|
17861
|
+
] }),
|
|
17862
|
+
/* @__PURE__ */ jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
|
|
17863
|
+
/* @__PURE__ */ jsx("label", { htmlFor: scopeId, className: "text-sm font-medium text-foreground", children: scopeLabel }),
|
|
17864
|
+
/* @__PURE__ */ jsx(
|
|
17865
|
+
"select",
|
|
17866
|
+
{
|
|
17867
|
+
id: scopeId,
|
|
17868
|
+
"data-slot": "artifact-save-as-memory-form-scope",
|
|
17869
|
+
value: scope,
|
|
17870
|
+
onChange: (e) => onScopeChange(e.target.value),
|
|
17871
|
+
className: cn123(
|
|
17872
|
+
"h-9 rounded-md border border-input bg-background px-3 text-sm",
|
|
17873
|
+
"outline-none focus-visible:ring-[3px] focus-visible:ring-ring"
|
|
17874
|
+
),
|
|
17875
|
+
children: scopeOptions.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value))
|
|
17876
|
+
}
|
|
17877
|
+
)
|
|
17878
|
+
] }),
|
|
17879
|
+
/* @__PURE__ */ jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
|
|
17880
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: tagsLabel }),
|
|
17881
|
+
/* @__PURE__ */ jsx(
|
|
17882
|
+
MosaicTagInput,
|
|
17883
|
+
{
|
|
17884
|
+
tags,
|
|
17885
|
+
onAddTag,
|
|
17886
|
+
onRemoveTag,
|
|
17887
|
+
placeholder: tagInputPlaceholder,
|
|
17888
|
+
removeTagAriaLabel,
|
|
17889
|
+
suggestions: suggestedTags,
|
|
17890
|
+
maxTags
|
|
17891
|
+
}
|
|
17892
|
+
)
|
|
17893
|
+
] }),
|
|
17894
|
+
/* @__PURE__ */ jsxs("div", { className: artifactSaveAsMemoryFormFooterVariants(), children: [
|
|
17895
|
+
/* @__PURE__ */ jsx(
|
|
17896
|
+
"button",
|
|
17897
|
+
{
|
|
17898
|
+
type: "button",
|
|
17899
|
+
"data-slot": "artifact-save-as-memory-form-cancel-button",
|
|
17900
|
+
onClick: onCancel,
|
|
17901
|
+
disabled: isSaving,
|
|
17902
|
+
className: artifactSaveAsMemoryFormButtonVariants({ intent: "cancel" }),
|
|
17903
|
+
children: cancelLabel
|
|
17904
|
+
}
|
|
17905
|
+
),
|
|
17906
|
+
/* @__PURE__ */ jsx(
|
|
17907
|
+
"button",
|
|
17908
|
+
{
|
|
17909
|
+
type: "button",
|
|
17910
|
+
"data-slot": "artifact-save-as-memory-form-save-button",
|
|
17911
|
+
onClick: onSave,
|
|
17912
|
+
disabled: !canSave || isSaving,
|
|
17913
|
+
"aria-busy": isSaving ? "true" : "false",
|
|
17914
|
+
className: artifactSaveAsMemoryFormButtonVariants({ intent: "save" }),
|
|
17915
|
+
children: isSaving ? savingLabel : saveLabel
|
|
17916
|
+
}
|
|
17917
|
+
)
|
|
17918
|
+
] })
|
|
17919
|
+
]
|
|
17920
|
+
}
|
|
17921
|
+
);
|
|
17922
|
+
}
|
|
17923
|
+
MosaicArtifactSaveAsMemoryForm.displayName = "MosaicArtifactSaveAsMemoryForm";
|
|
17924
|
+
function cn124(...classes) {
|
|
17925
|
+
return classes.filter(Boolean).join(" ");
|
|
17926
|
+
}
|
|
17927
|
+
function MosaicArtifactVersionHistory(props) {
|
|
17928
|
+
const {
|
|
17929
|
+
versions,
|
|
17930
|
+
selectedId,
|
|
17931
|
+
onSelectVersion,
|
|
17932
|
+
title,
|
|
17933
|
+
emptyMessage,
|
|
17934
|
+
currentLabel,
|
|
17935
|
+
selectAriaLabel,
|
|
17936
|
+
className
|
|
17937
|
+
} = props;
|
|
17938
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "artifact-version-history", className: cn124("flex h-full flex-col", className), children: [
|
|
17939
|
+
/* @__PURE__ */ jsx("div", { className: "border-border border-b px-4 py-3", children: /* @__PURE__ */ jsx("h2", { className: "font-semibold text-lg", children: title }) }),
|
|
17940
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [
|
|
17941
|
+
versions.length === 0 && /* @__PURE__ */ jsx("p", { className: "py-10 text-center text-muted-foreground text-sm", children: emptyMessage }),
|
|
17942
|
+
/* @__PURE__ */ jsx("ul", { "data-slot": "artifact-version-history-list", className: "space-y-2", children: versions.map((version2) => /* @__PURE__ */ jsx("li", { "data-slot": "artifact-version-history-item", children: /* @__PURE__ */ jsxs(
|
|
17943
|
+
"div",
|
|
17944
|
+
{
|
|
17945
|
+
className: cn124(
|
|
17946
|
+
"flex items-start justify-between gap-3 rounded-md border border-border px-3 py-2",
|
|
17947
|
+
selectedId === version2.id && "border-primary bg-primary/5"
|
|
17948
|
+
),
|
|
17949
|
+
children: [
|
|
17950
|
+
/* @__PURE__ */ jsxs(
|
|
17951
|
+
"button",
|
|
17952
|
+
{
|
|
17953
|
+
type: "button",
|
|
17954
|
+
"aria-current": selectedId === version2.id ? "true" : void 0,
|
|
17955
|
+
onClick: () => onSelectVersion(version2.id),
|
|
17956
|
+
className: cn124(
|
|
17957
|
+
"min-w-0 flex-1 text-left",
|
|
17958
|
+
"outline-none transition-colors",
|
|
17959
|
+
"focus-visible:ring-[3px] focus-visible:ring-ring"
|
|
17960
|
+
),
|
|
17961
|
+
"aria-label": selectAriaLabel(version2),
|
|
17962
|
+
children: [
|
|
17963
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex flex-wrap items-center gap-2", children: [
|
|
17964
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-xs", children: version2.versionLabel }),
|
|
17965
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs", children: version2.changeTypeLabel }),
|
|
17966
|
+
version2.isCurrent && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-primary px-2 py-0.5 text-primary-foreground text-xs", children: currentLabel })
|
|
17967
|
+
] }),
|
|
17968
|
+
version2.descriptionLabel && /* @__PURE__ */ jsx("p", { className: "mb-1 truncate font-medium text-sm", children: version2.descriptionLabel }),
|
|
17969
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 text-muted-foreground text-xs", children: [
|
|
17970
|
+
/* @__PURE__ */ jsx("span", { children: version2.authorLabel }),
|
|
17971
|
+
/* @__PURE__ */ jsx("span", { children: version2.timestampLabel })
|
|
17972
|
+
] })
|
|
17973
|
+
]
|
|
17974
|
+
}
|
|
17975
|
+
),
|
|
17976
|
+
props.onRestoreVersion && !version2.isCurrent && /* @__PURE__ */ jsx(
|
|
17977
|
+
"button",
|
|
17978
|
+
{
|
|
17979
|
+
type: "button",
|
|
17980
|
+
onClick: () => props.onRestoreVersion?.(version2.id),
|
|
17981
|
+
className: cn124(
|
|
17982
|
+
"shrink-0 rounded-md border border-input px-2 py-1 text-xs",
|
|
17983
|
+
"outline-none transition-colors hover:bg-muted",
|
|
17984
|
+
"focus-visible:ring-[3px] focus-visible:ring-ring"
|
|
17985
|
+
),
|
|
17986
|
+
"aria-label": props.restoreAriaLabel(version2),
|
|
17987
|
+
children: props.restoreLabel
|
|
17988
|
+
}
|
|
17989
|
+
)
|
|
17990
|
+
]
|
|
17991
|
+
}
|
|
17992
|
+
) }, version2.id)) })
|
|
17993
|
+
] })
|
|
17994
|
+
] });
|
|
17995
|
+
}
|
|
17996
|
+
MosaicArtifactVersionHistory.displayName = "MosaicArtifactVersionHistory";
|
|
17997
|
+
function cn125(...classes) {
|
|
17998
|
+
return classes.filter(Boolean).join(" ");
|
|
17999
|
+
}
|
|
18000
|
+
function ChevronDownIcon6() {
|
|
18001
|
+
return /* @__PURE__ */ jsx(
|
|
18002
|
+
"svg",
|
|
18003
|
+
{
|
|
18004
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18005
|
+
width: "16",
|
|
18006
|
+
height: "16",
|
|
18007
|
+
viewBox: "0 0 24 24",
|
|
18008
|
+
fill: "none",
|
|
18009
|
+
stroke: "currentColor",
|
|
18010
|
+
strokeWidth: "2",
|
|
18011
|
+
strokeLinecap: "round",
|
|
18012
|
+
strokeLinejoin: "round",
|
|
18013
|
+
"aria-hidden": "true",
|
|
18014
|
+
className: "h-4 w-4 shrink-0 text-muted-foreground",
|
|
18015
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
18016
|
+
}
|
|
18017
|
+
);
|
|
18018
|
+
}
|
|
18019
|
+
function OrgAvatar({ org }) {
|
|
18020
|
+
if (org.avatarUrl) {
|
|
18021
|
+
return /* @__PURE__ */ jsx(
|
|
18022
|
+
"img",
|
|
18023
|
+
{
|
|
18024
|
+
src: org.avatarUrl,
|
|
18025
|
+
alt: "",
|
|
18026
|
+
className: "h-8 w-8 shrink-0 rounded-full object-cover md:h-10 md:w-10"
|
|
18027
|
+
}
|
|
18028
|
+
);
|
|
18029
|
+
}
|
|
18030
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 md:h-10 md:w-10", children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-primary text-sm font-medium", children: org.name.charAt(0).toUpperCase() }) });
|
|
18031
|
+
}
|
|
18032
|
+
function MosaicOrgContextDisplay(props) {
|
|
18033
|
+
const { org, roleLabel, roleDescription, memberCountLabel, className } = props;
|
|
18034
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18035
|
+
/* @__PURE__ */ jsx(OrgAvatar, { org }),
|
|
18036
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-left", children: [
|
|
18037
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
18038
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium text-sm md:text-base", children: org.name }),
|
|
18039
|
+
/* @__PURE__ */ jsx("span", { className: "hidden md:inline-flex", children: /* @__PURE__ */ jsx(MosaicOrgRoleBadge, { role: org.role, label: roleLabel, description: roleDescription }) })
|
|
18040
|
+
] }),
|
|
18041
|
+
/* @__PURE__ */ jsx("div", { className: "hidden text-muted-foreground text-xs md:block", children: memberCountLabel(org.memberCount) })
|
|
18042
|
+
] })
|
|
18043
|
+
] });
|
|
18044
|
+
if (!props.onSwitchOrg) {
|
|
18045
|
+
return /* @__PURE__ */ jsx(
|
|
18046
|
+
"div",
|
|
18047
|
+
{
|
|
18048
|
+
"data-slot": "org-context-display",
|
|
18049
|
+
className: cn125("flex w-full items-center gap-3 min-h-[44px] p-2 md:p-3", className),
|
|
18050
|
+
children: content
|
|
18051
|
+
}
|
|
18052
|
+
);
|
|
18053
|
+
}
|
|
18054
|
+
return /* @__PURE__ */ jsxs(
|
|
18055
|
+
"button",
|
|
18056
|
+
{
|
|
18057
|
+
type: "button",
|
|
18058
|
+
"data-slot": "org-context-display",
|
|
18059
|
+
onClick: props.onSwitchOrg,
|
|
18060
|
+
"aria-label": props.switchAriaLabel,
|
|
18061
|
+
className: cn125(
|
|
18062
|
+
"flex w-full items-center gap-3 justify-start rounded-md border border-border",
|
|
18063
|
+
"outline-none transition-colors hover:bg-accent min-h-[44px] p-2 md:p-3",
|
|
18064
|
+
"focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
18065
|
+
className
|
|
18066
|
+
),
|
|
18067
|
+
children: [
|
|
18068
|
+
content,
|
|
18069
|
+
/* @__PURE__ */ jsx(ChevronDownIcon6, {})
|
|
18070
|
+
]
|
|
18071
|
+
}
|
|
18072
|
+
);
|
|
18073
|
+
}
|
|
18074
|
+
MosaicOrgContextDisplay.displayName = "MosaicOrgContextDisplay";
|
|
18075
|
+
function cn126(...classes) {
|
|
18076
|
+
return classes.filter(Boolean).join(" ");
|
|
18077
|
+
}
|
|
18078
|
+
function ShieldIcon() {
|
|
18079
|
+
return /* @__PURE__ */ jsx(
|
|
18080
|
+
"svg",
|
|
18081
|
+
{
|
|
18082
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18083
|
+
width: "16",
|
|
18084
|
+
height: "16",
|
|
18085
|
+
viewBox: "0 0 24 24",
|
|
18086
|
+
fill: "none",
|
|
18087
|
+
stroke: "currentColor",
|
|
18088
|
+
strokeWidth: "2",
|
|
18089
|
+
strokeLinecap: "round",
|
|
18090
|
+
strokeLinejoin: "round",
|
|
18091
|
+
"aria-hidden": "true",
|
|
18092
|
+
className: "size-3 shrink-0 md:size-4",
|
|
18093
|
+
children: /* @__PURE__ */ jsx("path", { d: "M20 13c0 5-3.5 7.5-7.35 8.95a1 1 0 0 1-1.3 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.79 17 5 19 5a1 1 0 0 1 1 1z" })
|
|
18094
|
+
}
|
|
18095
|
+
);
|
|
18096
|
+
}
|
|
18097
|
+
function AlertTriangleIcon() {
|
|
18098
|
+
return /* @__PURE__ */ jsxs(
|
|
18099
|
+
"svg",
|
|
18100
|
+
{
|
|
18101
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18102
|
+
width: "16",
|
|
18103
|
+
height: "16",
|
|
18104
|
+
viewBox: "0 0 24 24",
|
|
18105
|
+
fill: "none",
|
|
18106
|
+
stroke: "currentColor",
|
|
18107
|
+
strokeWidth: "2",
|
|
18108
|
+
strokeLinecap: "round",
|
|
18109
|
+
strokeLinejoin: "round",
|
|
18110
|
+
"aria-hidden": "true",
|
|
18111
|
+
className: "size-8 shrink-0 text-destructive md:size-10",
|
|
18112
|
+
children: [
|
|
18113
|
+
/* @__PURE__ */ jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
|
|
18114
|
+
/* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
|
|
18115
|
+
/* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
|
|
18116
|
+
]
|
|
18117
|
+
}
|
|
18118
|
+
);
|
|
18119
|
+
}
|
|
18120
|
+
function ArrowLeftIcon2() {
|
|
18121
|
+
return /* @__PURE__ */ jsxs(
|
|
18122
|
+
"svg",
|
|
18123
|
+
{
|
|
18124
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18125
|
+
width: "16",
|
|
18126
|
+
height: "16",
|
|
18127
|
+
viewBox: "0 0 24 24",
|
|
18128
|
+
fill: "none",
|
|
18129
|
+
stroke: "currentColor",
|
|
18130
|
+
strokeWidth: "2",
|
|
18131
|
+
strokeLinecap: "round",
|
|
18132
|
+
strokeLinejoin: "round",
|
|
18133
|
+
"aria-hidden": "true",
|
|
18134
|
+
className: "size-4 shrink-0",
|
|
18135
|
+
children: [
|
|
18136
|
+
/* @__PURE__ */ jsx("path", { d: "m12 19-7-7 7-7" }),
|
|
18137
|
+
/* @__PURE__ */ jsx("path", { d: "M19 12H5" })
|
|
18138
|
+
]
|
|
18139
|
+
}
|
|
18140
|
+
);
|
|
18141
|
+
}
|
|
18142
|
+
function DefaultLoadingFallback() {
|
|
18143
|
+
return /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center p-4 md:p-8", children: /* @__PURE__ */ jsx(
|
|
18144
|
+
"div",
|
|
18145
|
+
{
|
|
18146
|
+
"data-slot": "admin-only-guard-loading",
|
|
18147
|
+
"aria-hidden": "true",
|
|
18148
|
+
className: "size-8 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-primary md:size-10"
|
|
18149
|
+
}
|
|
18150
|
+
) });
|
|
18151
|
+
}
|
|
18152
|
+
function MosaicAdminOnlyGuard(props) {
|
|
18153
|
+
const {
|
|
18154
|
+
children,
|
|
18155
|
+
isAdmin,
|
|
18156
|
+
isLoaded,
|
|
18157
|
+
title,
|
|
18158
|
+
description,
|
|
18159
|
+
requiredRoleLabel,
|
|
18160
|
+
loadingFallback,
|
|
18161
|
+
className
|
|
18162
|
+
} = props;
|
|
18163
|
+
if (!isLoaded) {
|
|
18164
|
+
return /* @__PURE__ */ jsx(Fragment, { children: loadingFallback ?? /* @__PURE__ */ jsx(DefaultLoadingFallback, {}) });
|
|
18165
|
+
}
|
|
18166
|
+
if (!isAdmin) {
|
|
18167
|
+
return /* @__PURE__ */ jsx(
|
|
18168
|
+
"div",
|
|
18169
|
+
{
|
|
18170
|
+
"data-slot": "admin-only-guard",
|
|
18171
|
+
className: cn126(
|
|
18172
|
+
"flex min-h-screen flex-col items-center justify-center p-4 md:p-8",
|
|
18173
|
+
className
|
|
18174
|
+
),
|
|
18175
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md flex-col items-center gap-4 rounded-lg border bg-card p-6 md:gap-6 md:p-8", children: [
|
|
18176
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-16 items-center justify-center rounded-full bg-destructive/10 md:size-20", children: /* @__PURE__ */ jsx(AlertTriangleIcon, {}) }),
|
|
18177
|
+
/* @__PURE__ */ jsx("h2", { className: "text-center font-semibold text-lg md:text-xl", children: title }),
|
|
18178
|
+
/* @__PURE__ */ jsx("p", { className: "text-center text-muted-foreground text-sm md:text-base", children: description }),
|
|
18179
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-md bg-primary/10 px-3 py-2 text-primary text-xs md:text-sm", children: [
|
|
18180
|
+
/* @__PURE__ */ jsx(ShieldIcon, {}),
|
|
18181
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: requiredRoleLabel })
|
|
18182
|
+
] }),
|
|
18183
|
+
props.onExit ? /* @__PURE__ */ jsxs(
|
|
18184
|
+
MosaicButton,
|
|
18185
|
+
{
|
|
18186
|
+
onClick: props.onExit,
|
|
18187
|
+
"aria-label": props.exitAriaLabel,
|
|
18188
|
+
className: "mt-2 min-h-[44px] w-full",
|
|
18189
|
+
children: [
|
|
18190
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon2, {}),
|
|
18191
|
+
props.exitLabel
|
|
18192
|
+
]
|
|
18193
|
+
}
|
|
18194
|
+
) : null
|
|
18195
|
+
] })
|
|
18196
|
+
}
|
|
18197
|
+
);
|
|
18198
|
+
}
|
|
18199
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
18200
|
+
}
|
|
18201
|
+
MosaicAdminOnlyGuard.displayName = "MosaicAdminOnlyGuard";
|
|
18202
|
+
|
|
18203
|
+
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAddMemoryForm, MosaicAdminOnlyGuard, MosaicAgentBuilderModal, MosaicAgentCard, MosaicAgentChat, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentEditor, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentPreview, MosaicAgentTeamPreview, MosaicAlertDialog, MosaicAlertDialogAction, MosaicAlertDialogCancel, MosaicAlertDialogContent, MosaicAlertDialogDescription, MosaicAlertDialogFooter, MosaicAlertDialogHeader, MosaicAlertDialogOverlay, MosaicAlertDialogPortal, MosaicAlertDialogTitle, MosaicAlertDialogTrigger, MosaicAnimatedList, MosaicApiKeyPanel, MosaicAppSidebar, MosaicApprovalPrompt, MosaicArtifactCanvasAdapter, MosaicArtifactChart, MosaicArtifactChecklist, MosaicArtifactDataTable, MosaicArtifactDocument, MosaicArtifactLibrary, MosaicArtifactSaveAsMemoryForm, MosaicArtifactVersionHistory, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCallout, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicChatComposer, MosaicChatMessage, MosaicChatSidebar, MosaicChatThread, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDrawer, MosaicDropdownMenu, MosaicEditMemoryDialog, MosaicEditSessionDialog, MosaicEditableCell, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarkdown, MosaicMarketplaceCard, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMatchInput, MosaicMemberList, MosaicMemoryCard, MosaicMemoryDashboard, MosaicMemoryGrid, MosaicMemoryList, MosaicMemorySearch, MosaicMentionInput, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicMessageSearch, MosaicModelSelector, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgContextDisplay, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPdfViewer, MosaicPopover, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicReplyInput, MosaicResizableSplitPane, MosaicSaveChatAsMemoryForm, MosaicSaveTemplateModal, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSessionCard, MosaicSessionList, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTagInput, MosaicTemplateAgentCard, MosaicTemplateCard, MosaicTemplateCategoryChips, MosaicTemplateGallery, MosaicTemplateList, MosaicTemplateManagementPanel, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicThreadIndicator, MosaicThreadView, MosaicToast, MosaicToastProvider, MosaicToolToggleList, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUrlScraper, MosaicUserButton, Placeholder, addMemoryFormButtonVariants, addMemoryFormErrorVariants, addMemoryFormFieldVariants, addMemoryFormFooterVariants, addMemoryFormRootVariants, agentBuilderModalBackdropVariants, agentBuilderModalPopupVariants, agentChatRootVariants, agentEditorVariants, agentPreviewVariants, alertDialogContentVariants, alertDialogOverlayVariants, artifactSaveAsMemoryFormButtonVariants, artifactSaveAsMemoryFormErrorVariants, artifactSaveAsMemoryFormFieldVariants, artifactSaveAsMemoryFormFooterVariants, artifactSaveAsMemoryFormLearningVariants, artifactSaveAsMemoryFormPreviewVariants, artifactSaveAsMemoryFormRootVariants, badgeVariants, buttonVariants, calloutVariants, chatMessageBubbleVariants, chatMessageContainerVariants, chatMessageToolStatusVariants, chatSidebarThreadVariants, drawerBackdropVariants, drawerPopupVariants, editMemoryDialogBackdropVariants, editMemoryDialogErrorVariants, editMemoryDialogFieldVariants, editMemoryDialogPopupVariants, editSessionDialogBodyVariants, editSessionDialogButtonVariants, editSessionDialogErrorVariants, editSessionDialogFieldVariants, editSessionDialogFooterVariants, editableCellVariants, marketplaceCardVariants, matchStateVariants, memoryDashboardViewToggleButtonVariants, memoryGridVariants, memoryListItemVariants, memoryListVariants, memorySearchFilterChipVariants, mentionInputFieldVariants, mentionListItemVariants, mentionListVariants, normalizeArtifact, normalizeFromAiSdkArtifacts, normalizeFromMcpToolResult, pdfViewerFrameVariants, pdfViewerStatusVariants, pdfViewerToolbarButtonVariants, popoverPopupVariants, replyInputActionButtonVariants, replyInputContextVariants, replyInputRootVariants, replyInputTextareaVariants, saveChatAsMemoryFormButtonVariants, saveChatAsMemoryFormErrorVariants, saveChatAsMemoryFormFieldVariants, saveChatAsMemoryFormFooterVariants, saveChatAsMemoryFormRootVariants, saveTemplateModalBodyVariants, saveTemplateModalButtonVariants, saveTemplateModalErrorVariants, saveTemplateModalFieldVariants, saveTemplateModalFooterVariants, sessionCardVariants, sessionListItemVariants, sessionListVariants, skeletonVariants, splitPaneCollapseButtonVariants, splitPaneHandleVariants, splitPaneRootVariants, tagInputFieldVariants, tagInputRemoveButtonVariants, tagInputRootVariants, tagInputTagVariants, templateAgentCardBadgeVariants, templateAgentCardTagVariants, templateAgentCardVariants, templateCategoryChipVariants, templateListVariants, templateManagementRowVariants, threadIndicatorCountVariants, threadIndicatorRootVariants, threadViewEmptyVariants, threadViewRepliesVariants, threadViewReplyVariants, threadViewRootMessageVariants, threadViewRootVariants, toastCardVariants, toastDismissButtonVariants, toastProviderPositionVariants, toastTitleVariants, toolToggleListRowVariants, toolToggleListSectionVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
17106
18204
|
//# sourceMappingURL=index.js.map
|
|
17107
18205
|
//# sourceMappingURL=index.js.map
|