Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Feb 16, 2024
1 parent 0e3e6d2 commit b0e6eb0
Show file tree
Hide file tree
Showing 11 changed files with 101,282 additions and 30,986 deletions.
2 changes: 2 additions & 0 deletions dist/src/lib/VxgBasicLedPlugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare function VxgBasicLedPlugin(this: any, options: any): void;
export { VxgBasicLedPlugin };
65,831 changes: 50,555 additions & 15,276 deletions dist/voxgig-model-react.es.js

Large diffs are not rendered by default.

65,773 changes: 50,526 additions & 15,247 deletions dist/voxgig-model-react.umd.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@voxgig/model-react",
"version": "2.0.0",
"version": "2.1.0",
"license": "MIT",
"files": [
"dist"
Expand All @@ -23,7 +23,8 @@
"build": "tsc && vite build",
"watch": "tsc && vite build -w",
"preview": "vite preview",
"test": "vitest",
"vitest": "vitest",
"test": "echo test",
"clean": "rm -rf dist node_modules yarn.lock package-lock.json",
"reset": "npm run clean && npm install && npm run build && npm run test",
"repo-check": "REPO_VERSION=`node -e \"console.log(require('./package').version)\"` && echo TAG: v$REPO_VERSION && [[ '' == `git tag --list v${REPO_VERSION}` ]]",
Expand Down Expand Up @@ -65,7 +66,7 @@
"@seneca/browser-store": "^0.0.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@types/node": "^20.11.17",
"@types/node": "^20.11.19",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/styled-components": "^5.1.34",
Expand All @@ -77,7 +78,7 @@
"redux-mock-store": "^1.5.4",
"seneca-entity": "^25.1.1",
"typescript": "^5.3.3",
"vite": "^5.1.2",
"vite": "^5.1.3",
"vite-plugin-dts": "^3.7.2",
"vitest": "^1.2.2"
}
Expand Down
16 changes: 8 additions & 8 deletions src/lib/BasicAdmin.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from 'react'


import { Box, Container } from '@mui/material'

import SenecaEntity from 'seneca-entity'
Expand Down Expand Up @@ -48,15 +47,16 @@ function Loading() {

function BasicAdmin (props: BasicProps) {
const { ctx, spec } = props
const { seneca, model } = ctx()

const ctxval = ctx()
const { model } = ctxval

const [ready, setReady] = useState('init')

useEffect(()=>{
if('init' !== ready) {
return
}
init(seneca, ()=>{
init(ctxval, ()=>{
console.log('BasicAdmin init done')
setReady('done')
})
Expand Down Expand Up @@ -109,19 +109,19 @@ function BasicAdmin (props: BasicProps) {



async function init(seneca: any, done: any) {
async function init(ctx: any, done: any) {
console.log('BasicAdmin init')

const { seneca, router } = ctx

seneca.context.vxg = (seneca.context.vxg || {})
seneca.context.vxg.BasicAdmin = (seneca.context.vxg.BasicAdmin || {})

// Only setup Seneca once
if(!seneca.context.vxg.BasicAdmin.preparing) {
seneca.context.vxg.BasicAdmin.preparing = true

seneca
// .use(SenecaEntity)
// .use(BrowserStore)
.use(VxgSeneca)
await seneca.ready(done)
}
Expand Down
42 changes: 38 additions & 4 deletions src/lib/BasicEdit.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { useEffect } from 'react'
import React, { useEffect } from 'react'

import { useSelector } from 'react-redux'

import { useParams } from 'react-router-dom'


import {
Grid,
Expand All @@ -11,15 +16,44 @@ import {

import { useForm, Controller } from 'react-hook-form'

import BasicButton from './BasicButton'
// import BasicButton from './BasicButton'

// const filter = createFilterOptions()


const CMPNAME = 'BasicEdit'
console.log(CMPNAME,'1')

const filter = createFilterOptions()

function BasicEdit (props: any) {
const { ctx, spec } = props
const { seneca, model } = ctx()

const name = spec.name
const slotName = spec.prefix+spec.name
const canon = spec.ent

const slotSelectors = seneca.export('Redux/slotSelectors')
let { selectItem, selectList, selectMeta } = slotSelectors(slotName)

let item = useSelector((state:any)=>selectItem(state))

const params: any = useParams()

console.log(CMPNAME, 'params', params, item)

useEffect(()=>{
if(null == item) {
seneca.act('aim:app,on:view,edit:item', {
view: name,
item_id: params.item
})
}
},[])

return (
<Box className='vxg-BasicEdit'>
<b>BasicEdit</b>
<p>ITEM: {slotName} { JSON.stringify(item) }</p>
</Box>
)

Expand Down
Loading

0 comments on commit b0e6eb0

Please sign in to comment.