@equinor/fusion-framework-react-module-context 7.0.0-next.0 → 7.0.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.
package/CHANGELOG.md CHANGED
@@ -1,16 +1,37 @@
1
1
  # Change Log
2
2
 
3
- ## 7.0.0-next.0
3
+ ## 7.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 86a0599: Clarify the React context module README by documenting all package exports and linking to the existing app-scoped context wrapper documentation.
8
+
9
+ ## 7.0.0
4
10
 
5
11
  ### Major Changes
6
12
 
7
- - [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`9f7597e`](https://github.com/equinor/fusion-framework/commit/9f7597ee237ef069dc24cbe39c73b5b26db157dd) Thanks [@odinr](https://github.com/odinr)! - Require React 18+ as peer dependency. React 17 is no longer supported.
13
+ - abffa53: Major version bump for Fusion Framework React 19 release.
14
+
15
+ All packages are bumped to the next major version as part of the React 19 upgrade. This release drops support for React versions below 18 and includes breaking changes across the framework.
16
+
17
+ **Breaking changes:**
18
+ - Peer dependencies now require React 18 or 19 (`^18.0.0 || ^19.0.0`)
19
+ - React Router upgraded from v6 to v7
20
+ - Navigation module refactored with new history API
21
+ - `renderComponent` and `renderApp` now use `createRoot` API
22
+
23
+ **Migration:**
24
+ - Update your React version to 18.0.0 or higher before upgrading
25
+ - Replace `NavigationProvider.createRouter()` with `@equinor/fusion-framework-react-router`
26
+ - See individual package changelogs for package-specific migration steps
27
+
28
+ - abffa53: Require React 18+ as peer dependency. React 17 is no longer supported.
8
29
 
9
30
  **Migration:** Update your application to React 18+ to continue using these packages.
10
31
 
11
32
  Closes https://github.com/equinor/fusion-framework/issues/3504
12
33
 
13
- - [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`75c068f`](https://github.com/equinor/fusion-framework/commit/75c068fea13c32435ac26bd9043cc156482bfaf1) Thanks [@odinr](https://github.com/odinr)! - Upgrade to React 19 and remove support for React versions lower than 18.
34
+ - abffa53: Upgrade to React 19 and remove support for React versions lower than 18.
14
35
 
15
36
  **Breaking changes:**
16
37
  - Peer dependencies now require React 18 or 19 (`^18.0.0 || ^19.0.0`)
@@ -21,15 +42,31 @@
21
42
  - Update your React version to 18.0.0 or higher before upgrading these packages
22
43
  - If using React 16 or 17, upgrade to React 18 or 19 first
23
44
 
45
+ Closes https://github.com/equinor/fusion-framework/issues/3504
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [abffa53]
50
+ - Updated dependencies [abffa53]
51
+ - Updated dependencies [abffa53]
52
+ - Updated dependencies [abffa53]
53
+ - Updated dependencies [abffa53]
54
+ - @equinor/fusion-framework-module-context@8.0.0
55
+ - @equinor/fusion-framework-react-module@4.0.0
56
+ - @equinor/fusion-observable@9.0.0
57
+ - @equinor/fusion-query@7.0.0
58
+
59
+ ## 6.2.34
60
+
24
61
  ### Patch Changes
25
62
 
26
- - [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`265bb76`](https://github.com/equinor/fusion-framework/commit/265bb767249989eeb1971e83f3fba94879e0813b) Thanks [@odinr](https://github.com/odinr)! - relase next
63
+ - [#4157](https://github.com/equinor/fusion-framework/pull/4157) [`6aa8e1f`](https://github.com/equinor/fusion-framework/commit/6aa8e1f5c9d852b25e97aa7d98a63008c64d4581) Thanks [@Noggling](https://github.com/Noggling)! - Internal: patch release to align TypeScript types across packages for consistent type compatibility.
27
64
 
28
- - Updated dependencies [[`265bb76`](https://github.com/equinor/fusion-framework/commit/265bb767249989eeb1971e83f3fba94879e0813b), [`d252b0d`](https://github.com/equinor/fusion-framework/commit/d252b0d442b7c8c1b50bf2768cf9ecbbb55a76f8), [`d252b0d`](https://github.com/equinor/fusion-framework/commit/d252b0d442b7c8c1b50bf2768cf9ecbbb55a76f8), [`9f7597e`](https://github.com/equinor/fusion-framework/commit/9f7597ee237ef069dc24cbe39c73b5b26db157dd), [`75c068f`](https://github.com/equinor/fusion-framework/commit/75c068fea13c32435ac26bd9043cc156482bfaf1)]:
29
- - @equinor/fusion-framework-react-module@4.0.0-next.0
30
- - @equinor/fusion-observable@9.0.0-next.0
31
- - @equinor/fusion-query@7.0.0-next.0
32
- - @equinor/fusion-framework-module-context@7.0.3-next.0
65
+ - Updated dependencies [[`6aa8e1f`](https://github.com/equinor/fusion-framework/commit/6aa8e1f5c9d852b25e97aa7d98a63008c64d4581)]:
66
+ - @equinor/fusion-framework-module-context@7.0.3
67
+ - @equinor/fusion-framework-react-module@3.1.14
68
+ - @equinor/fusion-observable@8.5.8
69
+ - @equinor/fusion-query@6.0.4
33
70
 
34
71
  ## 6.2.33
35
72
 
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @equinor/fusion-framework-react-module-context
2
+
3
+ React hooks for the Fusion context module. Provides hooks to read the current context, set context, and query available contexts from React components.
4
+
5
+ **Import:**
6
+
7
+ ```ts
8
+ import { useCurrentContext, useQueryContext, enableContext } from '@equinor/fusion-framework-react-module-context';
9
+ ```
10
+
11
+ ## Exports
12
+
13
+ | Export | Type | Description |
14
+ | --------------------------- | -------- | -------------------------------------------------------------- |
15
+ | `useCurrentContext` | Hook | Read and set the current context (requires a provider argument) |
16
+ | `useModuleCurrentContext` | Hook | Read and set the current context from the closest module scope |
17
+ | `useQueryContext` | Hook | Search available contexts with debounce (requires a provider) |
18
+ | `useModuleQueryContext` | Hook | Search available contexts from the closest module scope |
19
+ | `enableContext` | Function | Enable the context module in a configurator |
20
+ | `ContextModule` | Type | Context module type definition |
21
+ | `ContextItem` | Type | A single context entry (project, facility, etc.) |
22
+ | `ContextItemType` | Type | Context item type discriminator |
23
+ | `IContextProvider` | Type | Context provider interface |
24
+ | `IContextModuleConfigurator` | Type | Configurator interface for enabling the context module |
25
+ | `FusionContextSearchError` | Error | Error thrown when context search fails |
26
+
27
+ ## This Package vs `react-app/context`
28
+
29
+ | Scenario | Import from |
30
+ | --------------------------------------- | ---------------------------------------------------- |
31
+ | Building a Fusion app (most common) | `@equinor/fusion-framework-react-app/context` |
32
+ | Building a reusable library or module | `@equinor/fusion-framework-react-module-context` |
33
+ | Building a portal or host application | `@equinor/fusion-framework-react-module-context` |
34
+
35
+ The `react-app/context` sub-path wraps these hooks with app-scoped convenience. Use this package directly when building framework-level code or shared libraries that need explicit provider injection.
36
+
37
+ ## useCurrentContext / useModuleCurrentContext
38
+
39
+ Returns the currently selected context and a setter function.
40
+
41
+ ```tsx
42
+ import { useModuleCurrentContext } from '@equinor/fusion-framework-react-module-context';
43
+
44
+ const ContextInfo = () => {
45
+ const { currentContext, setCurrentContext } = useModuleCurrentContext();
46
+
47
+ if (!currentContext) return <p>No context selected</p>;
48
+
49
+ return (
50
+ <div>
51
+ <p>{currentContext.title}</p>
52
+ <button onClick={() => setCurrentContext(null)}>Clear</button>
53
+ </div>
54
+ );
55
+ };
56
+ ```
57
+
58
+ ## useQueryContext / useModuleQueryContext
59
+
60
+ Search for available contexts with built-in debounce (default 500ms).
61
+
62
+ ```tsx
63
+ import { useModuleQueryContext } from '@equinor/fusion-framework-react-module-context';
64
+
65
+ const ContextSearch = () => {
66
+ const { value: results, querying, query } = useModuleQueryContext();
67
+
68
+ return (
69
+ <div>
70
+ <input onChange={(e) => query(e.target.value)} placeholder="Search contexts…" />
71
+ {querying && <span>Searching…</span>}
72
+ <ul>{results?.map((ctx) => <li key={ctx.id}>{ctx.title}</li>)}</ul>
73
+ </div>
74
+ );
75
+ };
76
+ ```
77
+
78
+ ## Related
79
+
80
+ - [`@equinor/fusion-framework-module-context`](../../modules/context/README.md) — the underlying context module
81
+ - [`@equinor/fusion-framework-react-app/context`](../../app/README.md#context) — app-developer-facing wrapper
package/dist/esm/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * React integration for the Fusion context module.
3
+ *
4
+ * Provides hooks for reading the current context ({@link useCurrentContext},
5
+ * {@link useModuleCurrentContext}) and querying available contexts
6
+ * ({@link useQueryContext}, {@link useModuleQueryContext}).
7
+ *
8
+ * @packageDocumentation
9
+ */
1
10
  export { enableContext, } from '@equinor/fusion-framework-module-context';
2
11
  export { FusionContextSearchError } from '@equinor/fusion-framework-module-context/errors.js';
3
12
  export { useCurrentContext, useModuleCurrentContext } from './useCurrentContext';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,GAMd,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,aAAa,GAMd,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '7.0.0-next.0';
2
+ export const version = '7.0.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}