@equinor/subsurface-app-management 2.2.3 → 2.3.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.
@@ -1,12 +1,10 @@
1
1
  export interface UseFeatureTogglingOptions {
2
2
  featureUuid: string;
3
- showIfKeyIsMissing?: boolean;
4
3
  showIfIsLoading?: boolean;
5
4
  }
6
5
  /**
7
6
  * @param featureUuid - The uuid of the feature-toggle
8
- * @param showIfKeyIsMissing - Show/hide if the key was not found/has been deleted. Defaults to true
9
- * @param ShowIfIsLoading - Show/hide if the feature toggles are still loading. Defaults to false
7
+ * @param showIfIsLoading - Show/hide if the feature toggles are still loading. Defaults to false
10
8
  */
11
9
  export declare function useFeatureToggling(params: UseFeatureTogglingOptions | string): {
12
10
  showContent: boolean;
@@ -1 +1 @@
1
- import{useMemo as e}from"react";import{useFeatureToggleContext as r}from"../providers/FeatureToggleProvider.js";function t(t){const{featureUuid:o,showIfKeyIsMissing:i=!0,showIfIsLoading:n=!1}="string"==typeof t?{featureUuid:t}:t,{features:s,isError:u,isLoading:a}=r();i||console.warn(`[FeatureToggle] Feature: ${o} will not show when the feature toggle is removed! Was this intentional?`);return{showContent:e((()=>{if(!n&&a||u)return!1;const e=s?.find((e=>e.uuid===o));return e?e.active:i}),[n,a,u,s,i,o])}}export{t as useFeatureToggling};
1
+ import{useMemo as r}from"react";import{useFeatureToggleContext as e}from"../providers/FeatureToggleProvider.js";function o(o){const{featureUuid:t,showIfIsLoading:i=!1}="string"==typeof o?{featureUuid:o}:o,{features:n,isError:u,isLoading:s}=e();return{showContent:r((()=>{if(!i&&s||u)return!1;const r=n?.find((r=>r.uuid===t));return r?r.active:(console.warn(`[FeatureToggling]: Feature with uuid ${t} not found. Defaulting to show.`),!0)}),[i,s,u,n,t])}}export{o as useFeatureToggling};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "2.2.3",
3
+ "version": "2.3.1",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",