@manta-eu/react 0.1.4 → 0.1.6
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 -8
- 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 +1 -1
- package/dist/components/chat/chat-input/index.d.ts.map +1 -1
- package/dist/components/chat/chat-input/index.js +4 -5
- package/dist/components/chat-view/Chat.d.ts +6 -0
- package/dist/components/chat-view/Chat.d.ts.map +1 -1
- package/dist/components/chat-view/Chat.js +18 -8
- 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.map +1 -1
- package/dist/components/embedded-chat/index.js +1 -8
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +25 -5
- 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/components/sidebar/nav-menu.d.ts +2 -0
- package/dist/components/sidebar/nav-menu.d.ts.map +1 -1
- package/dist/components/sidebar/nav-menu.js +11 -6
- package/dist/components/table/index.d.ts +26 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.js +31 -1
- 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/explain-fact/DatalogCode.d.ts.map +1 -1
- package/dist/explain-fact/DatalogCode.js +7 -2
- package/dist/explain-fact/FactValue.js +3 -3
- package/dist/explain-fact/proof-tree/ProofTreeFormulaFooter.d.ts.map +1 -1
- package/dist/explain-fact/proof-tree/ProofTreeFormulaFooter.js +2 -1
- package/dist/globals.css +10 -102
- package/dist/graph/createNodeRouter.d.ts.map +1 -1
- package/dist/graph/createNodeRouter.js +3 -0
- package/dist/graph/nodes/BrandFacetRuleView.d.ts.map +1 -1
- package/dist/graph/nodes/BrandFacetRuleView.js +6 -4
- package/dist/graph/nodes/BrandFontFamilyView.d.ts +3 -0
- package/dist/graph/nodes/BrandFontFamilyView.d.ts.map +1 -0
- package/dist/graph/nodes/BrandFontFamilyView.js +56 -0
- package/dist/graph/nodes/BrandFontUploadButton.d.ts +6 -0
- package/dist/graph/nodes/BrandFontUploadButton.d.ts.map +1 -0
- package/dist/graph/nodes/BrandFontUploadButton.js +65 -0
- package/dist/graph/nodes/BrandGuidelinesView.d.ts.map +1 -1
- package/dist/graph/nodes/BrandGuidelinesView.js +2 -6
- package/dist/graph/nodes/GoogleCampaignView.js +2 -2
- package/dist/graph/nodes/brand-font.d.ts +12 -0
- package/dist/graph/nodes/brand-font.d.ts.map +1 -0
- package/dist/graph/nodes/brand-font.js +12 -0
- package/dist/graph/nodes/brand-shared.d.ts +3 -2
- package/dist/graph/nodes/brand-shared.d.ts.map +1 -1
- package/dist/graph/nodes/brand-shared.js +3 -2
- package/dist/hooks/use-action-plans-list.js +1 -1
- package/dist/hooks/use-connection-problems.d.ts +15 -0
- package/dist/hooks/use-connection-problems.d.ts.map +1 -0
- package/dist/hooks/use-connection-problems.js +9 -0
- package/dist/hooks/use-font-face.d.ts +3 -0
- package/dist/hooks/use-font-face.d.ts.map +1 -0
- package/dist/hooks/use-font-face.js +33 -0
- package/dist/hooks/use-graph-refresh-after-turn.d.ts +2 -0
- package/dist/hooks/use-graph-refresh-after-turn.d.ts.map +1 -0
- package/dist/hooks/use-graph-refresh-after-turn.js +12 -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 +6 -1
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +36 -9
- 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/activity-changeset.d.ts.map +1 -1
- package/dist/lib/activity-changeset.js +6 -3
- package/dist/lib/datastore-route-table.d.ts +1 -0
- package/dist/lib/datastore-route-table.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.js +2 -0
- 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/lib/tool-icons.d.ts.map +1 -1
- package/dist/lib/tool-icons.js +1 -5
- package/dist/providers/ActiveChatProvider.d.ts.map +1 -1
- package/dist/providers/ActiveChatProvider.js +2 -0
- package/dist/providers/AuthContext.d.ts +1 -1
- package/dist/providers/AuthContext.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateContext.d.ts +0 -1
- package/dist/providers/KnowledgeGraphStateContext.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateProvider.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateProvider.js +8 -19
- 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/activity/change-display.js +1 -1
- package/dist/routes/data-explorer/components/record-detail/ActionFormDialog.d.ts.map +1 -1
- package/dist/routes/data-explorer/components/record-detail/ActionFormDialog.js +23 -9
- package/dist/routes/data-explorer/components/record-detail/action-properties.d.ts +2 -4
- package/dist/routes/data-explorer/components/record-detail/action-properties.d.ts.map +1 -1
- package/dist/routes/data-explorer/components/record-detail/action-properties.js +8 -50
- 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 +4 -1
- package/dist/routes/integrations/connection-view.d.ts.map +1 -1
- package/dist/routes/integrations/connection-view.js +39 -6
- package/dist/routes/integrations/types.d.ts +3 -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/dist/shacl/shacl-form-types.d.ts +2 -3
- package/dist/shacl/shacl-form-types.d.ts.map +1 -1
- package/dist/shared/graph-derived-queries.d.ts +5 -0
- package/dist/shared/graph-derived-queries.d.ts.map +1 -0
- package/dist/shared/graph-derived-queries.js +28 -0
- package/package.json +8 -10
- package/dist/components/ai-elements/chain-of-thought.d.ts +0 -30
- package/dist/components/ai-elements/chain-of-thought.d.ts.map +0 -1
- package/dist/components/ai-elements/chain-of-thought.js +0 -57
- package/dist/components/context-menu.d.ts +0 -29
- package/dist/components/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu.js +0 -67
- package/dist/components/hover-card.d.ts +0 -6
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -15
- package/dist/components/layouts/ChatHistoryItem.d.ts +0 -9
- package/dist/components/layouts/ChatHistoryItem.d.ts.map +0 -1
- package/dist/components/layouts/ChatHistoryItem.js +0 -7
- package/dist/components/layouts/SectionHeader.d.ts +0 -8
- package/dist/components/layouts/SectionHeader.d.ts.map +0 -1
- package/dist/components/layouts/SectionHeader.js +0 -6
- package/dist/components/orbit-site/Block.d.ts +0 -8
- package/dist/components/orbit-site/Block.d.ts.map +0 -1
- package/dist/components/orbit-site/Block.js +0 -7
- package/dist/components/orbit-site/Inset.d.ts +0 -7
- package/dist/components/orbit-site/Inset.d.ts.map +0 -1
- package/dist/components/orbit-site/Inset.js +0 -6
- package/dist/components/orbit-site/Section.d.ts +0 -7
- package/dist/components/orbit-site/Section.d.ts.map +0 -1
- package/dist/components/orbit-site/Section.js +0 -6
- package/dist/components/orbit-site/ThemeSelector.d.ts +0 -3
- package/dist/components/orbit-site/ThemeSelector.d.ts.map +0 -1
- package/dist/components/orbit-site/ThemeSelector.js +0 -42
- package/dist/components/planning/SampleChanges.d.ts +0 -9
- package/dist/components/planning/SampleChanges.d.ts.map +0 -1
- package/dist/components/planning/SampleChanges.js +0 -117
- package/dist/components/tool-invocation-card/index.d.ts +0 -8
- package/dist/components/tool-invocation-card/index.d.ts.map +0 -1
- package/dist/components/tool-invocation-card/index.js +0 -7
- package/dist/lib/schema-fields.d.ts +0 -2
- package/dist/lib/schema-fields.d.ts.map +0 -1
- package/dist/lib/schema-fields.js +0 -3
- package/dist/routes/memories/components/ConflictTimeoutFooter.d.ts +0 -7
- package/dist/routes/memories/components/ConflictTimeoutFooter.d.ts.map +0 -1
- package/dist/routes/memories/components/ConflictTimeoutFooter.js +0 -6
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { flexRender } from "@tanstack/react-table";
|
|
3
|
+
import { flexRender, getCoreRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
|
|
4
4
|
import { ChevronDown, ChevronsUpDown, ChevronUp } from "lucide-react";
|
|
5
|
+
import { useMemo, useState } from "react";
|
|
5
6
|
import { match } from "ts-pattern";
|
|
6
7
|
import { getCommonPinnedColumnStyles } from "./table-utils.js";
|
|
7
8
|
import { Button } from "#components/button/index";
|
|
@@ -114,3 +115,32 @@ export function DataTable(props) {
|
|
|
114
115
|
return (_jsx(TableHead, { className: cn("h-13 px-4 not-first:px-3 py-2", header.column.columnDef.meta?.className), "data-is-pinned": header.column.getIsPinned() ? true : undefined, style: pinningStyles, ref: (thElement) => columnSizingHandler(thElement, table, header.column), children: header.isPlaceholder ? null : header.column.getCanSort() ? (_jsx(ColumnHeader, { column: header.column, children: headerContent })) : (headerContent) }, header.id));
|
|
115
116
|
}) }, headerGroup.id))) }), _jsx(TableBody, { className: cn(isLoading && "animate-pulse", bodyClassName), children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => renderTableRow(row))) : (_jsx(TableRow, { className: tableBodyRowClassName, children: _jsx(TableCell, { colSpan: table.getAllColumns().length, className: "h-24 text-center", children: resolvedNoResultsMessage }) })) })] }) }));
|
|
116
117
|
}
|
|
118
|
+
export function renderCellValue(value) {
|
|
119
|
+
if (typeof value === "string" || typeof value === "number")
|
|
120
|
+
return value;
|
|
121
|
+
return value === null || value === undefined ? "" : String(value);
|
|
122
|
+
}
|
|
123
|
+
export function SortableTable(props) {
|
|
124
|
+
const { columns, rows, onRowClick, rowHref, ...rest } = props;
|
|
125
|
+
const columnDefs = useMemo(() => columns.map((column) => ({
|
|
126
|
+
accessorKey: column.key,
|
|
127
|
+
header: column.header,
|
|
128
|
+
enableSorting: column.sortable ?? true,
|
|
129
|
+
cell: (info) => (column.cell ? column.cell(info.row.original) : renderCellValue(info.getValue())),
|
|
130
|
+
...(column.numeric ? { meta: { type: "number" } } : {}),
|
|
131
|
+
})), [columns]);
|
|
132
|
+
const [sorting, setSorting] = useState([]);
|
|
133
|
+
const table = useReactTable({
|
|
134
|
+
data: rows,
|
|
135
|
+
columns: columnDefs,
|
|
136
|
+
state: { sorting },
|
|
137
|
+
onSortingChange: setSorting,
|
|
138
|
+
getCoreRowModel: getCoreRowModel(),
|
|
139
|
+
getSortedRowModel: getSortedRowModel(),
|
|
140
|
+
});
|
|
141
|
+
if (onRowClick)
|
|
142
|
+
return _jsx(DataTable, { table: table, onRowClick: (row) => onRowClick(row.original), ...rest });
|
|
143
|
+
if (rowHref)
|
|
144
|
+
return _jsx(DataTable, { table: table, rowHref: (row) => rowHref(row.original), ...rest });
|
|
145
|
+
return _jsx(DataTable, { table: table, ...rest });
|
|
146
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastore-picker-rows.d.ts","sourceRoot":"","sources":["../../src/datastore-picker/datastore-picker-rows.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,QAAgB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAuHF,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,GAAG,OAAO,CAO7E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"datastore-picker-rows.d.ts","sourceRoot":"","sources":["../../src/datastore-picker/datastore-picker-rows.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,QAAgB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAuHF,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,GAAG,OAAO,CAO7E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAOV;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC9C,CAAC;AAGF,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,kBAAkB,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAU9G;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,kBAAkB,EAAE,CAsBvF"}
|
|
@@ -107,8 +107,12 @@ export function hasDatastoreChoice(datastores) {
|
|
|
107
107
|
return only !== undefined && hasAncestorAbove(list, only);
|
|
108
108
|
}
|
|
109
109
|
export function canPickDatastore(args) {
|
|
110
|
-
const { canSwitchDatastore, canSelect, datastores } = args;
|
|
111
|
-
|
|
110
|
+
const { canSwitchDatastore, canSelect, datastores, isOperator } = args;
|
|
111
|
+
if (!canSwitchDatastore || !canSelect)
|
|
112
|
+
return false;
|
|
113
|
+
// An operator picks from the datastore tree, so there is no list here to count, and their right
|
|
114
|
+
// to switch is already settled by canSwitchDatastore.
|
|
115
|
+
return isOperator === true || hasDatastoreChoice(datastores);
|
|
112
116
|
}
|
|
113
117
|
// Below this the search box is more clutter than help.
|
|
114
118
|
export const searchThreshold = 7;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatalogCode.d.ts","sourceRoot":"","sources":["../../src/explain-fact/DatalogCode.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatalogCode.d.ts","sourceRoot":"","sources":["../../src/explain-fact/DatalogCode.tsx"],"names":[],"mappings":"AAmDA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAMlD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BLANK_NODE, booleanLiteralTokenTypes, builtinFunctionTokenTypes, delimiterTokenTypes, iriTokenTypes, keywordTokenTypes, LANGTAG, NOT, numericLiteralTokenTypes, operatorTokenTypes, stringLiteralTokenTypes, tokenizeDatalog, VARIABLE, } from "@manta-eu/datalog-parser";
|
|
2
|
+
import { BLANK_NODE, booleanLiteralTokenTypes, builtinFunctionTokenTypes, delimiterTokenTypes, DOUBLE, iriTokenTypes, keywordTokenTypes, LANGTAG, NOT, numericLiteralTokenTypes, operatorTokenTypes, plainDecimalText, stringLiteralTokenTypes, tokenizeDatalog, VARIABLE, } from "@manta-eu/datalog-parser";
|
|
3
3
|
import { Fragment, useMemo } from "react";
|
|
4
4
|
import { OntologyTermText } from "../ontology/OntologyTermText.js";
|
|
5
5
|
import { cn } from "#style";
|
|
@@ -45,6 +45,11 @@ function highlightWithBlankNodes(code) {
|
|
|
45
45
|
}
|
|
46
46
|
return segments;
|
|
47
47
|
}
|
|
48
|
+
// DOUBLE is matched before PLUS, so a leading + is part of the number token.
|
|
49
|
+
function plainDoubleTokenText(text) {
|
|
50
|
+
const plain = plainDecimalText(text);
|
|
51
|
+
return text.startsWith("+") && !plain.startsWith("+") ? `+${plain}` : plain;
|
|
52
|
+
}
|
|
48
53
|
function highlightDatalog(code, keyPrefix = "") {
|
|
49
54
|
const { tokens } = tokenizeDatalog(code);
|
|
50
55
|
const segments = [];
|
|
@@ -62,7 +67,7 @@ function highlightDatalog(code, keyPrefix = "") {
|
|
|
62
67
|
segments.push(_jsx(OntologyTermText, { term: text, className: className }, `${keyPrefix}token-${index}`));
|
|
63
68
|
}
|
|
64
69
|
else {
|
|
65
|
-
segments.push(_jsx("span", { className: className, children: text }, `${keyPrefix}token-${index}`));
|
|
70
|
+
segments.push(_jsx("span", { className: className, children: tokenName === DOUBLE.name ? plainDoubleTokenText(text) : text }, `${keyPrefix}token-${index}`));
|
|
66
71
|
}
|
|
67
72
|
cursor = end;
|
|
68
73
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isDateTimeLiteral, isLiteralTerm,
|
|
2
|
+
import { isDateTimeLiteral, isLiteralTerm, isNumericLiteralTerm, literalToDisplayText, parseBooleanLiteral, parseDatalogTermText, } from "@manta-eu/datalog-parser";
|
|
3
3
|
import { isPresent } from "@manta-eu/lib/present";
|
|
4
4
|
import { Check, Sparkles, X } from "lucide-react";
|
|
5
5
|
import { useMemo } from "react";
|
|
@@ -30,8 +30,8 @@ export function FactValue(props) {
|
|
|
30
30
|
const Icon = boolean ? Check : X;
|
|
31
31
|
return (_jsxs("span", { className: cn("inline-flex items-center gap-1 typography-small-medium", boolean ? "text-success-foreground" : "text-muted-foreground", className), children: [_jsx(Icon, { className: "size-3.5" }), boolean ? "true" : "false"] }));
|
|
32
32
|
}
|
|
33
|
-
if (
|
|
34
|
-
return _jsx(ValuePill, { className: className, children: formatMeasureValue(value, measure) });
|
|
33
|
+
if (isPresent(term) && isNumericLiteralTerm(term)) {
|
|
34
|
+
return _jsx(ValuePill, { className: className, children: formatMeasureValue(term.value, measure) });
|
|
35
35
|
}
|
|
36
36
|
if (literal) {
|
|
37
37
|
return (_jsx(ValuePill, { className: className, children: isDateTimeLiteral(literal) ? literalToDisplayText(literal) : literal.value }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProofTreeFormulaFooter.d.ts","sourceRoot":"","sources":["../../../src/explain-fact/proof-tree/ProofTreeFormulaFooter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProofTreeFormulaFooter.d.ts","sourceRoot":"","sources":["../../../src/explain-fact/proof-tree/ProofTreeFormulaFooter.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMxD,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,EAAE,uBAAuB,CAAC;IACjC,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAmBxE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DatalogCode } from "../DatalogCode.js";
|
|
2
3
|
import { datalogTextClass } from "../explain-styles.js";
|
|
3
4
|
import { factTokenText } from "../fact-token.js";
|
|
4
5
|
import { formulaHueClass } from "../formula-hues.js";
|
|
@@ -7,7 +8,7 @@ import { cn } from "#style";
|
|
|
7
8
|
const variableTokenPattern = /(\?\w+)/;
|
|
8
9
|
export function ProofTreeFormulaFooter(props) {
|
|
9
10
|
const { formula, mode, rawText } = props;
|
|
10
|
-
return (_jsx("div", { className: "flex items-center gap-3 border-t border-muted-border bg-faint px-3.5 py-4", children: _jsx("span", { className: "flex min-w-0 items-center gap-2.5", children: mode === "datalog" ? (_jsx("span", { className:
|
|
11
|
+
return (_jsx("div", { className: "flex items-center gap-3 border-t border-muted-border bg-faint px-3.5 py-4", children: _jsx("span", { className: "flex min-w-0 items-center gap-2.5", children: mode === "datalog" ? (_jsx("span", { className: "min-w-0 truncate", title: rawText, children: _jsx(DatalogCode, { code: rawText ?? formula.expression, className: cn(datalogTextClass, "text-body-foreground") }) })) : (_jsx(FormulaExpression, { formula: formula })) }) }));
|
|
11
12
|
}
|
|
12
13
|
function FormulaExpression(props) {
|
|
13
14
|
const { formula } = props;
|
package/dist/globals.css
CHANGED
|
@@ -513,9 +513,6 @@
|
|
|
513
513
|
.top-6 {
|
|
514
514
|
top: calc(var(--spacing) * 6);
|
|
515
515
|
}
|
|
516
|
-
.top-7 {
|
|
517
|
-
top: calc(var(--spacing) * 7);
|
|
518
|
-
}
|
|
519
516
|
.top-7\.75 {
|
|
520
517
|
top: calc(var(--spacing) * 7.75);
|
|
521
518
|
}
|
|
@@ -786,9 +783,6 @@
|
|
|
786
783
|
.mt-8 {
|
|
787
784
|
margin-top: calc(var(--spacing) * 8);
|
|
788
785
|
}
|
|
789
|
-
.mt-10 {
|
|
790
|
-
margin-top: calc(var(--spacing) * 10);
|
|
791
|
-
}
|
|
792
786
|
.mt-auto {
|
|
793
787
|
margin-top: auto;
|
|
794
788
|
}
|
|
@@ -1358,9 +1352,6 @@
|
|
|
1358
1352
|
.h-svh {
|
|
1359
1353
|
height: 100svh;
|
|
1360
1354
|
}
|
|
1361
|
-
.max-h-\(--radix-context-menu-content-available-height\) {
|
|
1362
|
-
max-height: var(--radix-context-menu-content-available-height);
|
|
1363
|
-
}
|
|
1364
1355
|
.max-h-\(--radix-dropdown-menu-content-available-height\) {
|
|
1365
1356
|
max-height: var(--radix-dropdown-menu-content-available-height);
|
|
1366
1357
|
}
|
|
@@ -1394,9 +1385,6 @@
|
|
|
1394
1385
|
.max-h-150 {
|
|
1395
1386
|
max-height: calc(var(--spacing) * 150);
|
|
1396
1387
|
}
|
|
1397
|
-
.max-h-\[22rem\] {
|
|
1398
|
-
max-height: 22rem;
|
|
1399
|
-
}
|
|
1400
1388
|
.max-h-\[50vh\] {
|
|
1401
1389
|
max-height: 50vh;
|
|
1402
1390
|
}
|
|
@@ -2066,15 +2054,9 @@
|
|
|
2066
2054
|
.border-collapse {
|
|
2067
2055
|
border-collapse: collapse;
|
|
2068
2056
|
}
|
|
2069
|
-
.origin-\(--radix-context-menu-content-transform-origin\) {
|
|
2070
|
-
transform-origin: var(--radix-context-menu-content-transform-origin);
|
|
2071
|
-
}
|
|
2072
2057
|
.origin-\(--radix-dropdown-menu-content-transform-origin\) {
|
|
2073
2058
|
transform-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
2074
2059
|
}
|
|
2075
|
-
.origin-\(--radix-hover-card-content-transform-origin\) {
|
|
2076
|
-
transform-origin: var(--radix-hover-card-content-transform-origin);
|
|
2077
|
-
}
|
|
2078
2060
|
.origin-\(--radix-popover-content-transform-origin\) {
|
|
2079
2061
|
transform-origin: var(--radix-popover-content-transform-origin);
|
|
2080
2062
|
}
|
|
@@ -2277,8 +2259,8 @@
|
|
|
2277
2259
|
.grid-cols-\[auto_1fr\] {
|
|
2278
2260
|
grid-template-columns: auto 1fr;
|
|
2279
2261
|
}
|
|
2280
|
-
.grid-cols-\[fit-content\(
|
|
2281
|
-
grid-template-columns: fit-content(
|
|
2262
|
+
.grid-cols-\[fit-content\(40\%\)_minmax\(0\,1fr\)_auto\] {
|
|
2263
|
+
grid-template-columns: fit-content(40%) minmax(0,1fr) auto;
|
|
2282
2264
|
}
|
|
2283
2265
|
.grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
2284
2266
|
grid-template-columns: minmax(0,1fr) auto;
|
|
@@ -3763,9 +3745,6 @@
|
|
|
3763
3745
|
.bg-\[length\:220\%_100\%\] {
|
|
3764
3746
|
background-size: 220% 100%;
|
|
3765
3747
|
}
|
|
3766
|
-
.fill-current {
|
|
3767
|
-
fill: currentcolor;
|
|
3768
|
-
}
|
|
3769
3748
|
.fill-default-foreground {
|
|
3770
3749
|
fill: var(--color-default-foreground);
|
|
3771
3750
|
}
|
|
@@ -4075,9 +4054,6 @@
|
|
|
4075
4054
|
.pb-16 {
|
|
4076
4055
|
padding-bottom: calc(var(--spacing) * 16);
|
|
4077
4056
|
}
|
|
4078
|
-
.pb-40 {
|
|
4079
|
-
padding-bottom: calc(var(--spacing) * 40);
|
|
4080
|
-
}
|
|
4081
4057
|
.pb-px {
|
|
4082
4058
|
padding-bottom: 1px;
|
|
4083
4059
|
}
|
|
@@ -4298,6 +4274,14 @@
|
|
|
4298
4274
|
--tw-font-weight: var(--font-weight-semibold);
|
|
4299
4275
|
font-weight: var(--font-weight-semibold);
|
|
4300
4276
|
}
|
|
4277
|
+
.typography-large-body {
|
|
4278
|
+
font-size: var(--text-lg);
|
|
4279
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
4280
|
+
--tw-leading: var(--leading-base);
|
|
4281
|
+
line-height: var(--leading-base);
|
|
4282
|
+
--tw-font-weight: var(--font-weight-normal);
|
|
4283
|
+
font-weight: var(--font-weight-normal);
|
|
4284
|
+
}
|
|
4301
4285
|
.typography-large-body-semibold {
|
|
4302
4286
|
font-size: var(--text-lg);
|
|
4303
4287
|
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
@@ -5870,14 +5854,6 @@
|
|
|
5870
5854
|
}
|
|
5871
5855
|
}
|
|
5872
5856
|
}
|
|
5873
|
-
.hover\:bg-background\/60 {
|
|
5874
|
-
&:is(:hover, [data-state="hover"]) {
|
|
5875
|
-
background-color: color-mix(in srgb, #f5f5f5 60%, transparent);
|
|
5876
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
5877
|
-
background-color: color-mix(in oklab, var(--color-background) 60%, transparent);
|
|
5878
|
-
}
|
|
5879
|
-
}
|
|
5880
|
-
}
|
|
5881
5857
|
.hover\:bg-background\/80 {
|
|
5882
5858
|
&:is(:hover, [data-state="hover"]) {
|
|
5883
5859
|
background-color: color-mix(in srgb, #f5f5f5 80%, transparent);
|
|
@@ -5990,11 +5966,6 @@
|
|
|
5990
5966
|
}
|
|
5991
5967
|
}
|
|
5992
5968
|
}
|
|
5993
|
-
.hover\:bg-secondary {
|
|
5994
|
-
&:is(:hover, [data-state="hover"]) {
|
|
5995
|
-
background-color: var(--color-secondary);
|
|
5996
|
-
}
|
|
5997
|
-
}
|
|
5998
5969
|
.hover\:bg-secondary-hover {
|
|
5999
5970
|
&:is(:hover, [data-state="hover"]) {
|
|
6000
5971
|
background-color: var(--color-secondary-hover);
|
|
@@ -6131,11 +6102,6 @@
|
|
|
6131
6102
|
border-color: transparent !important;
|
|
6132
6103
|
}
|
|
6133
6104
|
}
|
|
6134
|
-
.focus\:bg-accent {
|
|
6135
|
-
&:is(:focus-visible, [data-state="focus"]) {
|
|
6136
|
-
background-color: var(--color-accent);
|
|
6137
|
-
}
|
|
6138
|
-
}
|
|
6139
6105
|
.focus\:bg-faint {
|
|
6140
6106
|
&:is(:focus-visible, [data-state="focus"]) {
|
|
6141
6107
|
background-color: var(--color-faint);
|
|
@@ -6146,11 +6112,6 @@
|
|
|
6146
6112
|
background-color: transparent;
|
|
6147
6113
|
}
|
|
6148
6114
|
}
|
|
6149
|
-
.focus\:text-accent-foreground {
|
|
6150
|
-
&:is(:focus-visible, [data-state="focus"]) {
|
|
6151
|
-
color: var(--color-accent-foreground);
|
|
6152
|
-
}
|
|
6153
|
-
}
|
|
6154
6115
|
.focus\:ring-0 {
|
|
6155
6116
|
&:is(:focus-visible, [data-state="focus"]) {
|
|
6156
6117
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
@@ -6719,11 +6680,6 @@
|
|
|
6719
6680
|
opacity: 50%;
|
|
6720
6681
|
}
|
|
6721
6682
|
}
|
|
6722
|
-
.data-inset\:pl-8 {
|
|
6723
|
-
&[data-inset] {
|
|
6724
|
-
padding-left: calc(var(--spacing) * 8);
|
|
6725
|
-
}
|
|
6726
|
-
}
|
|
6727
6683
|
.data-is-pinned\:bg-faint {
|
|
6728
6684
|
&[data-is-pinned] {
|
|
6729
6685
|
background-color: var(--color-faint);
|
|
@@ -7100,11 +7056,6 @@
|
|
|
7100
7056
|
--tw-exit-translate-y: -100%;
|
|
7101
7057
|
}
|
|
7102
7058
|
}
|
|
7103
|
-
.data-\[state\=closed\]\:slide-out-to-top-2 {
|
|
7104
|
-
&[data-state="closed"] {
|
|
7105
|
-
--tw-exit-translate-y: -0.5rem;
|
|
7106
|
-
}
|
|
7107
|
-
}
|
|
7108
7059
|
.data-\[state\=closed\]\:zoom-out-95 {
|
|
7109
7060
|
&[data-state="closed"] {
|
|
7110
7061
|
--tw-exit-scale: .95;
|
|
@@ -7150,11 +7101,6 @@
|
|
|
7150
7101
|
background-color: var(--color-muted);
|
|
7151
7102
|
}
|
|
7152
7103
|
}
|
|
7153
|
-
.data-\[state\=open\]\:text-accent-foreground {
|
|
7154
|
-
&[data-state="open"] {
|
|
7155
|
-
color: var(--color-accent-foreground);
|
|
7156
|
-
}
|
|
7157
|
-
}
|
|
7158
7104
|
.data-\[state\=open\]\:text-default-foreground {
|
|
7159
7105
|
&[data-state="open"] {
|
|
7160
7106
|
color: var(--color-default-foreground);
|
|
@@ -7228,11 +7174,6 @@
|
|
|
7228
7174
|
--tw-enter-translate-y: -100%;
|
|
7229
7175
|
}
|
|
7230
7176
|
}
|
|
7231
|
-
.data-\[state\=open\]\:slide-in-from-top-2 {
|
|
7232
|
-
&[data-state="open"] {
|
|
7233
|
-
--tw-enter-translate-y: -0.5rem;
|
|
7234
|
-
}
|
|
7235
|
-
}
|
|
7236
7177
|
.data-\[state\=open\]\:zoom-in-95 {
|
|
7237
7178
|
&[data-state="open"] {
|
|
7238
7179
|
--tw-enter-scale: .95;
|
|
@@ -7270,25 +7211,6 @@
|
|
|
7270
7211
|
background-color: var(--color-muted);
|
|
7271
7212
|
}
|
|
7272
7213
|
}
|
|
7273
|
-
.data-\[variant\=destructive\]\:text-error-foreground {
|
|
7274
|
-
&[data-variant="destructive"] {
|
|
7275
|
-
color: var(--color-error-foreground);
|
|
7276
|
-
}
|
|
7277
|
-
}
|
|
7278
|
-
.data-\[variant\=destructive\]\:focus\:bg-error {
|
|
7279
|
-
&[data-variant="destructive"] {
|
|
7280
|
-
&:is(:focus-visible, [data-state="focus"]) {
|
|
7281
|
-
background-color: var(--color-error);
|
|
7282
|
-
}
|
|
7283
|
-
}
|
|
7284
|
-
}
|
|
7285
|
-
.data-\[variant\=destructive\]\:focus\:text-error-foreground {
|
|
7286
|
-
&[data-variant="destructive"] {
|
|
7287
|
-
&:is(:focus-visible, [data-state="focus"]) {
|
|
7288
|
-
color: var(--color-error-foreground);
|
|
7289
|
-
}
|
|
7290
|
-
}
|
|
7291
|
-
}
|
|
7292
7214
|
.data-\[visible\=false\]\:hidden {
|
|
7293
7215
|
&[data-visible="false"] {
|
|
7294
7216
|
display: none;
|
|
@@ -8225,11 +8147,6 @@
|
|
|
8225
8147
|
height: calc(var(--spacing) * 5);
|
|
8226
8148
|
}
|
|
8227
8149
|
}
|
|
8228
|
-
.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground {
|
|
8229
|
-
& svg:not([class*='text-']) {
|
|
8230
|
-
color: var(--color-muted-foreground);
|
|
8231
|
-
}
|
|
8232
|
-
}
|
|
8233
8150
|
.\[\&_svg\[data-loader\]\]\:size-3\.5 {
|
|
8234
8151
|
& svg[data-loader] {
|
|
8235
8152
|
width: calc(var(--spacing) * 3.5);
|
|
@@ -8416,15 +8333,6 @@
|
|
|
8416
8333
|
}
|
|
8417
8334
|
}
|
|
8418
8335
|
}
|
|
8419
|
-
.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-error-foreground\! {
|
|
8420
|
-
&[data-variant="destructive"] {
|
|
8421
|
-
:is(& > *) {
|
|
8422
|
-
&:is(svg) {
|
|
8423
|
-
color: var(--color-error-foreground) !important;
|
|
8424
|
-
}
|
|
8425
|
-
}
|
|
8426
|
-
}
|
|
8427
|
-
}
|
|
8428
8336
|
.\[\&\>\*\]\:pointer-events-auto {
|
|
8429
8337
|
&>* {
|
|
8430
8338
|
pointer-events: auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNodeRouter.d.ts","sourceRoot":"","sources":["../../src/graph/createNodeRouter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"createNodeRouter.d.ts","sourceRoot":"","sources":["../../src/graph/createNodeRouter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAiD3C,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,gBAAgB,CAAC;IAC7C,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;IAC/E,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,GAAG,KAAK,UAAU,GAAG,SAAS,CAAC;CACnF,CAAC;AAuEF,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,GAAG,CAA0D,CAAC;AAK5G,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,GAAG,CASjD,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,GAAG,CAAuD,CAAC;AAgB1G,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,uBAAuB,GAAG,UAAU,CAqB1E"}
|
|
@@ -13,6 +13,7 @@ import { BrandAssetAnalysisView } from "./nodes/BrandAssetAnalysisView.js";
|
|
|
13
13
|
import { BrandFacetCheckView } from "./nodes/BrandFacetCheckView.js";
|
|
14
14
|
import { BrandFacetRuleView } from "./nodes/BrandFacetRuleView.js";
|
|
15
15
|
import { BrandFitVerdictView } from "./nodes/BrandFitVerdictView.js";
|
|
16
|
+
import { BrandFontFamilyView } from "./nodes/BrandFontFamilyView.js";
|
|
16
17
|
import { BrandGuidelinesView } from "./nodes/BrandGuidelinesView.js";
|
|
17
18
|
import { BrandPaletteColorView } from "./nodes/BrandPaletteColorView.js";
|
|
18
19
|
import { CoresignalCompanyView } from "./nodes/CoresignalCompanyView.js";
|
|
@@ -99,6 +100,7 @@ const typedNodeEntries = [
|
|
|
99
100
|
[brand.BrandGuidelines, BrandGuidelinesView],
|
|
100
101
|
[brand.BrandFacetRule, BrandFacetRuleView],
|
|
101
102
|
[brand.BrandFitVerdict, BrandFitVerdictView],
|
|
103
|
+
[brand.FontFamily, BrandFontFamilyView],
|
|
102
104
|
[brand.FacetCheck, BrandFacetCheckView],
|
|
103
105
|
[brand.PaletteColor, BrandPaletteColorView],
|
|
104
106
|
];
|
|
@@ -113,6 +115,7 @@ export const diffSubsumingViewIris = new Set([
|
|
|
113
115
|
brand.BrandFacetRule,
|
|
114
116
|
brand.BrandFitVerdict,
|
|
115
117
|
brand.FacetCheck,
|
|
118
|
+
brand.FontFamily,
|
|
116
119
|
brand.PaletteColor,
|
|
117
120
|
]);
|
|
118
121
|
export const typedActionShapeIris = new Set(actionShapeNodeEntries.map(([iri]) => iri));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrandFacetRuleView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/BrandFacetRuleView.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"BrandFacetRuleView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/BrandFacetRuleView.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,eAAO,MAAM,kBAAkB,uDA+B7B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { namespaces } from "@manta-eu/rdf-lib/namespaces";
|
|
3
3
|
import { SlidersHorizontal } from "lucide-react";
|
|
4
4
|
import { memo } from "react";
|
|
@@ -6,9 +6,11 @@ import { BrandNodeBody, BrandStatusBadge } from "./brand-shared.js";
|
|
|
6
6
|
import { EntityCardShell } from "./EntityCardShell.js";
|
|
7
7
|
import { NodePropertyTable } from "./NodePropertyTable.js";
|
|
8
8
|
import { readBrandString } from "./typed-node-helpers.js";
|
|
9
|
-
const
|
|
9
|
+
const severityPredicate = `${namespaces.brand}severity`;
|
|
10
|
+
const entryStatusPredicate = `${namespaces.brand}entryStatus`;
|
|
10
11
|
export const BrandFacetRuleView = memo(function BrandFacetRuleView(props) {
|
|
11
12
|
const { data, selected = false, ringColor, onContextMenu } = props;
|
|
12
|
-
const
|
|
13
|
-
|
|
13
|
+
const severity = readBrandString(data.jsonLd, "severity");
|
|
14
|
+
const proposedEntryStatus = readBrandString(data.jsonLd, "entryStatus");
|
|
15
|
+
return (_jsx(EntityCardShell, { icon: SlidersHorizontal, label: `Facet Rule: ${data.label}`, labelMaxWidth: "max-w-140", selected: selected, ringColor: ringColor, onContextMenu: onContextMenu, children: _jsx(BrandNodeBody, { right: _jsxs("span", { className: "flex items-center gap-1.25", children: [_jsx(BrandStatusBadge, { status: proposedEntryStatus }), _jsx(BrandStatusBadge, { status: severity })] }), children: _jsx(NodePropertyTable, { properties: data.properties, jsonLd: data.jsonLd, omitPredicates: [severityPredicate, entryStatusPredicate] }) }) }));
|
|
14
16
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandFontFamilyView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/BrandFontFamilyView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAiEhD,eAAO,MAAM,mBAAmB,uDA6C9B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BrandFontFileSchema } from "@manta-eu/ldo";
|
|
3
|
+
import { redirectPath } from "@manta-eu/ldo/redirect-queries";
|
|
4
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
5
|
+
import { namespaces } from "@manta-eu/rdf-lib/namespaces";
|
|
6
|
+
import { Type } from "lucide-react";
|
|
7
|
+
import { memo, useId } from "react";
|
|
8
|
+
import { fontFaceDescriptors, preferredFontFile, specimenWeight, } from "./brand-font.js";
|
|
9
|
+
import { BrandNodeBody, BrandStatusBadge } from "./brand-shared.js";
|
|
10
|
+
import { BrandFontUploadButton } from "./BrandFontUploadButton.js";
|
|
11
|
+
import { EntityCardShell } from "./EntityCardShell.js";
|
|
12
|
+
import { NodePropertyTable } from "./NodePropertyTable.js";
|
|
13
|
+
import { readBrandString, toIriArray } from "./typed-node-helpers.js";
|
|
14
|
+
import { useEntitiesByIris } from "#hooks/use-entity";
|
|
15
|
+
import { useFontFace } from "#hooks/use-font-face";
|
|
16
|
+
import { useRedirectEndpoint } from "#hooks/use-redirect-endpoint";
|
|
17
|
+
const statusPredicate = `${namespaces.brand}entryStatus`;
|
|
18
|
+
const availabilityPredicate = `${namespaces.brand}fontAvailability`;
|
|
19
|
+
const fontFilePredicate = `${namespaces.brand}fontFile`;
|
|
20
|
+
const specimenText = "Aa Bb Cc Qq Rr 0123456789 — The quick brown fox jumps over the lazy dog";
|
|
21
|
+
function useStoredFontFiles(iris) {
|
|
22
|
+
const { data } = useEntitiesByIris({ schema: BrandFontFileSchema, iris });
|
|
23
|
+
return (data ?? []).flatMap((file) => file
|
|
24
|
+
? [
|
|
25
|
+
{
|
|
26
|
+
contentUrl: file.contentUrl,
|
|
27
|
+
source: file.fontSource,
|
|
28
|
+
style: file.fontStyle,
|
|
29
|
+
weightMin: file.fontWeightMin,
|
|
30
|
+
weightMax: file.fontWeightMax,
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
: []);
|
|
34
|
+
}
|
|
35
|
+
function FontSpecimen(props) {
|
|
36
|
+
const { file } = props;
|
|
37
|
+
const family = `brand-specimen-${useId().replace(/\W/g, "")}`;
|
|
38
|
+
const state = useFontFace(family, redirectPath(file.contentUrl, useRedirectEndpoint()), fontFaceDescriptors(file));
|
|
39
|
+
if (state === "failed") {
|
|
40
|
+
return _jsx("span", { className: "typography-tiny text-muted-foreground", children: "The font file could not be loaded." });
|
|
41
|
+
}
|
|
42
|
+
return (_jsx("p", { className: "typography-large-body text-default-foreground break-words", style: {
|
|
43
|
+
fontFamily: `"${family}", system-ui`,
|
|
44
|
+
fontWeight: specimenWeight(file),
|
|
45
|
+
visibility: state === "loaded" ? "visible" : "hidden",
|
|
46
|
+
}, children: specimenText }));
|
|
47
|
+
}
|
|
48
|
+
export const BrandFontFamilyView = memo(function BrandFontFamilyView(props) {
|
|
49
|
+
const { data, selected = false, ringColor, onContextMenu } = props;
|
|
50
|
+
const family = readBrandString(data.jsonLd, "family") ?? data.label;
|
|
51
|
+
const status = readBrandString(data.jsonLd, "entryStatus");
|
|
52
|
+
const availability = readBrandString(data.jsonLd, "fontAvailability");
|
|
53
|
+
const fileIris = toIriArray(data.jsonLd[fontFilePredicate] ?? data.jsonLd["brand:fontFile"]);
|
|
54
|
+
const file = preferredFontFile(useStoredFontFiles(fileIris));
|
|
55
|
+
return (_jsx(EntityCardShell, { icon: Type, label: `Font Family: ${family}`, labelMaxWidth: "max-w-140", selected: selected, ringColor: ringColor, onContextMenu: onContextMenu, children: _jsxs(BrandNodeBody, { right: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(BrandStatusBadge, { status: availability }), _jsx(BrandStatusBadge, { status: status })] }), children: [isPresent(file) && _jsx(FontSpecimen, { file: file }), isPresent(availability) && availability !== "available" && (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [availability === "needs-upload" && (_jsx("span", { className: "typography-tiny text-muted-foreground", children: "No font file found for this family." })), _jsx(BrandFontUploadButton, { family: family })] })), _jsx(NodePropertyTable, { properties: data.properties, jsonLd: data.jsonLd, omitPredicates: [statusPredicate, availabilityPredicate] })] }) }));
|
|
56
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandFontUploadButton.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/BrandFontUploadButton.tsx"],"names":[],"mappings":"AAmDA,KAAK,0BAA0B,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAsCtE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useAbortUploadMutation, useCompleteUploadMutation, useExecuteAgentActionAdditionMutation, useInitiateUploadMutation, } from "@manta-eu/client";
|
|
3
|
+
import { namespaces } from "@manta-eu/rdf-lib/namespaces";
|
|
4
|
+
import { Upload } from "lucide-react";
|
|
5
|
+
import { use, useRef, useState } from "react";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
import { Button } from "#components/button/index";
|
|
8
|
+
import { buildActionDocument, mintSubjectIri } from "#lib/action-document";
|
|
9
|
+
import { uploadFile } from "#lib/upload-client";
|
|
10
|
+
import { MantaClientProviderContext } from "#providers/manta-client-context";
|
|
11
|
+
const acceptedFontFiles = ".woff2,.woff,.ttf,.otf";
|
|
12
|
+
const attachFontFile = `${namespaces.brand}AttachFontFile`;
|
|
13
|
+
const attachFontFileShape = `${namespaces.brand}AttachFontFileShape`;
|
|
14
|
+
function ignoreProgress() { }
|
|
15
|
+
// Graph views sit below the provider barrels, so this reads the client context directly instead of useExecuteAction.
|
|
16
|
+
function useAttachFontFile(family) {
|
|
17
|
+
const mantaClient = use(MantaClientProviderContext)?.mantaClient;
|
|
18
|
+
if (!mantaClient)
|
|
19
|
+
throw new Error("BrandFontUploadButton must be used within a MantaClientProvider");
|
|
20
|
+
const { mutateAsync: initiateUpload } = useInitiateUploadMutation(mantaClient);
|
|
21
|
+
const { mutateAsync: completeUpload } = useCompleteUploadMutation(mantaClient);
|
|
22
|
+
const { mutateAsync: abortUpload } = useAbortUploadMutation(mantaClient);
|
|
23
|
+
const { mutateAsync: startAddition } = useExecuteAgentActionAdditionMutation(mantaClient);
|
|
24
|
+
return async (file) => {
|
|
25
|
+
const { fileIri } = await uploadFile({
|
|
26
|
+
file,
|
|
27
|
+
onFileProgress: ignoreProgress,
|
|
28
|
+
initiateUpload,
|
|
29
|
+
completeUpload,
|
|
30
|
+
abortUpload,
|
|
31
|
+
});
|
|
32
|
+
const subjectIri = mintSubjectIri(attachFontFile);
|
|
33
|
+
const properties = buildActionDocument({ subjectIri, rdfType: attachFontFile }, { [`${namespaces.brand}fontFamily`]: family, [`${namespaces.brand}fontFile`]: { "@id": fileIri } });
|
|
34
|
+
const { executeActionAddition } = await startAddition({
|
|
35
|
+
input: { subjectIri, rdfType: attachFontFile, actionShape: attachFontFileShape, properties },
|
|
36
|
+
});
|
|
37
|
+
if (!executeActionAddition.success)
|
|
38
|
+
throw new Error(executeActionAddition.error ?? "The font was not attached");
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function BrandFontUploadButton(props) {
|
|
42
|
+
const { family } = props;
|
|
43
|
+
const input = useRef(null);
|
|
44
|
+
const [isAttaching, setIsAttaching] = useState(false);
|
|
45
|
+
const attach = useAttachFontFile(family);
|
|
46
|
+
async function attachChosen(file) {
|
|
47
|
+
setIsAttaching(true);
|
|
48
|
+
try {
|
|
49
|
+
await attach(file);
|
|
50
|
+
toast.success(`${file.name} is being attached to ${family}`);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
toast.error(error instanceof Error ? error.message : `Could not attach ${file.name}`);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
setIsAttaching(false);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsx("input", { ref: input, type: "file", accept: acceptedFontFiles, className: "hidden", onChange: (event) => {
|
|
60
|
+
const file = event.target.files?.[0];
|
|
61
|
+
event.target.value = "";
|
|
62
|
+
if (file)
|
|
63
|
+
void attachChosen(file);
|
|
64
|
+
} }), _jsxs(Button, { variant: "secondary", size: "sm", disabled: isAttaching, onClick: () => input.current?.click(), children: [_jsx(Upload, { size: 12 }), "Upload font"] })] }));
|
|
65
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrandGuidelinesView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/BrandGuidelinesView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BrandGuidelinesView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/BrandGuidelinesView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,eAAO,MAAM,mBAAmB,uDAiB9B,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { namespaces } from "@manta-eu/rdf-lib/namespaces";
|
|
3
2
|
import { BookMarked } from "lucide-react";
|
|
4
3
|
import { memo } from "react";
|
|
5
|
-
import { BrandNodeBody
|
|
4
|
+
import { BrandNodeBody } from "./brand-shared.js";
|
|
6
5
|
import { EntityCardShell } from "./EntityCardShell.js";
|
|
7
6
|
import { NodePropertyTable } from "./NodePropertyTable.js";
|
|
8
|
-
import { readBrandString } from "./typed-node-helpers.js";
|
|
9
|
-
const statusPredicate = `${namespaces.brand}guidelineStatus`;
|
|
10
7
|
export const BrandGuidelinesView = memo(function BrandGuidelinesView(props) {
|
|
11
8
|
const { data, selected = false, ringColor, onContextMenu } = props;
|
|
12
|
-
|
|
13
|
-
return (_jsx(EntityCardShell, { icon: BookMarked, label: `Brand Guidelines: ${data.label}`, labelMaxWidth: "max-w-140", selected: selected, ringColor: ringColor, onContextMenu: onContextMenu, children: _jsx(BrandNodeBody, { right: _jsx(BrandStatusBadge, { status: status }), children: _jsx(NodePropertyTable, { properties: data.properties, jsonLd: data.jsonLd, omitPredicates: [statusPredicate] }) }) }));
|
|
9
|
+
return (_jsx(EntityCardShell, { icon: BookMarked, label: `Brand Guidelines: ${data.label}`, labelMaxWidth: "max-w-140", selected: selected, ringColor: ringColor, onContextMenu: onContextMenu, children: _jsx(BrandNodeBody, { children: _jsx(NodePropertyTable, { properties: data.properties, jsonLd: data.jsonLd }) }) }));
|
|
14
10
|
});
|
|
@@ -6,7 +6,7 @@ import { memo } from "react";
|
|
|
6
6
|
import { OpenInPlatformLink } from "../OpenInPlatformLink.js";
|
|
7
7
|
import { EntityCardShell } from "./EntityCardShell.js";
|
|
8
8
|
import { formatBidStrategy, formatDate, formatNetworksSummary, getChannelDescriptor, googleRed, statusColors, } from "./google-campaign-utils.js";
|
|
9
|
-
import { readEntityIri,
|
|
9
|
+
import { readEntityIri, readSchemaOrgString } from "./typed-node-helpers.js";
|
|
10
10
|
import { useEntity } from "#hooks/use-entity";
|
|
11
11
|
import { formatRelativeUpdated } from "#lib/format-date";
|
|
12
12
|
function row(Icon, text) {
|
|
@@ -19,7 +19,7 @@ export const GoogleCampaignView = memo(function GoogleCampaignView(props) {
|
|
|
19
19
|
const { data, selected = false, ringColor, onContextMenu } = props;
|
|
20
20
|
const iri = readEntityIri(data.jsonLd);
|
|
21
21
|
const { data: typed } = useEntity({ schema: GoogleCampaignCardSchema, iri });
|
|
22
|
-
const currency =
|
|
22
|
+
const currency = readSchemaOrgString(data.jsonLd, "currency");
|
|
23
23
|
const statusKey = typed?.campaignStatus?.toString().toLowerCase() ?? "";
|
|
24
24
|
const statusColor = statusColors[statusKey] ?? "#6b7280";
|
|
25
25
|
const servingStatus = typed?.campaignServingStatus?.toString();
|