@yoyomq/ije-react 0.1.3 → 0.1.4
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 +26 -16
- package/dist/AggregateStat.d.ts +2 -2
- package/dist/AggregateStat.js +1 -1
- package/dist/BarChart.d.ts +2 -2
- package/dist/BarChart.js +1 -1
- package/dist/Chat.d.ts +2 -2
- package/dist/Chat.js +1 -1
- package/dist/DeviceTrackerView.d.ts +14 -0
- package/dist/DeviceTrackerView.js +5 -0
- package/dist/MapTracker.d.ts +2 -2
- package/dist/MapTracker.js +1 -1
- package/dist/TelemetryChart.d.ts +2 -2
- package/dist/TelemetryChart.js +1 -1
- package/dist/TelemetryStat.d.ts +2 -2
- package/dist/TelemetryStat.js +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">First-class React components for the Ije SDK by <strong>Yoyo</strong>.</p>
|
|
8
8
|
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="https://raw.githubusercontent.com/Yoyo-MQ/ije/main/assets/screenshots/tracker.gif" alt="Live device tracking" width="100%" />
|
|
11
|
+
</p>
|
|
12
|
+
|
|
9
13
|
---
|
|
10
14
|
|
|
11
15
|
## Get your API key
|
|
@@ -27,13 +31,13 @@ React 16.8+ is required as a peer dependency.
|
|
|
27
31
|
Wrap your app (or the relevant subtree) with `IjeProvider`, then drop in any component:
|
|
28
32
|
|
|
29
33
|
```tsx
|
|
30
|
-
import { IjeProvider,
|
|
34
|
+
import { IjeProvider, IjeDeviceTrackerView, IjeTelemetryStat } from '@yoyomq/ije-react';
|
|
31
35
|
|
|
32
36
|
export default function App() {
|
|
33
37
|
return (
|
|
34
38
|
<IjeProvider config={{ apiKey: 'YOUR_YOYO_API_KEY' }}>
|
|
35
|
-
<
|
|
36
|
-
<
|
|
39
|
+
<IjeDeviceTrackerView deviceId={1001} title="Vehicle Location" />
|
|
40
|
+
<IjeTelemetryStat deviceId={1001} metric="speed" title="Speed" unit="km/h" />
|
|
37
41
|
</IjeProvider>
|
|
38
42
|
);
|
|
39
43
|
}
|
|
@@ -45,7 +49,7 @@ All components include `'use client'` — no extra setup needed. Place `IjeProvi
|
|
|
45
49
|
|
|
46
50
|
```tsx
|
|
47
51
|
// app/dashboard/layout.tsx
|
|
48
|
-
import { IjeProvider } from '@yoyomq/ije-react';
|
|
52
|
+
import { IjeProvider, IjeDeviceTrackerView } from '@yoyomq/ije-react';
|
|
49
53
|
|
|
50
54
|
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
|
|
51
55
|
return (
|
|
@@ -58,12 +62,14 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
|
|
|
58
62
|
|
|
59
63
|
## Components
|
|
60
64
|
|
|
61
|
-
### `<
|
|
65
|
+
### `<IjeDeviceTrackerView>`
|
|
62
66
|
|
|
63
67
|
Live map showing a device's current position and movement trail. Click the position marker to open an info bubble with speed, heading, altitude, coordinates, and timestamp. Optionally enables historical trip replay mode.
|
|
64
68
|
|
|
69
|
+
<img src="https://raw.githubusercontent.com/Yoyo-MQ/ije/main/assets/screenshots/tracker.png" alt="IjeDeviceTrackerView" width="100%" />
|
|
70
|
+
|
|
65
71
|
```tsx
|
|
66
|
-
<
|
|
72
|
+
<IjeDeviceTrackerView
|
|
67
73
|
deviceId={1001}
|
|
68
74
|
title="Vehicle Location"
|
|
69
75
|
width="100%"
|
|
@@ -84,12 +90,14 @@ Live map showing a device's current position and movement trail. Click the posit
|
|
|
84
90
|
| `startsAt` | `number` | Trip start Unix timestamp in seconds (trip-picker mode) |
|
|
85
91
|
| `endsAt` | `number` | Trip end Unix timestamp in seconds (trip-picker mode) |
|
|
86
92
|
|
|
87
|
-
### `<
|
|
93
|
+
### `<IjeTelemetryStat>`
|
|
88
94
|
|
|
89
95
|
Single live telemetry value (speed, fuel, temperature, etc.).
|
|
90
96
|
|
|
97
|
+
<img src="https://raw.githubusercontent.com/Yoyo-MQ/ije/main/assets/screenshots/stats.png" alt="IjeTelemetryStat" width="100%" />
|
|
98
|
+
|
|
91
99
|
```tsx
|
|
92
|
-
<
|
|
100
|
+
<IjeTelemetryStat deviceId={1001} metric="speed" title="Speed" unit="km/h" />
|
|
93
101
|
```
|
|
94
102
|
|
|
95
103
|
| Prop | Type | Description |
|
|
@@ -100,12 +108,14 @@ Single live telemetry value (speed, fuel, temperature, etc.).
|
|
|
100
108
|
| `unit` | `string` | Unit label (e.g. `km/h`, `°C`) |
|
|
101
109
|
| `helpMessage` | `string` | Tooltip shown on hover |
|
|
102
110
|
|
|
103
|
-
### `<
|
|
111
|
+
### `<IjeTelemetryChart>`
|
|
104
112
|
|
|
105
113
|
Live time-series chart for a telemetry metric.
|
|
106
114
|
|
|
115
|
+
<img src="https://raw.githubusercontent.com/Yoyo-MQ/ije/main/assets/screenshots/chart.png" alt="IjeTelemetryChart" width="100%" />
|
|
116
|
+
|
|
107
117
|
```tsx
|
|
108
|
-
<
|
|
118
|
+
<IjeTelemetryChart deviceId={1001} metric="speed" title="Speed over time" height="200px" />
|
|
109
119
|
```
|
|
110
120
|
|
|
111
121
|
| Prop | Type | Description |
|
|
@@ -117,7 +127,7 @@ Live time-series chart for a telemetry metric.
|
|
|
117
127
|
| `width` | `string` | CSS width |
|
|
118
128
|
| `height` | `string` | CSS height |
|
|
119
129
|
|
|
120
|
-
### `<
|
|
130
|
+
### `<IjeAggregateStat>`
|
|
121
131
|
|
|
122
132
|
Displays a set of aggregate metrics (totals, averages, counts) passed in as data.
|
|
123
133
|
|
|
@@ -131,7 +141,7 @@ const data: AggregateData = {
|
|
|
131
141
|
],
|
|
132
142
|
};
|
|
133
143
|
|
|
134
|
-
<
|
|
144
|
+
<IjeAggregateStat data={data} />
|
|
135
145
|
```
|
|
136
146
|
|
|
137
147
|
| Prop | Type | Description |
|
|
@@ -139,7 +149,7 @@ const data: AggregateData = {
|
|
|
139
149
|
| `data` | `AggregateData` | Metrics to display |
|
|
140
150
|
| `loading` | `boolean` | Show loading skeleton |
|
|
141
151
|
|
|
142
|
-
### `<
|
|
152
|
+
### `<IjeBarChart>`
|
|
143
153
|
|
|
144
154
|
Horizontal bar chart for comparing values across categories.
|
|
145
155
|
|
|
@@ -151,7 +161,7 @@ const data: BarChartData[] = [
|
|
|
151
161
|
{ label: 'Tue', value: 95 },
|
|
152
162
|
];
|
|
153
163
|
|
|
154
|
-
<
|
|
164
|
+
<IjeBarChart data={data} height="200px" />
|
|
155
165
|
```
|
|
156
166
|
|
|
157
167
|
| Prop | Type | Description |
|
|
@@ -160,12 +170,12 @@ const data: BarChartData[] = [
|
|
|
160
170
|
| `loading` | `boolean` | Show loading skeleton |
|
|
161
171
|
| `height` | `string` | CSS height |
|
|
162
172
|
|
|
163
|
-
### `<
|
|
173
|
+
### `<IjeChat>`
|
|
164
174
|
|
|
165
175
|
AI-powered fleet assistant chat widget.
|
|
166
176
|
|
|
167
177
|
```tsx
|
|
168
|
-
<
|
|
178
|
+
<IjeChat title="Fleet Assistant" placeholder="Ask about your fleet…" />
|
|
169
179
|
```
|
|
170
180
|
|
|
171
181
|
| Prop | Type | Description |
|
package/dist/AggregateStat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AggregateData } from '@yoyomq/ije-ui';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IjeAggregateStatProps {
|
|
3
3
|
data?: AggregateData;
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function IjeAggregateStat({ data, loading }: IjeAggregateStatProps): import("react").JSX.Element;
|
package/dist/AggregateStat.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
|
-
export function
|
|
4
|
+
export function IjeAggregateStat({ data, loading }) {
|
|
5
5
|
const ref = useRef(null);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (ref.current && data !== undefined) {
|
package/dist/BarChart.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BarChartData } from '@yoyomq/ije-ui';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IjeBarChartProps {
|
|
3
3
|
data?: BarChartData[];
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
height?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function IjeBarChart({ data, loading, height }: IjeBarChartProps): import("react").JSX.Element;
|
package/dist/BarChart.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
|
-
export function
|
|
4
|
+
export function IjeBarChart({ data, loading, height }) {
|
|
5
5
|
const ref = useRef(null);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (ref.current && data !== undefined) {
|
package/dist/Chat.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IjeChatProps {
|
|
2
2
|
title?: string;
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
width?: string;
|
|
5
5
|
height?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function IjeChat({ title, placeholder, width, height }: IjeChatProps): import("react").JSX.Element;
|
package/dist/Chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
export function
|
|
3
|
+
export function IjeChat({ title, placeholder, width, height }) {
|
|
4
4
|
return (_jsx("ije-chat", { title: title, placeholder: placeholder, width: width, height: height }));
|
|
5
5
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IjeDeviceTrackerViewProps {
|
|
2
|
+
deviceId: number;
|
|
3
|
+
title?: string;
|
|
4
|
+
helpMessage?: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
height?: string;
|
|
7
|
+
/** Trip-picker mode: pass trigger-id + optional trigger-name to enable historical trip replay. */
|
|
8
|
+
tripPicker?: boolean;
|
|
9
|
+
triggerId?: number;
|
|
10
|
+
triggerName?: string;
|
|
11
|
+
startsAt?: number;
|
|
12
|
+
endsAt?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function IjeDeviceTrackerView({ deviceId, title, helpMessage, width, height, tripPicker, triggerId, triggerName, startsAt, endsAt, }: IjeDeviceTrackerViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export function IjeDeviceTrackerView({ deviceId, title, helpMessage, width, height, tripPicker, triggerId, triggerName, startsAt, endsAt, }) {
|
|
4
|
+
return (_jsx("ije-map-tracker", { "device-id": deviceId, title: title, "help-message": helpMessage, width: width, height: height, "trip-picker": tripPicker ? '' : undefined, "trigger-id": triggerId, "trigger-name": triggerName, "starts-at": startsAt, "ends-at": endsAt }));
|
|
5
|
+
}
|
package/dist/MapTracker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IjeDeviceTrackerViewProps {
|
|
2
2
|
deviceId: number;
|
|
3
3
|
title?: string;
|
|
4
4
|
helpMessage?: string;
|
|
@@ -11,4 +11,4 @@ export interface MapTrackerProps {
|
|
|
11
11
|
startsAt?: number;
|
|
12
12
|
endsAt?: number;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function IjeDeviceTrackerView({ deviceId, title, helpMessage, width, height, tripPicker, triggerId, triggerName, startsAt, endsAt, }: IjeDeviceTrackerViewProps): import("react").JSX.Element;
|
package/dist/MapTracker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
export function
|
|
3
|
+
export function IjeDeviceTrackerView({ deviceId, title, helpMessage, width, height, tripPicker, triggerId, triggerName, startsAt, endsAt, }) {
|
|
4
4
|
return (_jsx("ije-map-tracker", { "device-id": deviceId, title: title, "help-message": helpMessage, width: width, height: height, "trip-picker": tripPicker ? '' : undefined, "trigger-id": triggerId, "trigger-name": triggerName, "starts-at": startsAt, "ends-at": endsAt }));
|
|
5
5
|
}
|
package/dist/TelemetryChart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IjeTelemetryChartProps {
|
|
2
2
|
deviceId: number;
|
|
3
3
|
metric?: string;
|
|
4
4
|
title?: string;
|
|
@@ -6,4 +6,4 @@ export interface TelemetryChartProps {
|
|
|
6
6
|
width?: string;
|
|
7
7
|
height?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function IjeTelemetryChart({ deviceId, metric, title, helpMessage, width, height }: IjeTelemetryChartProps): import("react").JSX.Element;
|
package/dist/TelemetryChart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
export function
|
|
3
|
+
export function IjeTelemetryChart({ deviceId, metric, title, helpMessage, width, height }) {
|
|
4
4
|
return (_jsx("ije-telemetry-chart", { "device-id": deviceId, metric: metric, title: title, "help-message": helpMessage, width: width, height: height }));
|
|
5
5
|
}
|
package/dist/TelemetryStat.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IjeTelemetryStatProps {
|
|
2
2
|
deviceId: number;
|
|
3
3
|
metric: string;
|
|
4
4
|
title?: string;
|
|
5
5
|
unit?: string;
|
|
6
6
|
helpMessage?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function IjeTelemetryStat({ deviceId, metric, title, unit, helpMessage }: IjeTelemetryStatProps): import("react").JSX.Element;
|
package/dist/TelemetryStat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
export function
|
|
3
|
+
export function IjeTelemetryStat({ deviceId, metric, title, unit, helpMessage }) {
|
|
4
4
|
return (_jsx("ije-telemetry-stat", { "device-id": deviceId, metric: metric, title: title, unit: unit, "help-message": helpMessage }));
|
|
5
5
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { IjeProvider } from './Provider';
|
|
2
2
|
export type { IjeProviderProps } from './Provider';
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
7
|
-
export {
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
10
|
-
export type {
|
|
11
|
-
export {
|
|
12
|
-
export type {
|
|
13
|
-
export {
|
|
14
|
-
export type {
|
|
3
|
+
export { IjeDeviceTrackerView } from './DeviceTrackerView';
|
|
4
|
+
export type { IjeDeviceTrackerViewProps } from './DeviceTrackerView';
|
|
5
|
+
export { IjeTelemetryStat } from './TelemetryStat';
|
|
6
|
+
export type { IjeTelemetryStatProps } from './TelemetryStat';
|
|
7
|
+
export { IjeTelemetryChart } from './TelemetryChart';
|
|
8
|
+
export type { IjeTelemetryChartProps } from './TelemetryChart';
|
|
9
|
+
export { IjeChat } from './Chat';
|
|
10
|
+
export type { IjeChatProps } from './Chat';
|
|
11
|
+
export { IjeAggregateStat } from './AggregateStat';
|
|
12
|
+
export type { IjeAggregateStatProps } from './AggregateStat';
|
|
13
|
+
export { IjeBarChart } from './BarChart';
|
|
14
|
+
export type { IjeBarChartProps } from './BarChart';
|
|
15
15
|
export type { SdkConfig } from '@yoyomq/ije-core';
|
|
16
16
|
export type { AggregateData, AggregateMetric, BarChartData } from '@yoyomq/ije-ui';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { IjeProvider } from './Provider';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
2
|
+
export { IjeDeviceTrackerView } from './DeviceTrackerView';
|
|
3
|
+
export { IjeTelemetryStat } from './TelemetryStat';
|
|
4
|
+
export { IjeTelemetryChart } from './TelemetryChart';
|
|
5
|
+
export { IjeChat } from './Chat';
|
|
6
|
+
export { IjeAggregateStat } from './AggregateStat';
|
|
7
|
+
export { IjeBarChart } from './BarChart';
|