updating to version 1.2.1

This commit is contained in:
Martin Karkowski 2022-07-05 08:32:11 +02:00
parent 6eaeeb760e
commit 338a488ec7
11 changed files with 78 additions and 26 deletions

View File

@ -132,3 +132,12 @@ Inital commit, which is working with the browser
- `lib/types/index`: Exporting `ui` elements
- Fixes:
- `types/nope/nopeInstanceManager.interface`: Fixing Type of createInstance. Now the Type `I` extends `INopeModule` instead of being set to `IGenericNopeModule`
# 1.2.1
- Added:
- `types/ui/helpers.interface`: Added the ui section in `IRenderData`. This contains the following props: `fullscreen` (INopeObservable<boolean>) to controll the fullscreen / ge the state. Additionally the functions `openFullscreen`, `closeFullScreen` and `getTheme` have been added. Added type `IUiTheme`
- Modified:
- Renamed `IEditPage` to `IServiceEditPage`
- Renamed `NODE_TYPE_COMPOSED` to `NODE_TYPE_GROUP`
- Adapted `TRenderConfigureServicePage`, `TRenderInstancePage` and `TInstanceManagerPage` by adding `Extension`-Type
- Adapted `TRenderFunction` removing the args setting.

View File

@ -1 +1 @@
1.2.0
1.2.1

View File

@ -22,7 +22,7 @@ export type VALID_PORTS =
| PORT_PRODUCE_TOKEN
| PORT_REQUIRE_TOKEN;
export type NODE_TYPE_COMPOSED = "node:composed";
export type NODE_TYPE_GROUP = "node:group";
export type NODE_TYPE_CONSTANT = "data:constant";
export type NODE_TYPE_DATA_TO_TOKEN = "logic:data-to-token";
export type NODE_TYPE_FLOW_OPERATION = "logic:flow";
@ -32,7 +32,7 @@ export type NODE_TYPE_TRANSITION = "logic:transition";
export type NODE_TYPE_VAR = "data:constant";
export type VALID_NODES =
| NODE_TYPE_COMPOSED
| NODE_TYPE_GROUP
| NODE_TYPE_CONSTANT
| NODE_TYPE_DATA_TO_TOKEN
| NODE_TYPE_FLOW_OPERATION
@ -62,7 +62,7 @@ export const VALID_PORTS: Array<VALID_PORTS> = [
PORT_REQUIRE_TOKEN,
];
export const NODE_TYPE_COMPOSED: NODE_TYPE_COMPOSED = "node:composed";
export const NODE_TYPE_GROUP: NODE_TYPE_GROUP = "node:group";
export const NODE_TYPE_CONSTANT: NODE_TYPE_CONSTANT = "data:constant";
export const NODE_TYPE_DATA_TO_TOKEN: NODE_TYPE_DATA_TO_TOKEN =
"logic:data-to-token";
@ -74,7 +74,7 @@ export const NODE_TYPE_TRANSITION: NODE_TYPE_TRANSITION = "logic:transition";
export const NODE_TYPE_VAR: NODE_TYPE_VAR = "data:constant";
export const VALID_NODES: Array<VALID_NODES> = [
NODE_TYPE_COMPOSED,
NODE_TYPE_GROUP,
NODE_TYPE_CONSTANT,
NODE_TYPE_DATA_TO_TOKEN,
NODE_TYPE_FLOW_OPERATION,
@ -96,6 +96,8 @@ export interface IBaseNode {
width: number;
height: number;
};
group?: number | string;
isGroup?: boolean;
}
export interface IPort {

View File

@ -6,7 +6,7 @@
import { TRenderFunctionResult } from "../layout.interface";
import { IPort } from "./INodes";
export interface IEditPage<T = any> extends TRenderFunctionResult {
export interface IServiceEditPage<T = any> extends TRenderFunctionResult {
/**
* Function, which must return the current service-data.
*
@ -14,7 +14,7 @@ export interface IEditPage<T = any> extends TRenderFunctionResult {
* @return {boolean}
* @memberof IEditPage
*/
getData(): any;
getData(): T;
/**
* Function which must return true, if the Entered-

View File

@ -5,7 +5,7 @@
*/
export * from "./IEdges";
export * from "./IEditPage";
export * from "./IServiceEditPage";
export * from "./IEdges";
// export * from "./INetwork";
export * from "./INodes";

View File

@ -4,13 +4,13 @@
*/
import { IRenderData } from "../helpers.interface";
import { IEditPage } from "./IEditPage";
import { IServiceEditPage } from "./IServiceEditPage";
import { PN } from "./INodes";
/** Helper to configurate a service */
export type TRenderConfigureServicePage<T extends PN> = (
export type TRenderConfigureServicePage<T extends PN, Extension = {}> = (
div: HTMLDivElement,
options: IRenderData & {
input: T;
}
) => IEditPage;
} & Extension
) => IServiceEditPage;

View File

@ -142,6 +142,25 @@ export type TcreateLayoutOptions = {
colors?: any;
};
export type IUiTheme = {
colors: {
primary: string;
secondary: string;
success: string;
info: string;
warning: string;
danger: string;
light: string;
dark: string;
};
font: {
size: number;
type: string;
color: string;
computedFont: string;
};
};
/** Helper for the provided data: */
export interface IRenderData {
helpers: {
@ -400,6 +419,25 @@ export interface IRenderData {
}): void;
};
};
ui: {
/**
* Contains a Flag to toggle the ui into fullscreen or not.
*/
readonly fullscreen: INopeObservable<boolean>;
/**
* Function, used to set the system to Fullscreen
*/
openFullscreen(): void;
/**
* Function, used to close the fullscreen.
*/
closeFullscreen(): void;
/**
* Returns a defintion of the currently used colors.
*/
getTheme(): IUiTheme;
};
};
logger: ILogger;
dispatcher: INopeDispatcher;

