linked-data-browser 0.0.6 → 0.0.7
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/.ldo/profile.shapeTypes.ts +18 -18
- package/.ldo/profile.typings.ts +17 -17
- package/babel.config.js +10 -1
- package/components/common/ProfileAvatar.tsx +2 -2
- package/components/nav/header/AvatarMenu.tsx +2 -2
- package/components/nav/header/SignInMenu.tsx +1 -1
- package/components/sharing/agentPermissions/AgentInformation.tsx +2 -3
- package/components/sharing/agentPermissions/AgentInput.tsx +2 -2
- package/metro.config.js +20 -0
- package/package.json +4 -3
- package/resourceViews/Profile/ProfileConfig.tsx +2 -2
- package/resourceViews/Profile/ProfileKnows.tsx +4 -3
- package/resourceViews/Profile/ProfileView.tsx +2 -2
|
@@ -2,12 +2,12 @@ import { ShapeType } from "@ldo/ldo";
|
|
|
2
2
|
import { profileSchema } from "./profile.schema";
|
|
3
3
|
import { profileContext } from "./profile.context";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
SolidProfile,
|
|
6
|
+
Address,
|
|
7
|
+
Email,
|
|
8
|
+
PhoneNumber,
|
|
9
|
+
TrustedApp,
|
|
10
|
+
RSAPublicKey,
|
|
11
11
|
} from "./profile.typings";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -17,54 +17,54 @@ import {
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* SolidProfile ShapeType
|
|
21
21
|
*/
|
|
22
|
-
export const
|
|
22
|
+
export const SolidProfileShapeType: ShapeType<SolidProfile> = {
|
|
23
23
|
schema: profileSchema,
|
|
24
24
|
shape: "https://shaperepo.com/schemas/solidProfile#SolidProfileShape",
|
|
25
25
|
context: profileContext,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Address ShapeType
|
|
30
30
|
*/
|
|
31
|
-
export const
|
|
31
|
+
export const AddressShapeType: ShapeType<Address> = {
|
|
32
32
|
schema: profileSchema,
|
|
33
33
|
shape: "https://shaperepo.com/schemas/solidProfile#AddressShape",
|
|
34
34
|
context: profileContext,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Email ShapeType
|
|
39
39
|
*/
|
|
40
|
-
export const
|
|
40
|
+
export const EmailShapeType: ShapeType<Email> = {
|
|
41
41
|
schema: profileSchema,
|
|
42
42
|
shape: "https://shaperepo.com/schemas/solidProfile#EmailShape",
|
|
43
43
|
context: profileContext,
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* PhoneNumber ShapeType
|
|
48
48
|
*/
|
|
49
|
-
export const
|
|
49
|
+
export const PhoneNumberShapeType: ShapeType<PhoneNumber> = {
|
|
50
50
|
schema: profileSchema,
|
|
51
51
|
shape: "https://shaperepo.com/schemas/solidProfile#PhoneNumberShape",
|
|
52
52
|
context: profileContext,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* TrustedApp ShapeType
|
|
57
57
|
*/
|
|
58
|
-
export const
|
|
58
|
+
export const TrustedAppShapeType: ShapeType<TrustedApp> = {
|
|
59
59
|
schema: profileSchema,
|
|
60
60
|
shape: "https://shaperepo.com/schemas/solidProfile#TrustedAppShape",
|
|
61
61
|
context: profileContext,
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* RSAPublicKey ShapeType
|
|
66
66
|
*/
|
|
67
|
-
export const
|
|
67
|
+
export const RSAPublicKeyShapeType: ShapeType<RSAPublicKey> = {
|
|
68
68
|
schema: profileSchema,
|
|
69
69
|
shape: "https://shaperepo.com/schemas/solidProfile#RSAPublicKeyShape",
|
|
70
70
|
context: profileContext,
|
package/.ldo/profile.typings.ts
CHANGED
|
@@ -7,9 +7,9 @@ import { LdoJsonldContext, LdSet } from "@ldo/ldo";
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* SolidProfile Type
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
12
|
+
export interface SolidProfile {
|
|
13
13
|
"@id"?: string;
|
|
14
14
|
"@context"?: LdoJsonldContext;
|
|
15
15
|
/**
|
|
@@ -34,11 +34,11 @@ export interface SolidProfileShape {
|
|
|
34
34
|
/**
|
|
35
35
|
* The person's street address.
|
|
36
36
|
*/
|
|
37
|
-
hasAddress?: LdSet<
|
|
37
|
+
hasAddress?: LdSet<Address>;
|
|
38
38
|
/**
|
|
39
39
|
* The person's email.
|
|
40
40
|
*/
|
|
41
|
-
hasEmail?: LdSet<
|
|
41
|
+
hasEmail?: LdSet<Email>;
|
|
42
42
|
/**
|
|
43
43
|
* A link to the person's photo
|
|
44
44
|
*/
|
|
@@ -52,7 +52,7 @@ export interface SolidProfileShape {
|
|
|
52
52
|
/**
|
|
53
53
|
* Person's telephone number
|
|
54
54
|
*/
|
|
55
|
-
hasTelephone?: LdSet<
|
|
55
|
+
hasTelephone?: LdSet<PhoneNumber>;
|
|
56
56
|
/**
|
|
57
57
|
* An alternative way to define a person's telephone number using a string
|
|
58
58
|
*/
|
|
@@ -68,11 +68,11 @@ export interface SolidProfileShape {
|
|
|
68
68
|
/**
|
|
69
69
|
* A list of app origins that are trusted by this user
|
|
70
70
|
*/
|
|
71
|
-
trustedApp?: LdSet<
|
|
71
|
+
trustedApp?: LdSet<TrustedApp>;
|
|
72
72
|
/**
|
|
73
73
|
* A list of RSA public keys that are associated with private keys the user holds.
|
|
74
74
|
*/
|
|
75
|
-
key?: LdSet<
|
|
75
|
+
key?: LdSet<RSAPublicKey>;
|
|
76
76
|
/**
|
|
77
77
|
* The user's LDP inbox to which apps can post notifications
|
|
78
78
|
*/
|
|
@@ -118,9 +118,9 @@ export interface SolidProfileShape {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* Address Type
|
|
122
122
|
*/
|
|
123
|
-
export interface
|
|
123
|
+
export interface Address {
|
|
124
124
|
"@id"?: string;
|
|
125
125
|
"@context"?: LdoJsonldContext;
|
|
126
126
|
/**
|
|
@@ -146,9 +146,9 @@ export interface AddressShape {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* Email Type
|
|
150
150
|
*/
|
|
151
|
-
export interface
|
|
151
|
+
export interface Email {
|
|
152
152
|
"@id"?: string;
|
|
153
153
|
"@context"?: LdoJsonldContext;
|
|
154
154
|
/**
|
|
@@ -198,9 +198,9 @@ export interface EmailShape {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
201
|
+
* PhoneNumber Type
|
|
202
202
|
*/
|
|
203
|
-
export interface
|
|
203
|
+
export interface PhoneNumber {
|
|
204
204
|
"@id"?: string;
|
|
205
205
|
"@context"?: LdoJsonldContext;
|
|
206
206
|
/**
|
|
@@ -250,9 +250,9 @@ export interface PhoneNumberShape {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
/**
|
|
253
|
-
*
|
|
253
|
+
* TrustedApp Type
|
|
254
254
|
*/
|
|
255
|
-
export interface
|
|
255
|
+
export interface TrustedApp {
|
|
256
256
|
"@id"?: string;
|
|
257
257
|
"@context"?: LdoJsonldContext;
|
|
258
258
|
/**
|
|
@@ -281,9 +281,9 @@ export interface TrustedAppShape {
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
/**
|
|
284
|
-
*
|
|
284
|
+
* RSAPublicKey Type
|
|
285
285
|
*/
|
|
286
|
-
export interface
|
|
286
|
+
export interface RSAPublicKey {
|
|
287
287
|
"@id"?: string;
|
|
288
288
|
"@context"?: LdoJsonldContext;
|
|
289
289
|
/**
|
package/babel.config.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
module.exports = function (api) {
|
|
2
2
|
api.cache(true);
|
|
3
3
|
return {
|
|
4
|
-
presets: [
|
|
4
|
+
presets: [
|
|
5
|
+
['babel-preset-expo', {
|
|
6
|
+
jsxImportSource: 'nativewind',
|
|
7
|
+
unstable_transformProfile: 'hermes-canary'
|
|
8
|
+
}],
|
|
9
|
+
'nativewind/babel'
|
|
10
|
+
],
|
|
11
|
+
plugins: [
|
|
12
|
+
'@babel/plugin-syntax-import-meta'
|
|
13
|
+
]
|
|
5
14
|
};
|
|
6
15
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SolidProfile } from '../../.ldo/profile.typings';
|
|
3
3
|
import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar';
|
|
4
4
|
import { Text } from '../ui/text';
|
|
5
5
|
import { User } from '../../lib/icons/User';
|
|
6
6
|
import { FunctionComponent } from 'react';
|
|
7
7
|
|
|
8
8
|
interface ProfileAvatarProps {
|
|
9
|
-
profile?:
|
|
9
|
+
profile?: SolidProfile;
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@ import { useResource, useSolidAuth, useSubject } from '@ldo/solid-react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FunctionComponent } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
-
import {
|
|
5
|
+
import { SolidProfileShapeType } from '../../../.ldo/profile.shapeTypes';
|
|
6
6
|
import { Text } from '../../ui/text';
|
|
7
7
|
import { Button } from '../../ui/button';
|
|
8
8
|
import { ThemeToggleMenu } from './ThemeToggleMenu';
|
|
@@ -21,7 +21,7 @@ export const AvatarMenu: FunctionComponent = () => {
|
|
|
21
21
|
const { session, logout } = useSolidAuth();
|
|
22
22
|
// TODO: Use WebId Resource to render a skeleton loader
|
|
23
23
|
const webIdResource = useResource(session.webId);
|
|
24
|
-
const profile = useSubject(
|
|
24
|
+
const profile = useSubject(SolidProfileShapeType, session.webId);
|
|
25
25
|
const { navigateTo } = useTargetResource();
|
|
26
26
|
|
|
27
27
|
if (!session.webId) return <></>;
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '../../ui/dialog';
|
|
27
27
|
import { Input } from '../../ui/input';
|
|
28
28
|
|
|
29
|
-
const DEFAULT_ISSUER =
|
|
29
|
+
const DEFAULT_ISSUER = window.location.origin;
|
|
30
30
|
|
|
31
31
|
export const SignInMenu: FunctionComponent = () => {
|
|
32
32
|
const [idpValue, setIdpValue] = useState('');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SolidProfileShapeType } from '../../../.ldo/profile.shapeTypes';
|
|
2
2
|
import { useResource, useSolidAuth, useSubject } from '@ldo/solid-react';
|
|
3
3
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
@@ -16,7 +16,7 @@ export const AgentInformation: FunctionComponent<AgentInformationProps> = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const { session } = useSolidAuth();
|
|
18
18
|
useResource(webId);
|
|
19
|
-
const agentProfile = useSubject(
|
|
19
|
+
const agentProfile = useSubject(SolidProfileShapeType, webId);
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<View className="flex-row gap-4 flex-1 items-center">
|
|
@@ -31,7 +31,6 @@ export const AgentInformation: FunctionComponent<AgentInformationProps> = ({
|
|
|
31
31
|
{webId}
|
|
32
32
|
</Text>
|
|
33
33
|
</View>
|
|
34
|
-
{accessoryRight && <View>{accessoryRight}</View>}
|
|
35
34
|
</View>
|
|
36
35
|
);
|
|
37
36
|
};
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
2
2
|
import { FunctionComponent } from 'react';
|
|
3
3
|
import { Pressable } from 'react-native';
|
|
4
4
|
import { useLinkQuery, useSolidAuth } from '@ldo/solid-react';
|
|
5
|
-
import {
|
|
5
|
+
import { SolidProfileShapeType } from '../../../.ldo/profile.shapeTypes';
|
|
6
6
|
import { AgentInformation } from './AgentInformation';
|
|
7
7
|
import { InputDropdown } from '../../ui/input-dropdown';
|
|
8
8
|
import { useContactFilter } from './useContactFilter';
|
|
@@ -46,7 +46,7 @@ export const AgentInput: FunctionComponent<AgentInputProps> = ({
|
|
|
46
46
|
|
|
47
47
|
// Get current user's profile to access their "knows" list
|
|
48
48
|
const currentUserProfile = useLinkQuery(
|
|
49
|
-
|
|
49
|
+
SolidProfileShapeType,
|
|
50
50
|
session.webId!,
|
|
51
51
|
session.webId!,
|
|
52
52
|
friendsLinkQuery,
|
package/metro.config.js
CHANGED
|
@@ -3,4 +3,24 @@ const { withNativeWind } = require('nativewind/metro');
|
|
|
3
3
|
|
|
4
4
|
const config = getDefaultConfig(__dirname);
|
|
5
5
|
|
|
6
|
+
// Add support for ES modules and import.meta
|
|
7
|
+
config.resolver.platforms = ['native', 'web', 'ios', 'android'];
|
|
8
|
+
config.transformer.minifierConfig = {
|
|
9
|
+
mangle: {
|
|
10
|
+
keep_fnames: true,
|
|
11
|
+
},
|
|
12
|
+
output: {
|
|
13
|
+
ascii_only: true,
|
|
14
|
+
quote_style: 3,
|
|
15
|
+
wrap_iife: true,
|
|
16
|
+
},
|
|
17
|
+
sourceMap: {
|
|
18
|
+
includeSources: false,
|
|
19
|
+
},
|
|
20
|
+
toplevel: false,
|
|
21
|
+
compress: {
|
|
22
|
+
reduce_funcs: false,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
6
26
|
module.exports = withNativeWind(config, { input: './global.css' });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linked-data-browser",
|
|
3
3
|
"main": "index.js",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev:ios": "expo start -c --ios",
|
|
7
7
|
"dev:web": "concurrently \"npm run solid-server\" \"expo start -c --web\"",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@ldo/connected": "^1.0.0-alpha.32",
|
|
23
23
|
"@ldo/connected-solid": "^1.0.0-alpha.32",
|
|
24
24
|
"@ldo/ldo": "^1.0.0-alpha.32",
|
|
25
|
-
"@ldo/react": "^1.0.0-alpha.
|
|
26
|
-
"@ldo/solid-react": "^1.0.0-alpha.
|
|
25
|
+
"@ldo/react": "^1.0.0-alpha.32",
|
|
26
|
+
"@ldo/solid-react": "^1.0.0-alpha.32",
|
|
27
27
|
"@monaco-editor/react": "^4.7.0",
|
|
28
28
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
29
29
|
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@babel/core": "^7.26.0",
|
|
92
|
+
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
|
92
93
|
"@expo/metro-runtime": "~5.0.4",
|
|
93
94
|
"@ldo/cli": "^1.0.0-alpha.32",
|
|
94
95
|
"@react-native-community/eslint-config": "^3.2.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SolidProfileShapeType } from '../../.ldo/profile.shapeTypes';
|
|
2
2
|
import { ResourceViewConfig } from '../../components/ResourceView';
|
|
3
3
|
import { User } from '../../lib/icons/User';
|
|
4
4
|
import { ProfileView } from './ProfileView';
|
|
@@ -10,7 +10,7 @@ export const ProfileConfig: ResourceViewConfig = {
|
|
|
10
10
|
view: ProfileView,
|
|
11
11
|
canDisplay: (targetUri, targetResource, dataset) => {
|
|
12
12
|
const profile = dataset
|
|
13
|
-
.usingType(
|
|
13
|
+
.usingType(SolidProfileShapeType)
|
|
14
14
|
.fromSubject(targetUri);
|
|
15
15
|
|
|
16
16
|
return !!profile?.type?.some?.(
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { Input } from '../../components/ui/input';
|
|
2
2
|
import React, { FunctionComponent, useCallback, useState } from 'react';
|
|
3
3
|
import { Plus } from '../../lib/icons/Plus';
|
|
4
|
-
import {
|
|
4
|
+
import { SolidProfile } from '../../.ldo/profile.typings';
|
|
5
5
|
import { AgentInformation } from '../../components/sharing/agentPermissions/AgentInformation';
|
|
6
6
|
import { View } from 'react-native';
|
|
7
7
|
import { useChangeSetData } from '@ldo/react';
|
|
8
8
|
import { SolidLeaf } from '@ldo/connected-solid';
|
|
9
9
|
import { Button } from '../../components/ui/button';
|
|
10
10
|
import { Trash } from '../../lib/icons/Trash';
|
|
11
|
+
import { ConnectedPlugin } from '@ldo/connected';
|
|
11
12
|
|
|
12
13
|
export interface ProfileKnowsProps {
|
|
13
14
|
resource: SolidLeaf;
|
|
14
|
-
profile:
|
|
15
|
-
setProfile: useChangeSetData<
|
|
15
|
+
profile: SolidProfile;
|
|
16
|
+
setProfile: useChangeSetData<SolidProfile, ConnectedPlugin<any, any, any, any, any>[]>;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export const ProfileKnows: FunctionComponent<ProfileKnowsProps> = ({
|
|
@@ -5,7 +5,7 @@ import { Input } from '../../components/ui/input';
|
|
|
5
5
|
import { Separator } from '../../components/ui/separator';
|
|
6
6
|
import { ProfileKnows } from './ProfileKnows';
|
|
7
7
|
import { useViewContext } from '../../components/useViewContext';
|
|
8
|
-
import {
|
|
8
|
+
import { SolidProfileShapeType } from '../../.ldo/profile.shapeTypes';
|
|
9
9
|
import { useChangeSubject, useResource } from '@ldo/solid-react';
|
|
10
10
|
import { Button } from '../../components/ui/button';
|
|
11
11
|
import { SolidLeaf } from '@ldo/connected-solid';
|
|
@@ -15,7 +15,7 @@ export const ProfileView: FunctionComponent = () => {
|
|
|
15
15
|
|
|
16
16
|
const profileResource = useResource(targetUri);
|
|
17
17
|
const [profile, setProfile, commitProfile, transactionDataset] =
|
|
18
|
-
useChangeSubject(
|
|
18
|
+
useChangeSubject(SolidProfileShapeType, targetUri);
|
|
19
19
|
|
|
20
20
|
if (
|
|
21
21
|
!targetUri ||
|