@xyo-network/react-shared 2.56.3 → 2.56.4

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.
@@ -6,4 +6,8 @@ export const useContextEx = (context, contextName, required = true) => {
6
6
  }
7
7
  return props;
8
8
  };
9
+ export const useProvided = (context) => {
10
+ const { provided } = useContext(context);
11
+ return provided;
12
+ };
9
13
  //# sourceMappingURL=use.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../src/contexts/contextEx/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,OAAO,CAAA;AAI3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAA2B,OAAmB,EAAE,WAAmB,EAAE,QAAQ,GAAG,IAAI,EAAE,EAAE;IAClH,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClD,IAAI,CAAC,QAAQ,IAAI,QAAQ,EAAE;QACzB,MAAM,KAAK,CAAC,MAAM,WAAW,iCAAiC,WAAW,4BAA4B,CAAC,CAAA;KACvG;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
1
+ {"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../src/contexts/contextEx/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,OAAO,CAAA;AAI3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAA2B,OAAmB,EAAE,WAAmB,EAAE,QAAQ,GAAG,IAAI,EAAE,EAAE;IAClH,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClD,IAAI,CAAC,QAAQ,IAAI,QAAQ,EAAE;QACzB,MAAM,KAAK,CAAC,MAAM,WAAW,iCAAiC,WAAW,4BAA4B,CAAC,CAAA;KACvG;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAA2B,OAAmB,EAAE,EAAE;IAC3E,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IACxC,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { Context } from 'react';
2
2
  import { ContextExState } from './State';
3
3
  export declare const useContextEx: <T extends ContextExState>(context: Context<T>, contextName: string, required?: boolean) => Omit<T, "provided">;
4
+ export declare const useProvided: <T extends ContextExState>(context: Context<T>) => boolean;
4
5
  //# sourceMappingURL=use.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/contextEx/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,eAAO,MAAM,YAAY,+DAAgE,MAAM,4CAM9F,CAAA"}
1
+ {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/contextEx/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,eAAO,MAAM,YAAY,+DAAgE,MAAM,4CAM9F,CAAA;AAED,eAAO,MAAM,WAAW,4DAGvB,CAAA"}
package/package.json CHANGED
@@ -17,12 +17,12 @@
17
17
  "@xylabs/react-link": "^2.17.6",
18
18
  "@xylabs/react-promise": "^2.17.6",
19
19
  "@xylabs/react-shared": "^2.17.6",
20
- "@xyo-network/core": "^2.64.1",
21
- "@xyo-network/payload-model": "^2.64.1",
22
- "@xyo-network/react-event": "^2.56.3"
20
+ "@xyo-network/core": "^2.64.3",
21
+ "@xyo-network/payload-model": "^2.64.3",
22
+ "@xyo-network/react-event": "^2.56.4"
23
23
  },
24
24
  "devDependencies": {
25
- "@storybook/react": "^7.0.24",
25
+ "@storybook/react": "^7.0.25",
26
26
  "@xylabs/react-quick-tip-button": "^2.17.6",
27
27
  "@xylabs/ts-scripts-yarn3": "^2.18.7",
28
28
  "@xylabs/tsconfig-react": "^2.18.7",
@@ -80,5 +80,5 @@
80
80
  },
81
81
  "sideEffects": false,
82
82
  "types": "dist/types/index.d.ts",
83
- "version": "2.56.3"
83
+ "version": "2.56.4"
84
84
  }
@@ -9,3 +9,8 @@ export const useContextEx = <T extends ContextExState>(context: Context<T>, cont
9
9
  }
10
10
  return props
11
11
  }
12
+
13
+ export const useProvided = <T extends ContextExState>(context: Context<T>) => {
14
+ const { provided } = useContext(context)
15
+ return provided
16
+ }