@rotorjs/jpl-react 0.1.0 → 0.3.0

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.
@@ -1,3 +1,3 @@
1
1
  import { JPLDashboardLayoutNode } from '@rotorjs/jpl';
2
2
  import { PropsWithChildren } from 'react';
3
- export declare function JPLLayout({ src, children, }: PropsWithChildren<JPLDashboardLayoutNode>): import("react/jsx-runtime").JSX.Element | null;
3
+ export declare function JPLLayout({ type, src, vars, initial, children, }: PropsWithChildren<JPLDashboardLayoutNode>): import("react/jsx-runtime").JSX.Element | null;
package/dist/JPLTile.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { JPLDashboardTileNode } from '@rotorjs/jpl';
2
- export declare function JPLTile({ src }: JPLDashboardTileNode): import("react/jsx-runtime").JSX.Element;
2
+ export declare function JPLTile({ type, src, vars, initial }: JPLDashboardTileNode): import("react/jsx-runtime").JSX.Element;
package/dist/main.js CHANGED
@@ -2,31 +2,43 @@ import { DashboardLayout as e, DashboardLayoutError as t, DashboardTiles as n, u
2
2
  import { useMemo as i } from "react";
3
3
  import { jsx as a } from "react/jsx-runtime";
4
4
  //#region lib/JPLLayout.tsx
5
- var o = [];
6
- function s({ src: n, children: s }) {
7
- let c = r(i(() => ({
8
- src: n ?? "",
9
- initialState: o
10
- }), [n]), o);
11
- if (!c.length) return null;
12
- if (c.length > 1) return /* @__PURE__ */ a(t, { error: "State reducer returned more than one layout node" });
13
- let [l] = c;
5
+ function o({ type: n, src: o, vars: s, initial: c, children: l }) {
6
+ let u = r(i(() => ({
7
+ type: n,
8
+ params: {
9
+ src: o,
10
+ vars: s
11
+ }
12
+ }), [
13
+ n,
14
+ o,
15
+ s
16
+ ]), c ? [c] : []);
17
+ if (!u.length) return null;
18
+ if (u.length > 1) return /* @__PURE__ */ a(t, { error: "State reducer returned more than one layout node" });
19
+ let [d] = u;
14
20
  return /* @__PURE__ */ a(e, {
15
- layout: l,
16
- children: s
21
+ layout: d,
22
+ children: l
17
23
  });
18
24
  }
19
25
  //#endregion
20
26
  //#region lib/JPLTile.tsx
21
- var c = [];
22
- function l({ src: e }) {
27
+ function s({ type: e, src: t, vars: o, initial: s }) {
23
28
  return /* @__PURE__ */ a(n, { content: r(i(() => ({
24
- src: e ?? "",
25
- initialState: c
26
- }), [e]), c) });
29
+ type: e,
30
+ params: {
31
+ src: t,
32
+ vars: o
33
+ }
34
+ }), [
35
+ e,
36
+ t,
37
+ o
38
+ ]), s) });
27
39
  }
28
40
  //#endregion
29
41
  //#region lib/nodes.ts
30
- var u = { script: s }, d = { script: l };
42
+ var c = { script: o }, l = { script: s };
31
43
  //#endregion
32
- export { s as JPLLayout, l as JPLTile, u as jplLayouts, d as jplTiles };
44
+ export { o as JPLLayout, s as JPLTile, c as jplLayouts, l as jplTiles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rotorjs/jpl-react",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Rotor",
5
5
  "author": {
6
6
  "name": "Aaron Burmeister"
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@eslint/js": "^10.0.1",
48
- "@rotorjs/dashboards": "^0.13.3",
49
- "@rotorjs/jpl": "^0.3.2",
50
- "@rotorjs/react": "^0.4.2",
48
+ "@rotorjs/dashboard": "^0.2.0",
49
+ "@rotorjs/jpl": "^0.5.0",
50
+ "@rotorjs/react": "^0.8.0",
51
51
  "@types/react": "^19.1.12",
52
52
  "@types/react-dom": "^19.1.9",
53
- "@vitejs/plugin-react": "^6.0.1",
54
- "eslint": "^10.3.0",
53
+ "@vitejs/plugin-react": "^6.0.2",
54
+ "eslint": "^10.4.0",
55
55
  "eslint-config-prettier": "^10.1.8",
56
56
  "eslint-import-resolver-typescript": "^4.4.4",
57
57
  "eslint-plugin-import-x": "^4.16.2",
@@ -63,14 +63,14 @@
63
63
  "react": "^19.2.6",
64
64
  "react-dom": "^19.2.6",
65
65
  "typescript": "^6.0.3",
66
- "typescript-eslint": "^8.59.3",
67
- "unplugin-dts": "^1.0.0",
68
- "vite": "^8.0.12"
66
+ "typescript-eslint": "^8.59.4",
67
+ "unplugin-dts": "^1.0.1",
68
+ "vite": "^8.0.13"
69
69
  },
70
70
  "peerDependencies": {
71
- "@rotorjs/dashboards": "^0.13.3",
72
- "@rotorjs/jpl": "^0.3.2",
73
- "@rotorjs/react": "^0.4.2",
71
+ "@rotorjs/dashboard": "^0.2.0",
72
+ "@rotorjs/jpl": "^0.5.0",
73
+ "@rotorjs/react": "^0.8.0",
74
74
  "react": "^19.0.0"
75
75
  }
76
76
  }