@treenity/core 1.0.18 → 1.0.20
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/CHANGELOG.md +15 -0
- package/dist/context.d.ts +6 -7
- package/dist/context.mjs +1 -1
- package/dist/contexts/{react → noflo}/types.d.ts +2 -1
- package/dist/index.d.ts +0 -1
- package/dist/stats.html +1 -1
- package/jest.config.mjs +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @treenity/core
|
|
2
2
|
|
|
3
|
+
## 1.0.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @treenity/js-shared@1.0.19
|
|
9
|
+
|
|
10
|
+
## 1.0.19
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Update something
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @treenity/js-shared@1.0.18
|
|
17
|
+
|
|
3
18
|
## 1.0.18
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/context.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Obj } from '@treenity/js-shared';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { PropsWithChildren } from 'react';
|
|
4
3
|
import { JsonObjectSchema } from './contexts/json-schema/types';
|
|
5
|
-
import {
|
|
4
|
+
import { PortsDescription } from './contexts/noflo/types';
|
|
6
5
|
import { Meta, Node } from './meta';
|
|
7
6
|
export interface TypeContextInfo<C, O> {
|
|
8
7
|
id: string;
|
|
@@ -20,6 +19,7 @@ export interface Context<C, O> {
|
|
|
20
19
|
getInfo(typeName: string): Promise<TypeContextInfo<C, O>>;
|
|
21
20
|
getInfo(subContext: string, typeName: string): Promise<TypeContextInfo<C, O>>;
|
|
22
21
|
search(query: string): TypeContextInfo<C, O>[];
|
|
22
|
+
search(subContext: string, query: string): TypeContextInfo<C, O>[];
|
|
23
23
|
}
|
|
24
24
|
export declare class ContextImpl<C, O> implements Context<C, O> {
|
|
25
25
|
name: string;
|
|
@@ -28,18 +28,17 @@ export declare class ContextImpl<C, O> implements Context<C, O> {
|
|
|
28
28
|
add(...args: any[]): TypeContextInfo<C, O>;
|
|
29
29
|
getInfo(subContext: string, typeName?: string): Promise<TypeContextInfo<C, O>>;
|
|
30
30
|
get(subContext: string, typeName?: string): Promise<[C, O]>;
|
|
31
|
-
search(
|
|
31
|
+
search(subContext: string, query?: string): TypeContextInfo<C, O>[];
|
|
32
32
|
}
|
|
33
33
|
export interface ReactContextOptions {
|
|
34
34
|
props?: Obj<any>;
|
|
35
|
-
ports?: PortTypeData;
|
|
36
35
|
}
|
|
37
|
-
export
|
|
36
|
+
export type IReactContextProps<T extends Meta = Meta, P = unknown> = {
|
|
38
37
|
value: T;
|
|
39
38
|
node: Node;
|
|
40
39
|
onChange(setter: (m: T) => T | void): void;
|
|
41
40
|
onChangeNode(setter: (node: Node) => Node | void): void;
|
|
42
|
-
}
|
|
41
|
+
} & P;
|
|
43
42
|
export type ReactTypeContextInfo = TypeContextInfo<React.FC<IReactContextProps>, ReactContextOptions>;
|
|
44
43
|
export interface ReactTypeContext extends Context<React.FC<IReactContextProps>, ReactContextOptions> {
|
|
45
44
|
}
|
|
@@ -55,7 +54,7 @@ export interface ServiceTypeContext extends Context<Service, ServiceContextOptio
|
|
|
55
54
|
}
|
|
56
55
|
export type ScriptNode = (...params: any[]) => any;
|
|
57
56
|
export interface NodeEngineContextOptions {
|
|
58
|
-
ports:
|
|
57
|
+
ports: PortsDescription;
|
|
59
58
|
}
|
|
60
59
|
export type NodeEngineTypeContextInfo = TypeContextInfo<ScriptNode, NodeEngineContextOptions>;
|
|
61
60
|
export interface NodeEngineTypeContext extends Context<ScriptNode, NodeEngineContextOptions> {
|
package/dist/context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{capitalize as e}from"@treenity/js-shared/utils";import{SynchronousPromise as t}from"synchronous-promise";class s{name;items=new Map;constructor(e){this.name=e,n[e]=this}add(...e){e.length
|
|
1
|
+
import{capitalize as e}from"@treenity/js-shared/utils";import{SynchronousPromise as t}from"synchronous-promise";class s{name;items=new Map;constructor(e){this.name=e,n[e]=this}add(...e){e.length<=3&&e.unshift("");const[t,s,n,o]=e,r=t?t+":"+s:s,a={id:r,context:this.name,subContext:t,component:n,options:o};return this.items.set(r,a),a}getInfo(e,s){s||(s=e,e="");const n=e?e+":"+s:s,o=this.items.get(n);return o?t.resolve(o):t.reject(new Error("not found: "+n))}get(e,t){return this.getInfo(e,t).then((({component:e,options:t})=>[e,t]))}search(e,t){const s=[];t||(t=e,e="");for(let n of this.items.values()){const o=n.subContext===e,r=n.id.includes(t);o&&r&&s.push(n)}return s}}const n={};new class extends s{add(...t){if(4===t.length){const[,s,n]=t;n.displayName||n.name||(n.displayName=e(s))}else{const[s,n]=t;n.displayName||n.name||(n.displayName=e(s))}return super.add(...t)}}("react"),new class extends s{}("meta"),new class extends s{}("proto"),new class extends s{}("jsSrv"),new class extends s{}("noflo");export{s as ContextImpl,n as types};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface PortsDescription {
|
|
2
2
|
in: Record<string, Omit<ISocket, 'name'> | string>;
|
|
3
3
|
out: Record<string, Omit<ISocket, 'name'> | string>;
|
|
4
4
|
}
|
|
@@ -7,6 +7,7 @@ export interface ISocket<D extends any = {}> {
|
|
|
7
7
|
name: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
type: string;
|
|
10
|
+
required?: boolean;
|
|
10
11
|
dynamic?: boolean;
|
|
11
12
|
value?: D;
|
|
12
13
|
isComplex?: boolean;
|
package/dist/index.d.ts
CHANGED
package/dist/stats.html
CHANGED
|
@@ -4822,7 +4822,7 @@ var drawChart = (function (exports) {
|
|
|
4822
4822
|
</script>
|
|
4823
4823
|
<script>
|
|
4824
4824
|
/*<!--*/
|
|
4825
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.mjs","children":[{"name":"src/index.ts","uid":"
|
|
4825
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.mjs","children":[{"name":"src/index.ts","uid":"36925c29-1"}]},{"name":"context.mjs","children":[{"name":"src/context.ts","uid":"36925c29-3"}]},{"name":"meta.mjs","children":[{"name":"src/meta.ts","uid":"36925c29-5"}]}],"isRoot":true},"nodeParts":{"36925c29-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"36925c29-0"},"36925c29-3":{"renderedLength":2915,"gzipLength":798,"brotliLength":0,"metaUid":"36925c29-2"},"36925c29-5":{"renderedLength":138,"gzipLength":118,"brotliLength":0,"metaUid":"36925c29-4"}},"nodeMetas":{"36925c29-0":{"id":"/src/index.ts","moduleParts":{"index.mjs":"36925c29-1"},"imported":[{"uid":"36925c29-2"},{"uid":"36925c29-6"},{"uid":"36925c29-4"}],"importedBy":[],"isEntry":true},"36925c29-2":{"id":"/src/context.ts","moduleParts":{"context.mjs":"36925c29-3"},"imported":[{"uid":"36925c29-7"},{"uid":"36925c29-8"}],"importedBy":[{"uid":"36925c29-0"}]},"36925c29-4":{"id":"/src/meta.ts","moduleParts":{"meta.mjs":"36925c29-5"},"imported":[],"importedBy":[{"uid":"36925c29-0"}]},"36925c29-6":{"id":"/src/contexts/json-schema/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"36925c29-0"}]},"36925c29-7":{"id":"@treenity/js-shared/utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"36925c29-2"}],"isExternal":true},"36925c29-8":{"id":"synchronous-promise","moduleParts":{},"imported":[],"importedBy":[{"uid":"36925c29-2"}],"isExternal":true}},"env":{"rollup":"4.9.6"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4826
4826
|
|
|
4827
4827
|
const run = () => {
|
|
4828
4828
|
const width = window.innerWidth;
|
package/jest.config.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@treenity/build-utils/jest-node.config.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treenity/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "treenity core",
|
|
5
5
|
"author": "Treenity",
|
|
6
6
|
"license": "ISC",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@treenity/js-shared": "1.0.
|
|
17
|
+
"@treenity/js-shared": "1.0.19",
|
|
18
18
|
"json-schema-to-ts": "3.0.0",
|
|
19
19
|
"synchronous-promise": "2.0.17",
|
|
20
20
|
"tslib": "2.6.2"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@testing-library/dom": "^8.17.1",
|
|
27
27
|
"@testing-library/jest-dom": "^5.16.5",
|
|
28
28
|
"@testing-library/preact": "3.2.3",
|
|
29
|
-
"@treenity/build-utils": "1.1.
|
|
30
|
-
"@treenity/tsconfig": "1.0.
|
|
29
|
+
"@treenity/build-utils": "1.1.10",
|
|
30
|
+
"@treenity/tsconfig": "1.0.9",
|
|
31
31
|
"@types/jest": "29.5.12",
|
|
32
32
|
"@types/node": "20.11.16",
|
|
33
33
|
"@types/prop-types": "^15.7.5",
|