@burdenoff/microfe-theglobalfuel 2026.528.1 → 2026.704.1

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.
Files changed (209) hide show
  1. package/dist/dev/main.d.ts +2 -0
  2. package/dist/dev/main.d.ts.map +1 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +6 -4
  6. package/dist/node_modules/{clsx → .bun/clsx@2.1.1/node_modules/clsx}/dist/clsx.js +1 -1
  7. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  8. package/dist/node_modules/{tailwind-merge → .bun/tailwind-merge@3.5.0/node_modules/tailwind-merge}/dist/bundle-mjs.js +170 -212
  9. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  10. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +5 -0
  11. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -0
  12. package/dist/theglobalfuel/TheGlobalFuelRoot.js +109 -161
  13. package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
  14. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +4 -0
  15. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -0
  16. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +70 -85
  17. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  18. package/dist/theglobalfuel/components/DataTable.d.ts +28 -0
  19. package/dist/theglobalfuel/components/DataTable.d.ts.map +1 -0
  20. package/dist/theglobalfuel/components/DataTable.js +71 -0
  21. package/dist/theglobalfuel/components/DataTable.js.map +1 -0
  22. package/dist/theglobalfuel/components/EmptyState.d.ts +18 -0
  23. package/dist/theglobalfuel/components/EmptyState.d.ts.map +1 -0
  24. package/dist/theglobalfuel/components/EmptyState.js +35 -0
  25. package/dist/theglobalfuel/components/EmptyState.js.map +1 -0
  26. package/dist/theglobalfuel/components/EvidenceUpload.d.ts +14 -0
  27. package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +1 -0
  28. package/dist/theglobalfuel/components/EvidenceUpload.js +93 -0
  29. package/dist/theglobalfuel/components/EvidenceUpload.js.map +1 -0
  30. package/dist/theglobalfuel/components/FileLink.d.ts +15 -0
  31. package/dist/theglobalfuel/components/FileLink.d.ts.map +1 -0
  32. package/dist/theglobalfuel/components/FileLink.js +36 -0
  33. package/dist/theglobalfuel/components/FileLink.js.map +1 -0
  34. package/dist/theglobalfuel/components/FilterTabs.d.ts +18 -0
  35. package/dist/theglobalfuel/components/FilterTabs.d.ts.map +1 -0
  36. package/dist/theglobalfuel/components/FilterTabs.js +27 -0
  37. package/dist/theglobalfuel/components/FilterTabs.js.map +1 -0
  38. package/dist/theglobalfuel/components/MetricsCard.d.ts +23 -0
  39. package/dist/theglobalfuel/components/MetricsCard.d.ts.map +1 -0
  40. package/dist/theglobalfuel/components/MetricsCard.js +64 -0
  41. package/dist/theglobalfuel/components/MetricsCard.js.map +1 -0
  42. package/dist/theglobalfuel/components/MiniBar.d.ts +16 -0
  43. package/dist/theglobalfuel/components/MiniBar.d.ts.map +1 -0
  44. package/dist/theglobalfuel/components/MiniBar.js +22 -0
  45. package/dist/theglobalfuel/components/MiniBar.js.map +1 -0
  46. package/dist/theglobalfuel/components/PageLayout.d.ts +16 -0
  47. package/dist/theglobalfuel/components/PageLayout.d.ts.map +1 -0
  48. package/dist/theglobalfuel/components/PageLayout.js +38 -0
  49. package/dist/theglobalfuel/components/PageLayout.js.map +1 -0
  50. package/dist/theglobalfuel/components/Pagination.d.ts +22 -0
  51. package/dist/theglobalfuel/components/Pagination.d.ts.map +1 -0
  52. package/dist/theglobalfuel/components/Pagination.js +50 -0
  53. package/dist/theglobalfuel/components/Pagination.js.map +1 -0
  54. package/dist/theglobalfuel/components/StateViews.d.ts +24 -0
  55. package/dist/theglobalfuel/components/StateViews.d.ts.map +1 -0
  56. package/dist/theglobalfuel/components/StateViews.js +49 -0
  57. package/dist/theglobalfuel/components/StateViews.js.map +1 -0
  58. package/dist/theglobalfuel/components/StatusBadge.d.ts +9 -0
  59. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -0
  60. package/dist/theglobalfuel/components/StatusBadge.js +73 -0
  61. package/dist/theglobalfuel/components/StatusBadge.js.map +1 -0
  62. package/dist/theglobalfuel/components/Tabs.d.ts +17 -0
  63. package/dist/theglobalfuel/components/Tabs.d.ts.map +1 -0
  64. package/dist/theglobalfuel/components/Tabs.js +31 -0
  65. package/dist/theglobalfuel/components/Tabs.js.map +1 -0
  66. package/dist/theglobalfuel/components/TheDiscussion.d.ts +18 -0
  67. package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +1 -0
  68. package/dist/theglobalfuel/components/TheDiscussion.js +109 -0
  69. package/dist/theglobalfuel/components/TheDiscussion.js.map +1 -0
  70. package/dist/theglobalfuel/components/TheTags.d.ts +17 -0
  71. package/dist/theglobalfuel/components/TheTags.d.ts.map +1 -0
  72. package/dist/theglobalfuel/components/TheTags.js +149 -0
  73. package/dist/theglobalfuel/components/TheTags.js.map +1 -0
  74. package/dist/theglobalfuel/components/index.d.ts +19 -0
  75. package/dist/theglobalfuel/components/index.d.ts.map +1 -0
  76. package/dist/theglobalfuel/components/index.js +14 -0
  77. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +16 -0
  78. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +1 -0
  79. package/dist/theglobalfuel/context/TheGlobalFuelContext.js +85 -0
  80. package/dist/theglobalfuel/context/TheGlobalFuelContext.js.map +1 -0
  81. package/dist/theglobalfuel/context/index.d.ts +6 -0
  82. package/dist/theglobalfuel/context/index.d.ts.map +1 -0
  83. package/dist/theglobalfuel/context/index.js +1 -0
  84. package/dist/theglobalfuel/hooks/index.d.ts +10 -0
  85. package/dist/theglobalfuel/hooks/index.d.ts.map +1 -0
  86. package/dist/theglobalfuel/hooks/index.js +5 -0
  87. package/dist/theglobalfuel/hooks/useCursorPager.d.ts +33 -0
  88. package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +1 -0
  89. package/dist/theglobalfuel/hooks/useCursorPager.js +25 -0
  90. package/dist/theglobalfuel/hooks/useCursorPager.js.map +1 -0
  91. package/dist/theglobalfuel/hooks/useTheComments.d.ts +36 -0
  92. package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +1 -0
  93. package/dist/theglobalfuel/hooks/useTheComments.js +45 -0
  94. package/dist/theglobalfuel/hooks/useTheComments.js.map +1 -0
  95. package/dist/theglobalfuel/hooks/useTheFiles.d.ts +47 -0
  96. package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +1 -0
  97. package/dist/theglobalfuel/hooks/useTheFiles.js +81 -0
  98. package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -0
  99. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +75 -0
  100. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -0
  101. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +353 -0
  102. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -0
  103. package/dist/theglobalfuel/hooks/useTheTags.d.ts +44 -0
  104. package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +1 -0
  105. package/dist/theglobalfuel/hooks/useTheTags.js +89 -0
  106. package/dist/theglobalfuel/hooks/useTheTags.js.map +1 -0
  107. package/dist/theglobalfuel/index.d.ts +9 -0
  108. package/dist/theglobalfuel/index.d.ts.map +1 -0
  109. package/dist/theglobalfuel/index.js +5 -2
  110. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +13 -0
  111. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +1 -0
  112. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +869 -0
  113. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -0
  114. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +10 -0
  115. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +1 -0
  116. package/dist/theglobalfuel/pages/assets/AssetsPage.js +547 -0
  117. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -0
  118. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +11 -0
  119. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +1 -0
  120. package/dist/theglobalfuel/pages/compliance/CompliancePage.js +511 -0
  121. package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -0
  122. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +9 -0
  123. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +1 -0
  124. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +878 -0
  125. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -0
  126. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +8 -0
  127. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +1 -0
  128. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +588 -0
  129. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -0
  130. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +13 -0
  131. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +1 -0
  132. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +507 -0
  133. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -0
  134. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +12 -0
  135. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +1 -0
  136. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +479 -0
  137. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -0
  138. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +11 -0
  139. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +1 -0
  140. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +592 -0
  141. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -0
  142. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +11 -0
  143. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -0
  144. package/dist/theglobalfuel/pages/production/ProductionPage.js +421 -0
  145. package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -0
  146. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +10 -0
  147. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +1 -0
  148. package/dist/theglobalfuel/pages/reserves/ReservesPage.js +439 -0
  149. package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -0
  150. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +10 -0
  151. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +1 -0
  152. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +550 -0
  153. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -0
  154. package/dist/theglobalfuel/types/index.d.ts +376 -0
  155. package/dist/theglobalfuel/types/index.d.ts.map +1 -0
  156. package/dist/theglobalfuel/utils/cn.d.ts +4 -0
  157. package/dist/theglobalfuel/utils/cn.d.ts.map +1 -0
  158. package/dist/theglobalfuel/utils/cn.js +2 -2
  159. package/dist/theglobalfuel/utils/formatters.d.ts +36 -0
  160. package/dist/theglobalfuel/utils/formatters.d.ts.map +1 -0
  161. package/dist/theglobalfuel/utils/formatters.js +94 -0
  162. package/dist/theglobalfuel/utils/formatters.js.map +1 -0
  163. package/dist/theglobalfuel/utils/i18n.d.ts +6 -0
  164. package/dist/theglobalfuel/utils/i18n.d.ts.map +1 -0
  165. package/dist/theglobalfuel/utils/index.d.ts +9 -0
  166. package/dist/theglobalfuel/utils/index.d.ts.map +1 -0
  167. package/dist/theglobalfuel/utils/navigation.d.ts +14 -0
  168. package/dist/theglobalfuel/utils/navigation.d.ts.map +1 -0
  169. package/dist/theglobalfuel/utils/navigation.js +2 -1
  170. package/dist/theglobalfuel/utils/navigation.js.map +1 -1
  171. package/package.json +3 -3
  172. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  173. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  174. package/dist/theglobalfuel/pages/AiIntelligencePage.js +0 -190
  175. package/dist/theglobalfuel/pages/AiIntelligencePage.js.map +0 -1
  176. package/dist/theglobalfuel/pages/AnalyticsPage.js +0 -241
  177. package/dist/theglobalfuel/pages/AnalyticsPage.js.map +0 -1
  178. package/dist/theglobalfuel/pages/CompliancePage.js +0 -173
  179. package/dist/theglobalfuel/pages/CompliancePage.js.map +0 -1
  180. package/dist/theglobalfuel/pages/DashboardPage.js +0 -145
  181. package/dist/theglobalfuel/pages/DashboardPage.js.map +0 -1
  182. package/dist/theglobalfuel/pages/FinancialPage.js +0 -204
  183. package/dist/theglobalfuel/pages/FinancialPage.js.map +0 -1
  184. package/dist/theglobalfuel/pages/FleetManagementPage.js +0 -244
  185. package/dist/theglobalfuel/pages/FleetManagementPage.js.map +0 -1
  186. package/dist/theglobalfuel/pages/MarketplacePage.js +0 -260
  187. package/dist/theglobalfuel/pages/MarketplacePage.js.map +0 -1
  188. package/dist/theglobalfuel/pages/OperationsPage.js +0 -190
  189. package/dist/theglobalfuel/pages/OperationsPage.js.map +0 -1
  190. package/dist/theglobalfuel/pages/QualityControlPage.js +0 -215
  191. package/dist/theglobalfuel/pages/QualityControlPage.js.map +0 -1
  192. package/dist/theglobalfuel/pages/ReportsPage.js +0 -247
  193. package/dist/theglobalfuel/pages/ReportsPage.js.map +0 -1
  194. package/dist/theglobalfuel/pages/ResourcesPage.js +0 -225
  195. package/dist/theglobalfuel/pages/ResourcesPage.js.map +0 -1
  196. package/dist/theglobalfuel/pages/RiskManagementPage.js +0 -230
  197. package/dist/theglobalfuel/pages/RiskManagementPage.js.map +0 -1
  198. package/dist/theglobalfuel/pages/SupplyChainPage.js +0 -214
  199. package/dist/theglobalfuel/pages/SupplyChainPage.js.map +0 -1
  200. package/dist/theglobalfuel/pages/SustainabilityPage.js +0 -261
  201. package/dist/theglobalfuel/pages/SustainabilityPage.js.map +0 -1
  202. package/dist/theglobalfuel/pages/TrainingPage.js +0 -253
  203. package/dist/theglobalfuel/pages/TrainingPage.js.map +0 -1
  204. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js +0 -27
  205. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js.map +0 -1
  206. package/dist/theglobalfuel/store/theglobalfuelStore.js +0 -712
  207. package/dist/theglobalfuel/store/theglobalfuelStore.js.map +0 -1
  208. package/dist/theglobalfuel/utils/i18n.js +0 -15
  209. package/dist/theglobalfuel/utils/i18n.js.map +0 -1