View File

@ -944,16 +944,14 @@ export type TRenderFunctionResult = {
export type TRenderFunction<
I,
O extends TRenderFunctionResult = TRenderFunctionResult,
D extends IMinProvidedDataSet = IMinProvidedDataSet,
A = any
D extends IMinProvidedDataSet = IMinProvidedDataSet
> = (
div: HTMLElement,
div: HTMLDivElement,
options: {
input: I;
setVisibilityOfPanel: (value: boolean) => void;
layout: IBasicLayoutComponent<D>;
},
args: A
}
) => O;
/**
@ -1092,13 +1090,12 @@ export interface IBasicLayoutComponent<
*/
openDynamicW2UiPanel<
I = any,
A = any,
O extends TRenderFunctionResult = TRenderFunctionResult
>(options: {
/** Input which is fowarded to the render Function "render" */
input?: I;
/** Callback which will be called to create the element */
render: TRenderFunction<I, O, D, A>;
render: TRenderFunction<I, O, D>;
/** Appends the Panel or replaces it. */
append?: boolean;
/** Show the Panel on creating */

View File

@ -15,18 +15,24 @@ import { IRenderData } from "./helpers.interface";
import { TRenderFunctionResult } from "./layout.interface";
/** Helper used, to render the instance details */
export type TRenderInstancePage<T extends INopeModule = INopeModule> = (
export type TRenderInstancePage<
T extends INopeModule = INopeModule,
Extension = {}
> = (
/** The DIV Element */
div: HTMLDivElement,
/** The Provided Options used by the function to create the ui */
options: IRenderData & {
/** The Instance to Render. */
input: T & IGenericNopeModule;
}
} & Extension
) => TRenderFunctionResult;
/** UI to define an instance. */
export type TInstanceManagerPage<T extends INopeModule = INopeModule> = (
export type TInstanceManagerPage<
T extends INopeModule = INopeModule,
Extension = {}
> = (
/** The DIV Element */
div: HTMLDivElement,
/** The Provided Options used by the function to create the ui */
@ -42,5 +48,5 @@ export type TInstanceManagerPage<T extends INopeModule = INopeModule> = (
}
) => Promise<T & IGenericNopeModule>;
instances: Array<INopeModuleDescription>;
}
} & Extension
) => void;

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "nope",
"version": "1.1.1",
"version": "1.2.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "nope",
"version": "1.1.1",
"version": "1.2.0",
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "nope",
"version": "1.2.0",
"version": "1.2.1",
"description": "NoPE Runtime for Nodejs. For Browser-Support please use nope-browser",
"files": [
"dist-nodejs/**/*",