Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/components/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* ObjectUI
* Copyright (c) 2024-present ObjectStack Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

// CSS Module declarations
declare module '*.css' {
const content: Record<string, string>;
export default content;
}

// Process environment for React components
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'development' | 'production' | 'test';
}
}

// Global process for browser environments
declare const process: {
env: {
NODE_ENV: string;
};
};
33 changes: 20 additions & 13 deletions packages/components/src/ui/chart.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/data-objectstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"README.md"
],
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts",
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
"build": "tsup",
"dev": "tsup --watch",
"clean": "rm -rf dist",
"type-check": "tsc --noEmit",
"test": "vitest run",
Expand Down
11 changes: 9 additions & 2 deletions packages/data-objectstack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"composite": true,
"declaration": true,
"noEmit": false
},
"include": ["src"]
"include": ["src/**/*"],
"references": [
{ "path": "../types" },
{ "path": "../core" }
]
}
26 changes: 26 additions & 0 deletions packages/data-objectstack/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* ObjectUI
* Copyright (c) 2024-present ObjectStack Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: {
compilerOptions: {
// Override composite to false for DTS generation
composite: false,
// Don't follow references during DTS build
skipLibCheck: true,
},
},
clean: true,
sourcemap: false,
skipNodeModulesBundle: true,
external: ['@object-ui/types', '@object-ui/core', '@objectstack/client'],
});
2 changes: 1 addition & 1 deletion packages/plugin-chatbot/src/useObjectChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export function useObjectChat(options: UseObjectChatOptions = {}): UseObjectChat
} : undefined,
maxToolRoundtrips: isApiMode ? maxToolRoundtrips : undefined,
onError: isApiMode ? (err: Error) => { onError?.(err); } : undefined,
});
} as any);

