@aaqu/fromcubes-portal-react 0.1.0-alpha.3 → 0.1.0-alpha.30

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,18 +1,20 @@
1
1
  {
2
2
  "name": "@aaqu/fromcubes-portal-react",
3
- "version": "0.1.0-alpha.3",
4
- "description": "Fromcubes Portal - React for Node-RED",
3
+ "version": "0.1.0-alpha.30",
4
+ "description": "Fromcubes Portal - React for Node-RED with Tailwind CSS and auto complete",
5
+ "type": "commonjs",
5
6
  "keywords": [
6
7
  "node-red",
7
- "react",
8
8
  "dashboard",
9
9
  "portal",
10
10
  "jsx",
11
+ "react",
11
12
  "tailwind",
12
13
  "websocket",
13
14
  "fromcubes"
14
15
  ],
15
16
  "node-red": {
17
+ "version": ">=4.0.0",
16
18
  "nodes": {
17
19
  "portal-react": "nodes/portal-react.js"
18
20
  }
@@ -20,27 +22,55 @@
20
22
  "files": [
21
23
  "nodes/",
22
24
  "examples/",
23
- "scripts/",
24
25
  "README.md",
26
+ "AI-GUIDE.md",
25
27
  "LICENSE"
26
28
  ],
27
29
  "engines": {
28
- "node": ">=18"
30
+ "node": ">=18.5"
29
31
  },
30
32
  "dependencies": {
31
- "esbuild": "0.25.0",
33
+ "esbuild": "^0.28.1",
32
34
  "monaco-editor": "^0.55.1",
33
- "tailwindcss": "^4.0.0"
35
+ "react": "^19.2.5",
36
+ "react-dom": "^19.2.5",
37
+ "tailwindcss": "^4.2.4"
38
+ },
39
+ "peerDependencies": {
40
+ "ws": "^8.21.0"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "ws": {
44
+ "optional": false
45
+ }
34
46
  },
35
47
  "devDependencies": {
36
- "prettier": "^3.8.1",
37
- "react": "^19.0.0",
38
- "react-dom": "^19.0.0"
48
+ "jsdoc": "^4.0.5",
49
+ "jsdoc-plugin-typescript": "^3.2.1",
50
+ "node-red": "5.0.0",
51
+ "node-red-node-test-helper": "^0.3.4",
52
+ "prettier": "^3.8.3",
53
+ "supertest": "^7.2.2",
54
+ "vitest": "^4.1.6",
55
+ "ws": "^8.21.0"
56
+ },
57
+ "overrides": {
58
+ "dompurify": "3.4.11"
39
59
  },
40
60
  "scripts": {
41
- "build": "node scripts/bundle-react.js",
42
- "start": "node-red"
61
+ "start": "node-red",
62
+ "test": "vitest run",
63
+ "test:watch": "vitest",
64
+ "docs": "jsdoc -c jsdoc.json"
65
+ },
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "git+https://github.com/Aaqu/fromcubes-portal-react.git"
69
+ },
70
+ "bugs": {
71
+ "url": "https://github.com/Aaqu/fromcubes-portal-react/issues"
43
72
  },
73
+ "homepage": "https://github.com/Aaqu/fromcubes-portal-react#readme",
44
74
  "license": "Apache-2.0",
45
75
  "author": "aaqu",
46
76
  "publishConfig": {
@@ -1,71 +0,0 @@
1
- [
2
- {
3
- "id": "fc-demo-flow",
4
- "type": "tab",
5
- "label": "Portal React Demo",
6
- "disabled": false
7
- },
8
- {
9
- "id": "fc-inject",
10
- "type": "inject",
11
- "z": "fc-demo-flow",
12
- "name": "Sensor tick",
13
- "props": [{ "p": "payload" }],
14
- "repeat": "2",
15
- "payload": "{}",
16
- "payloadType": "json",
17
- "x": 160,
18
- "y": 160,
19
- "wires": [["fc-rand"]]
20
- },
21
- {
22
- "id": "fc-rand",
23
- "type": "function",
24
- "z": "fc-demo-flow",
25
- "name": "Random sensors",
26
- "func": "msg.payload = {\n temp: +(18 + Math.random() * 12).toFixed(1),\n humidity: Math.round(35 + Math.random() * 40),\n pressure: Math.round(995 + Math.random() * 35),\n ts: Date.now()\n};\nreturn msg;",
27
- "outputs": 1,
28
- "x": 360,
29
- "y": 160,
30
- "wires": [["fc-portal"]]
31
- },
32
- {
33
- "id": "fc-gauge-comp",
34
- "type": "fc-portal-component",
35
- "z": "fc-demo-flow",
36
- "name": "Gauge",
37
- "compName": "Gauge",
38
- "compCode": "function Gauge({ value = 0, min = 0, max = 100, label = '', unit = '' }) {\n const pct = Math.min(100, Math.max(0, ((value - min) / (max - min)) * 100));\n const color = pct > 80 ? 'text-red-400' : pct > 50 ? 'text-amber-400' : 'text-green-400';\n const bg = pct > 80 ? 'from-red-500' : pct > 50 ? 'from-amber-500' : 'from-green-500';\n return (\n <div className=\"flex flex-col items-center p-4\">\n <div className=\"text-xs text-zinc-500 uppercase tracking-wider mb-2\">{label}</div>\n <div className=\"relative w-28 h-28 rounded-full bg-zinc-900 flex items-center justify-center\">\n <svg className=\"absolute inset-0 w-full h-full -rotate-90\" viewBox=\"0 0 100 100\">\n <circle cx=\"50\" cy=\"50\" r=\"42\" fill=\"none\" strokeWidth=\"6\" className=\"stroke-zinc-800\" />\n <circle cx=\"50\" cy=\"50\" r=\"42\" fill=\"none\" strokeWidth=\"6\"\n className={`stroke-current ${color}`}\n strokeDasharray={`${pct * 2.64} 264`}\n strokeLinecap=\"round\" />\n </svg>\n <div className={`text-2xl font-bold ${color}`}>\n {Math.round(value)}<span className=\"text-sm ml-0.5\">{unit}</span>\n </div>\n </div>\n </div>\n );\n}",
39
- "compInputs": "value,min,max,label,unit",
40
- "compOutputs": "",
41
- "x": 160,
42
- "y": 280,
43
- "wires": []
44
- },
45
- {
46
- "id": "fc-portal",
47
- "type": "portal-react",
48
- "z": "fc-demo-flow",
49
- "name": "Sensor Portal",
50
- "endpoint": "/sensors",
51
- "pageTitle": "Sensors",
52
- "customHead": "",
53
- "inputSchema": "[{\"name\":\"temp\",\"type\":\"number\"},{\"name\":\"humidity\",\"type\":\"number\"},{\"name\":\"pressure\",\"type\":\"number\"},{\"name\":\"ts\",\"type\":\"number\"}]",
54
- "outputSchema": "[{\"name\":\"action\",\"type\":\"string\"}]",
55
- "componentCode": "function App() {\n const { data, send } = useNodeRed();\n const s = data || { temp: 0, humidity: 0, pressure: 0 };\n\n return (\n <div className=\"min-h-screen bg-zinc-950 p-8 max-w-3xl mx-auto\">\n <h1 className=\"text-2xl font-light text-cyan-400 mb-6\">Sensor Portal</h1>\n <div className=\"flex gap-6 flex-wrap\">\n <Gauge value={s.temp} min={-10} max={50} label=\"Temperature\" unit=\"°C\" />\n <Gauge value={s.humidity} min={0} max={100} label=\"Humidity\" unit=\"%\" />\n <Gauge value={s.pressure} min={950} max={1050} label=\"Pressure\" unit=\"hPa\" />\n </div>\n <div className=\"mt-6 flex gap-3 items-center\">\n <button\n className=\"px-4 py-2 rounded-lg bg-blue-600 text-white hover:bg-blue-500 transition-colors\"\n onClick={() => send({ action: 'refresh' })}\n >Refresh</button>\n {s.ts && <span className=\"text-zinc-600 text-xs\">Last: {new Date(s.ts).toLocaleTimeString()}</span>}\n </div>\n </div>\n );\n}",
56
- "x": 560,
57
- "y": 160,
58
- "wires": [["fc-debug"]]
59
- },
60
- {
61
- "id": "fc-debug",
62
- "type": "debug",
63
- "z": "fc-demo-flow",
64
- "name": "Portal output",
65
- "active": true,
66
- "tosidebar": true,
67
- "x": 750,
68
- "y": 160,
69
- "wires": []
70
- }
71
- ]