@@ -0,0 +1,44 @@
1
+ /**
2
+ * TheGlobalFuel — wspace-tags-svc UniversalTag REUSE hooks (Integration C).
3
+ * @module theglobalfuel/hooks/useTheTags
4
+ *
5
+ * The theglobalfuel svc does NOT expose a tags field, so we drive the platform tag
6
+ * assignment store directly (approach (b) in the reuse audit) — no eco-svc
7
+ * change. All operations are composed into the WORKSPACE supergraph:
8
+ * - `getEntityTags(entityType, entityId)` → current assignments (display)
9
+ * - `searchTags(query)` → pick an existing tag
10
+ * - `createTag(input)` → create a new tag (needs a vocabulary)
11
+ * - `assignTag(input)` → link tag ↔ entity
12
+ * - `removeTagAssignment(id)` → unlink
13
+ *
14
+ * `createTag` requires a `vocabularyId`; we resolve a stable, workspace-scoped
15
+ * "theglobalfuel" vocabulary (`getVocabularyByKey`, creating it on first use).
16
+ *
17
+ * Transport reuses `wspaceFetch` from `useTheFiles`. Lives in a separate file;
18
+ * `useTheGlobalFuelApi.ts` is untouched.
19
+ */
20
+ export interface TheTag {
21
+ id: string;
22
+ label: string;
23
+ color: string | null;
24
+ key: string;
25
+ }
26
+ export interface TheTagAssignment {
27
+ id: string;
28
+ tag: TheTag;
29
+ }
30
+ /** Current tag assignments for an eco entity. */
31
+ export declare const useTheEntityTags: (entityType: string, entityId: string | undefined) => import('@tanstack/react-query').UseQueryResult<TheTagAssignment[], Error>;
32
+ /** Search existing tags (enabled only for a non-empty query). */
33
+ export declare const useTheTagSearch: (query: string) => import('@tanstack/react-query').UseQueryResult<TheTag[], Error>;
34
+ /** Assign an existing tag to the entity. */
35
+ export declare const useTheAssignTag: (entityType: string, entityId: string) => import('@tanstack/react-query').UseMutationResult<{
36
+ id: string;
37
+ }, Error, string, unknown>;
38
+ /** Remove a tag assignment by its assignment id. */
39
+ export declare const useTheRemoveTagAssignment: (entityType: string, entityId: string) => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
40
+ /** Create a new tag from a free-text label and assign it to the entity. */
41
+ export declare const useTheCreateAndAssignTag: (entityType: string, entityId: string) => import('@tanstack/react-query').UseMutationResult<{
42
+ id: string;
43
+ }, Error, string, unknown>;
44
+ //# sourceMappingURL=useTheTags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheTags.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/hooks/useTheTags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb;AAiBD,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,8EAmBhF,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,oEAiB5C,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM;QAKZ,MAAM;0BAW7D,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,yBAAyB,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM,uFAgB7E,CAAC;AA+BF,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM;QAalB,MAAM;0BAkBhE,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { useTheGlobalFuel as e } from "../context/TheGlobalFuelContext.js";
2
+ import "../context/index.js";
3
+ import { wspaceFetch as t } from "./useTheFiles.js";
4
+ import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
+ //#region src/theglobalfuel/hooks/useTheTags.ts
6
+ var a = "theglobalfuel", o = (e, t) => [
7
+ "theglobalfuel",
8
+ "entity-tags",
9
+ e,
10
+ t
11
+ ], s = "id label color key", c = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48) || "tag", l = (n, i) => {
12
+ let { apiGatewayUrl: a } = e();
13
+ return r({
14
+ queryKey: o(n, i ?? ""),
15
+ enabled: !!i,
16
+ queryFn: async () => (await t(`query TheGetEntityTags($entityType: String!, $entityId: ID!) {
17
+ getEntityTags(entityType: $entityType, entityId: $entityId) {
18
+ id
19
+ tag { ${s} }
20
+ }
21
+ }`, {
22
+ entityType: n,
23
+ entityId: i
24
+ }, a)).getEntityTags
25
+ });
26
+ }, u = (n) => {
27
+ let { apiGatewayUrl: i } = e(), a = n.trim();
28
+ return r({
29
+ queryKey: [
30
+ "theglobalfuel",
31
+ "tag-search",
32
+ a
33
+ ],
34
+ enabled: a.length > 0,
35
+ queryFn: async () => (await t(`query TheSearchTags($query: String!, $limit: Int) {
36
+ searchTags(query: $query, limit: $limit) { ${s} }
37
+ }`, {
38
+ query: a,
39
+ limit: 8
40
+ }, i)).searchTags
41
+ });
42
+ }, d = (r, a) => {
43
+ let { apiGatewayUrl: s } = e(), c = i();
44
+ return n({
45
+ mutationFn: async (e) => (await t("mutation TheAssignTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }", { input: {
46
+ entityType: r,
47
+ entityId: a,
48
+ tagId: e
49
+ } }, s)).assignTag,
50
+ onSuccess: () => c.invalidateQueries({ queryKey: o(r, a) })
51
+ });
52
+ }, f = (r, a) => {
53
+ let { apiGatewayUrl: s } = e(), c = i();
54
+ return n({
55
+ mutationFn: async (e) => (await t("mutation TheRemoveTagAssignment($id: ID!) {\n removeTagAssignment(id: $id)\n }", { id: e }, s)).removeTagAssignment,
56
+ onSuccess: () => c.invalidateQueries({ queryKey: o(r, a) })
57
+ });
58
+ }, p = async (e) => {
59
+ let n = await t("query TheGetVocabulary($key: String!) {\n getVocabularyByKey(key: $key) { id }\n }", { key: a }, e);
60
+ return n.getVocabularyByKey?.id ? n.getVocabularyByKey.id : (await t("mutation TheCreateVocabulary($input: CreateVocabularyInput!) {\n createVocabulary(input: $input) { id }\n }", { input: {
61
+ key: a,
62
+ name: "TheGlobalFuel",
63
+ description: "Tags for TheGlobalFuel sites, species and other records.",
64
+ allowCustomTags: !0
65
+ } }, e)).createVocabulary.id;
66
+ }, m = (r, a) => {
67
+ let { apiGatewayUrl: s } = e(), l = i();
68
+ return n({
69
+ mutationFn: async (e) => {
70
+ let n = e.trim();
71
+ if (!n) throw Error("A tag label is required.");
72
+ let i = await t("mutation TheCreateTag($input: CreateTagInput!) {\n createTag(input: $input) { id }\n }", { input: {
73
+ vocabularyId: await p(s),
74
+ key: `${c(n)}-${Math.random().toString(36).slice(2, 6)}`,
75
+ label: n
76
+ } }, s);
77
+ return await t("mutation TheAssignCreatedTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }", { input: {
78
+ entityType: r,
79
+ entityId: a,
80
+ tagId: i.createTag.id
81
+ } }, s), i.createTag;
82
+ },
83
+ onSuccess: () => l.invalidateQueries({ queryKey: o(r, a) })
84
+ });
85
+ };
86
+ //#endregion
87
+ export { d as useTheAssignTag, m as useTheCreateAndAssignTag, l as useTheEntityTags, f as useTheRemoveTagAssignment, u as useTheTagSearch };
88
+
89
+ //# sourceMappingURL=useTheTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheTags.js","names":[],"sources":["../../../src/theglobalfuel/hooks/useTheTags.ts"],"sourcesContent":["/**\n * TheGlobalFuel — wspace-tags-svc UniversalTag REUSE hooks (Integration C).\n * @module theglobalfuel/hooks/useTheTags\n *\n * The theglobalfuel svc does NOT expose a tags field, so we drive the platform tag\n * assignment store directly (approach (b) in the reuse audit) — no eco-svc\n * change. All operations are composed into the WORKSPACE supergraph:\n * - `getEntityTags(entityType, entityId)` → current assignments (display)\n * - `searchTags(query)` → pick an existing tag\n * - `createTag(input)` → create a new tag (needs a vocabulary)\n * - `assignTag(input)` → link tag ↔ entity\n * - `removeTagAssignment(id)` → unlink\n *\n * `createTag` requires a `vocabularyId`; we resolve a stable, workspace-scoped\n * \"theglobalfuel\" vocabulary (`getVocabularyByKey`, creating it on first use).\n *\n * Transport reuses `wspaceFetch` from `useTheFiles`. Lives in a separate file;\n * `useTheGlobalFuelApi.ts` is untouched.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useTheGlobalFuel } from '../context';\nimport { wspaceFetch } from './useTheFiles';\n\nexport interface TheTag {\n id: string;\n label: string;\n color: string | null;\n key: string;\n}\n\nexport interface TheTagAssignment {\n id: string;\n tag: TheTag;\n}\n\nconst THE_VOCABULARY_KEY = 'theglobalfuel';\n\nconst entityTagsKey = (entityType: string, entityId: string) =>\n ['theglobalfuel', 'entity-tags', entityType, entityId] as const;\n\nconst TAG_FIELDS = 'id label color key';\n\nconst slugify = (value: string): string =>\n value\n .toLowerCase()\n .trim()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 48) || 'tag';\n\n/** Current tag assignments for an eco entity. */\nexport const useTheEntityTags = (entityType: string, entityId: string | undefined) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: entityTagsKey(entityType, entityId ?? ''),\n enabled: Boolean(entityId),\n queryFn: async () => {\n const data = await wspaceFetch<{ getEntityTags: TheTagAssignment[] }>(\n `query TheGetEntityTags($entityType: String!, $entityId: ID!) {\n getEntityTags(entityType: $entityType, entityId: $entityId) {\n id\n tag { ${TAG_FIELDS} }\n }\n }`,\n { entityType, entityId },\n apiGatewayUrl\n );\n return data.getEntityTags;\n },\n });\n};\n\n/** Search existing tags (enabled only for a non-empty query). */\nexport const useTheTagSearch = (query: string) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const trimmed = query.trim();\n return useQuery({\n queryKey: ['theglobalfuel', 'tag-search', trimmed],\n enabled: trimmed.length > 0,\n queryFn: async () => {\n const data = await wspaceFetch<{ searchTags: TheTag[] }>(\n `query TheSearchTags($query: String!, $limit: Int) {\n searchTags(query: $query, limit: $limit) { ${TAG_FIELDS} }\n }`,\n { query: trimmed, limit: 8 },\n apiGatewayUrl\n );\n return data.searchTags;\n },\n });\n};\n\n/** Assign an existing tag to the entity. */\nexport const useTheAssignTag = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (tagId: string) => {\n const data = await wspaceFetch<{ assignTag: { id: string } }>(\n `mutation TheAssignTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }`,\n { input: { entityType, entityId, tagId } },\n apiGatewayUrl\n );\n return data.assignTag;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: entityTagsKey(entityType, entityId) }),\n });\n};\n\n/** Remove a tag assignment by its assignment id. */\nexport const useTheRemoveTagAssignment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (assignmentId: string) => {\n const data = await wspaceFetch<{ removeTagAssignment: boolean }>(\n `mutation TheRemoveTagAssignment($id: ID!) {\n removeTagAssignment(id: $id)\n }`,\n { id: assignmentId },\n apiGatewayUrl\n );\n return data.removeTagAssignment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: entityTagsKey(entityType, entityId) }),\n });\n};\n\n/** Resolve (creating on first use) the workspace-scoped \"theglobalfuel\" vocabulary. */\nconst resolveTheVocabularyId = async (baseUrl?: string): Promise<string> => {\n const existing = await wspaceFetch<{ getVocabularyByKey: { id: string } | null }>(\n `query TheGetVocabulary($key: String!) {\n getVocabularyByKey(key: $key) { id }\n }`,\n { key: THE_VOCABULARY_KEY },\n baseUrl\n );\n if (existing.getVocabularyByKey?.id) {\n return existing.getVocabularyByKey.id;\n }\n const created = await wspaceFetch<{ createVocabulary: { id: string } }>(\n `mutation TheCreateVocabulary($input: CreateVocabularyInput!) {\n createVocabulary(input: $input) { id }\n }`,\n {\n input: {\n key: THE_VOCABULARY_KEY,\n name: 'TheGlobalFuel',\n description: 'Tags for TheGlobalFuel sites, species and other records.',\n allowCustomTags: true,\n },\n },\n baseUrl\n );\n return created.createVocabulary.id;\n};\n\n/** Create a new tag from a free-text label and assign it to the entity. */\nexport const useTheCreateAndAssignTag = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (label: string) => {\n const trimmed = label.trim();\n if (!trimmed) {\n throw new Error('A tag label is required.');\n }\n const vocabularyId = await resolveTheVocabularyId(apiGatewayUrl);\n // A unique key avoids collisions with existing tags in the vocabulary;\n // the (non-unique) label is what users see.\n const key = `${slugify(trimmed)}-${Math.random().toString(36).slice(2, 6)}`;\n const created = await wspaceFetch<{ createTag: { id: string } }>(\n `mutation TheCreateTag($input: CreateTagInput!) {\n createTag(input: $input) { id }\n }`,\n { input: { vocabularyId, key, label: trimmed } },\n apiGatewayUrl\n );\n await wspaceFetch<{ assignTag: { id: string } }>(\n `mutation TheAssignCreatedTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }`,\n { input: { entityType, entityId, tagId: created.createTag.id } },\n apiGatewayUrl\n );\n return created.createTag;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: entityTagsKey(entityType, entityId) }),\n });\n};\n"],"mappings":";;;;;AAqCA,IAAM,IAAqB,iBAErB,KAAiB,GAAoB,MACzC;CAAC;CAAiB;CAAe;CAAY;CAAS,EAElD,IAAa,sBAEb,KAAW,MACf,EACG,aAAa,CACb,MAAM,CACN,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG,CACvB,MAAM,GAAG,GAAG,IAAI,OAGR,KAAoB,GAAoB,MAAiC;CACpF,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU,EAAc,GAAY,KAAY,GAAG;EACnD,SAAS,EAAQ;EACjB,SAAS,aACM,MAAM,EACjB;;;oBAGY,EAAW;;YAGvB;GAAE;GAAY;GAAU,EACxB,EACD,EACW;EAEf,CAAC;GAIS,KAAmB,MAAkB;CAChD,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAU,EAAM,MAAM;AAC5B,QAAO,EAAS;EACd,UAAU;GAAC;GAAiB;GAAc;GAAQ;EAClD,SAAS,EAAQ,SAAS;EAC1B,SAAS,aACM,MAAM,EACjB;uDAC+C,EAAW;YAE1D;GAAE,OAAO;GAAS,OAAO;GAAG,EAC5B,EACD,EACW;EAEf,CAAC;GAIS,KAAmB,GAAoB,MAAqB;CACvE,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB,0GAGA,EAAE,OAAO;GAAE;GAAY;GAAU;GAAO,EAAE,EAC1C,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAc,GAAY,EAAS,EAAE,CAAC;EACzF,CAAC;GAIS,KAA6B,GAAoB,MAAqB;CACjF,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB,kGAGA,EAAE,IAAI,GAAc,EACpB,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAc,GAAY,EAAS,EAAE,CAAC;EACzF,CAAC;GAIE,IAAyB,OAAO,MAAsC;CAC1E,IAAM,IAAW,MAAM,EACrB,8FAGA,EAAE,KAAK,GAAoB,EAC3B,EACD;AAkBD,QAjBI,EAAS,oBAAoB,KACxB,EAAS,mBAAmB,MAErB,MAAM,EACpB,uHAGA,EACE,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa;EACb,iBAAiB;EAClB,EACF,EACD,EACD,EACc,iBAAiB;GAIrB,KAA4B,GAAoB,MAAqB;CAChF,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,MAAkB;GACnC,IAAM,IAAU,EAAM,MAAM;AAC5B,OAAI,CAAC,EACH,OAAU,MAAM,2BAA2B;GAM7C,IAAM,IAAU,MAAM,EACpB,0GAGA,EAAE,OAAO;IAAE,cARQ,MAAM,EAAuB,EAAc;IAQrC,KALf,GAAG,EAAQ,EAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE;IAKzC,OAAO;IAAS,EAAE,EAChD,EACD;AAQD,UAPA,MAAM,EACJ,iHAGA,EAAE,OAAO;IAAE;IAAY;IAAU,OAAO,EAAQ,UAAU;IAAI,EAAE,EAChE,EACD,EACM,EAAQ;;EAEjB,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAc,GAAY,EAAS,EAAE,CAAC;EACzF,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * TheGlobalFuel Module Exports
3
+ * @module theglobalfuel
4
+ */
5
+ export { TheGlobalFuelRoot } from './TheGlobalFuelRoot';
6
+ export type { TheGlobalFuelRootProps, NavItem, FooterItem, TrendDirection } from './types';
7
+ export { TheGlobalFuelProvider, useTheGlobalFuel } from './context';
8
+ export { cn, joinPath, formatDate, formatDateTime, formatRelativeTime, formatNumber, formatQuantity, formatPercent, formatCo2e, formatCoords, formatEnumLabel, formatUnit, formatVolume, formatMoney, formatTonnesCo2e, isExpired, } from './utils';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theglobalfuel/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,YAAY,EAAE,sBAAsB,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG3F,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGpE,OAAO,EACL,EAAE,EACF,QAAQ,EACR,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAe,EACf,UAAU,EACV,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,SAAS,GACV,MAAM,SAAS,CAAC"}
@@ -1,3 +1,6 @@
1
- import "./providers/TheGlobalFuelProvider.js";
2
- import "./store/theglobalfuelStore.js";
1
+ import "./utils/navigation.js";
2
+ import "./context/TheGlobalFuelContext.js";
3
+ import "./utils/cn.js";
4
+ import "./utils/formatters.js";
5
+ import "./context/index.js";
3
6
  import "./TheGlobalFuelRoot.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Asset detail — lifecycle, production capture, reserve estimates, emissions,
3
+ * tags & discussion for a single resource asset.
4
+ * @module theglobalfuel/pages/assets
5
+ *
6
+ * Reads `theAsset` (+ nested productionRecords / reserveEstimates) and
7
+ * `theListEmissionRecords`; writes `theRecordProduction`,
8
+ * `theCreateReserveEstimate`, `theTransitionAsset` and `theRetireAsset`. Child
9
+ * creates invalidate the asset query in the hooks, so we just close the dialog
10
+ * and let it refetch. No mock data.
11
+ */
12
+ export declare function AssetDetailPage(): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=AssetDetailPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/theglobalfuel/pages/assets/AssetDetailPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA6HH,wBAAgB,eAAe,4CAkyB9B"}