Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Feb 8, 2024
2 parents 69f83a8 + 7668e95 commit ea6497b
Show file tree
Hide file tree
Showing 136 changed files with 4,203 additions and 3,324 deletions.
3 changes: 2 additions & 1 deletion .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@100;200;300;400;500;600;700;800&display=swap"
rel="stylesheet">
rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap" rel="stylesheet">
7 changes: 4 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InvertibleThemeProvider } from '@xylabs/react-invertible-theme'
import { FlexCol } from '@xylabs/react-flexbox'
import { CssBaseline } from '@mui/material';
import { useDarkMode } from 'storybook-dark-mode';
import { partialDarkThemeOptions, partialAppLightThemeOptions, themeOptions, appThemeOptions, webThemeOptions } from '@xyo-network/react-theme'
import { partialDarkThemeOptions, partialAppLightThemeOptions, themeOptions, appThemeOptions, webThemeOptions, osThemeOptions } from '@xyo-network/react-theme'
import { AppSettingsProvider } from '@xyo-network/react-app-settings'
import React from 'react';
import { Decorator } from '@storybook/react';
Expand All @@ -15,7 +15,7 @@ export const globalTypes = {
toolbar: {
icon: 'eye',
// Array of plain string values or MenuItem shape (see below)
items: ['Theme', 'AppTheme', 'WebTheme'],
items: ['Theme', 'AppTheme', 'WebTheme', 'OsTheme'],
// Property that specifies if the name of the item will be displayed
title: true,
// Change title based on selected value
Expand Down Expand Up @@ -45,6 +45,7 @@ const getTheme = (themeName) => {
Theme: themeOptions,
AppTheme: appThemeOptions,
WebTheme: webThemeOptions,
OsTheme: osThemeOptions
}
return themes[themeName]
}
Expand All @@ -58,7 +59,7 @@ const withThemeProvider: Decorator = (Story, context) => {

return (
<AppSettingsProvider value={{darkMode}}>
<InvertibleThemeProvider dark={darkMode} lightOptions={partialAppLightThemeOptions} darkTheme={partialDarkThemeOptions} options={themeOptions}>
<InvertibleThemeProvider dark={darkMode} options={themeOptions}>
<CssBaseline enableColorScheme />
<FlexCol alignItems="unset">
<Story {...context}/>
Expand Down
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,33 @@
},
"description": "Common React library for all XYO projects that use React",
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.6",
"@mui/material": "^5.15.6",
"@mui/styles": "^5.15.6",
"@storybook/addon-actions": "^7.6.10",
"@storybook/addon-controls": "^7.6.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-viewport": "^7.6.10",
"@storybook/addons": "^7.6.10",
"@storybook/api": "^7.6.10",
"@storybook/builder-webpack5": "^7.6.10",
"@storybook/components": "^7.6.10",
"@storybook/core-events": "^7.6.10",
"@mui/icons-material": "^5.15.8",
"@mui/material": "^5.15.8",
"@mui/styles": "^5.15.8",
"@storybook/addon-actions": "^7.6.13",
"@storybook/addon-controls": "^7.6.13",
"@storybook/addon-essentials": "^7.6.13",
"@storybook/addon-interactions": "^7.6.13",
"@storybook/addon-links": "^7.6.13",
"@storybook/addon-viewport": "^7.6.13",
"@storybook/addons": "^7.6.13",
"@storybook/api": "^7.6.13",
"@storybook/builder-webpack5": "^7.6.13",
"@storybook/components": "^7.6.13",
"@storybook/core-events": "^7.6.13",
"@storybook/mdx1-csf": "^1.0.0",
"@storybook/react": "^7.6.10",
"@storybook/react-webpack5": "^7.6.10",
"@storybook/react": "^7.6.13",
"@storybook/react-webpack5": "^7.6.13",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.6.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@storybook/theming": "^7.6.13",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@xylabs/eslint-config": "^3.2.42",
"@xylabs/eslint-config-react": "^3.2.42",
"@xylabs/pixel": "^1.4.14",
Expand All @@ -82,7 +82,7 @@
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-icons": "^4.12.0",
"storybook": "^7.6.10",
"storybook": "^7.6.13",
"storybook-dark-mode": "^3.0.3",
"ts-jest": "^29.1.2",
"typedoc": "^0.25.7",
Expand Down Expand Up @@ -149,7 +149,7 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"packageManager": "[email protected]",
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
25 changes: 12 additions & 13 deletions packages/modules/packages/archivist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
"@xylabs/react-button": "^3.0.39",
"@xylabs/react-flexbox": "^3.0.39",
"@xylabs/react-promise": "^3.0.39",
"@xyo-network/archivist": "^2.88.2",
"@xyo-network/archivist-model": "^2.88.2",
"@xyo-network/boundwitness-builder": "^2.88.2",
"@xyo-network/boundwitness-model": "^2.88.2",
"@xyo-network/boundwitness-wrapper": "^2.88.2",
"@xyo-network/module-events": "^2.88.2",
"@xyo-network/module-model": "^2.88.2",
"@xyo-network/module-wrapper": "^2.88.2",
"@xyo-network/payload-model": "^2.88.2",
"@xyo-network/archivist": "^2.89.0",
"@xyo-network/archivist-model": "^2.89.0",
"@xyo-network/boundwitness-builder": "^2.89.0",
"@xyo-network/boundwitness-model": "^2.89.0",
"@xyo-network/module-events": "^2.89.0",
"@xyo-network/module-model": "^2.89.0",
"@xyo-network/module-wrapper": "^2.89.0",
"@xyo-network/payload-model": "^2.89.0",
"@xyo-network/react-module": "workspace:~",
"@xyo-network/react-node": "workspace:~",
"@xyo-network/react-wallet": "workspace:~",
Expand All @@ -37,11 +36,11 @@
},
"description": "Common React library for all XYO projects that use React",
"devDependencies": {
"@storybook/react": "^7.6.10",
"@storybook/react": "^7.6.13",
"@xylabs/ts-scripts-yarn3": "^3.2.42",
"@xylabs/tsconfig-react": "^3.2.42",
"@xyo-network/account": "^2.88.2",
"@xyo-network/node-memory": "^2.88.2",
"@xyo-network/account": "^2.89.0",
"@xyo-network/node-memory": "^2.89.0",
"typescript": "^5.3.3"
},
"docs": "dist/docs.json",
Expand Down Expand Up @@ -94,6 +93,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const insertPayload = async (archivist?: ArchivistInstance) => {
const payload = { schema: 'network.xyo.payload', timestamp: Date.now() }
const insertQuery = { schema: ArchivistInsertQuerySchema }
const account = Account.randomSync()
const builder = new QueryBoundWitnessBuilder().payloads([insertQuery, payload]).witness(account).query(insertQuery)
const builder = await (await (new QueryBoundWitnessBuilder().payloads([insertQuery, payload]))).witness(account).query(insertQuery)
const [insertQueryBoundWitness, payloads] = await builder.build()
await archivist.insert([insertQueryBoundWitness, ...payloads])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'
import { Payload } from '@xyo-network/payload-model'

import { ArchivistStats } from './ArchivistStats'
import { usePromise } from '@xylabs/react-promise'

const account = Account.randomSync()
const payload = () => ({ schema: 'network.xyo.payload', timestamp: Date.now() })
const boundWitness = () => new BoundWitnessBuilder().payload(payload()).witness(account).build()
const boundWitness = async () => await (await new BoundWitnessBuilder().payload(payload())).witness(account).build()

const StorybookEntry = {
component: ArchivistStats,
Expand All @@ -19,7 +20,10 @@ const StorybookEntry = {
title: 'modules/archivist/ArchivistStats',
} as Meta<typeof ArchivistStats>

const Template: StoryFn<typeof ArchivistStats> = (props) => <ArchivistStats {...props} />
const Template: StoryFn<typeof ArchivistStats> = ({boundWitnesses, ...props}) => {
const [boundWitnessesProp] = usePromise(async () => boundWitnesses ? await Promise.all(boundWitnesses) : [], [boundWitnesses])
return boundWitnessesProp ? <ArchivistStats boundWitnesses={boundWitnessesProp} {...props} /> : <div/>
}

const Default = Template.bind({})
const WithStats = Template.bind({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Template: StoryFn<typeof MemoryArchivistsStats> = () => {
const payload = { schema: 'network.xyo.payload' }
const insertQuery = { schema: ArchivistInsertQuerySchema }
const account = Account.randomSync()
const builder = new QueryBoundWitnessBuilder().payloads([insertQuery, payload]).witness(account).query(insertQuery)
const builder = await (await new QueryBoundWitnessBuilder().payloads([insertQuery, payload])).witness(account).query(insertQuery)
const [insertQueryBoundWitness, payloads] = await builder.build()
await node.register(newParentModule)
await node.attach(newParentModule.address)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useAsyncEffect } from '@xylabs/react-async-effect'
import { ArchivistAllQuerySchema, ArchivistInstance } from '@xyo-network/archivist-model'
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
import { BoundWitnessWrapper } from '@xyo-network/boundwitness-wrapper'
import { asBoundWitness, BoundWitnessSchema } from '@xyo-network/boundwitness-model'
import { EventUnsubscribeFunction } from '@xyo-network/module-events'
import { Payload } from '@xyo-network/payload-model'
import { useCallback, useEffect, useMemo, useState } from 'react'
Expand Down Expand Up @@ -58,7 +57,7 @@ export const MemoryArchivistsStats: React.FC<MemoryArchivistStatsProps> = ({ arc
() =>
all?.reduce(
(prev, payload) => {
const w = BoundWitnessWrapper.tryParse(payload) as BoundWitnessWrapper | undefined
const w = asBoundWitness(payload)
if (w?.addresses)
for (const address of w?.addresses ?? []) {
prev[address] = (prev[address] ?? 0) + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { useState } from 'react'
import { useArchivistFromNode } from '../../hooks'

const testQueryCommit = { schema: ArchivistCommitQuerySchema }
const testQueryCommitBoundWitnessBuilder = new QueryBoundWitnessBuilder({ inlinePayloads: true }).query(testQueryCommit)
const testQueryCommitBoundWitnessBuilder = new QueryBoundWitnessBuilder().query(testQueryCommit)

const testQueryClear = { schema: ArchivistClearQuerySchema }
const testQueryClearBoundWitnessBuilder = new QueryBoundWitnessBuilder({ inlinePayloads: true }).query(testQueryClear)
const testQueryClearBoundWitnessBuilder = new QueryBoundWitnessBuilder().query(testQueryClear)

export interface ArchivistDetails extends FlexBoxProps {
address?: string
Expand All @@ -30,8 +30,8 @@ export const ArchivistDetails: React.FC<ArchivistDetails> = ({ address, ...props
// eslint-disable-next-line react-hooks/exhaustive-deps
async () => {
if (archivist) {
const [commitBW] = await testQueryCommitBoundWitnessBuilder.build()
const [clearBW] = await testQueryClearBoundWitnessBuilder.build()
const [commitBW] = await (await testQueryCommitBoundWitnessBuilder).build()
const [clearBW] = await (await testQueryClearBoundWitnessBuilder).build()
setQueryableCommit(await archivist?.queryable(commitBW, [testQueryCommit]))
setQueryableClear(await archivist?.queryable(clearBW, [testQueryClear]))
}
Expand Down
6 changes: 3 additions & 3 deletions packages/modules/packages/diviner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
},
"dependencies": {
"@xyo-network/diviner": "^2.88.2",
"@xyo-network/module-model": "^2.88.2",
"@xyo-network/diviner": "^2.89.0",
"@xyo-network/module-model": "^2.89.0",
"@xyo-network/react-node": "workspace:~"
},
"peerDependencies": {
Expand Down Expand Up @@ -77,6 +77,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
18 changes: 9 additions & 9 deletions packages/modules/packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
},
"dependencies": {
"@xylabs/eth-address": "^2.13.27",
"@xylabs/eth-address": "^2.14.0",
"@xylabs/react-button": "^3.0.39",
"@xylabs/react-crypto": "^3.0.39",
"@xylabs/react-flexbox": "^3.0.39",
"@xylabs/react-promise": "^3.0.39",
"@xyo-network/diviner": "^2.88.2",
"@xyo-network/module-model": "^2.88.2",
"@xyo-network/diviner": "^2.89.0",
"@xyo-network/module-model": "^2.89.0",
"@xyo-network/react-shared": "workspace:~"
},
"devDependencies": {
"@storybook/react": "^7.6.10",
"@storybook/react": "^7.6.13",
"@xylabs/react-async-effect": "^3.0.39",
"@xylabs/ts-scripts-yarn3": "^3.2.42",
"@xylabs/tsconfig-react": "^3.2.42",
"@xyo-network/archivist": "^2.88.2",
"@xyo-network/crypto-asset-plugin": "^2.86.5",
"@xyo-network/diviner-address-history": "^2.88.2",
"@xyo-network/node-memory": "^2.88.2",
"@xyo-network/archivist": "^2.89.0",
"@xyo-network/crypto-asset-plugin": "^2.87.0",
"@xyo-network/diviner-address-history": "^2.89.0",
"@xyo-network/node-memory": "^2.89.0",
"typescript": "^5.3.3"
},
"peerDependencies": {
Expand Down Expand Up @@ -88,6 +88,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
20 changes: 10 additions & 10 deletions packages/modules/packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/system": "^5.15.6",
"@mui/system": "^5.15.8",
"@mui/x-tree-view": "^6.17.0",
"@xylabs/logger": "^2.13.27",
"@xylabs/logger": "^2.14.0",
"@xylabs/react-async-effect": "^3.0.39",
"@xylabs/react-flexbox": "^3.0.39",
"@xylabs/react-promise": "^3.0.39",
"@xylabs/react-shared": "^3.0.39",
"@xyo-network/module-abstract": "^2.88.2",
"@xyo-network/module-model": "^2.88.2",
"@xyo-network/node-model": "^2.88.2",
"@xyo-network/payload-model": "^2.88.2",
"@xyo-network/module-abstract": "^2.89.0",
"@xyo-network/module-model": "^2.89.0",
"@xyo-network/node-model": "^2.89.0",
"@xyo-network/payload-model": "^2.89.0",
"@xyo-network/react-node-context": "workspace:~",
"@xyo-network/react-node-provider": "workspace:~"
},
"devDependencies": {
"@storybook/react": "^7.6.10",
"@storybook/react": "^7.6.13",
"@xylabs/ts-scripts-yarn3": "^3.2.42",
"@xylabs/tsconfig-react": "^3.2.42",
"@xyo-network/node-memory": "^2.88.2",
"@xyo-network/payload-model": "^2.88.2",
"@xyo-network/node-memory": "^2.89.0",
"@xyo-network/payload-model": "^2.89.0",
"@xyo-network/react-storybook": "workspace:~",
"@xyo-network/react-wallet": "workspace:~",
"typescript": "^5.3.3"
Expand Down Expand Up @@ -94,6 +94,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
6 changes: 3 additions & 3 deletions packages/modules/packages/node/packages/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
},
"dependencies": {
"@xyo-network/module-model": "^2.88.2",
"@xyo-network/node-model": "^2.88.2",
"@xyo-network/module-model": "^2.89.0",
"@xyo-network/node-model": "^2.89.0",
"@xyo-network/react-shared": "workspace:~"
},
"devDependencies": {
Expand Down Expand Up @@ -77,6 +77,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
8 changes: 4 additions & 4 deletions packages/modules/packages/node/packages/provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"dependencies": {
"@xylabs/react-async-effect": "^3.0.39",
"@xylabs/react-shared": "^3.0.39",
"@xyo-network/module-model": "^2.88.2",
"@xyo-network/node-memory": "^2.88.2",
"@xyo-network/node-model": "^2.88.2",
"@xyo-network/module-model": "^2.89.0",
"@xyo-network/node-memory": "^2.89.0",
"@xyo-network/node-model": "^2.89.0",
"@xyo-network/react-node-context": "workspace:~",
"@xyo-network/react-shared": "workspace:~"
},
Expand Down Expand Up @@ -81,6 +81,6 @@
},
"sideEffects": false,
"types": "dist/browser/index.d.ts",
"version": "2.67.18",
"version": "2.68.0",
"type": "module"
}
Loading

0 comments on commit ea6497b

Please sign in to comment.