From a919968f9c9afab92630b5b30778246c75a6c8ca Mon Sep 17 00:00:00 2001 From: Martin Karkowski Date: Fri, 15 Jul 2022 15:56:16 +0200 Subject: [PATCH] # 1.2.2 - Modified: - renaming the following constants in `lib/types/ui/editor/INodes`: - NODE_TYPE_CONSTANT = "node:data:constant"; - NODE_TYPE_DATA_TO_TOKEN = "node:logic:data-to-token"; - NODE_TYPE_FLOW_OPERATION = "node:logic:flow"; - NODE_TYPE_PLACE = "node:logic:place"; - NODE_TYPE_TOKEN_TO_DATA = "node:logic:token-to-data"; - NODE_TYPE_TRANSITION = "node:logic:transition"; - NODE_TYPE_VAR = "node:data:constant"; - NODE_TYPE_MODULE = "node:module"; - updating `TServiceGetPortsReturn` (adding `label` and removing `type`)and `IServiceEditPage` (remove `getPorts`) in `lib/types/ui/editor/IServiceEditPage` - relocating `IUiDefinition` to `lib/types/ui/helpers.interface` - influences `lib/ui/helpers.browser` and `lib/ui/helpers.nodejs` - fixing Link.bat --- 05-link.bat | 14 +++--- CHANGELOG.md | 18 ++++++- contribute/VERSION | 2 +- lib/types/ui/editor/INodes.ts | 34 +++++++------ lib/types/ui/editor/IServiceEditPage.ts | 12 +---- lib/types/ui/helpers.interface.ts | 64 ++++++++++++++++++++++++- lib/ui/helpers.browser.ts | 27 +---------- lib/ui/helpers.nodejs.ts | 2 +- package-lock.json | 4 +- package.json | 2 +- 10 files changed, 116 insertions(+), 63 deletions(-) diff --git a/05-link.bat b/05-link.bat index 177c622..d78f4e4 100644 --- a/05-link.bat +++ b/05-link.bat @@ -1,4 +1,4 @@ -@echo off + set DIR=%~dp0 cd "%DIR%" @@ -7,8 +7,8 @@ if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) (npm link) && ( node contribute/toLinkBrowser.js - cp ./package.json ./build/package.json - cp -r .\dist-browser\ .\build\dist-browser + copy .\\package.json .\\build\\package.json + copy -r .\dist-browser\ .\build\dist-browser cd ./build @@ -22,8 +22,8 @@ if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) ) || ( node contribute/toLinkBrowser.js - cp ./package.json ./build/package.json - cp -r .\dist-browser\ .\build\dist-browser + copy ./package.json ./build/package.json + copy -r .\dist-browser\ .\build\dist-browser cd ./build @@ -34,4 +34,6 @@ if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) cd "%DIR%" node contribute/toNodejs.js ) -) \ No newline at end of file +) + +pause \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a003481..3f1be2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -140,4 +140,20 @@ Inital commit, which is working with the browser - 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. \ No newline at end of file + - Adapted `TRenderFunction` removing the args setting. + +# 1.2.2 +- Modified: + - renaming the following constants in `lib/types/ui/editor/INodes`: + - NODE_TYPE_CONSTANT = "node:data:constant"; + - NODE_TYPE_DATA_TO_TOKEN = "node:logic:data-to-token"; + - NODE_TYPE_FLOW_OPERATION = "node:logic:flow"; + - NODE_TYPE_PLACE = "node:logic:place"; + - NODE_TYPE_TOKEN_TO_DATA = "node:logic:token-to-data"; + - NODE_TYPE_TRANSITION = "node:logic:transition"; + - NODE_TYPE_VAR = "node:data:constant"; + - NODE_TYPE_MODULE = "node:module"; + - updating `TServiceGetPortsReturn` (adding `label` and removing `type`)and `IServiceEditPage` (remove `getPorts`) in `lib/types/ui/editor/IServiceEditPage` + - relocating `IUiDefinition` to `lib/types/ui/helpers.interface` + - influences `lib/ui/helpers.browser` and `lib/ui/helpers.nodejs` + \ No newline at end of file diff --git a/contribute/VERSION b/contribute/VERSION index cb174d5..d2d61a7 100644 --- a/contribute/VERSION +++ b/contribute/VERSION @@ -1 +1 @@ -1.2.1 \ No newline at end of file +1.2.2 \ No newline at end of file diff --git a/lib/types/ui/editor/INodes.ts b/lib/types/ui/editor/INodes.ts index 56c3435..280e0b8 100644 --- a/lib/types/ui/editor/INodes.ts +++ b/lib/types/ui/editor/INodes.ts @@ -23,13 +23,14 @@ export type VALID_PORTS = | PORT_REQUIRE_TOKEN; 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"; -export type NODE_TYPE_PLACE = "logic:place"; -export type NODE_TYPE_TOKEN_TO_DATA = "logic:token-to-data"; -export type NODE_TYPE_TRANSITION = "logic:transition"; -export type NODE_TYPE_VAR = "data:constant"; +export type NODE_TYPE_CONSTANT = "node:data:constant"; +export type NODE_TYPE_DATA_TO_TOKEN = "node:logic:data-to-token"; +export type NODE_TYPE_FLOW_OPERATION = "node:logic:flow"; +export type NODE_TYPE_PLACE = "node:logic:place"; +export type NODE_TYPE_TOKEN_TO_DATA = "node:logic:token-to-data"; +export type NODE_TYPE_TRANSITION = "node:logic:transition"; +export type NODE_TYPE_VAR = "node:data:constant"; +export type NODE_TYPE_MODULE = "node:module"; export type VALID_NODES = | NODE_TYPE_GROUP @@ -40,6 +41,7 @@ export type VALID_NODES = | NODE_TYPE_TOKEN_TO_DATA | NODE_TYPE_TRANSITION | NODE_TYPE_VAR + | NODE_TYPE_MODULE | VALID_PORTS; export const PORT_AVOID_TOKEN: PORT_AVOID_TOKEN = "flow.input.avoid"; @@ -63,15 +65,18 @@ export const VALID_PORTS: Array = [ ]; export const NODE_TYPE_GROUP: NODE_TYPE_GROUP = "node:group"; -export const NODE_TYPE_CONSTANT: NODE_TYPE_CONSTANT = "data:constant"; +export const NODE_TYPE_CONSTANT: NODE_TYPE_CONSTANT = "node:data:constant"; export const NODE_TYPE_DATA_TO_TOKEN: NODE_TYPE_DATA_TO_TOKEN = - "logic:data-to-token"; -export const NODE_TYPE_FLOW_OPERATION: NODE_TYPE_FLOW_OPERATION = "logic:flow"; -export const NODE_TYPE_PLACE: NODE_TYPE_PLACE = "logic:place"; + "node:logic:data-to-token"; +export const NODE_TYPE_FLOW_OPERATION: NODE_TYPE_FLOW_OPERATION = + "node:logic:flow"; +export const NODE_TYPE_PLACE: NODE_TYPE_PLACE = "node:logic:place"; export const NODE_TYPE_TOKEN_TO_DATA: NODE_TYPE_TOKEN_TO_DATA = - "logic:token-to-data"; -export const NODE_TYPE_TRANSITION: NODE_TYPE_TRANSITION = "logic:transition"; -export const NODE_TYPE_VAR: NODE_TYPE_VAR = "data:constant"; + "node:logic:token-to-data"; +export const NODE_TYPE_TRANSITION: NODE_TYPE_TRANSITION = + "node:logic:transition"; +export const NODE_TYPE_VAR: NODE_TYPE_VAR = "node:data:constant"; +export const NODE_TYPE_MODULE: NODE_TYPE_MODULE = "node:module"; export const VALID_NODES: Array = [ NODE_TYPE_GROUP, @@ -81,6 +86,7 @@ export const VALID_NODES: Array = [ NODE_TYPE_PLACE, NODE_TYPE_TOKEN_TO_DATA, NODE_TYPE_TRANSITION, + NODE_TYPE_MODULE, NODE_TYPE_VAR, ]; VALID_PORTS.map((id) => VALID_NODES.push(id)); diff --git a/lib/types/ui/editor/IServiceEditPage.ts b/lib/types/ui/editor/IServiceEditPage.ts index 489836c..870ec4e 100644 --- a/lib/types/ui/editor/IServiceEditPage.ts +++ b/lib/types/ui/editor/IServiceEditPage.ts @@ -4,7 +4,6 @@ */ import { TRenderFunctionResult } from "../layout.interface"; -import { IPort } from "./INodes"; /** * Type to define the Ports of a UI: @@ -12,13 +11,11 @@ import { IPort } from "./INodes"; export type TServiceGetPortsReturn = { inputs: { id: string; - label: String; - type: IPort["type"]; + label: string; }[]; outputs: { id: string; - label: String; - type: IPort["type"]; + label: string; }[]; }; @@ -48,9 +45,4 @@ export interface IServiceEditPage extends TRenderFunctionResult { * Element showing the type of the edit panel. */ type: "node" | "edge"; - - /** - * Helper to define the Ports. - */ - getPorts?: TGetPorts; } diff --git a/lib/types/ui/helpers.interface.ts b/lib/types/ui/helpers.interface.ts index 5d4d211..8f61cbe 100644 --- a/lib/types/ui/helpers.interface.ts +++ b/lib/types/ui/helpers.interface.ts @@ -7,7 +7,12 @@ import * as go from "gojs"; import { ILogger } from "js-logger"; import * as plotly from "plotly.js"; import { IJsonSchema } from "../IJSONSchema"; -import { INopeDispatcher, INopeObservable } from "../nope/index"; +import { + IClassDescription, + IFunctionOptions, + INopeDispatcher, + INopeObservable, +} from "../nope/index"; import { IMinProvidedDataSet, IPanel, @@ -142,6 +147,59 @@ export type TcreateLayoutOptions = { colors?: any; }; +export interface IUiDefinition { + /** + * Contains the ui-defintions of the Functions + */ + functions: { + /** + * index - Function ID: + */ + [index: string]: { + /** + * The provided UI-Functions + */ + ui: IFunctionOptions["ui"]; + /** + * Original ID of the Function. + */ + id: string; + }; + }; + /** + * Contains all UIs for the class + */ + classes: { + /** + * Index = Class-Identifier. + */ + [index: string]: { + /** + * The UI Defintion of the Class. + */ + ui?: IClassDescription["ui"]; + /** + * Name of the Package + */ + package: string; + /** + * Path of the defintio file. + */ + path?: string; + /** + * Class identifier + */ + class: string; + /** + * The Methods of the class + */ + methods: { + [index: string]: IFunctionOptions["ui"]; + }; + }; + }; +} + export type IUiTheme = { colors: { primary: string; @@ -439,6 +497,10 @@ export interface IRenderData { getTheme(): IUiTheme; }; }; + /** + * Contains the information about the session. + */ + session: IUiDefinition; logger: ILogger; dispatcher: INopeDispatcher; libraries: TLibraries; diff --git a/lib/ui/helpers.browser.ts b/lib/ui/helpers.browser.ts index e378121..f30228f 100644 --- a/lib/ui/helpers.browser.ts +++ b/lib/ui/helpers.browser.ts @@ -1,10 +1,5 @@ import { stringifyWithFunctions } from "../helpers/jsonMethods"; -import { - IClassDescription, - IFunctionOptions, - IGenericNopeModule, - INopeModule, -} from "../types"; +import { IGenericNopeModule, INopeModule } from "../types"; import { TRenderInstancePage } from "../types/ui"; /** @@ -21,23 +16,3 @@ export function convertInstanceRenderPage( ): string { return stringifyWithFunctions(callback); } - -export interface IUiDefinition { - functions: { - [index: string]: { - ui: IFunctionOptions["ui"]; - id: string; - }; - }; - classes: { - [index: string]: { - ui?: IClassDescription["ui"]; - package: string; - class: string; - path: string; - methods: { - [index: string]: IFunctionOptions["ui"]; - }; - }; - }; -} diff --git a/lib/ui/helpers.nodejs.ts b/lib/ui/helpers.nodejs.ts index aee9b07..1c7e2bb 100644 --- a/lib/ui/helpers.nodejs.ts +++ b/lib/ui/helpers.nodejs.ts @@ -13,7 +13,7 @@ import { stringifyWithFunctions, } from "../index.browser"; import { listFunctions, listPackages } from "../index.nodejs"; -import { IUiDefinition } from "./helpers.browser"; +import { IUiDefinition } from "../types/ui"; /** * Helper Function to write a default configuration. diff --git a/package-lock.json b/package-lock.json index f1a5383..7dfd85e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nope", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nope", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "dependencies": { "argparse": "^2.0.1", diff --git a/package.json b/package.json index 73f847b..e2c2eec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nope", - "version": "1.2.1", + "version": "1.2.2", "description": "NoPE Runtime for Nodejs. For Browser-Support please use nope-browser", "files": [ "dist-nodejs/**/*",