// --- Local/legacy mode state ---
const [localMessages, setLocalMessages] = useState<OuiChatMessage[]>(
Expand Down
5 changes: 5 additions & 0 deletions packages/plugin-dashboard/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// CSS Module declarations
declare module '*.css' {
const content: Record<string, string>;
export default content;
}
2 changes: 1 addition & 1 deletion packages/plugin-kanban/src/ObjectKanban.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const ObjectKanban: React.FC<ObjectKanbanProps> = ({
loading: externalLoading,
onRowClick,
onCardClick,
...props
..._props
}) => {
// When a parent (e.g. ListView) pre-fetches data and passes it via the `data` prop,
// we must not trigger a second fetch. Detect external data by checking if externalData
Expand Down
34 changes: 17 additions & 17 deletions packages/plugin-list/src/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
const [showSort, setShowSort] = React.useState(false);
const [currentSort, setCurrentSort] = React.useState<SortItem[]>(() => {
if (schema.sort && schema.sort.length > 0) {
return schema.sort.map(s => {
return schema.sort.map((s: any) => {
// Support legacy string format "field desc"
if (typeof s === 'string') {
const parts = s.trim().split(/\s+/);
Expand Down Expand Up @@ -376,7 +376,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
// Tab State
const [activeTab, setActiveTab] = React.useState<string | undefined>(() => {
if (!schema.tabs || schema.tabs.length === 0) return undefined;
const defaultTab = schema.tabs.find(t => t.isDefault);
const defaultTab = schema.tabs.find((t: any) => t.isDefault);
return defaultTab?.name ?? schema.tabs[0]?.name;
});

Expand Down Expand Up @@ -420,7 +420,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
// subscribing to dataSource mutations to avoid double refreshes.
React.useEffect(() => {
if (!dataSource?.onMutation || !schema.objectName || schema.refreshTrigger) return;
const unsub = dataSource.onMutation((event) => {
const unsub = dataSource.onMutation((event: any) => {
if (event.resource === schema.objectName) {
setRefreshKey(k => k + 1);
}
Expand Down Expand Up @@ -449,7 +449,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
// Quick Filters State
const [activeQuickFilters, setActiveQuickFilters] = React.useState<Set<string>>(() => {
const defaults = new Set<string>();
schema.quickFilters?.forEach(qf => {
schema.quickFilters?.forEach((qf: any) => {
const normalized = normalizeQuickFilter(qf);
if (normalized.defaultActive) defaults.add(normalized.id);
});
Expand Down Expand Up @@ -724,7 +724,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
const availableViews = React.useMemo(() => {
// If appearance.allowedVisualizations is set, use it as whitelist
if (schema.appearance?.allowedVisualizations && schema.appearance.allowedVisualizations.length > 0) {
return schema.appearance.allowedVisualizations.filter(v =>
return schema.appearance.allowedVisualizations.filter((v: any) =>
['grid', 'kanban', 'gallery', 'calendar', 'timeline', 'gantt', 'map'].includes(v)
) as ViewType[];
}
Expand Down Expand Up @@ -833,12 +833,12 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({

// Apply field order
if (schema.fieldOrder && schema.fieldOrder.length > 0) {
const orderMap = new Map(schema.fieldOrder.map((f, i) => [f, i]));
const orderMap = new Map(schema.fieldOrder.map((f: any, i: number) => [f, i]));
fields = [...fields].sort((a: any, b: any) => {
const nameA = typeof a === 'string' ? a : (a?.name || a?.fieldName || a?.field);
const nameB = typeof b === 'string' ? b : (b?.name || b?.fieldName || b?.field);
const orderA = orderMap.get(nameA) ?? Infinity;
const orderB = orderMap.get(nameB) ?? Infinity;
const orderA: number = orderMap.get(nameA) ?? Infinity;
const orderB: number = orderMap.get(nameB) ?? Infinity;
return orderA - orderB;
});
}
Expand Down Expand Up @@ -1176,7 +1176,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
)}
</div>
<div className="max-h-60 overflow-y-auto space-y-1">
{allFields.map(field => (
{allFields.map((field: any) => (
<label key={field.name} className="flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer">
<input
type="checkbox"
Expand Down Expand Up @@ -1279,16 +1279,16 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
)}
</div>
<div className="max-h-60 overflow-y-auto space-y-1" data-testid="group-field-list">
{allFields.map(field => {
const isGrouped = groupingConfig?.fields?.some(f => f.field === field.name);
{allFields.map((field: any) => {
const isGrouped = groupingConfig?.fields?.some((f: any) => f.field === field.name);
return (
<label key={field.name} className="flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer">
<input
type="checkbox"
checked={!!isGrouped}
onChange={() => {
if (isGrouped) {
const newFields = (groupingConfig?.fields || []).filter(f => f.field !== field.name);
const newFields = (groupingConfig?.fields || []).filter((f: any) => f.field !== field.name);
setGroupingConfig(newFields.length > 0 ? { fields: newFields } : undefined);
} else {
const existing = groupingConfig?.fields || [];
Expand Down Expand Up @@ -1393,7 +1393,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
data-testid="color-field-select"
>
<option value="">{t('list.none')}</option>
{allFields.map(field => (
{allFields.map((field: any) => (
<option key={field.name} value={field.name}>{field.label}</option>
))}
</select>
Expand Down Expand Up @@ -1440,7 +1440,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
</PopoverTrigger>
<PopoverContent align="start" className="w-48 p-2">
<div className="space-y-1">
{(resolvedExportOptions.formats || ['csv', 'json']).map(format => (
{(resolvedExportOptions.formats || ['csv', 'json']).map((format: any) => (
<Button
key={format}
variant="ghost"
Expand Down Expand Up @@ -1587,7 +1587,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
const iconName = schema.emptyState?.icon;
const ResolvedIcon: LucideIcon = iconName
? ((icons as Record<string, LucideIcon>)[
iconName.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join('')
iconName.split('-').map((w: any) => w.charAt(0).toUpperCase() + w.slice(1)).join('')
] ?? Inbox)
: Inbox;
return (
Expand Down Expand Up @@ -1637,7 +1637,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
>
<span className="text-muted-foreground font-medium">{selectedRows.length} selected</span>
<div className="flex items-center gap-1 ml-2">
{schema.bulkActions.map(action => (
{schema.bulkActions.map((action: any) => (
<Button
key={action}
variant="outline"
Expand Down Expand Up @@ -1684,7 +1684,7 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
}}
data-testid="page-size-selector"
>
{schema.pagination.pageSizeOptions.map(size => (
{schema.pagination.pageSizeOptions.map((size: any) => (
<option key={size} value={size}>{size} / page</option>
))}
</select>
Expand Down
5 changes: 5 additions & 0 deletions packages/plugin-map/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// CSS Module declarations
declare module '*.css' {
const content: Record<string, string>;
export default content;
}
13 changes: 13 additions & 0 deletions packages/plugin-report/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Process environment for React components
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'development' | 'production' | 'test';
}
}

// Global process for browser environments
declare const process: {
env: {
NODE_ENV: string;
};
};
13 changes: 13 additions & 0 deletions packages/plugin-view/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Process environment for React components
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'development' | 'production' | 'test';
}
}

// Global process for browser environments
declare const process: {
env: {
NODE_ENV: string;
};
};
Loading