@burdenoff/microfe-movethewheels 2026.1117.1 → 2026.1123.2
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/dist/MoveTheWheelsRoot.js +149 -133
- package/dist/MoveTheWheelsRoutes.js +157 -139
- package/dist/components/EntityConversationsCard.js +145 -0
- package/dist/components/maps/MapCanvas.js +4 -3
- package/dist/events/rybbit.js +87 -0
- package/dist/generated/tracking-quality-operations.d.ts +342 -0
- package/dist/hooks/useEntityComments.js +111 -0
- package/dist/hooks/useFleet.js +394 -311
- package/dist/hooks/useInventory.js +378 -313
- package/dist/hooks/useMultiModalShipments.js +58 -53
- package/dist/hooks/useOrders.js +178 -158
- package/dist/hooks/useRoutes.js +146 -130
- package/dist/index.js +35 -34
- package/dist/movethewheels/components/EntityConversationsCard.d.ts +8 -0
- package/dist/movethewheels/events/rybbit.d.ts +27 -0
- package/dist/movethewheels/hooks/useEntityComments.d.ts +26 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +73 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +19 -0
- package/dist/movethewheels/index.d.ts +1 -0
- package/dist/movethewheels/pages/DocumentsLibraryPage.d.ts +1 -0
- package/dist/movethewheels/pages/NotificationsCenterPage.d.ts +1 -0
- package/dist/movethewheels/types/index.d.ts +95 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +10 -0
- package/dist/pages/DocumentsLibraryPage.js +235 -0
- package/dist/pages/DriverDetailsPage.js +625 -351
- package/dist/pages/NotificationsCenterPage.js +310 -0
- package/dist/pages/OrderDetailsPage.js +48 -42
- package/dist/pages/RouteDetailsPage.js +257 -251
- package/dist/pages/TrackingPage.js +202 -196
- package/dist/pages/VehicleDetailsPage.js +616 -314
- package/dist/pages/WarehouseDetailsPage.js +539 -253
- package/dist/stories/ControlTowerWidgets.stories.d.ts +10 -0
- package/dist/stories/DataTable.stories.d.ts +15 -0
- package/dist/stories/FleetCards.stories.d.ts +9 -0
- package/dist/stories/OrderForms.stories.d.ts +8 -0
- package/dist/stories/RouteMap.stories.d.ts +7 -0
- package/dist/stories/ShipmentTimeline.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +407 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +16 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +17 -2
- package/src/movethewheels/components/EntityConversationsCard.tsx +143 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +3 -3
- package/src/movethewheels/events/__tests__/rybbit.test.ts +98 -0
- package/src/movethewheels/events/rybbit.ts +191 -0
- package/src/movethewheels/hooks/useEntityComments.ts +258 -0
- package/src/movethewheels/hooks/useFleet.ts +300 -5
- package/src/movethewheels/hooks/useInventory.ts +231 -3
- package/src/movethewheels/hooks/useMultiModalShipments.ts +8 -1
- package/src/movethewheels/hooks/useOrders.ts +19 -3
- package/src/movethewheels/hooks/useRoutes.ts +14 -2
- package/src/movethewheels/index.ts +1 -0
- package/src/movethewheels/pages/DocumentsLibraryPage.tsx +229 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +250 -1
- package/src/movethewheels/pages/NotificationsCenterPage.tsx +331 -0
- package/src/movethewheels/pages/OrderDetailsPage.tsx +8 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +6 -0
- package/src/movethewheels/pages/TrackingPage.tsx +8 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +255 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +266 -2
- package/src/movethewheels/types/index.ts +103 -2
- package/src/stories/ControlTowerWidgets.stories.tsx +150 -0
- package/src/stories/DataTable.stories.tsx +94 -0
- package/src/stories/FleetCards.stories.tsx +77 -0
- package/src/stories/OrderForms.stories.tsx +84 -0
- package/src/stories/RouteMap.stories.tsx +43 -0
- package/src/stories/ShipmentTimeline.stories.tsx +128 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
2
|
+
import { executeGraphQL as t } from "../utils/graphqlClient.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
|
+
// src/movethewheels/hooks/useEntityComments.ts
|
|
5
|
+
var o = "\n query GetMtwEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n items {\n id\n entityType\n entityId\n content {\n text\n markdown\n }\n authorId\n status\n isPinned\n parentCommentId\n replyCount\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n", s = "\n mutation CreateMtwEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) {\n id\n entityType\n entityId\n content {\n text\n markdown\n }\n authorId\n status\n isPinned\n parentCommentId\n replyCount\n createdAt\n updatedAt\n }\n }\n", c = "\n mutation ResolveMtwEntityComment($input: ResolveCommentInput!) {\n resolveEntityComment(input: $input) {\n id\n status\n updatedAt\n }\n }\n", l = "\n mutation DeleteMtwEntityComment($input: DeleteCommentInput!) {\n deleteEntityComment(input: $input)\n }\n";
|
|
6
|
+
function u(e) {
|
|
7
|
+
return {
|
|
8
|
+
id: e.id,
|
|
9
|
+
entityType: e.entityType,
|
|
10
|
+
entityId: e.entityId,
|
|
11
|
+
text: e.content?.text ?? e.content?.markdown ?? "",
|
|
12
|
+
authorId: e.authorId,
|
|
13
|
+
status: e.status,
|
|
14
|
+
isPinned: e.isPinned,
|
|
15
|
+
parentCommentId: e.parentCommentId ?? null,
|
|
16
|
+
replyCount: e.replyCount,
|
|
17
|
+
createdAt: new Date(e.createdAt),
|
|
18
|
+
updatedAt: new Date(e.updatedAt)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function d(d, f) {
|
|
22
|
+
let { apiGatewayUrl: p, authToken: m, workspaceToken: h, workspaceId: g, tenantId: _, currentUser: v } = e(), [y, b] = a([]), [x, S] = a(0), [C, w] = a(!1), [T, E] = a(!1), [D, O] = a(null), k = i(() => ({
|
|
23
|
+
apiGatewayUrl: p,
|
|
24
|
+
authToken: m,
|
|
25
|
+
workspaceToken: h,
|
|
26
|
+
workspaceId: g,
|
|
27
|
+
tenantId: _,
|
|
28
|
+
actorId: v?.id
|
|
29
|
+
}), [
|
|
30
|
+
p,
|
|
31
|
+
m,
|
|
32
|
+
h,
|
|
33
|
+
g,
|
|
34
|
+
_,
|
|
35
|
+
v?.id
|
|
36
|
+
]), A = n(async () => {
|
|
37
|
+
if (!f) b([]), S(0);
|
|
38
|
+
else {
|
|
39
|
+
w(!0), O(null);
|
|
40
|
+
try {
|
|
41
|
+
let e = await t(k, o, { input: {
|
|
42
|
+
entityType: d,
|
|
43
|
+
entityId: f,
|
|
44
|
+
take: 50,
|
|
45
|
+
skip: 0
|
|
46
|
+
} });
|
|
47
|
+
b((e.getEntityComments?.items ?? []).map(u)), S(e.getEntityComments?.total ?? 0);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
O(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load conversation thread")), b([]);
|
|
50
|
+
} finally {
|
|
51
|
+
w(!1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, [
|
|
55
|
+
f,
|
|
56
|
+
d,
|
|
57
|
+
k
|
|
58
|
+
]);
|
|
59
|
+
return r(() => {
|
|
60
|
+
A();
|
|
61
|
+
}, [A]), {
|
|
62
|
+
comments: y,
|
|
63
|
+
total: x,
|
|
64
|
+
isLoading: C,
|
|
65
|
+
isSubmitting: T,
|
|
66
|
+
error: D,
|
|
67
|
+
refetch: A,
|
|
68
|
+
addComment: n(async (e, n) => {
|
|
69
|
+
let r = e.trim();
|
|
70
|
+
if (!f || !r) return null;
|
|
71
|
+
E(!0), O(null);
|
|
72
|
+
try {
|
|
73
|
+
let e = u((await t(k, s, { input: {
|
|
74
|
+
entityType: d,
|
|
75
|
+
entityId: f,
|
|
76
|
+
content: { text: r },
|
|
77
|
+
...n ? { parentCommentId: n } : {}
|
|
78
|
+
} })).createEntityComment);
|
|
79
|
+
return b((t) => [...t, e]), S((e) => e + 1), e;
|
|
80
|
+
} catch (e) {
|
|
81
|
+
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to post comment");
|
|
82
|
+
throw O(t), t;
|
|
83
|
+
} finally {
|
|
84
|
+
E(!1);
|
|
85
|
+
}
|
|
86
|
+
}, [
|
|
87
|
+
f,
|
|
88
|
+
d,
|
|
89
|
+
k
|
|
90
|
+
]),
|
|
91
|
+
toggleResolve: n(async (e, n) => {
|
|
92
|
+
let r = await t(k, c, { input: {
|
|
93
|
+
id: e,
|
|
94
|
+
resolved: n
|
|
95
|
+
} });
|
|
96
|
+
b((t) => t.map((t) => t.id === e ? {
|
|
97
|
+
...t,
|
|
98
|
+
status: r.resolveEntityComment.status,
|
|
99
|
+
updatedAt: new Date(r.resolveEntityComment.updatedAt)
|
|
100
|
+
} : t));
|
|
101
|
+
}, [k]),
|
|
102
|
+
deleteComment: n(async (e) => {
|
|
103
|
+
await t(k, l, { input: {
|
|
104
|
+
id: e,
|
|
105
|
+
soft: !0
|
|
106
|
+
} }), b((t) => t.filter((t) => t.id !== e)), S((e) => Math.max(0, e - 1));
|
|
107
|
+
}, [k]),
|
|
108
|
+
currentUserId: v?.id
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export { d as useEntityComments };
|