cozy-sharing 16.10.0 → 16.11.0

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [16.11.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@16.10.0...cozy-sharing@16.11.0) (2024-12-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * **Sharing:** Expose new component to show owner recipient ([bcc6302](https://github.com/cozy/cozy-libs/commit/bcc6302abf0190259e86a9d327aa0d46e39b693b))
12
+
13
+
14
+
15
+
16
+
6
17
  # [16.10.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@16.9.0...cozy-sharing@16.10.0) (2024-12-05)
7
18
 
8
19
 
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { useClient, useQuery, hasQueryBeenLoaded } from 'cozy-client';
3
+ import MemberRecipientLite from './MemberRecipientLite';
4
+ import withLocales from '../../hoc/withLocales';
5
+ import { buildInstanceSettingsQuery } from '../../queries/queries';
6
+
7
+ var OwnerRecipientDefaultLite = function OwnerRecipientDefaultLite() {
8
+ var _instanceSettingsResu;
9
+
10
+ var client = useClient();
11
+ var instanceSettingsQuery = buildInstanceSettingsQuery();
12
+ var instanceSettingsResult = useQuery(instanceSettingsQuery.definition, instanceSettingsQuery.options);
13
+ return hasQueryBeenLoaded(instanceSettingsResult) && /*#__PURE__*/React.createElement(MemberRecipientLite, {
14
+ recipient: {
15
+ status: 'owner',
16
+ instance: client.options.uri,
17
+ public_name: instanceSettingsResult === null || instanceSettingsResult === void 0 || (_instanceSettingsResu = instanceSettingsResult.data) === null || _instanceSettingsResu === void 0 || (_instanceSettingsResu = _instanceSettingsResu.attributes) === null || _instanceSettingsResu === void 0 ? void 0 : _instanceSettingsResu.public_name
18
+ },
19
+ isOwner: true
20
+ });
21
+ };
22
+
23
+ export default withLocales(OwnerRecipientDefaultLite);
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ export { SharingOwnerAvatar } from './SharingOwnerAvatar';
12
12
  export { SharedRecipients } from './SharedRecipients';
13
13
  export { default as MemberRecipientLite } from './components/Recipient/MemberRecipientLite';
14
14
  export { default as LinkRecipientLite } from './components/Recipient/LinkRecipientLite';
15
+ export { default as OwnerRecipientDefaultLite } from './components/Recipient/OwnerRecipientDefaultLite';
15
16
  export { SharedRecipientsList } from './SharedRecipientsList';
16
17
  export { ShareButton } from './ShareButton';
17
18
  export { ShareModal } from './components/ShareModal/ShareModal';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "16.10.0",
3
+ "version": "16.11.0",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -71,5 +71,5 @@
71
71
  "sideEffects": [
72
72
  "*.css"
73
73
  ],
74
- "gitHead": "b4c3da8d1cb8aa777ea0b09d8d00fbe3630b8666"
74
+ "gitHead": "99210fddf08b4701afcf0390c0042d3f7cfb97ec"
75
75
  }
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+
3
+ import { useClient, useQuery, hasQueryBeenLoaded } from 'cozy-client'
4
+
5
+ import MemberRecipientLite from './MemberRecipientLite'
6
+ import withLocales from '../../hoc/withLocales'
7
+ import { buildInstanceSettingsQuery } from '../../queries/queries'
8
+
9
+ const OwnerRecipientDefaultLite = () => {
10
+ const client = useClient()
11
+
12
+ const instanceSettingsQuery = buildInstanceSettingsQuery()
13
+ const instanceSettingsResult = useQuery(
14
+ instanceSettingsQuery.definition,
15
+ instanceSettingsQuery.options
16
+ )
17
+
18
+ return (
19
+ hasQueryBeenLoaded(instanceSettingsResult) && (
20
+ <MemberRecipientLite
21
+ recipient={{
22
+ status: 'owner',
23
+ instance: client.options.uri,
24
+ public_name: instanceSettingsResult?.data?.attributes?.public_name
25
+ }}
26
+ isOwner={true}
27
+ />
28
+ )
29
+ )
30
+ }
31
+
32
+ export default withLocales(OwnerRecipientDefaultLite)
package/src/index.jsx CHANGED
@@ -16,6 +16,7 @@ export { SharingOwnerAvatar } from './SharingOwnerAvatar'
16
16
  export { SharedRecipients } from './SharedRecipients'
17
17
  export { default as MemberRecipientLite } from './components/Recipient/MemberRecipientLite'
18
18
  export { default as LinkRecipientLite } from './components/Recipient/LinkRecipientLite'
19
+ export { default as OwnerRecipientDefaultLite } from './components/Recipient/OwnerRecipientDefaultLite'
19
20
  export { SharedRecipientsList } from './SharedRecipientsList'
20
21
  export { ShareButton } from './ShareButton'
21
22
  export { ShareModal } from './components/ShareModal/ShareModal'