@wecode-team/we0-cms 1.0.37 → 1.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wecode-team/we0-cms",
3
- "version": "1.0.37",
3
+ "version": "1.1.10",
4
4
  "description": "A CMS component for React applications with shadcn/ui",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -20,7 +20,7 @@
20
20
  "README.md"
21
21
  ],
22
22
  "scripts": {
23
- "build": "rollup -c --bundleConfigAsCjs",
23
+ "build": "rollup -c --bundleConfigAsCjs && node -e \"try { require('fs').unlinkSync('dist/request.d.ts'); } catch(e) {}\"",
24
24
  "prepublishOnly": "npm run build",
25
25
  "publish:public": "npm run build && NPM_CONFIG_USERCONFIG=$(node -e \"process.stdout.write(require('fs').existsSync('.npmrc.public.local') ? '.npmrc.public.local' : '.npmrc.public')\") npm publish --access public --ignore-scripts",
26
26
  "publish:private": "npm run build && NPM_CONFIG_USERCONFIG=$(node -e \"process.stdout.write(require('fs').existsSync('.npmrc.private.local') ? '.npmrc.private.local' : '.npmrc.private')\") npm publish --access public --ignore-scripts",
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { Layout } from 'react-grid-layout';
3
- import 'react-grid-layout/css/styles.css';
4
- import 'react-resizable/css/styles.css';
5
- import { Dashboard } from './types';
6
- interface DashboardContainerProps {
7
- dashboard: Dashboard;
8
- onLayoutChange?: (layout: Layout[]) => void;
9
- }
10
- export declare function DashboardContainer({ dashboard, onLayoutChange }: DashboardContainerProps): React.JSX.Element;
11
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { WidgetConfig } from './types';
3
- interface WidgetRendererProps {
4
- widgetConfig: WidgetConfig;
5
- }
6
- export declare function WidgetRenderer({ widgetConfig }: WidgetRendererProps): React.JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { WidgetConfig } from '../types';
3
- interface BarChartWidgetProps {
4
- config: WidgetConfig;
5
- }
6
- export declare function BarChartWidget({ config }: BarChartWidgetProps): React.JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { WidgetConfig } from '../types';
3
- interface LineChartWidgetProps {
4
- config: WidgetConfig;
5
- }
6
- export declare function LineChartWidget({ config }: LineChartWidgetProps): React.JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { WidgetConfig } from '../types';
3
- interface PieChartWidgetProps {
4
- config: WidgetConfig;
5
- }
6
- export declare function PieChartWidget({ config }: PieChartWidgetProps): React.JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { WidgetConfig } from '../types';
3
- interface StatCardWidgetProps {
4
- config: WidgetConfig;
5
- }
6
- export declare function StatCardWidget({ config }: StatCardWidgetProps): React.JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { WidgetConfig } from '../types';
3
- interface TableWidgetProps {
4
- config: WidgetConfig;
5
- }
6
- export declare function TableWidget({ config }: TableWidgetProps): React.JSX.Element;
7
- export {};
@@ -1,8 +0,0 @@
1
- import { DataSourceConfig } from '../types';
2
- interface UseWidgetDataResult {
3
- data: any[];
4
- loading: boolean;
5
- error: Error | null;
6
- }
7
- export declare function useWidgetData(dataSource: DataSourceConfig, enableMock?: boolean): UseWidgetDataResult;
8
- export {};
@@ -1,6 +0,0 @@
1
- import { DataSourceConfig } from './types';
2
- export declare class MockDataService {
3
- static getAggregateData(table: string, config: DataSourceConfig): Promise<any[]>;
4
- static getTableData(table: string, config: DataSourceConfig): Promise<any[]>;
5
- static getTimeSeriesData(table: string, config: DataSourceConfig): Promise<any[]>;
6
- }
@@ -1,61 +0,0 @@
1
- export interface Dashboard {
2
- id: number | string;
3
- name: string;
4
- description?: string;
5
- layout_config: {
6
- columns: number;
7
- rowHeight: number;
8
- gap: number;
9
- };
10
- widgets: WidgetConfig[];
11
- is_public?: boolean;
12
- created_at?: string;
13
- updated_at?: string;
14
- }
15
- export type WidgetType = 'stat-card' | 'line-chart' | 'bar-chart' | 'pie-chart' | 'area-chart' | 'table';
16
- export interface WidgetConfig {
17
- id: string;
18
- type: WidgetType;
19
- title: string;
20
- position: {
21
- x: number;
22
- y: number;
23
- w: number;
24
- h: number;
25
- };
26
- dataSource: DataSourceConfig;
27
- chartConfig?: ChartConfig;
28
- refreshInterval?: number;
29
- }
30
- export interface DataSourceConfig {
31
- table: string;
32
- aggregation?: {
33
- type: 'count' | 'sum' | 'avg' | 'max' | 'min';
34
- field?: string;
35
- groupBy?: string | string[];
36
- timeUnit?: 'day' | 'week' | 'month' | 'year';
37
- };
38
- filters?: Array<{
39
- column: string;
40
- operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'in' | 'is';
41
- value: any;
42
- }>;
43
- dateRange?: {
44
- field: string;
45
- start: string;
46
- end: string;
47
- };
48
- limit?: number;
49
- orderBy?: {
50
- field: string;
51
- direction: 'asc' | 'desc';
52
- };
53
- }
54
- export interface ChartConfig {
55
- xAxis?: string;
56
- yAxis?: string | string[];
57
- colors?: string[];
58
- showLegend?: boolean;
59
- showGrid?: boolean;
60
- previousValue?: number;
61
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * 导出 Dashboard 为图片
3
- */
4
- export declare function exportDashboardAsImage(elementId: string, filename?: string): Promise<void>;
5
- /**
6
- * 导出 Dashboard 为 PDF
7
- */
8
- export declare function exportDashboardAsPDF(elementId: string, filename?: string, title?: string): Promise<void>;
9
- /**
10
- * 导出单个 Widget 为图片
11
- */
12
- export declare function exportWidgetAsImage(element: HTMLElement, filename?: string): Promise<void>;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import { CmsModel } from "./types";
3
- interface CmsLayoutProps {
4
- inputModels: {
5
- models: CmsModel[];
6
- };
7
- }
8
- export default function CmsLayout({ inputModels }: CmsLayoutProps): React.JSX.Element;
9
- export {};
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export default function DashboardPage(): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export default function WelcomePage(): React.JSX.Element;
package/dist/request.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * CMS Request 网络请求工具
3
- * 专用于CMS系统的独立请求实例
4
- * 基于 axios 封装
5
- */
6
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
7
- declare const request: {
8
- get: (url: string, params?: any, config?: AxiosRequestConfig) => Promise<any>;
9
- post: (url: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
10
- put: (url: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
11
- delete: (url: string, config?: AxiosRequestConfig) => Promise<any>;
12
- instance: AxiosInstance;
13
- };
14
- export default request;