@manta-eu/react 0.1.3 → 0.1.5
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 -9
- package/dist/components/audience-phase-badge/index.d.ts +1 -1
- package/dist/components/audience-phase-badge/index.d.ts.map +1 -1
- package/dist/components/audience-phase-badge/index.js +3 -0
- package/dist/components/authenticated-chat/index.d.ts.map +1 -1
- package/dist/components/authenticated-chat/index.js +0 -5
- package/dist/components/chat/chat-input/index.d.ts.map +1 -1
- package/dist/components/chat/chat-input/index.js +7 -0
- package/dist/components/chat-view/Chat.d.ts +8 -1
- package/dist/components/chat-view/Chat.d.ts.map +1 -1
- package/dist/components/chat-view/Chat.js +9 -7
- package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
- package/dist/components/chat-view/ChatHeaders.js +3 -2
- package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts +1 -0
- package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts.map +1 -1
- package/dist/components/embedded-chat/EmbeddedDatastorePicker.js +9 -3
- package/dist/components/embedded-chat/index.d.ts +1 -0
- package/dist/components/embedded-chat/index.d.ts.map +1 -1
- package/dist/components/embedded-chat/index.js +2 -9
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +11 -4
- package/dist/components/planning/ActioningView.d.ts.map +1 -1
- package/dist/components/planning/ActioningView.js +11 -6
- package/dist/components/planning/ExecutionSectionItem.d.ts +2 -3
- package/dist/components/planning/ExecutionSectionItem.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSectionItem.js +3 -6
- package/dist/components/planning/ExecutionSections.d.ts +2 -3
- package/dist/components/planning/ExecutionSections.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSections.js +2 -2
- package/dist/components/planning/ManualActionCard.d.ts +3 -4
- package/dist/components/planning/ManualActionCard.d.ts.map +1 -1
- package/dist/components/planning/ManualActionCard.js +24 -6
- package/dist/components/rdf-insights/CampaignChannelMix.js +1 -1
- package/dist/components/rdf-insights/CampaignGrid.d.ts.map +1 -1
- package/dist/components/rdf-insights/CampaignGrid.js +2 -2
- package/dist/components/rdf-insights/DailyPerformance.js +2 -2
- package/dist/components/rdf-insights/KpiDashboard.d.ts +2 -2
- package/dist/components/rdf-insights/KpiDashboard.d.ts.map +1 -1
- package/dist/components/rdf-insights/KpiDashboard.js +33 -53
- package/dist/components/rdf-insights/MetaDailyInsights.js +2 -2
- package/dist/components/rdf-insights/ProductCard.d.ts.map +1 -1
- package/dist/components/rdf-insights/ProductCard.js +1 -1
- package/dist/components/rdf-insights/ProductVariantsTable.js +1 -1
- package/dist/components/rdf-insights/useExtractedInsights.d.ts +1 -1
- package/dist/components/rdf-insights/useExtractedInsights.js +3 -3
- package/dist/datastore-picker/datastore-picker-rows.d.ts +1 -0
- package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
- package/dist/datastore-picker/datastore-picker-rows.js +6 -2
- package/dist/graph/nodes/GoogleCampaignView.js +2 -2
- package/dist/hooks/use-action-plans-list.js +1 -1
- package/dist/hooks/use-composer-draft.d.ts +10 -0
- package/dist/hooks/use-composer-draft.d.ts.map +1 -0
- package/dist/hooks/use-composer-draft.js +20 -0
- package/dist/hooks/use-manual-actions.d.ts +11 -1
- package/dist/hooks/use-manual-actions.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.js +47 -100
- package/dist/hooks/useAuth.d.ts +47 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +50 -10
- package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
- package/dist/ldo-ui.d.ts +1 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/lib/chat-types.d.ts +5 -0
- package/dist/lib/chat-types.d.ts.map +1 -1
- package/dist/lib/manual-actions.js +1 -1
- package/dist/lib/rdf/index.d.ts +4 -2
- package/dist/lib/rdf/index.d.ts.map +1 -1
- package/dist/lib/rdf/index.js +48 -18
- package/dist/lib/rdf/insights.d.ts +6 -1
- package/dist/lib/rdf/insights.d.ts.map +1 -1
- package/dist/lib/rdf/insights.js +15 -3
- package/dist/lib/rdf/types.d.ts +21 -8
- package/dist/lib/rdf/types.d.ts.map +1 -1
- package/dist/providers/AuthContext.d.ts +1 -1
- package/dist/providers/AuthContext.d.ts.map +1 -1
- package/dist/providers/index.d.ts +4 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -1
- package/dist/routes/chat/index.d.ts +2 -1
- package/dist/routes/chat/index.d.ts.map +1 -1
- package/dist/routes/chat/index.js +2 -2
- package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +4 -2
- package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -1
- package/dist/routes/datastores/components/DatastoreFormDialog.js +7 -4
- package/dist/routes/datastores/components/DatastoresToolbar.d.ts +3 -1
- package/dist/routes/datastores/components/DatastoresToolbar.d.ts.map +1 -1
- package/dist/routes/datastores/components/DatastoresToolbar.js +18 -5
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts.map +1 -1
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.js +6 -2
- package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts +7 -0
- package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts.map +1 -0
- package/dist/routes/datastores/components/ProvisionDatastoreDialog.js +10 -0
- package/dist/routes/datastores/flatten.d.ts +4 -0
- package/dist/routes/datastores/flatten.d.ts.map +1 -1
- package/dist/routes/datastores/flatten.js +11 -0
- package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts +4 -1
- package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts.map +1 -1
- package/dist/routes/datastores/hooks/useDatastoreColumns.js +6 -2
- package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts +3 -0
- package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts.map +1 -0
- package/dist/routes/datastores/hooks/useTenantOrganizationCheck.js +21 -0
- package/dist/routes/datastores/index.d.ts.map +1 -1
- package/dist/routes/datastores/index.js +44 -6
- package/dist/routes/datastores/link-provider.d.ts +11 -0
- package/dist/routes/datastores/link-provider.d.ts.map +1 -0
- package/dist/routes/datastores/link-provider.js +34 -0
- package/dist/routes/integrations/components/connect-forms/types.d.ts +1 -0
- package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
- package/dist/routes/integrations/connection-view.d.ts.map +1 -1
- package/dist/routes/integrations/connection-view.js +19 -6
- package/dist/routes/integrations/types.d.ts +2 -0
- package/dist/routes/integrations/types.d.ts.map +1 -1
- package/dist/routes/memories/components/ChangeScopeDialog.d.ts +1 -1
- package/dist/routes/memories/components/ChangeScopeDialog.d.ts.map +1 -1
- package/dist/routes/memories/components/ChangeScopeDialog.js +3 -3
- package/dist/routes/memories/components/EmptyStates.d.ts +1 -2
- package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
- package/dist/routes/memories/components/EmptyStates.js +2 -2
- package/dist/routes/memories/components/MemoriesPanel.d.ts +1 -1
- package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoriesPanel.js +9 -9
- package/dist/routes/memories/components/MemoryActions.d.ts +1 -1
- package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryActions.js +4 -4
- package/dist/routes/memories/components/MemoryFields.d.ts +1 -1
- package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFields.js +2 -2
- package/dist/routes/memories/components/MemoryFormDialog.d.ts +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.js +2 -2
- package/dist/routes/memories/components/TeamPicker.d.ts +1 -1
- package/dist/routes/memories/components/TeamPicker.d.ts.map +1 -1
- package/dist/routes/memories/components/TeamPicker.js +2 -2
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.js +3 -3
- package/dist/routes/memories/index.d.ts.map +1 -1
- package/dist/routes/memories/index.js +21 -21
- package/package.json +7 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GQLMemory } from "@manta-eu/client";
|
|
2
2
|
export type MemoryActionsProps = {
|
|
3
3
|
memory: GQLMemory;
|
|
4
|
-
|
|
4
|
+
canManageSharedMemories?: boolean;
|
|
5
5
|
onEdit: (memory: GQLMemory) => void;
|
|
6
6
|
onDelete: (iri: string) => void;
|
|
7
7
|
onMove?: (memory: GQLMemory) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryActions.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/MemoryActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkBlE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"MemoryActions.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/MemoryActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkBlE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kDAsEtD"}
|
|
@@ -8,17 +8,17 @@ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
|
|
|
8
8
|
import { Button } from "#components/button/index";
|
|
9
9
|
import { Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownTrigger } from "#components/dropdown/index";
|
|
10
10
|
export function MemoryActions(props) {
|
|
11
|
-
const { memory,
|
|
11
|
+
const { memory, canManageSharedMemories, onEdit, onDelete, onMove, onRestore, onReconfirm } = props;
|
|
12
12
|
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
13
13
|
const isRealm = memory.scope === GQLMemoryScope.Company;
|
|
14
14
|
if (isPresent(memory.supersededBy)) {
|
|
15
|
-
const canRestore =
|
|
15
|
+
const canRestore = canManageSharedMemories || memory.scope === GQLMemoryScope.User;
|
|
16
16
|
if (!canRestore)
|
|
17
17
|
return null;
|
|
18
18
|
return (_jsx("div", { className: "text-right", onClick: (e) => e.stopPropagation(), children: _jsxs(Button, { variant: "tertiary", size: "sm", rounded: "lg", onClick: () => onRestore?.(memory.iri), className: "gap-1.5", children: [_jsx(Undo2, { size: 14 }), "Restore"] }) }));
|
|
19
19
|
}
|
|
20
|
-
if (!isRealm ||
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-right", onClick: (e) => e.stopPropagation(), children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsx(Button, { variant: "tertiary", iconOnly: true, icon: EllipsisIcon, "aria-label": "Actions" }) }), _jsx(DropdownContent, { align: "end", className: "z-60 w-44", children: _jsxs(DropdownGroup, { children: [_jsxs(DropdownItem, { onSelect: () => onEdit(memory), children: [_jsx(Pencil, { size: 16 }), "Edit"] }), onReconfirm && needsTrustReview(memory) && (_jsxs(DropdownItem, { onSelect: () => onReconfirm(memory.iri), children: [_jsx(BadgeCheck, { size: 16 }), "Reconfirm"] })), onMove &&
|
|
20
|
+
if (!isRealm || canManageSharedMemories) {
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-right", onClick: (e) => e.stopPropagation(), children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsx(Button, { variant: "tertiary", iconOnly: true, icon: EllipsisIcon, "aria-label": "Actions" }) }), _jsx(DropdownContent, { align: "end", className: "z-60 w-44", children: _jsxs(DropdownGroup, { children: [_jsxs(DropdownItem, { onSelect: () => onEdit(memory), children: [_jsx(Pencil, { size: 16 }), "Edit"] }), onReconfirm && needsTrustReview(memory) && (_jsxs(DropdownItem, { onSelect: () => onReconfirm(memory.iri), children: [_jsx(BadgeCheck, { size: 16 }), "Reconfirm"] })), onMove && canManageSharedMemories && (_jsxs(DropdownItem, { onSelect: () => onMove(memory), children: [_jsx(MoveRight, { size: 16 }), "Move to\u2026"] })), _jsxs(DropdownItem, { onSelect: () => setConfirmOpen(true), children: [_jsx(Trash2, { size: 16, className: "text-error-foreground" }), "Delete"] })] }) })] }) }), _jsx(AlertDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Delete memory?" }), _jsxs(AlertDialogDescription, { children: ["\"", memory.label, "\" will be permanently deleted."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { variant: "destructive", onClick: () => onDelete(memory.iri), children: "Delete" })] })] }) })] }));
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
@@ -17,7 +17,7 @@ export type MemoryFieldsProps = {
|
|
|
17
17
|
form: MemoryFormState;
|
|
18
18
|
errors: FormErrors;
|
|
19
19
|
isTeam: boolean;
|
|
20
|
-
|
|
20
|
+
canManageSharedMemories?: boolean;
|
|
21
21
|
schemas?: GQLMemorySchema[];
|
|
22
22
|
onChange: (next: Partial<MemoryFormState>) => void;
|
|
23
23
|
descriptionPlaceholder?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryFields.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/MemoryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAwBvC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3G,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,eAUvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"MemoryFields.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/MemoryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAwBvC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3G,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,eAUvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACnD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAyHpD"}
|
|
@@ -22,9 +22,9 @@ export const emptyForm = {
|
|
|
22
22
|
importance: 3,
|
|
23
23
|
};
|
|
24
24
|
export function MemoryFields(props) {
|
|
25
|
-
const { form, errors, isTeam,
|
|
25
|
+
const { form, errors, isTeam, canManageSharedMemories = false, schemas, onChange, descriptionPlaceholder, labelPlaceholder, autoFocus = false, onEditProperties, filledPropertyCount = 0, totalPropertyCount = 0, children, } = props;
|
|
26
26
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { className: "typography-small", children: "Importance" }), _jsx(ImportanceSlider, { value: form.importance, onChange: (v) => onChange({ importance: v }) })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { className: "typography-small", children: "Kind" }), _jsxs(Select, { value: form.kind, onValueChange: (v) => onChange({ kind: v }), children: [_jsx(SelectTrigger, { label: "Kind", id: "memory-kind", hiddenLabel: true, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: GQLMemoryKind.Preference, children: "Preference" }), _jsx(SelectItem, { value: GQLMemoryKind.Fact, children: "Fact" }), _jsx(SelectItem, { value: GQLMemoryKind.Objective, children: "Objective" }), _jsx(SelectItem, { value: GQLMemoryKind.Context, children: "Context" })] })] })] }), isPresent(schemas) && (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { className: "typography-small", children: "Schema" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Combobox, { children: [_jsx(ComboboxTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: cn(createSelectClassName({ size: "base" }), "flex-1 min-w-0"), children: [_jsx("span", { className: cn("flex-1 min-w-0 truncate text-left", !form.memorySubclass && "text-placeholder-foreground"), children: form.memorySubclass
|
|
27
27
|
? (schemas.find((s) => s.iri === form.memorySubclass)?.label ??
|
|
28
28
|
formatEntityName(form.memorySubclass))
|
|
29
|
-
: "Default" }), _jsx(ChevronDown, { className: "size-4 shrink-0 text-muted-foreground" })] }) }), _jsxs(ComboboxContent, { align: "start", className: "w-[var(--radix-popover-trigger-width,320px)]", children: [_jsx(ComboboxInput, { placeholder: "Search schemas\u2026" }), _jsxs(ComboboxList, { children: [_jsx(ComboboxEmpty, { children: "No schemas found" }), _jsx(ComboboxItem, { value: "none", selected: form.memorySubclass === null, onSelect: () => onChange({ memorySubclass: null, customProperties: {} }), children: "Default" }), schemas.map((schema) => (_jsx(ComboboxItem, { value: schema.label, selected: form.memorySubclass === schema.iri, onSelect: () => onChange({ memorySubclass: schema.iri, customProperties: {} }), children: schema.label }, schema.iri)))] })] })] }), onEditProperties && totalPropertyCount > 0 && (_jsxs(Button, { type: "button", variant: "tertiary", size: "base", onClick: onEditProperties, className: "shrink-0", children: [filledPropertyCount > 0 ? `${filledPropertyCount}/${totalPropertyCount} filled` : "Edit properties", _jsx(ChevronRight, { className: "size-3.5" })] }))] })] })), _jsx(Input, { id: "memory-label", label: "Label", placeholder: labelPlaceholder, value: form.label, onChange: (e) => onChange({ label: e.target.value }), error: errors.label }), _jsx(Textarea, { id: "memory-description", label: "Description", placeholder: descriptionPlaceholder, value: form.description ?? "", onChange: (e) => onChange({ description: e.target.value }), minRows: 3, maxRows: 8, autoFocus: autoFocus, error: errors.description }), children, isTeam && (_jsx(TeamPicker, { selected: form.teams, onChange: (teams) => onChange({ teams }),
|
|
29
|
+
: "Default" }), _jsx(ChevronDown, { className: "size-4 shrink-0 text-muted-foreground" })] }) }), _jsxs(ComboboxContent, { align: "start", className: "w-[var(--radix-popover-trigger-width,320px)]", children: [_jsx(ComboboxInput, { placeholder: "Search schemas\u2026" }), _jsxs(ComboboxList, { children: [_jsx(ComboboxEmpty, { children: "No schemas found" }), _jsx(ComboboxItem, { value: "none", selected: form.memorySubclass === null, onSelect: () => onChange({ memorySubclass: null, customProperties: {} }), children: "Default" }), schemas.map((schema) => (_jsx(ComboboxItem, { value: schema.label, selected: form.memorySubclass === schema.iri, onSelect: () => onChange({ memorySubclass: schema.iri, customProperties: {} }), children: schema.label }, schema.iri)))] })] })] }), onEditProperties && totalPropertyCount > 0 && (_jsxs(Button, { type: "button", variant: "tertiary", size: "base", onClick: onEditProperties, className: "shrink-0", children: [filledPropertyCount > 0 ? `${filledPropertyCount}/${totalPropertyCount} filled` : "Edit properties", _jsx(ChevronRight, { className: "size-3.5" })] }))] })] })), _jsx(Input, { id: "memory-label", label: "Label", placeholder: labelPlaceholder, value: form.label, onChange: (e) => onChange({ label: e.target.value }), error: errors.label }), _jsx(Textarea, { id: "memory-description", label: "Description", placeholder: descriptionPlaceholder, value: form.description ?? "", onChange: (e) => onChange({ description: e.target.value }), minRows: 3, maxRows: 8, autoFocus: autoFocus, error: errors.description }), children, isTeam && (_jsx(TeamPicker, { selected: form.teams, onChange: (teams) => onChange({ teams }), canManageSharedMemories: canManageSharedMemories, error: errors.teams }))] }));
|
|
30
30
|
}
|
|
@@ -7,7 +7,7 @@ export type MemoryFormDialogProps = {
|
|
|
7
7
|
initial?: GQLMemory;
|
|
8
8
|
onSave: (form: MemoryFormState, supersedesMemoryIris?: string[]) => Promise<void>;
|
|
9
9
|
isSaving: boolean;
|
|
10
|
-
|
|
10
|
+
canManageSharedMemories?: boolean;
|
|
11
11
|
schemas?: GQLMemorySchema[];
|
|
12
12
|
currentUserId?: string;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryFormDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/MemoryFormDialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAA6B,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAUnH,OAAO,EAA4C,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAuBhG,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,QAAQ,EAAE,OAAO,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"MemoryFormDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/MemoryFormDialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAA6B,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAUnH,OAAO,EAA4C,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAuBhG,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAsGF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAkf5D"}
|
|
@@ -59,7 +59,7 @@ function MemoryDateField(props) {
|
|
|
59
59
|
return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { htmlFor: id, className: "typography-small", children: label }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", id: id, "aria-invalid": error ? true : undefined, "aria-describedby": error ? errorId : undefined, className: cn(createSelectClassName({ size: "base" }), "flex-1 min-w-0 gap-2"), children: [_jsx(CalendarIcon, { className: "size-4 shrink-0 text-muted-foreground" }), _jsx("span", { className: cn("flex-1 min-w-0 truncate text-left", !value && "text-placeholder-foreground"), children: selected ? format(selected, "MMM d, yyyy") : placeholder })] }) }), _jsx(PopoverContent, { align: "start", className: "w-auto border-0 bg-transparent p-0 shadow-none", children: _jsx(Calendar, { mode: "single", captionLayout: "dropdown", startMonth: new Date(), endMonth: latest ?? addYears(new Date(), 10), selected: selected, defaultMonth: selected, disabled: latest ? { before: startOfTomorrow(), after: latest } : { before: startOfTomorrow() }, onSelect: (date) => onChange(date ? endOfDay(date).toISOString() : null) }) })] }), value && (_jsxs(Button, { type: "button", variant: "tertiary", size: "base", onClick: () => onChange(null), className: "shrink-0", children: [_jsx(X, { className: "size-3.5" }), "Clear"] }))] }), _jsx("p", { className: "typography-small text-muted-foreground", children: hint }), error && (_jsx("p", { id: errorId, className: "typography-small text-error-foreground", children: error }))] }));
|
|
60
60
|
}
|
|
61
61
|
export function MemoryFormDialog(props) {
|
|
62
|
-
const { open, onOpenChange, scope, initial, onSave, isSaving,
|
|
62
|
+
const { open, onOpenChange, scope, initial, onSave, isSaving, canManageSharedMemories = false, schemas, currentUserId, } = props;
|
|
63
63
|
const isEdit = !!initial;
|
|
64
64
|
const isCompany = scope === GQLMemoryScope.Company;
|
|
65
65
|
const isTeam = scope === GQLMemoryScope.Team;
|
|
@@ -288,7 +288,7 @@ export function MemoryFormDialog(props) {
|
|
|
288
288
|
}));
|
|
289
289
|
}
|
|
290
290
|
return (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg bg-faint p-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("label", { htmlFor: hasLargeEnum || (!hasSmallEnum && !isBoolean) ? `prop-${localName}` : undefined, className: "typography-small-medium text-default-foreground flex-1", children: [prop.label, prop.required && _jsx("span", { className: "text-error-foreground ml-1", children: "*" })] }), _jsx("span", { className: "typography-tiny text-muted-foreground bg-card border border-muted-border rounded px-1.5 py-0.5 shrink-0", children: shortDatatype(prop.dataType) })] }), hasSmallEnum ? (_jsx("div", { className: "flex gap-1 flex-wrap", children: prop.allowedValues.map((v) => (_jsx(Button, { type: "button", variant: value === v ? "primary" : "tertiary", size: "sm", rounded: "md", onClick: () => setPropValue(v), children: v }, v))) })) : hasLargeEnum ? (_jsxs(Select, { value: value, onValueChange: setPropValue, children: [_jsx(SelectTrigger, { label: prop.label, id: `prop-${localName}`, hiddenLabel: true, children: _jsx(SelectValue, { placeholder: `Select ${prop.label.toLowerCase()}` }) }), _jsx(SelectContent, { children: prop.allowedValues.map((v) => (_jsx(SelectItem, { value: v, children: v }, v))) })] })) : isBoolean ? (_jsx("div", { className: "flex gap-1", children: ["true", "false"].map((v) => (_jsx(Button, { type: "button", variant: (value || "false") === v ? "primary" : "tertiary", size: "sm", rounded: "md", className: "flex-1", onClick: () => setPropValue(v), children: v === "true" ? "Yes" : "No" }, v))) })) : (_jsx(Input, { id: `prop-${localName}`, type: isNumeric ? "number" : "text", value: value, onChange: (e) => setPropValue(e.target.value), placeholder: `Enter ${prop.label.toLowerCase()}` }))] }, prop.path));
|
|
291
|
-
})) : (_jsxs(MemoryFields, { form: form, errors: errors, isTeam: isTeam,
|
|
291
|
+
})) : (_jsxs(MemoryFields, { form: form, errors: errors, isTeam: isTeam, canManageSharedMemories: canManageSharedMemories, schemas: schemas, onChange: (next) => setForm((prev) => ({ ...prev, ...next })), labelPlaceholder: isEdit ? "e.g. Target ROAS" : "Auto-generated from description", descriptionPlaceholder: getDescriptionPlaceholder(), autoFocus: !isEdit, onEditProperties: hasProperties ? () => setView("properties") : undefined, filledPropertyCount: filledPropertyCount, totalPropertyCount: schemaProperties.length, children: [_jsx(MemoryDateField, { id: "memory-expiry", label: "Valid until", hint: "No longer true after this date, so the agent stops using it. Nothing is deleted. Use it only for a real deadline.", placeholder: "Never expires", value: form.memoryValidUntil, onChange: (memoryValidUntil) => setForm((prev) => ({ ...prev, memoryValidUntil })) }), _jsx(MemoryDateField, { id: "memory-trust-horizon", label: "Trusted until", hint: "Stops pre-loading after this date but stays searchable. Use it for anything that drifts.", placeholder: "Trusted indefinitely", value: form.memoryTrustedUntil, notAfter: form.memoryValidUntil, error: errors.memoryTrustedUntil, onChange: (memoryTrustedUntil) => setForm((prev) => ({ ...prev, memoryTrustedUntil })) })] })) }), _jsx(DialogFooter, { children: view === "conflicts" ? (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", onClick: handleSaveWithoutSuperseding, className: "sm:mr-auto", disabled: isSaving, children: "Save & keep both" }), _jsx(Button, { onClick: handleConflictConfirmInline, disabled: conflictChecked.size === 0 || isSaving, children: getReplaceLabel() })] })) : view === "properties" ? (_jsx(Button, { onClick: () => setView("main"), children: "Done" })) : showDiscardConfirm ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "typography-small text-muted-foreground mr-auto", children: "Discard unsaved changes?" }), _jsx(Button, { variant: "tertiary", onClick: () => setShowDiscardConfirm(false), children: "Keep editing" }), _jsx(Button, { variant: "destructive", onClick: () => onOpenChange(false), children: "Discard" })] })) : conflictCheckTimedOut && pendingForm ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "typography-small text-muted-foreground mr-auto", children: "Conflict check timed out. Save without checking?" }), _jsx(Button, { variant: "tertiary", onClick: () => {
|
|
292
292
|
setConflictCheckTimedOut(false);
|
|
293
293
|
setPendingForm(null);
|
|
294
294
|
}, disabled: isSaving, children: "Cancel" }), _jsx(Button, { onClick: () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type TeamPickerProps = {
|
|
2
2
|
selected: string[];
|
|
3
3
|
onChange: (teams: string[]) => void;
|
|
4
|
-
|
|
4
|
+
canManageSharedMemories: boolean;
|
|
5
5
|
error?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare function TeamPicker(props: TeamPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeamPicker.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/TeamPicker.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,
|
|
1
|
+
{"version":3,"file":"TeamPicker.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/components/TeamPicker.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,uBAAuB,EAAE,OAAO,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAMF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAoEhD"}
|
|
@@ -9,9 +9,9 @@ function getTeamName(path) {
|
|
|
9
9
|
return path.split("/").filter(Boolean).pop() ?? path;
|
|
10
10
|
}
|
|
11
11
|
export function TeamPicker(props) {
|
|
12
|
-
const { selected, onChange,
|
|
12
|
+
const { selected, onChange, canManageSharedMemories, error } = props;
|
|
13
13
|
const { mantaClient } = useMantaClient();
|
|
14
|
-
const { data } = useAvailableTeamsQuery(mantaClient, undefined, { enabled:
|
|
14
|
+
const { data } = useAvailableTeamsQuery(mantaClient, undefined, { enabled: canManageSharedMemories });
|
|
15
15
|
const availableTeams = data?.availableTeams.teams.map((g) => g.name) ?? [];
|
|
16
16
|
function toggle(path) {
|
|
17
17
|
onChange(selected.includes(path) ? selected.filter((t) => t !== path) : [...selected, path]);
|
|
@@ -18,7 +18,7 @@ export declare const memoryColumnLabels: {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const defaultColumnOrder: string[];
|
|
20
20
|
type UseMemoryColumnsArgs = {
|
|
21
|
-
|
|
21
|
+
canManageSharedMemories?: boolean;
|
|
22
22
|
userId: string;
|
|
23
23
|
schemas?: GQLMemorySchema[];
|
|
24
24
|
onEdit: (memory: GQLMemory) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMemoryColumns.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/hooks/useMemoryColumns.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA2BvD,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAGpF,eAAO,MAAM,kBAAkB;;;;;;CAMkB,CAAC;AAElD,eAAO,MAAM,kBAAkB,UAW9B,CAAC;AAyBF,KAAK,oBAAoB,GAAG;IAC1B,
|
|
1
|
+
{"version":3,"file":"useMemoryColumns.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/hooks/useMemoryColumns.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA2BvD,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAGpF,eAAO,MAAM,kBAAkB;;;;;;CAMkB,CAAC;AAElD,eAAO,MAAM,kBAAkB,UAW9B,CAAC;AAyBF,KAAK,oBAAoB,GAAG;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,CA+PnF"}
|
|
@@ -54,7 +54,7 @@ function MaybeTooltip(props) {
|
|
|
54
54
|
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { children: tooltip })] }));
|
|
55
55
|
}
|
|
56
56
|
export function useMemoryColumns(args) {
|
|
57
|
-
const {
|
|
57
|
+
const { canManageSharedMemories, userId, schemas, onEdit, onDelete, onMove, onRestore, onReconfirm, duplicates } = args;
|
|
58
58
|
return useMemo(() => {
|
|
59
59
|
const schemaByIri = new Map(schemas?.map((s) => [s.iri, s]) ?? []);
|
|
60
60
|
return [
|
|
@@ -181,8 +181,8 @@ export function useMemoryColumns(args) {
|
|
|
181
181
|
id: memoryColumnIds.actions,
|
|
182
182
|
enableHiding: false,
|
|
183
183
|
enableSorting: false,
|
|
184
|
-
cell: ({ row }) => (_jsx(MemoryActions, { memory: row.original,
|
|
184
|
+
cell: ({ row }) => (_jsx(MemoryActions, { memory: row.original, canManageSharedMemories: canManageSharedMemories, onEdit: onEdit, onDelete: onDelete, onMove: onMove, onRestore: onRestore, onReconfirm: onReconfirm })),
|
|
185
185
|
},
|
|
186
186
|
];
|
|
187
|
-
}, [
|
|
187
|
+
}, [canManageSharedMemories, userId, schemas, onEdit, onDelete, onMove, onRestore, onReconfirm, duplicates]);
|
|
188
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/memories/index.tsx"],"names":[],"mappings":"AAuCA,OAAO,EAAkD,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA8FtG,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7G,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAiCjE,wBAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/memories/index.tsx"],"names":[],"mappings":"AAuCA,OAAO,EAAkD,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA8FtG,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7G,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAiCjE,wBAAgB,aAAa,4CA4lB5B"}
|
|
@@ -77,7 +77,7 @@ const tabLabels = {
|
|
|
77
77
|
"live-context": "Live Context",
|
|
78
78
|
};
|
|
79
79
|
export function MemoriesRoute() {
|
|
80
|
-
const { datastore, datastores, user, logout, isOperator, canSwitchDatastore } = useAuthContext();
|
|
80
|
+
const { datastore, datastores, user, logout, isOperator, canManageSharedMemories, canSwitchDatastore } = useAuthContext();
|
|
81
81
|
const { mantaClient } = useMantaClient();
|
|
82
82
|
const queryClient = useQueryClient();
|
|
83
83
|
const [showArchived, setShowArchived] = useState(false);
|
|
@@ -104,15 +104,15 @@ export function MemoriesRoute() {
|
|
|
104
104
|
const deleteMutation = useDeleteMemoryMutation(mantaClient);
|
|
105
105
|
const restoreMutation = useRestoreMemoryMutation(mantaClient);
|
|
106
106
|
const reconfirmMutation = useReconfirmMemoryMutation(mantaClient);
|
|
107
|
-
const { data: teamsData } = useAvailableTeamsQuery(mantaClient, undefined, { enabled: !!
|
|
107
|
+
const { data: teamsData } = useAvailableTeamsQuery(mantaClient, undefined, { enabled: !!canManageSharedMemories });
|
|
108
108
|
const hasTeams = isPresent(teamsData?.availableTeams.teams);
|
|
109
109
|
const availableTabs = useMemo(() => [
|
|
110
|
-
...(
|
|
111
|
-
...(
|
|
110
|
+
...(canManageSharedMemories ? ["company"] : []),
|
|
111
|
+
...(canManageSharedMemories && hasTeams ? ["team"] : []),
|
|
112
112
|
"personal",
|
|
113
|
-
...(
|
|
113
|
+
...(canManageSharedMemories ? ["schemas"] : []),
|
|
114
114
|
"live-context",
|
|
115
|
-
], [
|
|
115
|
+
], [canManageSharedMemories, hasTeams]);
|
|
116
116
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
117
117
|
const tabParam = searchParams.get("tab");
|
|
118
118
|
const activeTab = useMemo(() => {
|
|
@@ -203,7 +203,7 @@ export function MemoriesRoute() {
|
|
|
203
203
|
const handleCreate = useCallback(async (form, supersedesMemoryIris) => {
|
|
204
204
|
if (!addDialog)
|
|
205
205
|
return;
|
|
206
|
-
if (!
|
|
206
|
+
if (!canManageSharedMemories && addDialog.scope !== GQLMemoryScope.User)
|
|
207
207
|
return;
|
|
208
208
|
try {
|
|
209
209
|
const result = await createMutation.mutateAsync({
|
|
@@ -219,11 +219,11 @@ export function MemoriesRoute() {
|
|
|
219
219
|
catch (e) {
|
|
220
220
|
reportMutationError(e, "Failed to add memory");
|
|
221
221
|
}
|
|
222
|
-
}, [addDialog, createMutation, invalidate,
|
|
222
|
+
}, [addDialog, createMutation, invalidate, canManageSharedMemories]);
|
|
223
223
|
const handleUpdate = useCallback(async (form, supersedesMemoryIris) => {
|
|
224
224
|
if (!editingMemory)
|
|
225
225
|
return;
|
|
226
|
-
if (!
|
|
226
|
+
if (!canManageSharedMemories && editingMemory.scope !== GQLMemoryScope.User)
|
|
227
227
|
return;
|
|
228
228
|
try {
|
|
229
229
|
const result = await updateMutation.mutateAsync({
|
|
@@ -239,10 +239,10 @@ export function MemoriesRoute() {
|
|
|
239
239
|
catch (e) {
|
|
240
240
|
reportMutationError(e, "Failed to update memory");
|
|
241
241
|
}
|
|
242
|
-
}, [editingMemory, updateMutation, invalidate,
|
|
242
|
+
}, [editingMemory, updateMutation, invalidate, canManageSharedMemories]);
|
|
243
243
|
const handleDelete = useCallback(async (iri) => {
|
|
244
244
|
const target = allMemories.find((m) => m.iri === iri);
|
|
245
|
-
if (!
|
|
245
|
+
if (!canManageSharedMemories && target && target.scope !== GQLMemoryScope.User)
|
|
246
246
|
return;
|
|
247
247
|
try {
|
|
248
248
|
await deleteMutation.mutateAsync({ memoryIri: iri });
|
|
@@ -252,7 +252,7 @@ export function MemoriesRoute() {
|
|
|
252
252
|
catch (e) {
|
|
253
253
|
reportMutationError(e, "Failed to delete memory");
|
|
254
254
|
}
|
|
255
|
-
}, [deleteMutation, invalidate,
|
|
255
|
+
}, [deleteMutation, invalidate, canManageSharedMemories, allMemories]);
|
|
256
256
|
const handleRestore = useCallback(async (iri) => {
|
|
257
257
|
try {
|
|
258
258
|
const result = await restoreMutation.mutateAsync({ memoryIri: iri });
|
|
@@ -308,7 +308,7 @@ export function MemoriesRoute() {
|
|
|
308
308
|
const handleMove = useCallback(async (newScope, newTeams, supersedesMemoryIris) => {
|
|
309
309
|
if (!movingMemory)
|
|
310
310
|
return;
|
|
311
|
-
if (!
|
|
311
|
+
if (!canManageSharedMemories)
|
|
312
312
|
return;
|
|
313
313
|
try {
|
|
314
314
|
const result = await updateMutation.mutateAsync({
|
|
@@ -335,17 +335,17 @@ export function MemoriesRoute() {
|
|
|
335
335
|
catch (e) {
|
|
336
336
|
reportMutationError(e, "Failed to move memory");
|
|
337
337
|
}
|
|
338
|
-
}, [movingMemory, updateMutation, invalidate,
|
|
338
|
+
}, [movingMemory, updateMutation, invalidate, canManageSharedMemories]);
|
|
339
339
|
const { duplicates } = useDuplicateDetection(unreviewedPersonalMemories, {
|
|
340
340
|
enabled: activeTab === "personal",
|
|
341
341
|
});
|
|
342
342
|
const columns = useMemoryColumns({
|
|
343
|
-
|
|
343
|
+
canManageSharedMemories,
|
|
344
344
|
userId: user.id,
|
|
345
345
|
schemas,
|
|
346
346
|
onEdit: setEditingMemory,
|
|
347
347
|
onDelete: handleDelete,
|
|
348
|
-
onMove:
|
|
348
|
+
onMove: canManageSharedMemories ? setMovingMemory : undefined,
|
|
349
349
|
onRestore: handleRestore,
|
|
350
350
|
onReconfirm: handleReconfirm,
|
|
351
351
|
duplicates,
|
|
@@ -371,7 +371,7 @@ export function MemoriesRoute() {
|
|
|
371
371
|
}));
|
|
372
372
|
const tabsList = _jsx(ScopeTabs, { tabs: scopeTabs, activeValue: activeTab, isLoading: isLoading });
|
|
373
373
|
const addMemoryButton = addMemoryButtonConfig(activeTab);
|
|
374
|
-
const canShowArchived = activeTab === "personal" || (
|
|
374
|
+
const canShowArchived = activeTab === "personal" || (canManageSharedMemories && (activeTab === "company" || activeTab === "team"));
|
|
375
375
|
const headerActions = [
|
|
376
376
|
{
|
|
377
377
|
key: "refresh",
|
|
@@ -458,14 +458,14 @@ export function MemoriesRoute() {
|
|
|
458
458
|
return (_jsxs(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, children: [_jsx(PageHeader, { title: "Memories", icon: Brain, actions: _jsx(PageHeaderActions, { actions: headerActions }) }), _jsxs(Tabs, { value: activeTab, onValueChange: handleTabChange, className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [_jsx(ScopeMemoriesTab, { value: "personal", tableState: personalTableState, memories: displayedPersonalMemories, tabs: tabsList, isLoading: isLoading, errorMessage: errorMessage, schemas: schemas, onRowClick: handleRowClick, visibleStatusFilters: [
|
|
459
459
|
...alwaysVisibleStatusFilters,
|
|
460
460
|
"autoCaptured",
|
|
461
|
-
...(
|
|
462
|
-
], emptyState: _jsx(MemoriesEmptyState, {
|
|
461
|
+
...(canManageSharedMemories ? ["promotion"] : []),
|
|
462
|
+
], emptyState: _jsx(MemoriesEmptyState, { onAdd: () => setAddDialog({ scope: GQLMemoryScope.User }) }) }), canManageSharedMemories && (_jsx(ScopeMemoriesTab, { value: "company", tableState: companyTableState, memories: companyMemories, tabs: tabsList, isLoading: isLoading, errorMessage: errorMessage, schemas: schemas, onRowClick: handleRowClick, emptyState: showCompanyOnboarding ? (_jsx("div", { className: "flex items-center justify-center h-full min-h-64 p-5", children: _jsx(MemoryOnboardingWizard, { scope: GQLMemoryScope.Company, onComplete: () => setShowOrgOnboarding(false), onSkip: () => setShowOrgOnboarding(false) }) })) : (_jsx(CompanyMemoriesEmptyState, { onAdd: () => setAddDialog({ scope: GQLMemoryScope.Company }), onSetUp: () => setShowOrgOnboarding(true) })) })), canManageSharedMemories && hasTeams && (_jsx(ScopeMemoriesTab, { value: "team", tableState: teamTableState, memories: teamMemories, tabs: tabsList, isLoading: isLoading, errorMessage: errorMessage, schemas: schemas, onRowClick: handleRowClick, emptyState: _jsx(GroupMemoriesEmptyState, { canManageSharedMemories: true, onAdd: () => setAddDialog({ scope: GQLMemoryScope.Team }) }) })), canManageSharedMemories && (_jsx(FilterableTabContent, { value: "schemas", tabs: tabsList, placeholder: "Filter schemas\u2026", query: schemasQuery, onQueryChange: setSchemasQuery, children: _jsx(SchemasTab, { query: schemasQuery }) })), _jsx(FilterableTabContent, { value: "live-context", tabs: tabsList, placeholder: "Filter live context\u2026", query: liveContextQuery, onQueryChange: setLiveContextQuery, children: _jsx(LiveContextTab, { query: liveContextQuery }) })] }), formDialogState && (_jsx(MemoryFormDialog, { open: true, onOpenChange: (open) => {
|
|
463
463
|
if (!open)
|
|
464
464
|
formDialogState.onClose();
|
|
465
|
-
}, scope: formDialogState.scope, initial: formDialogState.initial, onSave: formDialogState.onSave, isSaving: formDialogState.isSaving,
|
|
465
|
+
}, scope: formDialogState.scope, initial: formDialogState.initial, onSave: formDialogState.onSave, isSaving: formDialogState.isSaving, canManageSharedMemories: canManageSharedMemories, schemas: schemas, currentUserId: user.id })), movingMemory && (_jsx(ChangeScopeDialog, { open: true, onOpenChange: (open) => {
|
|
466
466
|
if (!open)
|
|
467
467
|
setMovingMemory(null);
|
|
468
|
-
}, memory: movingMemory,
|
|
468
|
+
}, memory: movingMemory, canManageSharedMemories: canManageSharedMemories, onSave: handleMove, isSaving: updateMutation.isPending, currentUserId: user.id })), _jsx(RestoreBlockedDialog, { open: restoreBlocked != null, onOpenChange: (open) => {
|
|
469
469
|
if (!open)
|
|
470
470
|
setRestoreBlocked(null);
|
|
471
471
|
}, blockedByLabel: restoreBlocked?.blockedByLabel ?? null, onConfirm: handleConfirmRestoreBlocked }), _jsx(ConsolidationReviewDialog, { open: consolidating, clusters: reviewGroups, isLoading: isFindingRedundancy, isSaving: consolidateMutation.isPending, candidateCount: consolidationCandidates.length, comparedCount: reviewData?.memoryRedundancyReview.comparedCount ?? null, timedOut: reviewData?.memoryRedundancyReview.timedOut ?? false, errorMessage: reviewData?.memoryRedundancyReview.error ?? (reviewError instanceof Error ? reviewError.message : null), onMerge: handleConsolidate, onClose: () => setConsolidating(false) })] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manta-eu/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "The Manta design system, knowledge-graph UI and agent components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1085,11 +1085,12 @@
|
|
|
1085
1085
|
"usehooks-ts": "^3.1.1",
|
|
1086
1086
|
"zod": "^4.5.0",
|
|
1087
1087
|
"zustand": "^5.0.2",
|
|
1088
|
-
"@manta-eu/
|
|
1089
|
-
"@manta-eu/
|
|
1090
|
-
"@manta-eu/datalog-parser": "0.1.
|
|
1091
|
-
"@manta-eu/
|
|
1092
|
-
"@manta-eu/lib": "0.1.
|
|
1088
|
+
"@manta-eu/auth": "0.1.5",
|
|
1089
|
+
"@manta-eu/client": "0.1.5",
|
|
1090
|
+
"@manta-eu/datalog-parser": "0.1.5",
|
|
1091
|
+
"@manta-eu/ldo": "0.1.5",
|
|
1092
|
+
"@manta-eu/lib": "0.1.5",
|
|
1093
|
+
"@manta-eu/rdf-lib": "0.1.5"
|
|
1093
1094
|
},
|
|
1094
1095
|
"peerDependencies": {
|
|
1095
1096
|
"@ulb-darmstadt/shacl-form": "^2.1.1-rc1",
|