fix: 3.0.0 (again)
This commit is contained in:
parent
8989960697
commit
d6126f3574
|
@ -11,7 +11,6 @@
|
||||||
"debug": "DEBUG=*,-babel* npm run dev",
|
"debug": "DEBUG=*,-babel* npm run dev",
|
||||||
"dev": "npm run -- build:only -hv",
|
"dev": "npm run -- build:only -hv",
|
||||||
"link-all": "yarn link $(for i in $(ls node_modules/@flecks); do echo -n \"@flecks/$i \"; done)",
|
"link-all": "yarn link $(for i in $(ls node_modules/@flecks); do echo -n \"@flecks/$i \"; done)",
|
||||||
"postinstall": "patch-package",
|
|
||||||
"repl": "npx flecks repl --rlwrap",
|
"repl": "npx flecks repl --rlwrap",
|
||||||
"start": "DEBUG=@flecks*,honeybee,-@flecks/core/flecks* npm run dev",
|
"start": "DEBUG=@flecks*,honeybee,-@flecks/core/flecks* npm run dev",
|
||||||
"unlink-all": "yarn unlink $(for i in $(ls node_modules/@flecks); do echo -n \"@flecks/$i \"; done) && yarn install --force",
|
"unlink-all": "yarn unlink $(for i in $(ls node_modules/@flecks); do echo -n \"@flecks/$i \"; done) && yarn install --force",
|
||||||
|
|
|
@ -5,15 +5,17 @@ import {join} from 'path';
|
||||||
import {
|
import {
|
||||||
PropTypes,
|
PropTypes,
|
||||||
React,
|
React,
|
||||||
|
useEffect,
|
||||||
|
useFlecks,
|
||||||
|
useState,
|
||||||
|
} from '@flecks/react';
|
||||||
|
import {useParams} from '@flecks/react/router';
|
||||||
|
import {
|
||||||
Tab,
|
Tab,
|
||||||
Tabs,
|
Tabs,
|
||||||
TabList,
|
TabList,
|
||||||
TabPanel,
|
TabPanel,
|
||||||
useEffect,
|
} from 'react-tabs';
|
||||||
useFlecks,
|
|
||||||
useParams,
|
|
||||||
useState,
|
|
||||||
} from '@flecks/react';
|
|
||||||
|
|
||||||
import Traits from './traits';
|
import Traits from './traits';
|
||||||
import View from './view';
|
import View from './view';
|
||||||
|
|
|
@ -7,15 +7,17 @@ import {JsonController, useJsonPatcher} from '@avocado/resource-persea';
|
||||||
import {
|
import {
|
||||||
PropTypes,
|
PropTypes,
|
||||||
React,
|
React,
|
||||||
Tab,
|
|
||||||
Tabs,
|
|
||||||
TabList,
|
|
||||||
TabPanel,
|
|
||||||
useFlecks,
|
useFlecks,
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from '@flecks/react';
|
} from '@flecks/react';
|
||||||
import difference from 'lodash.difference';
|
import difference from 'lodash.difference';
|
||||||
|
import {
|
||||||
|
Tab,
|
||||||
|
Tabs,
|
||||||
|
TabList,
|
||||||
|
TabPanel,
|
||||||
|
} from 'react-tabs';
|
||||||
|
|
||||||
import Suggest from './suggest';
|
import Suggest from './suggest';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Flecks, Hooks} from '@flecks/react';
|
import {Flecks, Hooks} from '@flecks/core';
|
||||||
|
|
||||||
import EntityController from './controllers/entity';
|
import EntityController from './controllers/entity';
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ const Particle = ({
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className="emitter__particle-inputs">
|
<div className="emitter__particle-inputs">
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
||||||
<label>
|
<label>
|
||||||
Rate
|
Rate
|
||||||
<Number
|
<Number
|
||||||
|
@ -44,6 +45,7 @@ const Particle = ({
|
||||||
onChange={patch.onChange(join(path, 'rate'))}
|
onChange={patch.onChange(join(path, 'rate'))}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
||||||
<label>
|
<label>
|
||||||
Count
|
Count
|
||||||
<Number
|
<Number
|
||||||
|
|
72
packages/react/src/components/icon-pages/index.jsx
Normal file
72
packages/react/src/components/icon-pages/index.jsx
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
import {
|
||||||
|
classnames,
|
||||||
|
PropTypes,
|
||||||
|
React,
|
||||||
|
} from '@flecks/react';
|
||||||
|
|
||||||
|
import {locals} from './index.module.scss';
|
||||||
|
|
||||||
|
function IconPages({
|
||||||
|
iconPages,
|
||||||
|
iconsAreBelow,
|
||||||
|
index,
|
||||||
|
onIndexChanged,
|
||||||
|
}) {
|
||||||
|
const changeIndex = (index, event) => {
|
||||||
|
onIndexChanged(index, event);
|
||||||
|
};
|
||||||
|
const $icons = (
|
||||||
|
<div className={locals.icons}>
|
||||||
|
{iconPages.map(({Icon}, i) => (
|
||||||
|
<button
|
||||||
|
className={classnames({active: i === index})}
|
||||||
|
// eslint-disable-next-line react/no-array-index-key
|
||||||
|
key={i}
|
||||||
|
onClick={(event) => {
|
||||||
|
changeIndex(i, event);
|
||||||
|
}}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
{Icon}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<div className={locals['icon-pages']}>
|
||||||
|
{!iconsAreBelow && $icons}
|
||||||
|
<div className={locals.pages}>
|
||||||
|
{iconPages.map(({Page}, i) => (
|
||||||
|
<div
|
||||||
|
className={classnames(locals.page, index === i && locals.active)}
|
||||||
|
// eslint-disable-next-line react/no-array-index-key
|
||||||
|
key={i}
|
||||||
|
>
|
||||||
|
{Page}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{iconsAreBelow && $icons}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
IconPages.defaultProps = {
|
||||||
|
iconsAreBelow: true,
|
||||||
|
index: 0,
|
||||||
|
onIndexChanged: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
IconPages.displayName = 'IconPages';
|
||||||
|
|
||||||
|
IconPages.propTypes = {
|
||||||
|
iconsAreBelow: PropTypes.bool,
|
||||||
|
iconPages: PropTypes.arrayOf(PropTypes.shape({
|
||||||
|
Icon: PropTypes.node,
|
||||||
|
Page: PropTypes.node,
|
||||||
|
})).isRequired,
|
||||||
|
index: PropTypes.number,
|
||||||
|
onIndexChanged: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default IconPages;
|
58
packages/react/src/components/icon-pages/index.module.scss
Normal file
58
packages/react/src/components/icon-pages/index.module.scss
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
.icon-pages {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pages {
|
||||||
|
flex-grow: 1;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
display: none;
|
||||||
|
overflow: auto;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
display: block;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icons {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
height: 3rem;
|
||||||
|
justify-content: space-around;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
button {
|
||||||
|
background-color: transparent;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
flex-grow: 1;
|
||||||
|
height: 3em;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 1rem;
|
||||||
|
width: 2em;
|
||||||
|
|
||||||
|
&:focus, &:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:global(.active) {
|
||||||
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
|
border-bottom: 2px solid #009fb4;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
fill: #999;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
export {default as Code} from './components/code';
|
export {default as Code} from './components/code';
|
||||||
|
export {default as IconPages} from './components/icon-pages';
|
||||||
export {default as Json} from './components/json';
|
export {default as Json} from './components/json';
|
||||||
export {default as Modal} from './components/modal';
|
export {default as Modal} from './components/modal';
|
||||||
export {default as Number} from './components/number';
|
export {default as Number} from './components/number';
|
||||||
|
|
|
@ -3,8 +3,8 @@ import {basename} from 'path';
|
||||||
import {
|
import {
|
||||||
PropTypes,
|
PropTypes,
|
||||||
React,
|
React,
|
||||||
useParams,
|
|
||||||
} from '@flecks/react';
|
} from '@flecks/react';
|
||||||
|
import {useParams} from '@flecks/react/router';
|
||||||
|
|
||||||
import useResourceController from '../../hooks/use-resource-controller';
|
import useResourceController from '../../hooks/use-resource-controller';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {useParams} from '@flecks/react';
|
import {useParams} from '@flecks/react/router';
|
||||||
import {useDispatch} from '@flecks/redux';
|
import {useDispatch} from '@flecks/redux';
|
||||||
import {compare} from 'fast-json-patch';
|
import {compare} from 'fast-json-patch';
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default {
|
||||||
[Hooks]: {
|
[Hooks]: {
|
||||||
'@flecks/core.starting': async (flecks) => {
|
'@flecks/core.starting': async (flecks) => {
|
||||||
const Controllers = (
|
const Controllers = (
|
||||||
await flecks.invokeOrdered('@avocado/resource-persea.controllers')
|
await flecks.invokeSequentialAsync('@avocado/resource-persea.controllers')
|
||||||
).flat();
|
).flat();
|
||||||
Controllers.push(
|
Controllers.push(
|
||||||
JsonController,
|
JsonController,
|
||||||
|
|
|
@ -10,10 +10,10 @@ import {
|
||||||
PropTypes,
|
PropTypes,
|
||||||
React,
|
React,
|
||||||
useEffect,
|
useEffect,
|
||||||
useParams,
|
|
||||||
useFlecks,
|
useFlecks,
|
||||||
useState,
|
useState,
|
||||||
} from '@flecks/react';
|
} from '@flecks/react';
|
||||||
|
import {useParams} from '@flecks/react/router';
|
||||||
|
|
||||||
const AnimationVisualization = ({json}) => {
|
const AnimationVisualization = ({json}) => {
|
||||||
const flecks = useFlecks();
|
const flecks = useFlecks();
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"@avocado/entity-persea": "^3.0.0",
|
"@avocado/entity-persea": "^3.0.0",
|
||||||
"@avocado/graphics": "^3.0.0",
|
"@avocado/graphics": "^3.0.0",
|
||||||
"@avocado/math": "^3.0.0",
|
"@avocado/math": "^3.0.0",
|
||||||
|
"@avocado/react": "^3.0.0",
|
||||||
"@avocado/resource-persea": "^3.0.0",
|
"@avocado/resource-persea": "^3.0.0",
|
||||||
"@avocado/timing": "^3.0.0",
|
"@avocado/timing": "^3.0.0",
|
||||||
"@flecks/core": "^1.3.0",
|
"@flecks/core": "^1.3.0",
|
||||||
|
|
|
@ -6,19 +6,21 @@ import {
|
||||||
Rectangle,
|
Rectangle,
|
||||||
Vector,
|
Vector,
|
||||||
} from '@avocado/math';
|
} from '@avocado/math';
|
||||||
|
import {
|
||||||
|
IconPages,
|
||||||
|
} from '@avocado/react';
|
||||||
import {
|
import {
|
||||||
classnames,
|
classnames,
|
||||||
hot,
|
hot,
|
||||||
IconPages,
|
|
||||||
PropTypes,
|
PropTypes,
|
||||||
React,
|
React,
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useFlecks,
|
useFlecks,
|
||||||
useParams,
|
|
||||||
usePrevious,
|
usePrevious,
|
||||||
useState,
|
useState,
|
||||||
} from '@flecks/react';
|
} from '@flecks/react';
|
||||||
|
import {useParams} from '@flecks/react/router';
|
||||||
|
|
||||||
import {locals} from './component.module.scss';
|
import {locals} from './component.module.scss';
|
||||||
|
|
||||||
|
|
|
@ -1108,8 +1108,8 @@
|
||||||
|
|
||||||
"@flecks/core@^1.3.0":
|
"@flecks/core@^1.3.0":
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
resolved "http://verdaccio.localhost/@flecks%2fcore/-/core-1.3.0.tgz#507420af7275bfd77b492545e88899bf8ddf1113"
|
resolved "http://verdaccio.localhost/@flecks%2fcore/-/core-1.3.0.tgz#864381f7923b9a026bcc1d94a96c198249ec06c7"
|
||||||
integrity sha512-G0j6VIPsRdrkVYBVAYyEYA8GgxNcOYKLhjHlm3SQjR5H7Xa64nHjQboJPHfY2fB01lOfAOHZlXZrHyYYvipzDA==
|
integrity sha512-XPs3hd0jKQT6D3MN8vHurBTVFzo5slFaVGLD9p1NK5iMIQIcOh88Hb0jWvlKLx1nhLS+tdHubuZn9oslD4kigQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/core" "^7.12.10"
|
"@babel/core" "^7.12.10"
|
||||||
"@babel/plugin-proposal-optional-chaining" "^7.12.16"
|
"@babel/plugin-proposal-optional-chaining" "^7.12.16"
|
||||||
|
@ -1157,8 +1157,8 @@
|
||||||
|
|
||||||
"@flecks/http@^1.3.0":
|
"@flecks/http@^1.3.0":
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
resolved "http://verdaccio.localhost/@flecks%2fhttp/-/http-1.3.0.tgz#bddd3301f0d3f551fff43c1210dc223c640804a2"
|
resolved "http://verdaccio.localhost/@flecks%2fhttp/-/http-1.3.0.tgz#0ba76cac5a3f1c6fa410721f58a5cc03dd7d126c"
|
||||||
integrity sha512-rk+PyLq3HptwCINNRZrOx3TWHA5pz1GCneCZXJZjDcr16l/8RR/SGdr3MemZeKFnyUf8eFJV0TnzEJhUoUUW3A==
|
integrity sha512-JErENN8Euzcbs6DdeNGdwUQMQmnSqej6rVWbkQKK8biDqJRkuYgyC9HL18WBnu3Sk4vfRvsRHILkL+H3rv/Sug==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/parser" "^7.17.0"
|
"@babel/parser" "^7.17.0"
|
||||||
"@babel/types" "^7.17.0"
|
"@babel/types" "^7.17.0"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user