@xyo-network/react-schema 2.25.21 → 2.25.22
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/dist/cjs/components/Property/SchemaProperty.d.ts +2 -2
- package/dist/cjs/components/Property/SchemaProperty.js +2 -2
- package/dist/cjs/components/Property/SchemaProperty.js.map +1 -1
- package/dist/docs.json +179 -25020
- package/dist/esm/components/Property/SchemaProperty.d.ts +2 -2
- package/dist/esm/components/Property/SchemaProperty.js +2 -2
- package/dist/esm/components/Property/SchemaProperty.js.map +1 -1
- package/package.json +9 -9
- package/src/components/Property/SchemaProperty.tsx +6 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PropertyProps } from '@xyo-network/react-property';
|
|
3
|
-
export
|
|
3
|
+
export declare type SchemaPropertyProps = PropertyProps & {
|
|
4
4
|
value?: string;
|
|
5
5
|
viewSchemaUrl?: string;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export declare const SchemaProperty: React.FC<SchemaPropertyProps>;
|
|
@@ -21,8 +21,8 @@ const useResolveSchema = (schema) => {
|
|
|
21
21
|
}, [schema]);
|
|
22
22
|
return entry;
|
|
23
23
|
};
|
|
24
|
-
export const SchemaProperty = ({ value, viewSchemaUrl = 'https://explore.xyo.network/' }) => {
|
|
24
|
+
export const SchemaProperty = ({ titleProps, value, viewSchemaUrl = 'https://explore.xyo.network/' }) => {
|
|
25
25
|
const resolvedSchema = useResolveSchema(value);
|
|
26
|
-
return (_jsxs(Property, { flexGrow: 1, title: "Schema", value: value, tip: "Schema sent with the payload", children: [value ? (resolvedSchema === null ? (_jsx(IconButton, { rel: "noopener noreferrer", size: "small", target: "_blank", href: `${viewSchemaUrl}${value}`, children: _jsx(NewReleasesIcon, { color: "
|
|
26
|
+
return (_jsxs(Property, { flexGrow: 1, title: "Schema", value: value, tip: "Schema sent with the payload", titleProps: titleProps, children: [value ? (resolvedSchema === null ? (_jsx(IconButton, { rel: "noopener noreferrer", size: "small", target: "_blank", href: `${viewSchemaUrl}${value}`, children: _jsx(NewReleasesIcon, { color: "warning", fontSize: "inherit" }) })) : resolvedSchema === undefined ? (_jsx(IconButton, { rel: "noopener noreferrer", size: "small", target: "_blank", href: `${viewSchemaUrl}${value}`, children: _jsx(NewReleasesIcon, { color: "disabled", fontSize: "inherit" }) })) : (_jsx(IconButton, { rel: "noopener noreferrer", size: "small", target: "_blank", href: resolvedSchema?.huri?.href ?? '', children: _jsx(VerifiedIcon, { color: "success", fontSize: "inherit" }) }))) : null, value ? (_jsx(LinkEx, { flexGrow: 1, alignItems: "center", href: `${viewSchemaUrl}${value}`, rel: "noopener noreferrer", display: "flex", children: _jsx(PropertyValue, { value: value, title: "view schema in new window" }) })) : null, value ? (_jsx(LinkEx, { marginX: 1, alignItems: "center", href: `${viewSchemaUrl}${value}`, target: "_blank", rel: "noopener noreferrer", display: "flex", children: _jsx(OpenInNewIcon, { fontSize: "inherit" }) })) : null] }));
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=SchemaProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.js","sourceRoot":"","sources":["../../../../src/components/Property/SchemaProperty.tsx"],"names":[],"mappings":";AAAA,OAAO,eAAe,MAAM,iCAAiC,CAAA;AAC7D,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,YAAY,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAiB,aAAa,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"SchemaProperty.js","sourceRoot":"","sources":["../../../../src/components/Property/SchemaProperty.tsx"],"names":[],"mappings":";AAAA,OAAO,eAAe,MAAM,iCAAiC,CAAA;AAC7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,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EAAC,OAAO,EAAC,MAAM,YAChI,KAAC,aAAa,IAAC,QAAQ,EAAC,SAAS,GAAG,GAC7B,CACV,CAAC,CAAC,CAAC,IAAI,IACC,CACZ,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"@emotion/react": "^11.9.0",
|
|
14
14
|
"@emotion/styled": "^11.8.1",
|
|
15
15
|
"@mui/material": "^5.8.1",
|
|
16
|
-
"@xylabs/sdk-react": "^2.12.
|
|
16
|
+
"@xylabs/sdk-react": "^2.12.10",
|
|
17
17
|
"@xyo-network/api": "^2.20.33",
|
|
18
18
|
"@xyo-network/core": "^2.20.33",
|
|
19
|
-
"@xyo-network/react-archive": "^2.25.
|
|
20
|
-
"@xyo-network/react-archivist-api": "^2.25.
|
|
21
|
-
"@xyo-network/react-shared": "^2.25.
|
|
22
|
-
"@xyo-network/react-theme": "^2.25.
|
|
19
|
+
"@xyo-network/react-archive": "^2.25.22",
|
|
20
|
+
"@xyo-network/react-archivist-api": "^2.25.22",
|
|
21
|
+
"@xyo-network/react-shared": "^2.25.22",
|
|
22
|
+
"@xyo-network/react-theme": "^2.25.22",
|
|
23
23
|
"@xyo-network/utils": "^2.20.33",
|
|
24
24
|
"lodash": "^4.17.21",
|
|
25
25
|
"react": "^18.1.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"description": "Common React library for all XYO projects that use React",
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@babel/core": "^7.18.
|
|
34
|
-
"@babel/preset-env": "^7.18.
|
|
33
|
+
"@babel/core": "^7.18.2",
|
|
34
|
+
"@babel/preset-env": "^7.18.2",
|
|
35
35
|
"@storybook/addons": "^6.5.5",
|
|
36
36
|
"@storybook/api": "^6.5.5",
|
|
37
37
|
"@storybook/components": "^6.5.5",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@storybook/react": "^6.5.5",
|
|
40
40
|
"@storybook/theming": "^6.5.5",
|
|
41
41
|
"@types/lodash": "^4.14.182",
|
|
42
|
-
"@xylabs/sdk-react": "^2.12.
|
|
42
|
+
"@xylabs/sdk-react": "^2.12.10",
|
|
43
43
|
"@xylabs/ts-scripts": "^1.0.66",
|
|
44
44
|
"@xylabs/tsconfig": "^1.0.13",
|
|
45
45
|
"axios": "^0.27.2",
|
|
@@ -104,6 +104,6 @@
|
|
|
104
104
|
},
|
|
105
105
|
"sideEffects": false,
|
|
106
106
|
"types": "dist/esm/index.d.ts",
|
|
107
|
-
"version": "2.25.
|
|
107
|
+
"version": "2.25.22",
|
|
108
108
|
"packageManager": "yarn@3.1.1"
|
|
109
109
|
}
|
|
@@ -4,10 +4,11 @@ import VerifiedIcon from '@mui/icons-material/Verified'
|
|
|
4
4
|
import { IconButton } from '@mui/material'
|
|
5
5
|
import { LinkEx, useAsyncEffect } from '@xylabs/sdk-react'
|
|
6
6
|
import { Property, PropertyProps, PropertyValue } from '@xyo-network/react-property'
|
|
7
|
+
import { PropertyTitleProps } from '@xyo-network/react-property/dist/esm/components/Title'
|
|
7
8
|
import { XyoSchemaCache, XyoSchemaCacheEntry } from '@xyo-network/utils'
|
|
8
9
|
import { useState } from 'react'
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
+
export type SchemaPropertyProps = PropertyProps & {
|
|
11
12
|
value?: string
|
|
12
13
|
viewSchemaUrl?: string
|
|
13
14
|
}
|
|
@@ -29,14 +30,14 @@ const useResolveSchema = (schema?: string) => {
|
|
|
29
30
|
return entry
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export const SchemaProperty: React.FC<SchemaPropertyProps> = ({ value, viewSchemaUrl = 'https://explore.xyo.network/' }) => {
|
|
33
|
+
export const SchemaProperty: React.FC<SchemaPropertyProps> = ({ titleProps, value, viewSchemaUrl = 'https://explore.xyo.network/' }) => {
|
|
33
34
|
const resolvedSchema = useResolveSchema(value)
|
|
34
35
|
return (
|
|
35
|
-
<Property flexGrow={1} title="Schema" value={value} tip="Schema sent with the payload">
|
|
36
|
+
<Property flexGrow={1} title="Schema" value={value} tip="Schema sent with the payload" titleProps={titleProps}>
|
|
36
37
|
{value ? (
|
|
37
38
|
resolvedSchema === null ? (
|
|
38
39
|
<IconButton rel="noopener noreferrer" size="small" target="_blank" href={`${viewSchemaUrl}${value}`}>
|
|
39
|
-
<NewReleasesIcon color="
|
|
40
|
+
<NewReleasesIcon color="warning" fontSize="inherit" />
|
|
40
41
|
</IconButton>
|
|
41
42
|
) : resolvedSchema === undefined ? (
|
|
42
43
|
<IconButton rel="noopener noreferrer" size="small" target="_blank" href={`${viewSchemaUrl}${value}`}>
|
|
@@ -49,7 +50,7 @@ export const SchemaProperty: React.FC<SchemaPropertyProps> = ({ value, viewSchem
|
|
|
49
50
|
)
|
|
50
51
|
) : null}
|
|
51
52
|
{value ? (
|
|
52
|
-
<LinkEx
|
|
53
|
+
<LinkEx flexGrow={1} alignItems="center" href={`${viewSchemaUrl}${value}`} rel="noopener noreferrer" display="flex">
|
|
53
54
|
<PropertyValue value={value} title="view schema in new window" />
|
|
54
55
|
</LinkEx>
|
|
55
56
|
) : null}
|