@burdenoff/fluidgrids-fe-sdk 2026.1112.2 → 2026.1112.3
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.
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
// src/navigation-v2/useNavigationV2.ts
|
|
6
|
+
/**
|
|
7
|
+
* The FluidGrids Navigation v2 switch (BOFF-10854 build tickets: BOFF-11846…11852).
|
|
8
|
+
*
|
|
9
|
+
* This SDK is shared by about 27 Burdenoff apps. The Navigation v2 page changes
|
|
10
|
+
* (plain lists, "what happened" summaries, level-2 details) are for FluidGrids
|
|
11
|
+
* only, so every SDK page that changes reads this switch and keeps today's UI
|
|
12
|
+
* when it is off.
|
|
13
|
+
*
|
|
14
|
+
* - **Off by default.** An app that never mounts `NavigationV2Provider` sees
|
|
15
|
+
* exactly today's pages.
|
|
16
|
+
* - **One switch, one context.** fluidgrids-app wraps the workflows module in
|
|
17
|
+
* `<NavigationV2Provider enabled>`. React context crosses the package
|
|
18
|
+
* boundary because the app bundles a single copy of this SDK; the light
|
|
19
|
+
* `./navigation-v2` entry and the pages share this module (one chunk).
|
|
20
|
+
*
|
|
21
|
+
* Plain bug fixes do NOT go behind this switch; they ship to every app.
|
|
22
|
+
*/
|
|
23
|
+
const NavigationV2Context = createContext(false);
|
|
24
|
+
NavigationV2Context.displayName = "FluidGridsNavigationV2";
|
|
25
|
+
/** True only inside `<NavigationV2Provider enabled>` (fluidgrids-app). */
|
|
26
|
+
function useNavigationV2() {
|
|
27
|
+
return useContext(NavigationV2Context);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/navigation-v2/NavigationV2Provider.tsx
|
|
31
|
+
/**
|
|
32
|
+
* Turns the FluidGrids Navigation v2 page variants on (or, nested, off) for
|
|
33
|
+
* the SDK pages rendered inside. See `useNavigationV2`.
|
|
34
|
+
*/
|
|
35
|
+
function NavigationV2Provider({ enabled, children }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(NavigationV2Context.Provider, {
|
|
37
|
+
value: enabled,
|
|
38
|
+
children
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { useNavigationV2 as n, NavigationV2Provider as t };
|