├── .gitignore ├── Angular ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── .gitignore │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── rete │ │ │ ├── components │ │ │ ├── add-component.ts │ │ │ ├── node │ │ │ │ ├── node.component.html │ │ │ │ ├── node.component.sass │ │ │ │ ├── node.component.ts │ │ │ │ └── vars.sass │ │ │ └── number-component.ts │ │ │ ├── controls │ │ │ └── number-control.ts │ │ │ ├── rete.component.css │ │ │ ├── rete.component.ts │ │ │ ├── sockets.ts │ │ │ └── tsconfig.json │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json ├── tslint.json └── webpack.config.js ├── Angular10 ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.component.html │ │ ├── app.component.sass │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── rete │ │ │ ├── components │ │ │ ├── add-component.ts │ │ │ ├── node │ │ │ │ ├── node.component.html │ │ │ │ ├── node.component.sass │ │ │ │ ├── node.component.ts │ │ │ │ └── vars.sass │ │ │ └── number-component.ts │ │ │ ├── controls │ │ │ └── number-control.ts │ │ │ ├── rete.component.css │ │ │ ├── rete.component.ts │ │ │ ├── sockets.ts │ │ │ └── tsconfig.json │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.sass │ └── test.ts ├── tsconfig.app.json ├── tsconfig.base.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── Angular8 ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.component.html │ │ ├── app.component.sass │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── rete │ │ │ ├── components │ │ │ ├── add-component.ts │ │ │ ├── node │ │ │ │ ├── node.component.html │ │ │ │ ├── node.component.sass │ │ │ │ ├── node.component.ts │ │ │ │ └── vars.sass │ │ │ └── number-component.ts │ │ │ ├── controls │ │ │ └── number-control.ts │ │ │ ├── rete.component.css │ │ │ ├── rete.component.ts │ │ │ ├── sockets.ts │ │ │ └── tsconfig.json │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.sass │ └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── Electron ├── .gitignore ├── LICENSE.md ├── README.md ├── index.html ├── main.js ├── package-lock.json ├── package.json └── rete.js ├── Module ├── components.js ├── data.js ├── index.html ├── index.js └── style.css ├── Phaser ├── .gitignore ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── index.js │ └── rete-editor.js └── webpack.config.js ├── README.md ├── Tasks ├── components.js ├── data.js ├── index.html ├── index.js └── style.css ├── Vue3 ├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ └── index.html └── src │ ├── App.vue │ ├── assets │ └── logo.png │ ├── components │ ├── Editor.vue │ └── NumControl.vue │ └── main.js └── nodejs ├── .gitignore ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | node_modules 3 | dist 4 | -------------------------------------------------------------------------------- /Angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /Angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /Angular/README.md: -------------------------------------------------------------------------------- 1 | # D3NE with Angular4 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.0. 4 | 5 | ## What's added 6 | 7 | 1. Installed library 8 | ```bash 9 | npm install --save d3-node-editor 10 | ``` 11 | 2. Added folder with d3ne component 12 | ``` 13 | src/app/d3ne 14 | ``` 15 | 3. app.module.ts 16 | 17 | ``` 18 | import { D3NEComponent } from './d3ne/d3ne.component' 19 | ``` 20 | 21 | 4. `` inside `app.component.html` 22 | 23 | 24 | 25 | ## Development server 26 | 27 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 28 | 29 | ## Code scaffolding 30 | 31 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 32 | 33 | ## Build 34 | 35 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 36 | 37 | ## Running unit tests 38 | 39 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 40 | 41 | ## Running end-to-end tests 42 | 43 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 44 | 45 | ## Further help 46 | 47 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 48 | -------------------------------------------------------------------------------- /Angular/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "cli": { 5 | "packageManager": "npm" 6 | }, 7 | "projects": { 8 | "app": { 9 | "root": "", 10 | "sourceRoot": "src", 11 | "projectType": "application", 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "tsconfig.json", 21 | "assets": [ 22 | "src/assets", 23 | "src/favicon.ico" 24 | ], 25 | "styles": [ 26 | "src/styles.css" 27 | ], 28 | "scripts": [], 29 | "preserveSymlinks": true 30 | }, 31 | "configurations": { 32 | "fast": { 33 | "optimization": false 34 | }, 35 | "next": { 36 | "fileReplacements": [ 37 | { 38 | "src": "src/environments/environment.ts", 39 | "replaceWith": "src/environments/environment.next.ts" 40 | } 41 | ], 42 | "serviceWorker": true 43 | }, 44 | "stable": { 45 | "fileReplacements": [ 46 | { 47 | "src": "src/environments/environment.ts", 48 | "replaceWith": "src/environments/environment.stable.ts" 49 | } 50 | ], 51 | "serviceWorker": true 52 | }, 53 | "archive": { 54 | "fileReplacements": [ 55 | { 56 | "src": "src/environments/environment.ts", 57 | "replaceWith": "src/environments/environment.archive.ts" 58 | } 59 | ], 60 | "serviceWorker": true 61 | } 62 | } 63 | }, 64 | "serve": { 65 | "builder": "@angular-devkit/build-angular:dev-server", 66 | "options": { 67 | "browserTarget": "app:build" 68 | }, 69 | "configurations": { 70 | "fast": { 71 | "browserTarget": "app:build:fast" 72 | }, 73 | "next": { 74 | "browserTarget": "app:build:next" 75 | }, 76 | "stable": { 77 | "browserTarget": "app:build:stable" 78 | }, 79 | "archive": { 80 | "browserTarget": "app:build:archive" 81 | } 82 | } 83 | }, 84 | "lint": { 85 | "builder": "@angular-devkit/build-angular:tslint", 86 | "options": { 87 | "tsConfig": [ 88 | "tsconfig.json" 89 | ], 90 | "exclude": [] 91 | } 92 | } 93 | }, 94 | 95 | "prefix": "app" 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Angular/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('angular4 App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Angular/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Angular/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Angular/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /Angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve app", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular-devkit/build-angular": "^0.10.2", 16 | "@angular/animations": "7.0.0", 17 | "@angular/common": "7.0.0", 18 | "@angular/compiler": "7.0.0", 19 | "@angular/core": "7.0.0", 20 | "@angular/elements": "^8.2.4", 21 | "@angular/forms": "7.0.0", 22 | "@angular/http": "7.0.0", 23 | "@angular/platform-browser": "7.0.0", 24 | "@angular/platform-browser-dynamic": "7.0.0", 25 | "@angular/router": "7.0.0", 26 | "babel-polyfill": "^6.26.0", 27 | "core-js": "^2.4.1", 28 | "rete": "^1.3.1-rc.3", 29 | "rete-angular-render-plugin": "^0.2.0-rc.1", 30 | "rete-connection-mastery-plugin": "^0.2.0", 31 | "rete-connection-plugin": "^0.8.3", 32 | "rete-context-menu-plugin": "^0.3.4", 33 | "rete-readonly-plugin": "^0.3.0", 34 | "rete-vue-render-plugin": "^0.3.3", 35 | "rxjs": "^6.3.3", 36 | "vue": "^2.6.5", 37 | "zone.js": "^0.8.26" 38 | }, 39 | "devDependencies": { 40 | "@angular/cli": "^7.0.2", 41 | "@angular/compiler-cli": "7.0.0", 42 | "@angular/language-service": "7.0.0", 43 | "@types/jasmine": "~2.5.53", 44 | "@types/jasminewd2": "~2.0.2", 45 | "@types/node": "~6.0.60", 46 | "codelyzer": "^4.0.1", 47 | "jasmine-core": "~2.6.2", 48 | "jasmine-spec-reporter": "~4.1.0", 49 | "karma": "~1.7.0", 50 | "karma-chrome-launcher": "~2.1.1", 51 | "karma-cli": "~1.0.1", 52 | "karma-coverage-istanbul-reporter": "^1.2.1", 53 | "karma-jasmine": "~1.1.0", 54 | "karma-jasmine-html-reporter": "^0.2.2", 55 | "protractor": "~5.1.2", 56 | "ts-node": "~3.2.0", 57 | "tslint": "~5.7.0", 58 | "typescript": "3.1.3" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Angular/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /Angular/src/.gitignore: -------------------------------------------------------------------------------- 1 | render-plugin -------------------------------------------------------------------------------- /Angular/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular/src/app/app.component.css -------------------------------------------------------------------------------- /Angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.css', ] 8 | }) 9 | export class AppComponent { 10 | title = 'app'; 11 | } 12 | -------------------------------------------------------------------------------- /Angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, Injector } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { ReteComponent } from './rete/rete.component'; 6 | import { ReteModule } from 'rete-angular-render-plugin'; 7 | import { NumberComponent } from './rete/controls/number-control'; 8 | import { MyNodeComponent } from './rete/components/node/node.component'; 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent, 13 | ReteComponent, 14 | NumberComponent, 15 | MyNodeComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | ReteModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent], 23 | entryComponents: [NumberComponent, MyNodeComponent] 24 | }) 25 | export class AppModule {} 26 | -------------------------------------------------------------------------------- /Angular/src/app/rete/components/add-component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Output, Node } from 'rete'; 2 | import { numSocket } from '../sockets'; 3 | import { NumControl } from '../controls/number-control'; 4 | import { AngularComponent, AngularComponentData } from 'rete-angular-render-plugin'; 5 | import { MyNodeComponent } from './node/node.component'; 6 | 7 | export class AddComponent extends Component implements AngularComponent { 8 | data: AngularComponentData; 9 | 10 | constructor() { 11 | super('Add'); 12 | this.data.render = 'angular'; 13 | this.data.component = MyNodeComponent; 14 | } 15 | 16 | async builder(node) { 17 | const inp1 = new Input('num1', 'Number', numSocket); 18 | const inp2 = new Input('num2', 'Number', numSocket); 19 | const out = new Output('num', 'Number', numSocket); 20 | 21 | inp1.addControl(new NumControl(this.editor, 'num1')); 22 | inp2.addControl(new NumControl(this.editor, 'num2')); 23 | 24 | node.addInput(inp1) 25 | .addInput(inp2) 26 | .addControl(new NumControl(this.editor, 'preview', true)) 27 | .addOutput(out); 28 | } 29 | 30 | worker(node, inputs, outputs) { 31 | const n1 = inputs['num1'].length ? inputs['num1'][0] : node.data.num1; 32 | const n2 = inputs['num2'].length ? inputs['num2'][0] : node.data.num2; 33 | const sum = n1 + n2; 34 | 35 | const ctrl = this.editor.nodes.find(n => n.id === node.id).controls.get('preview'); 36 | ctrl.setValue(sum); 37 | outputs['num'] = sum; 38 | } 39 | 40 | created(node) { 41 | console.log('created', node); 42 | } 43 | 44 | destroyed(node) { 45 | console.log('destroyed', node); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Angular/src/app/rete/components/node/node.component.html: -------------------------------------------------------------------------------- 1 |
2 |
{{node.name}}
3 |
4 |
{{output.name}}
5 | 6 |
7 |
8 |
9 | 10 |
{{input.name}}
11 |
12 |
13 |
-------------------------------------------------------------------------------- /Angular/src/app/rete/components/node/node.component.sass: -------------------------------------------------------------------------------- 1 | @import "./vars" 2 | 3 | .node 4 | background: $node-color 5 | border: 2px solid #4e58bf 6 | border-radius: 10px 7 | cursor: pointer 8 | min-width: $node-width 9 | height: auto 10 | padding-bottom: 6px 11 | box-sizing: content-box 12 | position: relative 13 | user-select: none 14 | &:hover 15 | background: lighten($node-color,4%) 16 | &.selected 17 | background: $node-color-selected 18 | border-color: #e3c000 19 | .title 20 | color: white 21 | font-family: sans-serif 22 | font-size: 18px 23 | padding: 8px 24 | .output 25 | text-align: right 26 | .input 27 | text-align: left 28 | .input-title,.output-title 29 | vertical-align: middle 30 | color: white 31 | display: inline-block 32 | font-family: sans-serif 33 | font-size: 14px 34 | margin: $socket-margin 35 | line-height: $socket-size 36 | &[hidden] 37 | display: none 38 | .input-control 39 | z-index: 1 40 | width: calc(100% - #{$socket-size + 2*$socket-margin}) 41 | vertical-align: middle 42 | display: inline-block 43 | .control 44 | padding: $socket-margin $socket-size/2 + $socket-margin -------------------------------------------------------------------------------- /Angular/src/app/rete/components/node/node.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NodeComponent, NodeService } from 'rete-angular-render-plugin'; 3 | 4 | @Component({ 5 | templateUrl: './node.component.html', 6 | styleUrls: ['./node.component.sass'], 7 | providers: [NodeService] 8 | }) 9 | export class MyNodeComponent extends NodeComponent { 10 | constructor(protected service: NodeService) { 11 | super(service); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Angular/src/app/rete/components/node/vars.sass: -------------------------------------------------------------------------------- 1 | $node-color: rgba(70,36,155,0.8) 2 | $node-color-selected: #ffd92c 3 | $group-color: rgba(15,80,255,0.2) 4 | $group-handler-size: 40px 5 | $group-handler-offset: -10px 6 | $socket-size: 24px 7 | $socket-margin: 6px 8 | $socket-color: #96b38a 9 | $node-width: 180px -------------------------------------------------------------------------------- /Angular/src/app/rete/components/number-component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Output } from 'rete'; 2 | import { numSocket } from '../sockets'; 3 | import { NumControl } from '../controls/number-control'; 4 | 5 | export class NumComponent extends Component { 6 | 7 | constructor() { 8 | super('Number'); 9 | } 10 | 11 | builder(node) { 12 | const out1 = new Output('num', 'Number', numSocket); 13 | 14 | return node.addControl(new NumControl(this.editor, 'num')).addOutput(out1); 15 | } 16 | 17 | worker(node, inputs, outputs) { 18 | outputs['num'] = node.data.num; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Angular/src/app/rete/controls/number-control.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Type } from '@angular/core'; 2 | import { Control } from 'rete'; 3 | import { AngularControl } from 'rete-angular-render-plugin'; 4 | 5 | @Component({ 6 | template: ``, 7 | styles: [` 8 | input { 9 | border-radius: 30px; 10 | background-color: white; 11 | padding: 2px 6px; 12 | border: 1px solid #999; 13 | font-size: 110%; 14 | width: 140px; 15 | box-sizing: border-box; 16 | } 17 | `] 18 | }) 19 | export class NumberComponent { 20 | @Input() value!: number; 21 | @Input() readonly!: boolean; 22 | @Input() change!: Function; 23 | @Input() mounted!: Function; 24 | 25 | ngOnInit() { 26 | this.mounted(); 27 | } 28 | } 29 | 30 | export class NumControl extends Control implements AngularControl { 31 | component: Type 32 | props: {[key: string]: unknown} 33 | 34 | constructor(public emitter, public key, readonly = false) { 35 | super(key); 36 | 37 | this.component = NumberComponent; 38 | this.props = { 39 | readonly, 40 | change: v => this.onChange(v), 41 | value: 0, 42 | mounted: () => { 43 | this.setValue(+(this.getData(key) as any) || 0) 44 | } 45 | }; 46 | } 47 | 48 | onChange(val: number) { 49 | this.setValue(val); 50 | this.emitter.trigger('process'); 51 | } 52 | 53 | setValue(val: number) { 54 | this.props.value = +val; 55 | this.putData(this.key, this.props.value) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Angular/src/app/rete/rete.component.css: -------------------------------------------------------------------------------- 1 | .wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | } 5 | 6 | .socket.number{ 7 | background: #96b38a; 8 | } -------------------------------------------------------------------------------- /Angular/src/app/rete/rete.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; 2 | 3 | import { NodeEditor, Engine } from 'rete'; 4 | import ConnectionPlugin from 'rete-connection-plugin'; 5 | import ContextMenuPlugin from 'rete-context-menu-plugin'; 6 | import { NumComponent } from './components/number-component'; 7 | import { AddComponent } from './components/add-component'; 8 | import { AngularRenderPlugin } from 'rete-angular-render-plugin'; 9 | 10 | @Component({ 11 | selector: 'app-rete', 12 | template: '
', 13 | styleUrls: ['./rete.component.css'], 14 | }) 15 | 16 | export class ReteComponent implements AfterViewInit { 17 | 18 | @ViewChild('nodeEditor') el: ElementRef; 19 | editor = null; 20 | 21 | async ngAfterViewInit() { 22 | const container = this.el.nativeElement; 23 | 24 | const components = [new NumComponent(), new AddComponent()]; 25 | 26 | const editor = new NodeEditor('demo@0.2.0', container); 27 | editor.use(ConnectionPlugin); 28 | editor.use(AngularRenderPlugin)//, { component: MyNodeComponent }); 29 | editor.use(ContextMenuPlugin); 30 | 31 | const engine = new Engine('demo@0.2.0'); 32 | 33 | components.map(c => { 34 | editor.register(c); 35 | engine.register(c); 36 | }); 37 | 38 | const n1 = await components[0].createNode({ num: 2 }); 39 | const n2 = await components[0].createNode({ num: 0 }); 40 | const add = await components[1].createNode(); 41 | 42 | n1.position = [80, 200]; 43 | n2.position = [80, 400]; 44 | add.position = [500, 240]; 45 | 46 | editor.addNode(n1); 47 | editor.addNode(n2); 48 | editor.addNode(add); 49 | 50 | editor.connect(n1.outputs.get('num'), add.inputs.get('num1')); 51 | editor.connect(n2.outputs.get('num'), add.inputs.get('num2')); 52 | 53 | 54 | editor.on(['process', 'nodecreated', 'noderemoved', 'connectioncreated', 'connectionremoved'], (async () => { 55 | await engine.abort(); 56 | await engine.process(editor.toJSON()); 57 | }) as any); 58 | 59 | editor.view.resize(); 60 | editor.trigger('process'); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Angular/src/app/rete/sockets.ts: -------------------------------------------------------------------------------- 1 | import { Socket } from 'rete'; 2 | 3 | export const numSocket = new Socket('Number value'); 4 | -------------------------------------------------------------------------------- /Angular/src/app/rete/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "target": "es5", 5 | "lib": [ "es2015" ] 6 | } 7 | } -------------------------------------------------------------------------------- /Angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /Angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /Angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular/src/favicon.ico -------------------------------------------------------------------------------- /Angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /Angular/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | import 'babel-polyfill'; 44 | 45 | /** Evergreen browsers require these. **/ 46 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 47 | import 'core-js/es7/reflect'; 48 | 49 | 50 | /** 51 | * Required to support Web Animations `@angular/platform-browser/animations`. 52 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | 57 | 58 | /*************************************************************************************************** 59 | * Zone JS is required by default for Angular itself. 60 | */ 61 | import 'zone.js/dist/zone'; // Included with Angular CLI. 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | -------------------------------------------------------------------------------- /Angular/src/styles.css: -------------------------------------------------------------------------------- 1 | html, body, app-root { 2 | display: block; 3 | height: 100%; 4 | } -------------------------------------------------------------------------------- /Angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /Angular/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [], 8 | "lib": [ 9 | "es2015", 10 | "dom" 11 | ], 12 | "preserveSymlinks": true 13 | }, 14 | "exclude": [ 15 | "test.ts", 16 | "**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Angular/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Angular/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module : NodeModule; 3 | interface NodeModule { 4 | id : string; 5 | } 6 | 7 | declare module '*.html' { 8 | var template: string; 9 | export default template; 10 | } 11 | -------------------------------------------------------------------------------- /Angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "allowSyntheticDefaultImports": true, 11 | "target": "es6", 12 | "allowJs": true, 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2015", 18 | "dom" 19 | ] 20 | }, 21 | "include": [ 22 | "src/**/*.ts", 23 | "node_modules/rete/build/*.js" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /Angular/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs", 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": [ 26 | true, 27 | "spaces" 28 | ], 29 | "interface-over-type-literal": true, 30 | "label-position": true, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-access": false, 36 | "member-ordering": [ 37 | true, 38 | { 39 | "order": [ 40 | "static-field", 41 | "instance-field", 42 | "static-method", 43 | "instance-method" 44 | ] 45 | } 46 | ], 47 | "no-arg": true, 48 | "no-bitwise": true, 49 | "no-console": [ 50 | true, 51 | "debug", 52 | "info", 53 | "time", 54 | "timeEnd", 55 | "trace" 56 | ], 57 | "no-construct": true, 58 | "no-debugger": true, 59 | "no-duplicate-super": true, 60 | "no-empty": false, 61 | "no-empty-interface": true, 62 | "no-eval": true, 63 | "no-inferrable-types": [ 64 | true, 65 | "ignore-params" 66 | ], 67 | "no-misused-new": true, 68 | "no-non-null-assertion": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "typeof-compare": true, 111 | "unified-signatures": true, 112 | "variable-name": false, 113 | "whitespace": [ 114 | true, 115 | "check-branch", 116 | "check-decl", 117 | "check-operator", 118 | "check-separator", 119 | "check-type" 120 | ], 121 | "directive-selector": [ 122 | true, 123 | "attribute", 124 | "app", 125 | "camelCase" 126 | ], 127 | "component-selector": [ 128 | true, 129 | "element", 130 | "app", 131 | "kebab-case" 132 | ], 133 | "no-output-on-prefix": true, 134 | "use-input-property-decorator": true, 135 | "use-output-property-decorator": true, 136 | "use-host-property-decorator": true, 137 | "no-input-rename": true, 138 | "no-output-rename": true, 139 | "use-life-cycle-interface": true, 140 | "use-pipe-transform-interface": true, 141 | "component-class-suffix": true, 142 | "directive-class-suffix": true 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /Angular/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rulegs: [ 3 | { 4 | test: /\.vue$/, 5 | loader: 'vue-loader', 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /Angular10/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /Angular10/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /Angular10/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /Angular10/README.md: -------------------------------------------------------------------------------- 1 | # Angular9 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.1. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /Angular10/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular10": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:component": { 10 | "style": "sass" 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "prefix": "app", 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/angular10", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "tsconfig.app.json", 25 | "aot": true, 26 | "assets": [ 27 | "src/favicon.ico", 28 | "src/assets" 29 | ], 30 | "styles": [ 31 | "src/styles.sass" 32 | ], 33 | "scripts": [] 34 | }, 35 | "configurations": { 36 | "production": { 37 | "fileReplacements": [ 38 | { 39 | "replace": "src/environments/environment.ts", 40 | "with": "src/environments/environment.prod.ts" 41 | } 42 | ], 43 | "optimization": true, 44 | "outputHashing": "all", 45 | "sourceMap": false, 46 | "extractCss": true, 47 | "namedChunks": false, 48 | "extractLicenses": true, 49 | "vendorChunk": false, 50 | "buildOptimizer": true, 51 | "budgets": [ 52 | { 53 | "type": "initial", 54 | "maximumWarning": "2mb", 55 | "maximumError": "5mb" 56 | }, 57 | { 58 | "type": "anyComponentStyle", 59 | "maximumWarning": "6kb", 60 | "maximumError": "10kb" 61 | } 62 | ] 63 | } 64 | } 65 | }, 66 | "serve": { 67 | "builder": "@angular-devkit/build-angular:dev-server", 68 | "options": { 69 | "browserTarget": "angular10:build" 70 | }, 71 | "configurations": { 72 | "production": { 73 | "browserTarget": "angular10:build:production" 74 | } 75 | } 76 | }, 77 | "extract-i18n": { 78 | "builder": "@angular-devkit/build-angular:extract-i18n", 79 | "options": { 80 | "browserTarget": "angular10:build" 81 | } 82 | }, 83 | "test": { 84 | "builder": "@angular-devkit/build-angular:karma", 85 | "options": { 86 | "main": "src/test.ts", 87 | "polyfills": "src/polyfills.ts", 88 | "tsConfig": "tsconfig.spec.json", 89 | "karmaConfig": "karma.conf.js", 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets" 93 | ], 94 | "styles": [ 95 | "src/styles.sass" 96 | ], 97 | "scripts": [] 98 | } 99 | }, 100 | "lint": { 101 | "builder": "@angular-devkit/build-angular:tslint", 102 | "options": { 103 | "tsConfig": [ 104 | "tsconfig.app.json", 105 | "tsconfig.spec.json", 106 | "e2e/tsconfig.json" 107 | ], 108 | "exclude": [ 109 | "**/node_modules/**" 110 | ] 111 | } 112 | }, 113 | "e2e": { 114 | "builder": "@angular-devkit/build-angular:protractor", 115 | "options": { 116 | "protractorConfig": "e2e/protractor.conf.js", 117 | "devServerTarget": "angular10:serve" 118 | }, 119 | "configurations": { 120 | "production": { 121 | "devServerTarget": "angular10:serve:production" 122 | } 123 | } 124 | } 125 | } 126 | }}, 127 | "defaultProject": "angular10" 128 | } 129 | -------------------------------------------------------------------------------- /Angular10/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /Angular10/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Angular10 app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Angular10/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo(): Promise { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Angular10/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es2018", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Angular10/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/angular10'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /Angular10/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular10", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e", 11 | "postinstall": "./node_modules/.bin/ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "~10.0.3", 16 | "@angular/common": "~10.0.3", 17 | "@angular/compiler": "~10.0.3", 18 | "@angular/core": "~10.0.3", 19 | "@angular/elements": "^10.0.3", 20 | "@angular/forms": "~10.0.3", 21 | "@angular/platform-browser": "~10.0.3", 22 | "@angular/platform-browser-dynamic": "~10.0.3", 23 | "@angular/router": "~10.0.3", 24 | "rete": "1.4.1", 25 | "rete-angular-render-plugin": "0.2.1", 26 | "rete-connection-plugin": "0.9.0", 27 | "rete-context-menu-plugin": "^0.5.2", 28 | "rxjs": "~6.5.4", 29 | "tslib": "^2.0.0", 30 | "zone.js": "~0.10.3" 31 | }, 32 | "devDependencies": { 33 | "@angular-devkit/build-angular": "~0.1000.2", 34 | "@angular/cli": "~10.0.2", 35 | "@angular/compiler-cli": "~10.0.3", 36 | "@angular/language-service": "~10.0.3", 37 | "@types/jasmine": "~3.5.0", 38 | "@types/jasminewd2": "~2.0.3", 39 | "@types/node": "^12.11.1", 40 | "codelyzer": "^6.0.0", 41 | "jasmine-core": "~3.5.0", 42 | "jasmine-spec-reporter": "~5.0.0", 43 | "karma": "~5.0.0", 44 | "karma-chrome-launcher": "~3.1.0", 45 | "karma-coverage-istanbul-reporter": "~3.0.2", 46 | "karma-jasmine": "~3.3.0", 47 | "karma-jasmine-html-reporter": "^1.5.0", 48 | "protractor": "~7.0.0", 49 | "regenerator-runtime": "^0.13.3", 50 | "ts-node": "~8.3.0", 51 | "tslint": "~6.1.0", 52 | "typescript": "~3.9.6" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Angular10/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Angular10/src/app/app.component.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular10/src/app/app.component.sass -------------------------------------------------------------------------------- /Angular10/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'Angular10'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.componentInstance; 22 | expect(app.title).toEqual('Angular10'); 23 | }); 24 | 25 | it('should render title', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.nativeElement; 29 | expect(compiled.querySelector('.content span').textContent).toContain('Angular10 app is running!'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /Angular10/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.sass'] 7 | }) 8 | export class AppComponent { 9 | title = 'Angular10'; 10 | } 11 | -------------------------------------------------------------------------------- /Angular10/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { ReteComponent } from './rete/rete.component'; 6 | import { ReteModule } from 'rete-angular-render-plugin'; 7 | import { NumberComponent } from './rete/controls/number-control'; 8 | import { MyNodeComponent } from './rete/components/node/node.component'; 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent, 13 | ReteComponent, 14 | NumberComponent, 15 | MyNodeComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | ReteModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent], 23 | entryComponents: [NumberComponent, MyNodeComponent] 24 | }) 25 | export class AppModule {} 26 | 27 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/components/add-component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Output } from 'rete'; 2 | import { AngularComponent, AngularComponentData } from 'rete-angular-render-plugin'; 3 | import { NumControl } from '../controls/number-control'; 4 | import { numSocket } from '../sockets'; 5 | import { MyNodeComponent } from './node/node.component'; 6 | 7 | export class AddComponent extends Component implements AngularComponent { 8 | data: AngularComponentData; 9 | 10 | constructor() { 11 | super('Add'); 12 | this.data.render = 'angular'; 13 | this.data.component = MyNodeComponent; 14 | } 15 | 16 | async builder(node) { 17 | const inp1 = new Input('num1', 'Number', numSocket); 18 | const inp2 = new Input('num2', 'Number', numSocket); 19 | const out = new Output('num', 'Number', numSocket); 20 | 21 | inp1.addControl(new NumControl(this.editor, 'num1')); 22 | inp2.addControl(new NumControl(this.editor, 'num2')); 23 | 24 | node.addInput(inp1) 25 | .addInput(inp2) 26 | .addControl(new NumControl(this.editor, 'preview', true)) 27 | .addOutput(out); 28 | } 29 | 30 | worker(node, inputs, outputs) { 31 | const n1 = inputs['num1'].length ? inputs['num1'][0] : node.data.num1; 32 | const n2 = inputs['num2'].length ? inputs['num2'][0] : node.data.num2; 33 | const sum = n1 + n2; 34 | 35 | const ctrl = this.editor.nodes.find(n => n.id === node.id).controls.get('preview'); 36 | ctrl.setValue(sum); 37 | outputs['num'] = sum; 38 | } 39 | 40 | created(node) { 41 | console.log('created', node); 42 | } 43 | 44 | destroyed(node) { 45 | console.log('destroyed', node); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/components/node/node.component.html: -------------------------------------------------------------------------------- 1 |
2 |
{{node.name}}
3 |
4 |
{{output.name}}
5 | 6 |
7 |
8 |
9 | 10 |
{{input.name}}
11 |
12 |
13 |
-------------------------------------------------------------------------------- /Angular10/src/app/rete/components/node/node.component.sass: -------------------------------------------------------------------------------- 1 | @import "./vars" 2 | 3 | .node 4 | background: $node-color 5 | border: 2px solid #4e58bf 6 | border-radius: 10px 7 | cursor: pointer 8 | min-width: $node-width 9 | height: auto 10 | padding-bottom: 6px 11 | box-sizing: content-box 12 | position: relative 13 | user-select: none 14 | &:hover 15 | background: lighten($node-color,4%) 16 | &.selected 17 | background: $node-color-selected 18 | border-color: #e3c000 19 | .title 20 | color: white 21 | font-family: sans-serif 22 | font-size: 18px 23 | padding: 8px 24 | .output 25 | text-align: right 26 | .input 27 | text-align: left 28 | .input-title,.output-title 29 | vertical-align: middle 30 | color: white 31 | display: inline-block 32 | font-family: sans-serif 33 | font-size: 14px 34 | margin: $socket-margin 35 | line-height: $socket-size 36 | &[hidden] 37 | display: none 38 | .input-control 39 | z-index: 1 40 | width: calc(100% - #{$socket-size + 2*$socket-margin}) 41 | vertical-align: middle 42 | display: inline-block 43 | .control 44 | padding: $socket-margin $socket-size/2 + $socket-margin -------------------------------------------------------------------------------- /Angular10/src/app/rete/components/node/node.component.ts: -------------------------------------------------------------------------------- 1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; 2 | import { NodeComponent, NodeService } from 'rete-angular-render-plugin'; 3 | 4 | @Component({ 5 | templateUrl: './node.component.html', 6 | styleUrls: ['./node.component.sass'], 7 | providers: [NodeService], 8 | changeDetection: ChangeDetectionStrategy.OnPush 9 | }) 10 | export class MyNodeComponent extends NodeComponent { 11 | constructor(protected service: NodeService, protected cdr: ChangeDetectorRef) { 12 | super(service, cdr); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/components/node/vars.sass: -------------------------------------------------------------------------------- 1 | $node-color: rgba(70,36,155,0.8) 2 | $node-color-selected: #ffd92c 3 | $group-color: rgba(15,80,255,0.2) 4 | $group-handler-size: 40px 5 | $group-handler-offset: -10px 6 | $socket-size: 24px 7 | $socket-margin: 6px 8 | $socket-color: #96b38a 9 | $node-width: 180px -------------------------------------------------------------------------------- /Angular10/src/app/rete/components/number-component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Output } from 'rete'; 2 | import { numSocket } from '../sockets'; 3 | import { NumControl } from '../controls/number-control'; 4 | 5 | export class NumComponent extends Component { 6 | 7 | constructor() { 8 | super('Number'); 9 | } 10 | 11 | builder(node) { 12 | const out1 = new Output('num', 'Number', numSocket); 13 | 14 | return node.addControl(new NumControl(this.editor, 'num')).addOutput(out1); 15 | } 16 | 17 | worker(node, inputs, outputs) { 18 | outputs['num'] = node.data.num; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/controls/number-control.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Type } from '@angular/core'; 2 | import { Control } from 'rete'; 3 | import { AngularControl } from 'rete-angular-render-plugin'; 4 | 5 | @Component({ 6 | template: ``, 7 | styles: [` 8 | input { 9 | border-radius: 30px; 10 | background-color: white; 11 | padding: 2px 6px; 12 | border: 1px solid #999; 13 | font-size: 110%; 14 | width: 140px; 15 | box-sizing: border-box; 16 | } 17 | `] 18 | }) 19 | export class NumberComponent { 20 | @Input() value!: number; 21 | @Input() readonly!: boolean; 22 | @Input() change!: Function; 23 | @Input() mounted!: Function; 24 | 25 | ngOnInit() { 26 | this.mounted(); 27 | } 28 | } 29 | 30 | export class NumControl extends Control implements AngularControl { 31 | component: Type 32 | props: {[key: string]: unknown} 33 | 34 | constructor(public emitter, public key, readonly = false) { 35 | super(key); 36 | 37 | this.component = NumberComponent; 38 | this.props = { 39 | readonly, 40 | change: v => this.onChange(v), 41 | value: 0, 42 | mounted: () => { 43 | this.setValue(+(this.getData(key) as any) || 0) 44 | } 45 | }; 46 | } 47 | 48 | onChange(val: number) { 49 | this.setValue(val); 50 | this.emitter.trigger('process'); 51 | } 52 | 53 | setValue(val: number) { 54 | this.props.value = +val; 55 | this.putData(this.key, this.props.value) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/rete.component.css: -------------------------------------------------------------------------------- 1 | .wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | } 5 | 6 | .socket.number{ 7 | background: #96b38a; 8 | } -------------------------------------------------------------------------------- /Angular10/src/app/rete/rete.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; 2 | 3 | import { NodeEditor, Engine } from 'rete'; 4 | import ConnectionPlugin from 'rete-connection-plugin'; 5 | // import ContextMenuPlugin from 'rete-context-menu-plugin'; 6 | import { NumComponent } from './components/number-component'; 7 | import { AddComponent } from './components/add-component'; 8 | import { AngularRenderPlugin } from 'rete-angular-render-plugin'; 9 | 10 | @Component({ 11 | selector: 'app-rete', 12 | template: '
', 13 | styleUrls: ['./rete.component.css'], 14 | }) 15 | 16 | export class ReteComponent implements AfterViewInit { 17 | 18 | @ViewChild('nodeEditor', { static: true }) el: ElementRef; 19 | editor = null; 20 | 21 | async ngAfterViewInit() { 22 | const container = this.el.nativeElement; 23 | 24 | const components = [new NumComponent(), new AddComponent()]; 25 | 26 | const editor = new NodeEditor('demo@0.2.0', container); 27 | editor.use(ConnectionPlugin); 28 | editor.use(AngularRenderPlugin)//, { component: MyNodeComponent }); 29 | // editor.use(ContextMenuPlugin); 30 | 31 | const engine = new Engine('demo@0.2.0'); 32 | 33 | components.map(c => { 34 | editor.register(c); 35 | engine.register(c); 36 | }); 37 | 38 | const n1 = await components[0].createNode({ num: 2 }); 39 | const n2 = await components[0].createNode({ num: 0 }); 40 | const add = await components[1].createNode(); 41 | 42 | n1.position = [80, 200]; 43 | n2.position = [80, 400]; 44 | add.position = [500, 240]; 45 | 46 | editor.addNode(n1); 47 | editor.addNode(n2); 48 | editor.addNode(add); 49 | 50 | editor.connect(n1.outputs.get('num'), add.inputs.get('num1')); 51 | editor.connect(n2.outputs.get('num'), add.inputs.get('num2')); 52 | 53 | editor.on(['process', 'nodecreated', 'noderemoved', 'connectioncreated', 'connectionremoved'], (async () => { 54 | await engine.abort(); 55 | await engine.process(editor.toJSON()); 56 | }) as any); 57 | 58 | editor.view.resize(); 59 | editor.trigger('process'); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/sockets.ts: -------------------------------------------------------------------------------- 1 | import { Socket } from 'rete'; 2 | 3 | export const numSocket = new Socket('Number value'); 4 | -------------------------------------------------------------------------------- /Angular10/src/app/rete/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "target": "es5", 5 | "lib": [ "es2015" ] 6 | } 7 | } -------------------------------------------------------------------------------- /Angular10/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular10/src/assets/.gitkeep -------------------------------------------------------------------------------- /Angular10/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Angular10/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Angular10/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular10/src/favicon.ico -------------------------------------------------------------------------------- /Angular10/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular9 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Angular10/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Angular10/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | 65 | import "regenerator-runtime/runtime"; -------------------------------------------------------------------------------- /Angular10/src/styles.sass: -------------------------------------------------------------------------------- 1 | html, body, app-root 2 | display: block 3 | height: 100% -------------------------------------------------------------------------------- /Angular10/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting() 21 | ); 22 | // Then we find all the tests. 23 | const context = require.context('./', true, /\.spec\.ts$/); 24 | // And load the modules. 25 | context.keys().map(context); 26 | -------------------------------------------------------------------------------- /Angular10/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Angular10/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "es2020", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | }, 22 | "angularCompilerOptions": { 23 | "fullTemplateTypeCheck": true, 24 | "strictInjectionParameters": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Angular10/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /Angular10/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Angular10/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "align": { 5 | "options": [ 6 | "parameters", 7 | "statements" 8 | ] 9 | }, 10 | "array-type": false, 11 | "arrow-parens": false, 12 | "arrow-return-shorthand": true, 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warning" 16 | }, 17 | "component-class-suffix": true, 18 | "contextual-lifecycle": true, 19 | "directive-class-suffix": true, 20 | "directive-selector": [ 21 | true, 22 | "attribute", 23 | "app", 24 | "camelCase" 25 | ], 26 | "component-selector": [ 27 | true, 28 | "element", 29 | "app", 30 | "kebab-case" 31 | ], 32 | "eofline": true, 33 | "import-blacklist": [ 34 | true, 35 | "rxjs/Rx" 36 | ], 37 | "import-spacing": true, 38 | "indent": { 39 | "options": [ 40 | "spaces" 41 | ] 42 | }, 43 | "interface-name": false, 44 | "max-classes-per-file": false, 45 | "max-line-length": [ 46 | true, 47 | 140 48 | ], 49 | "member-access": false, 50 | "member-ordering": [ 51 | true, 52 | { 53 | "order": [ 54 | "static-field", 55 | "instance-field", 56 | "static-method", 57 | "instance-method" 58 | ] 59 | } 60 | ], 61 | "no-consecutive-blank-lines": false, 62 | "no-console": [ 63 | true, 64 | "debug", 65 | "info", 66 | "time", 67 | "timeEnd", 68 | "trace" 69 | ], 70 | "no-empty": false, 71 | "no-inferrable-types": [ 72 | true, 73 | "ignore-params" 74 | ], 75 | "no-non-null-assertion": true, 76 | "no-redundant-jsdoc": true, 77 | "no-switch-case-fall-through": true, 78 | "no-var-requires": false, 79 | "object-literal-key-quotes": [ 80 | true, 81 | "as-needed" 82 | ], 83 | "object-literal-sort-keys": false, 84 | "ordered-imports": false, 85 | "quotemark": [ 86 | true, 87 | "single" 88 | ], 89 | "semicolon": { 90 | "options": [ 91 | "always" 92 | ] 93 | }, 94 | "space-before-function-paren": { 95 | "options": { 96 | "anonymous": "never", 97 | "asyncArrow": "always", 98 | "constructor": "never", 99 | "method": "never", 100 | "named": "never" 101 | } 102 | }, 103 | "trailing-comma": false, 104 | "no-conflicting-lifecycle": true, 105 | "no-host-metadata-property": true, 106 | "no-input-rename": true, 107 | "no-inputs-metadata-property": true, 108 | "no-output-native": true, 109 | "no-output-on-prefix": true, 110 | "no-output-rename": true, 111 | "no-outputs-metadata-property": true, 112 | "template-banana-in-box": true, 113 | "template-no-negated-async": true, 114 | "typedef-whitespace": { 115 | "options": [ 116 | { 117 | "call-signature": "nospace", 118 | "index-signature": "nospace", 119 | "parameter": "nospace", 120 | "property-declaration": "nospace", 121 | "variable-declaration": "nospace" 122 | }, 123 | { 124 | "call-signature": "onespace", 125 | "index-signature": "onespace", 126 | "parameter": "onespace", 127 | "property-declaration": "onespace", 128 | "variable-declaration": "onespace" 129 | } 130 | ] 131 | }, 132 | "use-lifecycle-interface": true, 133 | "use-pipe-transform-interface": true 134 | , "variable-name": { 135 | "options": [ 136 | "ban-keywords", 137 | "check-format", 138 | "allow-pascal-case" 139 | ] 140 | }, 141 | "whitespace": { 142 | "options": [ 143 | "check-branch", 144 | "check-decl", 145 | "check-operator", 146 | "check-separator", 147 | "check-type", 148 | "check-typecast" 149 | ] 150 | } 151 | }, 152 | "rulesDirectory": [ 153 | "codelyzer" 154 | ] 155 | } -------------------------------------------------------------------------------- /Angular8/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /Angular8/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events.json 15 | speed-measure-plugin.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /Angular8/README.md: -------------------------------------------------------------------------------- 1 | # Angular8 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.0.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /Angular8/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular8": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:component": { 10 | "style": "sass" 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "prefix": "app", 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/angular8", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "tsconfig.app.json", 25 | "aot": false, 26 | "assets": [ 27 | "src/favicon.ico", 28 | "src/assets" 29 | ], 30 | "styles": [ 31 | "src/styles.sass" 32 | ], 33 | "scripts": [] 34 | }, 35 | "configurations": { 36 | "production": { 37 | "fileReplacements": [ 38 | { 39 | "replace": "src/environments/environment.ts", 40 | "with": "src/environments/environment.prod.ts" 41 | } 42 | ], 43 | "optimization": true, 44 | "outputHashing": "all", 45 | "sourceMap": false, 46 | "extractCss": true, 47 | "namedChunks": false, 48 | "aot": true, 49 | "extractLicenses": true, 50 | "vendorChunk": false, 51 | "buildOptimizer": true, 52 | "budgets": [ 53 | { 54 | "type": "initial", 55 | "maximumWarning": "2mb", 56 | "maximumError": "5mb" 57 | } 58 | ] 59 | } 60 | } 61 | }, 62 | "serve": { 63 | "builder": "@angular-devkit/build-angular:dev-server", 64 | "options": { 65 | "browserTarget": "angular8:build" 66 | }, 67 | "configurations": { 68 | "production": { 69 | "browserTarget": "angular8:build:production" 70 | } 71 | } 72 | }, 73 | "extract-i18n": { 74 | "builder": "@angular-devkit/build-angular:extract-i18n", 75 | "options": { 76 | "browserTarget": "angular8:build" 77 | } 78 | }, 79 | "test": { 80 | "builder": "@angular-devkit/build-angular:karma", 81 | "options": { 82 | "main": "src/test.ts", 83 | "polyfills": "src/polyfills.ts", 84 | "tsConfig": "tsconfig.spec.json", 85 | "karmaConfig": "karma.conf.js", 86 | "assets": [ 87 | "src/favicon.ico", 88 | "src/assets" 89 | ], 90 | "styles": [ 91 | "src/styles.sass" 92 | ], 93 | "scripts": [] 94 | } 95 | }, 96 | "lint": { 97 | "builder": "@angular-devkit/build-angular:tslint", 98 | "options": { 99 | "tsConfig": [ 100 | "tsconfig.app.json", 101 | "tsconfig.spec.json", 102 | "e2e/tsconfig.json" 103 | ], 104 | "exclude": [ 105 | "**/node_modules/**" 106 | ] 107 | } 108 | }, 109 | "e2e": { 110 | "builder": "@angular-devkit/build-angular:protractor", 111 | "options": { 112 | "protractorConfig": "e2e/protractor.conf.js", 113 | "devServerTarget": "angular8:serve" 114 | }, 115 | "configurations": { 116 | "production": { 117 | "devServerTarget": "angular8:serve:production" 118 | } 119 | } 120 | } 121 | } 122 | }}, 123 | "defaultProject": "angular8" 124 | } -------------------------------------------------------------------------------- /Angular8/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /Angular8/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | 'browserName': 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /Angular8/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to angular8!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Angular8/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Angular8/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Angular8/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/angular8'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /Angular8/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular8", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~8.0.0", 15 | "@angular/common": "~8.0.0", 16 | "@angular/compiler": "~8.0.0", 17 | "@angular/core": "~8.0.0", 18 | "@angular/elements": "^8.2.7", 19 | "@angular/forms": "~8.0.0", 20 | "@angular/platform-browser": "~8.0.0", 21 | "@angular/platform-browser-dynamic": "~8.0.0", 22 | "@angular/router": "~8.0.0", 23 | "rete": "^1.4.1", 24 | "rete-angular-render-plugin": "^0.2.0-rc.2", 25 | "rete-connection-plugin": "^0.8.3", 26 | "rxjs": "~6.4.0", 27 | "tslib": "^1.9.0", 28 | "zone.js": "~0.9.1" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "~0.800.0", 32 | "@angular/cli": "~8.0.2", 33 | "@angular/compiler-cli": "~8.0.0", 34 | "@angular/language-service": "~8.0.0", 35 | "@types/jasmine": "~3.3.8", 36 | "@types/jasminewd2": "~2.0.3", 37 | "@types/node": "~8.9.4", 38 | "babel-polyfill": "^6.26.0", 39 | "codelyzer": "^5.0.0", 40 | "jasmine-core": "~3.4.0", 41 | "jasmine-spec-reporter": "~4.2.1", 42 | "karma": "~4.1.0", 43 | "karma-chrome-launcher": "~2.2.0", 44 | "karma-coverage-istanbul-reporter": "~2.0.1", 45 | "karma-jasmine": "~2.0.1", 46 | "karma-jasmine-html-reporter": "^1.4.0", 47 | "protractor": "~5.4.0", 48 | "ts-node": "~7.0.0", 49 | "tslint": "~5.15.0", 50 | "typescript": "~3.4.3" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Angular8/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Angular8/src/app/app.component.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular8/src/app/app.component.sass -------------------------------------------------------------------------------- /Angular8/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.sass'] 7 | }) 8 | export class AppComponent { 9 | title = 'angular8'; 10 | } 11 | -------------------------------------------------------------------------------- /Angular8/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { ReteComponent } from './rete/rete.component'; 6 | import { ReteModule } from 'rete-angular-render-plugin'; 7 | import { NumberComponent } from './rete/controls/number-control'; 8 | import { MyNodeComponent } from './rete/components/node/node.component'; 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent, 13 | ReteComponent, 14 | NumberComponent, 15 | MyNodeComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | ReteModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent], 23 | entryComponents: [NumberComponent, MyNodeComponent] 24 | }) 25 | export class AppModule {} 26 | 27 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/components/add-component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Output, Node } from 'rete'; 2 | import { numSocket } from '../sockets'; 3 | import { NumControl } from '../controls/number-control'; 4 | import { AngularComponent, AngularComponentData } from 'rete-angular-render-plugin'; 5 | import { MyNodeComponent } from './node/node.component'; 6 | 7 | export class AddComponent extends Component implements AngularComponent { 8 | data: AngularComponentData; 9 | 10 | constructor() { 11 | super('Add'); 12 | this.data.render = 'angular'; 13 | this.data.component = MyNodeComponent; 14 | } 15 | 16 | async builder(node) { 17 | const inp1 = new Input('num1', 'Number', numSocket); 18 | const inp2 = new Input('num2', 'Number', numSocket); 19 | const out = new Output('num', 'Number', numSocket); 20 | 21 | inp1.addControl(new NumControl(this.editor, 'num1')); 22 | inp2.addControl(new NumControl(this.editor, 'num2')); 23 | 24 | node.addInput(inp1) 25 | .addInput(inp2) 26 | .addControl(new NumControl(this.editor, 'preview', true)) 27 | .addOutput(out); 28 | } 29 | 30 | worker(node, inputs, outputs) { 31 | const n1 = inputs['num1'].length ? inputs['num1'][0] : node.data.num1; 32 | const n2 = inputs['num2'].length ? inputs['num2'][0] : node.data.num2; 33 | const sum = n1 + n2; 34 | 35 | const ctrl = this.editor.nodes.find(n => n.id === node.id).controls.get('preview'); 36 | ctrl.setValue(sum); 37 | outputs['num'] = sum; 38 | } 39 | 40 | created(node) { 41 | console.log('created', node); 42 | } 43 | 44 | destroyed(node) { 45 | console.log('destroyed', node); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/components/node/node.component.html: -------------------------------------------------------------------------------- 1 |
2 |
{{node.name}}
3 |
4 |
{{output.name}}
5 | 6 |
7 |
8 |
9 | 10 |
{{input.name}}
11 |
12 |
13 |
-------------------------------------------------------------------------------- /Angular8/src/app/rete/components/node/node.component.sass: -------------------------------------------------------------------------------- 1 | @import "./vars" 2 | 3 | .node 4 | background: $node-color 5 | border: 2px solid #4e58bf 6 | border-radius: 10px 7 | cursor: pointer 8 | min-width: $node-width 9 | height: auto 10 | padding-bottom: 6px 11 | box-sizing: content-box 12 | position: relative 13 | user-select: none 14 | &:hover 15 | background: lighten($node-color,4%) 16 | &.selected 17 | background: $node-color-selected 18 | border-color: #e3c000 19 | .title 20 | color: white 21 | font-family: sans-serif 22 | font-size: 18px 23 | padding: 8px 24 | .output 25 | text-align: right 26 | .input 27 | text-align: left 28 | .input-title,.output-title 29 | vertical-align: middle 30 | color: white 31 | display: inline-block 32 | font-family: sans-serif 33 | font-size: 14px 34 | margin: $socket-margin 35 | line-height: $socket-size 36 | &[hidden] 37 | display: none 38 | .input-control 39 | z-index: 1 40 | width: calc(100% - #{$socket-size + 2*$socket-margin}) 41 | vertical-align: middle 42 | display: inline-block 43 | .control 44 | padding: $socket-margin $socket-size/2 + $socket-margin -------------------------------------------------------------------------------- /Angular8/src/app/rete/components/node/node.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectorRef } from '@angular/core'; 2 | import { NodeComponent, NodeService } from 'rete-angular-render-plugin'; 3 | 4 | @Component({ 5 | templateUrl: './node.component.html', 6 | styleUrls: ['./node.component.sass'], 7 | providers: [NodeService] 8 | }) 9 | export class MyNodeComponent extends NodeComponent { 10 | constructor(protected service: NodeService, protected cdr: ChangeDetectorRef) { 11 | super(service, cdr); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/components/node/vars.sass: -------------------------------------------------------------------------------- 1 | $node-color: rgba(70,36,155,0.8) 2 | $node-color-selected: #ffd92c 3 | $group-color: rgba(15,80,255,0.2) 4 | $group-handler-size: 40px 5 | $group-handler-offset: -10px 6 | $socket-size: 24px 7 | $socket-margin: 6px 8 | $socket-color: #96b38a 9 | $node-width: 180px -------------------------------------------------------------------------------- /Angular8/src/app/rete/components/number-component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Output } from 'rete'; 2 | import { numSocket } from '../sockets'; 3 | import { NumControl } from '../controls/number-control'; 4 | 5 | export class NumComponent extends Component { 6 | 7 | constructor() { 8 | super('Number'); 9 | } 10 | 11 | builder(node) { 12 | const out1 = new Output('num', 'Number', numSocket); 13 | 14 | return node.addControl(new NumControl(this.editor, 'num')).addOutput(out1); 15 | } 16 | 17 | worker(node, inputs, outputs) { 18 | outputs['num'] = node.data.num; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/controls/number-control.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Type } from '@angular/core'; 2 | import { Control } from 'rete'; 3 | import { AngularControl } from 'rete-angular-render-plugin'; 4 | 5 | @Component({ 6 | template: ``, 7 | styles: [` 8 | input { 9 | border-radius: 30px; 10 | background-color: white; 11 | padding: 2px 6px; 12 | border: 1px solid #999; 13 | font-size: 110%; 14 | width: 140px; 15 | box-sizing: border-box; 16 | } 17 | `] 18 | }) 19 | export class NumberComponent { 20 | @Input() value!: number; 21 | @Input() readonly!: boolean; 22 | @Input() change!: Function; 23 | @Input() mounted!: Function; 24 | 25 | ngOnInit() { 26 | this.mounted(); 27 | } 28 | } 29 | 30 | export class NumControl extends Control implements AngularControl { 31 | component: Type 32 | props: {[key: string]: unknown} 33 | 34 | constructor(public emitter, public key, readonly = false) { 35 | super(key); 36 | 37 | this.component = NumberComponent; 38 | this.props = { 39 | readonly, 40 | change: v => this.onChange(v), 41 | value: 0, 42 | mounted: () => { 43 | this.setValue(+(this.getData(key) as any) || 0) 44 | } 45 | }; 46 | } 47 | 48 | onChange(val: number) { 49 | this.setValue(val); 50 | this.emitter.trigger('process'); 51 | } 52 | 53 | setValue(val: number) { 54 | this.props.value = +val; 55 | this.putData(this.key, this.props.value) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/rete.component.css: -------------------------------------------------------------------------------- 1 | .wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | } 5 | 6 | .socket.number{ 7 | background: #96b38a; 8 | } -------------------------------------------------------------------------------- /Angular8/src/app/rete/rete.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; 2 | 3 | import { NodeEditor, Engine } from 'rete'; 4 | import ConnectionPlugin from 'rete-connection-plugin'; 5 | // import ContextMenuPlugin from 'rete-context-menu-plugin'; 6 | import { NumComponent } from './components/number-component'; 7 | import { AddComponent } from './components/add-component'; 8 | import { AngularRenderPlugin } from 'rete-angular-render-plugin'; 9 | 10 | @Component({ 11 | selector: 'app-rete', 12 | template: '
', 13 | styleUrls: ['./rete.component.css'], 14 | }) 15 | 16 | export class ReteComponent implements AfterViewInit { 17 | 18 | @ViewChild('nodeEditor', { static: true }) el: ElementRef; 19 | editor = null; 20 | 21 | async ngAfterViewInit() { 22 | const container = this.el.nativeElement; 23 | 24 | const components = [new NumComponent(), new AddComponent()]; 25 | 26 | const editor = new NodeEditor('demo@0.2.0', container); 27 | editor.use(ConnectionPlugin); 28 | editor.use(AngularRenderPlugin)//, { component: MyNodeComponent }); 29 | // editor.use(ContextMenuPlugin); 30 | 31 | const engine = new Engine('demo@0.2.0'); 32 | 33 | components.map(c => { 34 | editor.register(c); 35 | engine.register(c); 36 | }); 37 | 38 | const n1 = await components[0].createNode({ num: 2 }); 39 | const n2 = await components[0].createNode({ num: 0 }); 40 | const add = await components[1].createNode(); 41 | 42 | n1.position = [80, 200]; 43 | n2.position = [80, 400]; 44 | add.position = [500, 240]; 45 | 46 | editor.addNode(n1); 47 | editor.addNode(n2); 48 | editor.addNode(add); 49 | 50 | editor.connect(n1.outputs.get('num'), add.inputs.get('num1')); 51 | editor.connect(n2.outputs.get('num'), add.inputs.get('num2')); 52 | 53 | 54 | editor.on(['process', 'nodecreated', 'noderemoved', 'connectioncreated', 'connectionremoved'], (async () => { 55 | await engine.abort(); 56 | await engine.process(editor.toJSON()); 57 | }) as any); 58 | 59 | editor.view.resize(); 60 | editor.trigger('process'); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/sockets.ts: -------------------------------------------------------------------------------- 1 | import { Socket } from 'rete'; 2 | 3 | export const numSocket = new Socket('Number value'); 4 | -------------------------------------------------------------------------------- /Angular8/src/app/rete/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "target": "es5", 5 | "lib": [ "es2015" ] 6 | } 7 | } -------------------------------------------------------------------------------- /Angular8/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular8/src/assets/.gitkeep -------------------------------------------------------------------------------- /Angular8/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Angular8/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Angular8/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Angular8/src/favicon.ico -------------------------------------------------------------------------------- /Angular8/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular8 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Angular8/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Angular8/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | import 'babel-polyfill'; 22 | 23 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 24 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 25 | 26 | /** 27 | * Web Animations `@angular/platform-browser/animations` 28 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 29 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 30 | */ 31 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 32 | 33 | /** 34 | * By default, zone.js will patch all possible macroTask and DomEvents 35 | * user can disable parts of macroTask/DomEvents patch by setting following flags 36 | * because those flags need to be set before `zone.js` being loaded, and webpack 37 | * will put import in the top of bundle, so user need to create a separate file 38 | * in this directory (for example: zone-flags.ts), and put the following flags 39 | * into that file, and then add the following code before importing zone.js. 40 | * import './zone-flags.ts'; 41 | * 42 | * The flags allowed in zone-flags.ts are listed here. 43 | * 44 | * The following flags will work for all browsers. 45 | * 46 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 47 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 48 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 49 | * 50 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 51 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 52 | * 53 | * (window as any).__Zone_enable_cross_context_check = true; 54 | * 55 | */ 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | /*************************************************************************************************** 64 | * APPLICATION IMPORTS 65 | */ 66 | -------------------------------------------------------------------------------- /Angular8/src/styles.sass: -------------------------------------------------------------------------------- 1 | html, body, app-root 2 | display: block 3 | height: 100% -------------------------------------------------------------------------------- /Angular8/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Angular8/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "src/test.ts", 12 | "src/**/*.spec.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Angular8/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "esnext", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Angular8/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Angular8/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "array-type": false, 5 | "arrow-parens": false, 6 | "deprecation": { 7 | "severity": "warn" 8 | }, 9 | "component-class-suffix": true, 10 | "contextual-lifecycle": true, 11 | "directive-class-suffix": true, 12 | "directive-selector": [ 13 | true, 14 | "attribute", 15 | "app", 16 | "camelCase" 17 | ], 18 | "component-selector": [ 19 | true, 20 | "element", 21 | "app", 22 | "kebab-case" 23 | ], 24 | "import-blacklist": [ 25 | true, 26 | "rxjs/Rx" 27 | ], 28 | "interface-name": false, 29 | "max-classes-per-file": false, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-consecutive-blank-lines": false, 47 | "no-console": [ 48 | true, 49 | "debug", 50 | "info", 51 | "time", 52 | "timeEnd", 53 | "trace" 54 | ], 55 | "no-empty": false, 56 | "no-inferrable-types": [ 57 | true, 58 | "ignore-params" 59 | ], 60 | "no-non-null-assertion": true, 61 | "no-redundant-jsdoc": true, 62 | "no-switch-case-fall-through": true, 63 | "no-use-before-declare": true, 64 | "no-var-requires": false, 65 | "object-literal-key-quotes": [ 66 | true, 67 | "as-needed" 68 | ], 69 | "object-literal-sort-keys": false, 70 | "ordered-imports": false, 71 | "quotemark": [ 72 | true, 73 | "single" 74 | ], 75 | "trailing-comma": false, 76 | "no-conflicting-lifecycle": true, 77 | "no-host-metadata-property": true, 78 | "no-input-rename": true, 79 | "no-inputs-metadata-property": true, 80 | "no-output-native": true, 81 | "no-output-on-prefix": true, 82 | "no-output-rename": true, 83 | "no-outputs-metadata-property": true, 84 | "template-banana-in-box": true, 85 | "template-no-negated-async": true, 86 | "use-lifecycle-interface": true, 87 | "use-pipe-transform-interface": true 88 | }, 89 | "rulesDirectory": [ 90 | "codelyzer" 91 | ] 92 | } -------------------------------------------------------------------------------- /Electron/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /Electron/LICENSE.md: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | ================== 3 | 4 | Statement of Purpose 5 | --------------------- 6 | 7 | The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). 8 | 9 | Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. 10 | 11 | For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 12 | 13 | 1. Copyright and Related Rights. 14 | -------------------------------- 15 | A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: 16 | 17 | i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; 18 | ii. moral rights retained by the original author(s) and/or performer(s); 19 | iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; 20 | iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; 21 | v. rights protecting the extraction, dissemination, use and reuse of data in a Work; 22 | vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and 23 | vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 24 | 25 | 2. Waiver. 26 | ----------- 27 | To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 28 | 29 | 3. Public License Fallback. 30 | ---------------------------- 31 | Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 32 | 33 | 4. Limitations and Disclaimers. 34 | -------------------------------- 35 | 36 | a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. 37 | b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. 38 | c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. 39 | d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. 40 | -------------------------------------------------------------------------------- /Electron/README.md: -------------------------------------------------------------------------------- 1 | # Electron D3 Node Editor 2 | 3 | 4 | This is a minimal Electron application using D3 Node editor library. 5 | 6 | 7 | What you need to install the library in your Electron app: 8 | 9 | Install library using npm 10 | ```bash 11 | npm install --save d3-node-editor 12 | ``` 13 | `d3ne.js` - [basic example](https://codepen.io/Ni55aN/pen/jBEKBQ?editors=0010) with dependencies required globally 14 | 15 | Add to `.html` page: 16 | ```html 17 | 18 | 23 | 24 |
25 | 29 | ``` 30 | 31 | You can learn more about D3NE library in the [repository](https://github.com/Ni55aN/D3-Node-editor). 32 | 33 | -------------------------------------------------------------------------------- /Electron/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello Rete.js! 6 | 15 | 16 | 17 |
18 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Electron/main.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron') 2 | // Module to control application life. 3 | const app = electron.app 4 | // Module to create native browser window. 5 | const BrowserWindow = electron.BrowserWindow 6 | 7 | const path = require('path') 8 | const url = require('url') 9 | // Keep a global reference of the window object, if you don't, the window will 10 | // be closed automatically when the JavaScript object is garbage collected. 11 | 12 | let mainWindow 13 | 14 | function createWindow () { 15 | // Create the browser window. 16 | mainWindow = new BrowserWindow({width: 800, height: 600}) 17 | 18 | // and load the index.html of the app. 19 | mainWindow.loadURL(url.format({ 20 | pathname: path.join(__dirname, 'index.html'), 21 | protocol: 'file:', 22 | slashes: true 23 | })) 24 | 25 | // Open the DevTools. 26 | // mainWindow.webContents.openDevTools() 27 | 28 | // Emitted when the window is closed. 29 | mainWindow.on('closed', function () { 30 | // Dereference the window object, usually you would store windows 31 | // in an array if your app supports multi windows, this is the time 32 | // when you should delete the corresponding element. 33 | mainWindow = null 34 | }) 35 | } 36 | 37 | // This method will be called when Electron has finished 38 | // initialization and is ready to create browser windows. 39 | // Some APIs can only be used after this event occurs. 40 | app.on('ready', createWindow) 41 | 42 | // Quit when all windows are closed. 43 | app.on('window-all-closed', function () { 44 | // On OS X it is common for applications and their menu bar 45 | // to stay active until the user quits explicitly with Cmd + Q 46 | if (process.platform !== 'darwin') { 47 | app.quit() 48 | } 49 | }) 50 | 51 | app.on('activate', function () { 52 | // On OS X it's common to re-create a window in the app when the 53 | // dock icon is clicked and there are no other windows open. 54 | if (mainWindow === null) { 55 | createWindow() 56 | } 57 | }) 58 | 59 | // In this file you can include the rest of your app's specific main process 60 | // code. You can also put them in separate files and require them here. 61 | -------------------------------------------------------------------------------- /Electron/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-rete", 3 | "version": "1.0.0", 4 | "description": "A minimal Electron application", 5 | "main": "main.js", 6 | "scripts": { 7 | "start": "electron ." 8 | }, 9 | "repository": "https://github.com/electron/electron-quick-start", 10 | "keywords": [ 11 | "Electron", 12 | "quick", 13 | "start", 14 | "tutorial", 15 | "demo" 16 | ], 17 | "author": "GitHub", 18 | "license": "CC0-1.0", 19 | "devDependencies": { 20 | "electron": "^1.8.2" 21 | }, 22 | "dependencies": { 23 | "rete": "^1.0.0-alpha.2", 24 | "rete-alight-render-plugin": "^0.1.0", 25 | "rete-connection-plugin": "^0.1.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Electron/rete.js: -------------------------------------------------------------------------------- 1 | 2 | const Rete = require('rete'); 3 | const AlightRenderPlugin = require('rete-connection-plugin'); 4 | const ConnectionPlugin = require('rete-alight-render-plugin'); 5 | 6 | var numSocket = new Rete.Socket('Number value'); 7 | 8 | class NumControl extends Rete.Control { 9 | 10 | constructor(emitter, key, readonly) { 11 | super(); 12 | this.emitter = emitter; 13 | this.key = key; 14 | this.template = ''; 15 | 16 | this.scope = { 17 | value: 0, 18 | readonly, 19 | change: this.change.bind(this) 20 | }; 21 | } 22 | 23 | change(e){ 24 | this.scope.value = +e.target.value; 25 | this.update(); 26 | } 27 | 28 | update(){ 29 | if(this.key) 30 | this.putData(this.key, this.scope.value) 31 | this.emitter.trigger('process'); 32 | this._alight.scan(); 33 | } 34 | 35 | mounted() { 36 | this.scope.value = this.getData(this.key) || 0; 37 | this.update(); 38 | } 39 | 40 | setValue(val) { 41 | this.scope.value = val; 42 | this._alight.scan() 43 | } 44 | } 45 | 46 | class NumComponent extends Rete.Component { 47 | 48 | constructor(){ 49 | super("Number"); 50 | } 51 | 52 | builder(node) { 53 | var out1 = new Rete.Output("Number", numSocket); 54 | 55 | return node.addControl(new NumControl(this.editor, 'num')).addOutput(out1); 56 | } 57 | 58 | worker(node, inputs, outputs) { 59 | outputs[0] = node.data.num; 60 | } 61 | } 62 | 63 | 64 | class AddComponent extends Rete.Component { 65 | constructor(){ 66 | super("Add"); 67 | } 68 | 69 | builder(node) { 70 | var inp1 = new Rete.Input("Number", numSocket); 71 | var inp2 = new Rete.Input("Number", numSocket); 72 | var out = new Rete.Output("Number", numSocket); 73 | 74 | inp1.addControl(new NumControl(this.editor, 'num1')) 75 | inp2.addControl(new NumControl(this.editor, 'num2')) 76 | 77 | return node 78 | .addInput(inp1) 79 | .addInput(inp2) 80 | .addControl(new NumControl(this.editor, null, true)) 81 | .addOutput(out); 82 | } 83 | 84 | worker(node, inputs, outputs) { 85 | var n1 = inputs[0].length?inputs[0][0]:node.data.num1; 86 | var n2 = inputs[1].length?inputs[1][0]:node.data.num2; 87 | var sum = n1 + n2; 88 | 89 | this.editor.nodes.find(n => n.id == node.id).controls[0].setValue(sum); 90 | outputs[0] = sum; 91 | } 92 | } 93 | 94 | exports.createEditor = async (container) => { 95 | 96 | var components = [new NumComponent(), new AddComponent()]; 97 | 98 | var editor = new Rete.NodeEditor('demo@0.1.0', container); 99 | editor.use(ConnectionPlugin, { curvature: 0.4 }); 100 | editor.use(AlightRenderPlugin); 101 | 102 | var engine = new Rete.Engine('demo@0.1.0'); 103 | 104 | components.map(c => { 105 | editor.register(c); 106 | engine.register(c); 107 | }); 108 | 109 | var n1 = await components[0].createNode({num: 2}); 110 | var n2 = await components[0].createNode({num: 0}); 111 | var add = await components[1].createNode(); 112 | 113 | n1.position = [80, 200]; 114 | n2.position = [80, 400]; 115 | add.position = [500, 240]; 116 | 117 | editor.addNode(n1); 118 | editor.addNode(n2); 119 | editor.addNode(add); 120 | 121 | editor.connect(n1.outputs[0], add.inputs[0]); 122 | editor.connect(n2.outputs[0], add.inputs[1]); 123 | 124 | 125 | editor.on('process nodecreated noderemoved connectioncreated connectionremoved', async () => { 126 | await engine.abort(); 127 | await engine.process(editor.toJSON()); 128 | }); 129 | 130 | editor.view.resize(); 131 | editor.trigger('process'); 132 | } -------------------------------------------------------------------------------- /Module/components.js: -------------------------------------------------------------------------------- 1 | var numSocket = new Rete.Socket("Number"); 2 | var floatSocket = new Rete.Socket("Float"); 3 | 4 | class TextControl extends Rete.Control { 5 | 6 | constructor(emitter, key, readonly, type = 'text') { 7 | super(); 8 | this.emitter = emitter; 9 | this.key = key; 10 | this.type = type; 11 | this.template = ``; 12 | 13 | this.scope = { 14 | value: null, 15 | readonly, 16 | change: this.change.bind(this) 17 | }; 18 | } 19 | 20 | onChange() {} 21 | 22 | change(e) { 23 | this.scope.value = this.type === 'number' ? +e.target.value : e.target.value; 24 | this.update(); 25 | this.onChange(); 26 | } 27 | 28 | update() { 29 | if (this.key) 30 | this.putData(this.key, this.scope.value) 31 | this.emitter.trigger('process'); 32 | this._alight.scan(); 33 | } 34 | 35 | mounted() { 36 | this.scope.value = this.getData(this.key) || (this.type === 'number' ? 0 : '...'); 37 | this.update(); 38 | } 39 | 40 | setValue(val) { 41 | this.scope.value = val; 42 | this._alight.scan() 43 | } 44 | } 45 | 46 | 47 | class InputComponent extends Rete.Component { 48 | 49 | constructor() { 50 | super("Input"); 51 | this.module = { 52 | nodeType: 'input', 53 | socket: numSocket 54 | } 55 | } 56 | 57 | builder(node) { 58 | var out1 = new Rete.Output('output', "Number", numSocket); 59 | var ctrl = new TextControl(this.editor, 'name'); 60 | 61 | return node.addControl(ctrl).addOutput(out1); 62 | } 63 | } 64 | 65 | 66 | class ModuleComponent extends Rete.Component { 67 | 68 | constructor() { 69 | super("Module"); 70 | this.module = { 71 | nodeType: 'module' 72 | } 73 | } 74 | 75 | builder(node) { 76 | var ctrl = new TextControl(this.editor, 'module'); 77 | ctrl.onChange = () => { 78 | console.log(this) 79 | this.updateModuleSockets(node); 80 | node._alight.scan(); 81 | } 82 | return node.addControl(ctrl); 83 | } 84 | 85 | change(node, item) { 86 | node.data.module = item; 87 | this.editor.trigger('process'); 88 | } 89 | } 90 | 91 | 92 | class OutputComponent extends Rete.Component { 93 | 94 | constructor() { 95 | super("Output"); 96 | this.module = { 97 | nodeType: 'output', 98 | socket: numSocket 99 | } 100 | } 101 | 102 | builder(node) { 103 | var inp = new Rete.Input('input', "Number", numSocket); 104 | var ctrl = new TextControl(this.editor, 'name'); 105 | 106 | return node.addControl(ctrl).addInput(inp); 107 | } 108 | } 109 | 110 | 111 | class OutputFloatComponent extends Rete.Component { 112 | 113 | constructor() { 114 | super("Float Output"); 115 | this.module = { 116 | nodeType: 'output', 117 | socket: floatSocket 118 | } 119 | } 120 | 121 | builder(node) { 122 | var inp = new Rete.Input('float', "Float", floatSocket); 123 | var ctrl = new TextControl(this.editor, 'name'); 124 | 125 | return node.addControl(ctrl).addInput(inp); 126 | } 127 | } 128 | 129 | class NumComponent extends Rete.Component { 130 | 131 | constructor() { 132 | super("Number"); 133 | } 134 | 135 | builder(node) { 136 | var out1 = new Rete.Output('num', "Number", numSocket); 137 | var ctrl = new TextControl(this.editor, 'num', false, 'number'); 138 | 139 | return node.addControl(ctrl).addOutput(out1); 140 | } 141 | 142 | worker(node, inputs, outputs) { 143 | outputs['num'] = node.data.num; 144 | } 145 | } 146 | 147 | 148 | class AddComponent extends Rete.Component { 149 | constructor() { 150 | super("Add"); 151 | } 152 | 153 | builder(node) { 154 | var inp1 = new Rete.Input('num1', "Number", numSocket); 155 | var inp2 = new Rete.Input('num2', "Number", numSocket); 156 | var out = new Rete.Output('num', "Number", numSocket); 157 | 158 | inp1.addControl(new TextControl(this.editor, 'num1', false, 'number')) 159 | inp2.addControl(new TextControl(this.editor, 'num2', false, 'number')) 160 | 161 | return node 162 | .addInput(inp1) 163 | .addInput(inp2) 164 | .addControl(new TextControl(this.editor, 'preview', true)) 165 | .addOutput(out); 166 | } 167 | 168 | worker(node, inputs, outputs, { 169 | silent 170 | } = {}) { 171 | var n1 = inputs['num1'].length ? inputs['num1'][0] : node.data.num1; 172 | var n2 = inputs['num2'].length ? inputs['num2'][0] : node.data.num2; 173 | var sum = n1 + n2; 174 | 175 | if (!silent) 176 | this.editor.nodes.find(n => n.id == node.id).controls.get('preview').setValue(sum); 177 | 178 | outputs['num'] = sum; 179 | } 180 | 181 | created(node) { 182 | console.log('created', node) 183 | } 184 | 185 | destroyed(node) { 186 | console.log('destroyed', node) 187 | } 188 | } -------------------------------------------------------------------------------- /Module/data.js: -------------------------------------------------------------------------------- 1 | const modulesData = { 2 | "index.rete": { 3 | "data": { 4 | "id": "demo@0.1.0", 5 | "nodes": { 6 | "4": { 7 | "id": 4, 8 | "data": { 9 | "module": "module1.rete" 10 | }, 11 | "inputs": { 12 | "2": { 13 | "connections": [{ 14 | "node": 12, 15 | "output": "num", 16 | "data": {} 17 | }] 18 | }, 19 | "...": { 20 | "connections": [{ 21 | "node": 12, 22 | "output": "num", 23 | "data": {} 24 | }] 25 | } 26 | }, 27 | "outputs": { 28 | "...": { 29 | "connections": [{ 30 | "node": 5, 31 | "input": "num1", 32 | "data": {} 33 | }, { 34 | "node": 5, 35 | "input": "num2", 36 | "data": {} 37 | }] 38 | } 39 | }, 40 | "position": [854, 159], 41 | "name": "Module" 42 | }, 43 | "5": { 44 | "id": 5, 45 | "data": { 46 | "num1": 0, 47 | "num2": 0 48 | }, 49 | "inputs": { 50 | "num1": { 51 | "connections": [{ 52 | "node": 4, 53 | "output": "...", 54 | "data": {} 55 | }] 56 | }, 57 | "num2": { 58 | "connections": [{ 59 | "node": 4, 60 | "output": "...", 61 | "data": {} 62 | }] 63 | } 64 | }, 65 | "outputs": { 66 | "num": { 67 | "connections": [] 68 | } 69 | }, 70 | "position": [1217, 123], 71 | "name": "Add" 72 | }, 73 | "12": { 74 | "id": 12, 75 | "data": { 76 | "num": 1 77 | }, 78 | "inputs": {}, 79 | "outputs": { 80 | "num": { 81 | "connections": [{ 82 | "node": 4, 83 | "input": "...", 84 | "data": {} 85 | }, { 86 | "node": 4, 87 | "input": "2", 88 | "data": {} 89 | }] 90 | } 91 | }, 92 | "position": [410, 212], 93 | "name": "Number" 94 | } 95 | } 96 | } 97 | }, 98 | "module1.rete": { 99 | "data": { 100 | "id": "demo@0.1.0", 101 | "nodes": { 102 | "1": { 103 | "id": 1, 104 | "data": { 105 | "name": "..." 106 | }, 107 | "inputs": {}, 108 | "outputs": { 109 | "output": { 110 | "connections": [{ 111 | "node": 9, 112 | "input": "num1", 113 | "data": {} 114 | }] 115 | } 116 | }, 117 | "position": [348, 78], 118 | "name": "Input" 119 | }, 120 | "2": { 121 | "id": 2, 122 | "data": { 123 | "name": "..." 124 | }, 125 | "inputs": { 126 | "input": { 127 | "connections": [{ 128 | "node": 9, 129 | "output": "num", 130 | "data": {} 131 | }] 132 | } 133 | }, 134 | "outputs": {}, 135 | "position": [1086, 202], 136 | "name": "Output" 137 | }, 138 | "8": { 139 | "id": 8, 140 | "data": { 141 | "name": "2" 142 | }, 143 | "inputs": {}, 144 | "outputs": { 145 | "output": { 146 | "connections": [{ 147 | "node": 9, 148 | "input": "num2", 149 | "data": {} 150 | }] 151 | } 152 | }, 153 | "position": [285, 320], 154 | "name": "Input" 155 | }, 156 | "9": { 157 | "id": 9, 158 | "data": { 159 | "num1": 0, 160 | "num2": 0 161 | }, 162 | "inputs": { 163 | "num1": { 164 | "connections": [{ 165 | "node": 1, 166 | "output": "output", 167 | "data": {} 168 | }] 169 | }, 170 | "num2": { 171 | "connections": [{ 172 | "node": 8, 173 | "output": "output", 174 | "data": {} 175 | }] 176 | } 177 | }, 178 | "outputs": { 179 | "num": { 180 | "connections": [{ 181 | "node": 2, 182 | "input": "input", 183 | "data": {} 184 | }] 185 | } 186 | }, 187 | "position": [730, 275], 188 | "name": "Add" 189 | } 190 | } 191 | } 192 | } 193 | }; -------------------------------------------------------------------------------- /Module/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Modular Rete Sample 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | {{key}} 13 |
14 | 17 |
18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Module/index.js: -------------------------------------------------------------------------------- 1 | var container = document.querySelector('#rete'); 2 | var editor = null; 3 | var initialData = () => ({id: 'demo@0.1.0', nodes: {}}); 4 | var modules = { 5 | ...modulesData 6 | } 7 | var currentModule = {}; 8 | 9 | function addModule() { 10 | modules['module'+Object.keys(modules).length+'.rete'] = { data: initialData() } 11 | } 12 | 13 | async function openModule(name) { 14 | currentModule.data = editor.toJSON(); 15 | 16 | currentModule = modules[name]; 17 | await editor.fromJSON(currentModule.data); 18 | } 19 | 20 | 21 | alight('#modules', { modules, addModule, openModule }); 22 | 23 | 24 | var editor = new Rete.NodeEditor("demo@0.1.0", container); 25 | editor.use(ConnectionPlugin, { curvature: 0.4 }); 26 | editor.use(AlightRenderPlugin); 27 | editor.use(ContextMenuPlugin); 28 | 29 | var engine = new Rete.Engine("demo@0.1.0"); 30 | 31 | editor.use(ModulePlugin, { engine, modules }); 32 | 33 | [new NumComponent, new AddComponent, new InputComponent, new ModuleComponent, new OutputComponent, new OutputFloatComponent].map(c => { 34 | editor.register(c); 35 | engine.register(c); 36 | }); 37 | 38 | 39 | editor.on("process connectioncreated connectionremoved", () => { 40 | requestAnimationFrame(async () => { 41 | await engine.abort(); 42 | await engine.process(editor.toJSON()); 43 | }); 44 | }); 45 | 46 | editor.view.resize(); 47 | 48 | openModule('index.rete') -------------------------------------------------------------------------------- /Module/style.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | margin: 0; 4 | height: 100%; 5 | } 6 | 7 | #rete { 8 | height: 100% !important 9 | } 10 | 11 | #modules { 12 | position: absolute; 13 | left: 0; 14 | top: 0; 15 | z-index: 5; 16 | } 17 | 18 | .module { 19 | padding: 5px; 20 | cursor: pointer; 21 | } 22 | 23 | .module:hover { 24 | color: #a167e7; 25 | } 26 | 27 | .node .socket.number { 28 | background: #96b38a 29 | } 30 | 31 | .node .socket.float { 32 | background: red; 33 | } -------------------------------------------------------------------------------- /Phaser/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /Phaser/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | phaser-rete 6 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | -------------------------------------------------------------------------------- /Phaser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phaser-rete", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "webpack-dev-server --hot --inline", 8 | "build": "webpack" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "phaser": "^3.3.0", 14 | "rete": "^1.0.0-alpha.2", 15 | "rete-alight-render-plugin": "^0.1.0", 16 | "rete-connection-plugin": "^0.1.0" 17 | }, 18 | "devDependencies": { 19 | "babel-core": "^6.26.0", 20 | "babel-loader": "^7.1.2", 21 | "babel-preset-es2015": "^6.24.1", 22 | "babel-preset-stage-2": "^6.24.1", 23 | "css-loader": "^0.28.11", 24 | "html-webpack-plugin": "^3.2.0", 25 | "raw-loader": "^0.5.1", 26 | "style-loader": "^0.20.3", 27 | "webpack": "^4.5.0", 28 | "webpack-cli": "^2.0.14", 29 | "webpack-dev-server": "^3.1.3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Phaser/src/index.js: -------------------------------------------------------------------------------- 1 | import Phaser from 'phaser'; 2 | import { initRete } from './rete-editor' 3 | 4 | var config = { 5 | type: Phaser.AUTO, 6 | width: 800, 7 | height: 600, 8 | parent: document.querySelector('.container'), 9 | physics: { 10 | default: 'arcade', 11 | arcade: { 12 | gravity: { y: 200 } 13 | } 14 | }, 15 | scene: { 16 | preload, 17 | create 18 | } 19 | }; 20 | 21 | 22 | var game = new Phaser.Game(config); 23 | 24 | function preload () 25 | { 26 | this.load.setBaseURL('http://labs.phaser.io'); 27 | 28 | this.load.image('sky', 'assets/skies/space3.png'); 29 | this.load.image('logo', 'assets/sprites/phaser3-logo.png'); 30 | this.load.image('red', 'assets/particles/red.png'); 31 | } 32 | 33 | function create () 34 | { 35 | this.add.image(400, 300, 'sky'); 36 | 37 | var particles = this.add.particles('red'); 38 | 39 | var emitter = particles.createEmitter({ 40 | speed: 100, 41 | scale: { start: 1, end: 0 }, 42 | blendMode: 'ADD' 43 | }); 44 | 45 | var logo = this.physics.add.image(400, 100, 'logo'); 46 | 47 | logo.setVelocity(100, 200); 48 | logo.setBounce(1, 1); 49 | logo.setCollideWorldBounds(true); 50 | 51 | emitter.startFollow(logo); 52 | } 53 | 54 | window.onload = function () { 55 | const container = document.querySelector('#nodeEditor'); 56 | console.log(container) 57 | initRete(container); 58 | } -------------------------------------------------------------------------------- /Phaser/src/rete-editor.js: -------------------------------------------------------------------------------- 1 | 2 | import Rete from 'rete'; 3 | import * as AlightRenderPlugin from 'rete-connection-plugin'; 4 | import * as ConnectionPlugin from 'rete-alight-render-plugin'; 5 | console.log(Rete) 6 | var numSocket = new Rete.Socket('Number value'); 7 | 8 | class NumControl extends Rete.Control { 9 | 10 | constructor(emitter, key, readonly) { 11 | super(); 12 | this.emitter = emitter; 13 | this.key = key; 14 | this.template = ''; 15 | 16 | this.scope = { 17 | value: 0, 18 | readonly, 19 | change: this.change.bind(this) 20 | }; 21 | } 22 | 23 | change(e){ 24 | this.scope.value = +e.target.value; 25 | this.update(); 26 | } 27 | 28 | update(){ 29 | if(this.key) 30 | this.putData(this.key, this.scope.value) 31 | this.emitter.trigger('process'); 32 | this._alight.scan(); 33 | } 34 | 35 | mounted() { 36 | this.scope.value = this.getData(this.key) || 0; 37 | this.update(); 38 | } 39 | 40 | setValue(val) { 41 | this.scope.value = val; 42 | this._alight.scan() 43 | } 44 | } 45 | 46 | class NumComponent extends Rete.Component { 47 | 48 | constructor(){ 49 | super("Number"); 50 | } 51 | 52 | builder(node) { 53 | var out1 = new Rete.Output("Number", numSocket); 54 | 55 | return node.addControl(new NumControl(this.editor, 'num')).addOutput(out1); 56 | } 57 | 58 | worker(node, inputs, outputs) { 59 | outputs[0] = node.data.num; 60 | } 61 | } 62 | 63 | 64 | class AddComponent extends Rete.Component { 65 | constructor(){ 66 | super("Add"); 67 | } 68 | 69 | builder(node) { 70 | var inp1 = new Rete.Input("Number", numSocket); 71 | var inp2 = new Rete.Input("Number", numSocket); 72 | var out = new Rete.Output("Number", numSocket); 73 | 74 | inp1.addControl(new NumControl(this.editor, 'num1')) 75 | inp2.addControl(new NumControl(this.editor, 'num2')) 76 | 77 | return node 78 | .addInput(inp1) 79 | .addInput(inp2) 80 | .addControl(new NumControl(this.editor, null, true)) 81 | .addOutput(out); 82 | } 83 | 84 | worker(node, inputs, outputs) { 85 | var n1 = inputs[0].length?inputs[0][0]:node.data.num1; 86 | var n2 = inputs[1].length?inputs[1][0]:node.data.num2; 87 | var sum = n1 + n2; 88 | 89 | this.editor.nodes.find(n => n.id == node.id).controls[0].setValue(sum); 90 | outputs[0] = sum; 91 | } 92 | } 93 | 94 | 95 | export async function initRete(container) { 96 | var components = [new NumComponent(), new AddComponent()]; 97 | 98 | var editor = new Rete.NodeEditor('demo@0.1.0', container); 99 | editor.use(ConnectionPlugin, { curvature: 0.4 }); 100 | editor.use(AlightRenderPlugin); 101 | 102 | var engine = new Rete.Engine('demo@0.1.0'); 103 | 104 | components.map(c => { 105 | editor.register(c); 106 | engine.register(c); 107 | }); 108 | 109 | var n1 = await components[0].createNode({num: 2}); 110 | var n2 = await components[0].createNode({num: 0}); 111 | var add = await components[1].createNode(); 112 | 113 | n1.position = [80, 200]; 114 | n2.position = [80, 400]; 115 | add.position = [500, 240]; 116 | 117 | editor.addNode(n1); 118 | editor.addNode(n2); 119 | editor.addNode(add); 120 | 121 | editor.connect(n1.outputs[0], add.inputs[0]); 122 | editor.connect(n2.outputs[0], add.inputs[1]); 123 | 124 | 125 | editor.on('process nodecreated noderemoved connectioncreated connectionremoved', async () => { 126 | await engine.abort(); 127 | await engine.process(editor.toJSON()); 128 | }); 129 | 130 | editor.view.resize(); 131 | editor.trigger('process'); 132 | } -------------------------------------------------------------------------------- /Phaser/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin') 4 | 5 | const APP_DIR = path.resolve(__dirname, 'src'); 6 | const BUILD_DIR = path.resolve(__dirname, 'dist'); 7 | 8 | module.exports = { 9 | entry: `${APP_DIR}/index.js`, 10 | output: { 11 | path: BUILD_DIR, 12 | filename: 'bundle.js', 13 | }, 14 | resolve: { 15 | extensions: ['.js', '.json'], 16 | modules: [APP_DIR, 'node_modules'], 17 | alias: { 18 | // https://github.com/webpack/webpack/issues/4666 19 | constants: `${APP_DIR}/constants`, 20 | }, 21 | }, 22 | devtool: 'source-map', 23 | module: { 24 | rules: [ 25 | { 26 | test: /\.js$/, 27 | exclude: /node_modules/, 28 | use: ['babel-loader'], 29 | include: APP_DIR 30 | }, 31 | { 32 | test: /\.css$/, 33 | use: [ 'style-loader', 'css-loader' ] 34 | }, 35 | { 36 | test: [/\.vert$/, /\.frag$/], 37 | use: ['raw-loader'], 38 | } 39 | ], 40 | }, 41 | plugins: [ 42 | new webpack.DefinePlugin({ 43 | CANVAS_RENDERER: true, 44 | WEBGL_RENDERER: true, 45 | }), 46 | new HtmlWebpackPlugin({ 47 | template: 'index.html' 48 | }) 49 | ], 50 | devServer: { 51 | contentBase: BUILD_DIR, 52 | port: 4200, 53 | stats: 'minimal', 54 | } 55 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Examples for Rete.js v1 2 | 3 | This repository contains an examples for Rete.js version 1. 4 | 5 | However, if you need the source code for examples for the next major version, please check out the [Examples](https://retejs.org/examples) page. 6 | -------------------------------------------------------------------------------- /Tasks/components.js: -------------------------------------------------------------------------------- 1 | var actionSocket = new Rete.Socket('Action'); 2 | var dataSocket = new Rete.Socket('Data'); 3 | 4 | var eventHandlers = { 5 | list: [], 6 | remove() { 7 | this 8 | .list 9 | .forEach(h => { 10 | document.removeEventListener('keydown', h); 11 | }); 12 | this.list = []; 13 | }, 14 | add(name, h) { 15 | document.addEventListener(name, h, false); 16 | this 17 | .list 18 | .push(h); 19 | } 20 | }; 21 | 22 | class KeydownComp extends Rete.Component { 23 | 24 | constructor() { 25 | super('Keydown event'); 26 | this.task = { 27 | outputs: ['option', 'output'], 28 | init: this.init 29 | } 30 | } 31 | 32 | init(task) { 33 | eventHandlers.remove(); 34 | eventHandlers.add('keydown', function (e) { 35 | task.run(e.keyCode); 36 | task.reset(); 37 | }); 38 | } 39 | 40 | builder(node) { 41 | 42 | node.addOutput(new Rete.Output('', actionSocket)); 43 | node.addOutput(new Rete.Output('Key code', dataSocket)); 44 | } 45 | 46 | worker(node, inputs, data) { 47 | console.log('Keydown event', node.id, data); 48 | return [data] 49 | } 50 | } 51 | 52 | class EnterPressComp extends Rete.Component { 53 | 54 | constructor() { 55 | super('Enter pressed') 56 | this.task = { 57 | outputs: ['option', 'option'] 58 | } 59 | } 60 | 61 | builder(node) { 62 | node.addInput(new Rete.Input('', actionSocket)) 63 | node.addInput(new Rete.Input('Key code', dataSocket)) 64 | node.addOutput(new Rete.Output('Tren', actionSocket)) 65 | node.addOutput(new Rete.Output('Else', actionSocket)); 66 | } 67 | 68 | worker(node, inputs) { 69 | if (inputs[0][0] == 13) 70 | this.closed = [1]; 71 | else 72 | this.closed = [0]; 73 | console.log('Print', node.id, inputs); 74 | } 75 | } 76 | 77 | 78 | 79 | class MessageControl extends Rete.Control { 80 | 81 | constructor(emitter, msg) { 82 | super(); 83 | this.emitter = emitter; 84 | this.template = ''; 85 | 86 | this.scope = { 87 | msg, 88 | change: this.change.bind(this) 89 | }; 90 | } 91 | 92 | change(e) { 93 | this.scope.value = +e.target.value; 94 | this.update(); 95 | } 96 | 97 | update() { 98 | this.putData('msg', this.scope.value) 99 | this.emitter.trigger('process'); 100 | this._alight.scan(); 101 | } 102 | 103 | mounted() { 104 | this.scope.value = this.getData('msg') || 0; 105 | this.update(); 106 | } 107 | 108 | setValue(val) { 109 | this.scope.value = val; 110 | this._alight.scan() 111 | } 112 | } 113 | 114 | 115 | class AlertComp extends Rete.Component { 116 | 117 | constructor() { 118 | super('Alert'); 119 | this.task = { 120 | outputs: [] 121 | } 122 | } 123 | 124 | builder(node) { 125 | var ctrl = new MessageControl(this.editor, node.data.msg); 126 | 127 | node.addControl(ctrl) 128 | node.addInput(new Rete.Input('ff', actionSocket)); 129 | } 130 | 131 | worker(node, inputs) { 132 | console.log('Alert', node.id, node.data); 133 | alert(node.data.msg); 134 | } 135 | }; -------------------------------------------------------------------------------- /Tasks/data.js: -------------------------------------------------------------------------------- 1 | var data = { 2 | 'id': 'tasksample@0.1.0', 3 | 'nodes': { 4 | '2': { 5 | 'id': 2, 6 | 'data': {}, 7 | 'group': null, 8 | 'inputs': [], 9 | 'outputs': [ 10 | { 11 | 'connections': [ 12 | { 13 | 'node': 3, 14 | 'input': 0 15 | } 16 | ] 17 | }, { 18 | 'connections': [ 19 | { 20 | 'node': 3, 21 | 'input': 1 22 | } 23 | ] 24 | } 25 | ], 26 | 'position': [ 27 | 114, 133 28 | ], 29 | 'name': 'Keydown event' 30 | }, 31 | '3': { 32 | 'id': 3, 33 | 'data': {}, 34 | 'group': null, 35 | 'inputs': [ 36 | { 37 | 'connections': [ 38 | { 39 | 'node': 2, 40 | 'output': 0 41 | } 42 | ] 43 | }, { 44 | 'connections': [ 45 | { 46 | 'node': 2, 47 | 'output': 1 48 | } 49 | ] 50 | } 51 | ], 52 | 'outputs': [ 53 | { 54 | 'connections': [ 55 | { 56 | 'node': 10, 57 | 'input': 0 58 | } 59 | ] 60 | }, { 61 | 'connections': [ 62 | { 63 | 'node': 11, 64 | 'input': 0 65 | } 66 | ] 67 | } 68 | ], 69 | 'position': [ 70 | 443, 112 71 | ], 72 | 'name': 'Enter pressed' 73 | }, 74 | '10': { 75 | 'id': 10, 76 | 'data': { 77 | 'msg': 'Enter!' 78 | }, 79 | 'group': null, 80 | 'inputs': [ 81 | { 82 | 'connections': [ 83 | { 84 | 'node': 3, 85 | 'output': 0 86 | } 87 | ] 88 | } 89 | ], 90 | 'outputs': [], 91 | 'position': [ 92 | 773, 106 93 | ], 94 | 'name': 'Alert' 95 | }, 96 | '11': { 97 | 'id': 11, 98 | 'data': { 99 | 'msg': 'Another key pressed' 100 | }, 101 | 'group': null, 102 | 'inputs': [ 103 | { 104 | 'connections': [ 105 | { 106 | 'node': 3, 107 | 'output': 1 108 | } 109 | ] 110 | } 111 | ], 112 | 'outputs': [], 113 | 'position': [ 114 | 766, 292 115 | ], 116 | 'name': 'Alert' 117 | } 118 | }, 119 | 'groups': {} 120 | } -------------------------------------------------------------------------------- /Tasks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tasks Rete Sample 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tasks/index.js: -------------------------------------------------------------------------------- 1 | var container = document.querySelector('#rete') 2 | 3 | var editor = new Rete.NodeEditor('tasksample@0.1.0', container); 4 | editor.use(ConnectionPlugin, { curvature: 0.4 }); 5 | editor.use(AlightRenderPlugin); 6 | editor.use(ContextMenuPlugin); 7 | editor.use(TaskPlugin); 8 | 9 | var engine = new Rete.Engine('tasksample@0.1.0'); 10 | 11 | [new KeydownComp(), new EnterPressComp(), new AlertComp()].map(c => { 12 | editor.register(c); 13 | engine.register(c); 14 | }); 15 | 16 | editor.on('process connectioncreate connectionremove nodecreate noderemove', async ()=>{ 17 | if(editor.silent) return; 18 | await engine.abort(); 19 | await engine.process(editor.toJSON()); 20 | }); 21 | 22 | editor.view.resize(); 23 | 24 | editor.fromJSON(data).then(() => editor.trigger('process')); 25 | -------------------------------------------------------------------------------- /Tasks/style.css: -------------------------------------------------------------------------------- 1 | #d3ne { 2 | height: 100%; 3 | } 4 | 5 | .socket.data { 6 | background: rgb(143, 125, 224) 7 | } 8 | 9 | .socket.act { 10 | background: rgb(16, 202, 16); 11 | border-radius: 0 !important; 12 | width: 16px !important; 13 | } 14 | 15 | id { 16 | position: absolute; 17 | left: -6px; 18 | top: -6px; 19 | background: white; 20 | } -------------------------------------------------------------------------------- /Vue3/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /Vue3/README.md: -------------------------------------------------------------------------------- 1 | # rete-vue3-example 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /Vue3/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /Vue3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rete-vue3-example", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.6.5", 12 | "rete": "^1.4.5", 13 | "rete-area-plugin": "^0.2.1", 14 | "rete-connection-plugin": "^0.9.0", 15 | "rete-context-menu-plugin": "^0.6.0-rc.1", 16 | "rete-vue-render-plugin": "^1.0.0-rc1", 17 | "vue": "^3.0.0" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "~4.5.0", 21 | "@vue/cli-plugin-eslint": "~4.5.0", 22 | "@vue/cli-service": "~4.5.0", 23 | "@vue/compiler-sfc": "^3.0.0", 24 | "babel-eslint": "^10.1.0", 25 | "eslint": "^6.7.2", 26 | "eslint-plugin-vue": "^7.0.0" 27 | }, 28 | "eslintConfig": { 29 | "root": true, 30 | "env": { 31 | "node": true 32 | }, 33 | "extends": [ 34 | "plugin:vue/vue3-essential", 35 | "eslint:recommended" 36 | ], 37 | "parserOptions": { 38 | "parser": "babel-eslint" 39 | }, 40 | "rules": {} 41 | }, 42 | "browserslist": [ 43 | "> 1%", 44 | "last 2 versions", 45 | "not dead" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /Vue3/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Vue3/public/favicon.ico -------------------------------------------------------------------------------- /Vue3/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Vue3/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | 17 | 27 | -------------------------------------------------------------------------------- /Vue3/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/retejs/examples/4e8a26157bde3f0a723036088b64e92942bbf05a/Vue3/src/assets/logo.png -------------------------------------------------------------------------------- /Vue3/src/components/Editor.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 130 | 131 | 152 | -------------------------------------------------------------------------------- /Vue3/src/components/NumControl.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 38 | -------------------------------------------------------------------------------- /Vue3/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | 4 | createApp(App).mount('#app') 5 | -------------------------------------------------------------------------------- /nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | -------------------------------------------------------------------------------- /nodejs/index.ts: -------------------------------------------------------------------------------- 1 | import { Engine, Component } from 'rete'; 2 | 3 | class Comp extends Component { 4 | constructor() { 5 | super('component1'); 6 | } 7 | 8 | async builder() {} 9 | 10 | worker(node, inputs, outputs) { 11 | console.log('worker') 12 | outputs[0] = 1; 13 | } 14 | } 15 | 16 | var engine = new Engine('name@0.0.0'); 17 | engine.register(new Comp()); 18 | 19 | engine.process({ 20 | id: 'name@0.0.0', 21 | nodes: { 22 | 1: { 23 | name: 'component1', 24 | id: 1, 25 | inputs: {}, 26 | outputs: {}, 27 | data: {}, 28 | position: [0, 0] 29 | } 30 | } 31 | }).then(console.log) 32 | -------------------------------------------------------------------------------- /nodejs/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs-rete", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "nodejs-rete", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "rete": "^1.5.0" 13 | }, 14 | "devDependencies": { 15 | "@types/node": "^18.11.18", 16 | "nodemon": "^2.0.20", 17 | "ts-node": "^10.9.1", 18 | "typescript": "^4.9.4" 19 | } 20 | }, 21 | "node_modules/@cspotcode/source-map-support": { 22 | "version": "0.8.1", 23 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 24 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 25 | "dev": true, 26 | "dependencies": { 27 | "@jridgewell/trace-mapping": "0.3.9" 28 | }, 29 | "engines": { 30 | "node": ">=12" 31 | } 32 | }, 33 | "node_modules/@jridgewell/resolve-uri": { 34 | "version": "3.1.0", 35 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", 36 | "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", 37 | "dev": true, 38 | "engines": { 39 | "node": ">=6.0.0" 40 | } 41 | }, 42 | "node_modules/@jridgewell/sourcemap-codec": { 43 | "version": "1.4.14", 44 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", 45 | "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", 46 | "dev": true 47 | }, 48 | "node_modules/@jridgewell/trace-mapping": { 49 | "version": "0.3.9", 50 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 51 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 52 | "dev": true, 53 | "dependencies": { 54 | "@jridgewell/resolve-uri": "^3.0.3", 55 | "@jridgewell/sourcemap-codec": "^1.4.10" 56 | } 57 | }, 58 | "node_modules/@tsconfig/node10": { 59 | "version": "1.0.9", 60 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 61 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", 62 | "dev": true 63 | }, 64 | "node_modules/@tsconfig/node12": { 65 | "version": "1.0.11", 66 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 67 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", 68 | "dev": true 69 | }, 70 | "node_modules/@tsconfig/node14": { 71 | "version": "1.0.3", 72 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 73 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", 74 | "dev": true 75 | }, 76 | "node_modules/@tsconfig/node16": { 77 | "version": "1.0.3", 78 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", 79 | "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", 80 | "dev": true 81 | }, 82 | "node_modules/@types/node": { 83 | "version": "18.11.18", 84 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", 85 | "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", 86 | "dev": true 87 | }, 88 | "node_modules/abbrev": { 89 | "version": "1.1.1", 90 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 91 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", 92 | "dev": true 93 | }, 94 | "node_modules/acorn": { 95 | "version": "8.8.2", 96 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", 97 | "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", 98 | "dev": true, 99 | "bin": { 100 | "acorn": "bin/acorn" 101 | }, 102 | "engines": { 103 | "node": ">=0.4.0" 104 | } 105 | }, 106 | "node_modules/acorn-walk": { 107 | "version": "8.2.0", 108 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", 109 | "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", 110 | "dev": true, 111 | "engines": { 112 | "node": ">=0.4.0" 113 | } 114 | }, 115 | "node_modules/anymatch": { 116 | "version": "3.1.3", 117 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 118 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 119 | "dev": true, 120 | "dependencies": { 121 | "normalize-path": "^3.0.0", 122 | "picomatch": "^2.0.4" 123 | }, 124 | "engines": { 125 | "node": ">= 8" 126 | } 127 | }, 128 | "node_modules/arg": { 129 | "version": "4.1.3", 130 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 131 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 132 | "dev": true 133 | }, 134 | "node_modules/balanced-match": { 135 | "version": "1.0.2", 136 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 137 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 138 | "dev": true 139 | }, 140 | "node_modules/binary-extensions": { 141 | "version": "2.2.0", 142 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 143 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 144 | "dev": true, 145 | "engines": { 146 | "node": ">=8" 147 | } 148 | }, 149 | "node_modules/brace-expansion": { 150 | "version": "1.1.11", 151 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 152 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 153 | "dev": true, 154 | "dependencies": { 155 | "balanced-match": "^1.0.0", 156 | "concat-map": "0.0.1" 157 | } 158 | }, 159 | "node_modules/braces": { 160 | "version": "3.0.2", 161 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 162 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 163 | "dev": true, 164 | "dependencies": { 165 | "fill-range": "^7.0.1" 166 | }, 167 | "engines": { 168 | "node": ">=8" 169 | } 170 | }, 171 | "node_modules/chokidar": { 172 | "version": "3.5.3", 173 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 174 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 175 | "dev": true, 176 | "funding": [ 177 | { 178 | "type": "individual", 179 | "url": "https://paulmillr.com/funding/" 180 | } 181 | ], 182 | "dependencies": { 183 | "anymatch": "~3.1.2", 184 | "braces": "~3.0.2", 185 | "glob-parent": "~5.1.2", 186 | "is-binary-path": "~2.1.0", 187 | "is-glob": "~4.0.1", 188 | "normalize-path": "~3.0.0", 189 | "readdirp": "~3.6.0" 190 | }, 191 | "engines": { 192 | "node": ">= 8.10.0" 193 | }, 194 | "optionalDependencies": { 195 | "fsevents": "~2.3.2" 196 | } 197 | }, 198 | "node_modules/concat-map": { 199 | "version": "0.0.1", 200 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 201 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 202 | "dev": true 203 | }, 204 | "node_modules/create-require": { 205 | "version": "1.1.1", 206 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 207 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 208 | "dev": true 209 | }, 210 | "node_modules/debug": { 211 | "version": "3.2.7", 212 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 213 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 214 | "dev": true, 215 | "dependencies": { 216 | "ms": "^2.1.1" 217 | } 218 | }, 219 | "node_modules/diff": { 220 | "version": "4.0.2", 221 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 222 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 223 | "dev": true, 224 | "engines": { 225 | "node": ">=0.3.1" 226 | } 227 | }, 228 | "node_modules/fill-range": { 229 | "version": "7.0.1", 230 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 231 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 232 | "dev": true, 233 | "dependencies": { 234 | "to-regex-range": "^5.0.1" 235 | }, 236 | "engines": { 237 | "node": ">=8" 238 | } 239 | }, 240 | "node_modules/fsevents": { 241 | "version": "2.3.2", 242 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 243 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 244 | "dev": true, 245 | "hasInstallScript": true, 246 | "optional": true, 247 | "os": [ 248 | "darwin" 249 | ], 250 | "engines": { 251 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 252 | } 253 | }, 254 | "node_modules/glob-parent": { 255 | "version": "5.1.2", 256 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 257 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 258 | "dev": true, 259 | "dependencies": { 260 | "is-glob": "^4.0.1" 261 | }, 262 | "engines": { 263 | "node": ">= 6" 264 | } 265 | }, 266 | "node_modules/has-flag": { 267 | "version": "3.0.0", 268 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 269 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 270 | "dev": true, 271 | "engines": { 272 | "node": ">=4" 273 | } 274 | }, 275 | "node_modules/ignore-by-default": { 276 | "version": "1.0.1", 277 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 278 | "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", 279 | "dev": true 280 | }, 281 | "node_modules/is-binary-path": { 282 | "version": "2.1.0", 283 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 284 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 285 | "dev": true, 286 | "dependencies": { 287 | "binary-extensions": "^2.0.0" 288 | }, 289 | "engines": { 290 | "node": ">=8" 291 | } 292 | }, 293 | "node_modules/is-extglob": { 294 | "version": "2.1.1", 295 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 296 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 297 | "dev": true, 298 | "engines": { 299 | "node": ">=0.10.0" 300 | } 301 | }, 302 | "node_modules/is-glob": { 303 | "version": "4.0.3", 304 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 305 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 306 | "dev": true, 307 | "dependencies": { 308 | "is-extglob": "^2.1.1" 309 | }, 310 | "engines": { 311 | "node": ">=0.10.0" 312 | } 313 | }, 314 | "node_modules/is-number": { 315 | "version": "7.0.0", 316 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 317 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 318 | "dev": true, 319 | "engines": { 320 | "node": ">=0.12.0" 321 | } 322 | }, 323 | "node_modules/make-error": { 324 | "version": "1.3.4", 325 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", 326 | "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", 327 | "dev": true 328 | }, 329 | "node_modules/minimatch": { 330 | "version": "3.1.2", 331 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 332 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 333 | "dev": true, 334 | "dependencies": { 335 | "brace-expansion": "^1.1.7" 336 | }, 337 | "engines": { 338 | "node": "*" 339 | } 340 | }, 341 | "node_modules/ms": { 342 | "version": "2.1.3", 343 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 344 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 345 | "dev": true 346 | }, 347 | "node_modules/nodemon": { 348 | "version": "2.0.20", 349 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", 350 | "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", 351 | "dev": true, 352 | "dependencies": { 353 | "chokidar": "^3.5.2", 354 | "debug": "^3.2.7", 355 | "ignore-by-default": "^1.0.1", 356 | "minimatch": "^3.1.2", 357 | "pstree.remy": "^1.1.8", 358 | "semver": "^5.7.1", 359 | "simple-update-notifier": "^1.0.7", 360 | "supports-color": "^5.5.0", 361 | "touch": "^3.1.0", 362 | "undefsafe": "^2.0.5" 363 | }, 364 | "bin": { 365 | "nodemon": "bin/nodemon.js" 366 | }, 367 | "engines": { 368 | "node": ">=8.10.0" 369 | }, 370 | "funding": { 371 | "type": "opencollective", 372 | "url": "https://opencollective.com/nodemon" 373 | } 374 | }, 375 | "node_modules/nopt": { 376 | "version": "1.0.10", 377 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 378 | "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", 379 | "dev": true, 380 | "dependencies": { 381 | "abbrev": "1" 382 | }, 383 | "bin": { 384 | "nopt": "bin/nopt.js" 385 | }, 386 | "engines": { 387 | "node": "*" 388 | } 389 | }, 390 | "node_modules/normalize-path": { 391 | "version": "3.0.0", 392 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 393 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 394 | "dev": true, 395 | "engines": { 396 | "node": ">=0.10.0" 397 | } 398 | }, 399 | "node_modules/picomatch": { 400 | "version": "2.3.1", 401 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 402 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 403 | "dev": true, 404 | "engines": { 405 | "node": ">=8.6" 406 | }, 407 | "funding": { 408 | "url": "https://github.com/sponsors/jonschlinkert" 409 | } 410 | }, 411 | "node_modules/pstree.remy": { 412 | "version": "1.1.8", 413 | "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 414 | "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", 415 | "dev": true 416 | }, 417 | "node_modules/readdirp": { 418 | "version": "3.6.0", 419 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 420 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 421 | "dev": true, 422 | "dependencies": { 423 | "picomatch": "^2.2.1" 424 | }, 425 | "engines": { 426 | "node": ">=8.10.0" 427 | } 428 | }, 429 | "node_modules/rete": { 430 | "version": "1.5.0", 431 | "resolved": "https://registry.npmjs.org/rete/-/rete-1.5.0.tgz", 432 | "integrity": "sha512-JLQXjSbYuz7XBq+BcN2KTSRErwZ7X/MoHmlO1wGlyAmEdaMzog+nLWRwouBD8b5yEeKj1Lkf46eajVVLxYHUgA==", 433 | "hasInstallScript": true 434 | }, 435 | "node_modules/semver": { 436 | "version": "5.7.1", 437 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 438 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 439 | "dev": true, 440 | "bin": { 441 | "semver": "bin/semver" 442 | } 443 | }, 444 | "node_modules/simple-update-notifier": { 445 | "version": "1.1.0", 446 | "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", 447 | "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", 448 | "dev": true, 449 | "dependencies": { 450 | "semver": "~7.0.0" 451 | }, 452 | "engines": { 453 | "node": ">=8.10.0" 454 | } 455 | }, 456 | "node_modules/simple-update-notifier/node_modules/semver": { 457 | "version": "7.0.0", 458 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", 459 | "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", 460 | "dev": true, 461 | "bin": { 462 | "semver": "bin/semver.js" 463 | } 464 | }, 465 | "node_modules/supports-color": { 466 | "version": "5.5.0", 467 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 468 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 469 | "dev": true, 470 | "dependencies": { 471 | "has-flag": "^3.0.0" 472 | }, 473 | "engines": { 474 | "node": ">=4" 475 | } 476 | }, 477 | "node_modules/to-regex-range": { 478 | "version": "5.0.1", 479 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 480 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 481 | "dev": true, 482 | "dependencies": { 483 | "is-number": "^7.0.0" 484 | }, 485 | "engines": { 486 | "node": ">=8.0" 487 | } 488 | }, 489 | "node_modules/touch": { 490 | "version": "3.1.0", 491 | "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", 492 | "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", 493 | "dev": true, 494 | "dependencies": { 495 | "nopt": "~1.0.10" 496 | }, 497 | "bin": { 498 | "nodetouch": "bin/nodetouch.js" 499 | } 500 | }, 501 | "node_modules/ts-node": { 502 | "version": "10.9.1", 503 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", 504 | "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", 505 | "dev": true, 506 | "dependencies": { 507 | "@cspotcode/source-map-support": "^0.8.0", 508 | "@tsconfig/node10": "^1.0.7", 509 | "@tsconfig/node12": "^1.0.7", 510 | "@tsconfig/node14": "^1.0.0", 511 | "@tsconfig/node16": "^1.0.2", 512 | "acorn": "^8.4.1", 513 | "acorn-walk": "^8.1.1", 514 | "arg": "^4.1.0", 515 | "create-require": "^1.1.0", 516 | "diff": "^4.0.1", 517 | "make-error": "^1.1.1", 518 | "v8-compile-cache-lib": "^3.0.1", 519 | "yn": "3.1.1" 520 | }, 521 | "bin": { 522 | "ts-node": "dist/bin.js", 523 | "ts-node-cwd": "dist/bin-cwd.js", 524 | "ts-node-esm": "dist/bin-esm.js", 525 | "ts-node-script": "dist/bin-script.js", 526 | "ts-node-transpile-only": "dist/bin-transpile.js", 527 | "ts-script": "dist/bin-script-deprecated.js" 528 | }, 529 | "peerDependencies": { 530 | "@swc/core": ">=1.2.50", 531 | "@swc/wasm": ">=1.2.50", 532 | "@types/node": "*", 533 | "typescript": ">=2.7" 534 | }, 535 | "peerDependenciesMeta": { 536 | "@swc/core": { 537 | "optional": true 538 | }, 539 | "@swc/wasm": { 540 | "optional": true 541 | } 542 | } 543 | }, 544 | "node_modules/typescript": { 545 | "version": "4.9.4", 546 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", 547 | "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", 548 | "dev": true, 549 | "bin": { 550 | "tsc": "bin/tsc", 551 | "tsserver": "bin/tsserver" 552 | }, 553 | "engines": { 554 | "node": ">=4.2.0" 555 | } 556 | }, 557 | "node_modules/undefsafe": { 558 | "version": "2.0.5", 559 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", 560 | "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", 561 | "dev": true 562 | }, 563 | "node_modules/v8-compile-cache-lib": { 564 | "version": "3.0.1", 565 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 566 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", 567 | "dev": true 568 | }, 569 | "node_modules/yn": { 570 | "version": "3.1.1", 571 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 572 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 573 | "dev": true, 574 | "engines": { 575 | "node": ">=6" 576 | } 577 | } 578 | }, 579 | "dependencies": { 580 | "@cspotcode/source-map-support": { 581 | "version": "0.8.1", 582 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 583 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 584 | "dev": true, 585 | "requires": { 586 | "@jridgewell/trace-mapping": "0.3.9" 587 | } 588 | }, 589 | "@jridgewell/resolve-uri": { 590 | "version": "3.1.0", 591 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", 592 | "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", 593 | "dev": true 594 | }, 595 | "@jridgewell/sourcemap-codec": { 596 | "version": "1.4.14", 597 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", 598 | "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", 599 | "dev": true 600 | }, 601 | "@jridgewell/trace-mapping": { 602 | "version": "0.3.9", 603 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 604 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 605 | "dev": true, 606 | "requires": { 607 | "@jridgewell/resolve-uri": "^3.0.3", 608 | "@jridgewell/sourcemap-codec": "^1.4.10" 609 | } 610 | }, 611 | "@tsconfig/node10": { 612 | "version": "1.0.9", 613 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 614 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", 615 | "dev": true 616 | }, 617 | "@tsconfig/node12": { 618 | "version": "1.0.11", 619 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 620 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", 621 | "dev": true 622 | }, 623 | "@tsconfig/node14": { 624 | "version": "1.0.3", 625 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 626 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", 627 | "dev": true 628 | }, 629 | "@tsconfig/node16": { 630 | "version": "1.0.3", 631 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", 632 | "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", 633 | "dev": true 634 | }, 635 | "@types/node": { 636 | "version": "18.11.18", 637 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", 638 | "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", 639 | "dev": true 640 | }, 641 | "abbrev": { 642 | "version": "1.1.1", 643 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 644 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", 645 | "dev": true 646 | }, 647 | "acorn": { 648 | "version": "8.8.2", 649 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", 650 | "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", 651 | "dev": true 652 | }, 653 | "acorn-walk": { 654 | "version": "8.2.0", 655 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", 656 | "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", 657 | "dev": true 658 | }, 659 | "anymatch": { 660 | "version": "3.1.3", 661 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 662 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 663 | "dev": true, 664 | "requires": { 665 | "normalize-path": "^3.0.0", 666 | "picomatch": "^2.0.4" 667 | } 668 | }, 669 | "arg": { 670 | "version": "4.1.3", 671 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 672 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 673 | "dev": true 674 | }, 675 | "balanced-match": { 676 | "version": "1.0.2", 677 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 678 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 679 | "dev": true 680 | }, 681 | "binary-extensions": { 682 | "version": "2.2.0", 683 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 684 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 685 | "dev": true 686 | }, 687 | "brace-expansion": { 688 | "version": "1.1.11", 689 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 690 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 691 | "dev": true, 692 | "requires": { 693 | "balanced-match": "^1.0.0", 694 | "concat-map": "0.0.1" 695 | } 696 | }, 697 | "braces": { 698 | "version": "3.0.2", 699 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 700 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 701 | "dev": true, 702 | "requires": { 703 | "fill-range": "^7.0.1" 704 | } 705 | }, 706 | "chokidar": { 707 | "version": "3.5.3", 708 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 709 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 710 | "dev": true, 711 | "requires": { 712 | "anymatch": "~3.1.2", 713 | "braces": "~3.0.2", 714 | "fsevents": "~2.3.2", 715 | "glob-parent": "~5.1.2", 716 | "is-binary-path": "~2.1.0", 717 | "is-glob": "~4.0.1", 718 | "normalize-path": "~3.0.0", 719 | "readdirp": "~3.6.0" 720 | } 721 | }, 722 | "concat-map": { 723 | "version": "0.0.1", 724 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 725 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 726 | "dev": true 727 | }, 728 | "create-require": { 729 | "version": "1.1.1", 730 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 731 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 732 | "dev": true 733 | }, 734 | "debug": { 735 | "version": "3.2.7", 736 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 737 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 738 | "dev": true, 739 | "requires": { 740 | "ms": "^2.1.1" 741 | } 742 | }, 743 | "diff": { 744 | "version": "4.0.2", 745 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 746 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 747 | "dev": true 748 | }, 749 | "fill-range": { 750 | "version": "7.0.1", 751 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 752 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 753 | "dev": true, 754 | "requires": { 755 | "to-regex-range": "^5.0.1" 756 | } 757 | }, 758 | "fsevents": { 759 | "version": "2.3.2", 760 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 761 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 762 | "dev": true, 763 | "optional": true 764 | }, 765 | "glob-parent": { 766 | "version": "5.1.2", 767 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 768 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 769 | "dev": true, 770 | "requires": { 771 | "is-glob": "^4.0.1" 772 | } 773 | }, 774 | "has-flag": { 775 | "version": "3.0.0", 776 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 777 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 778 | "dev": true 779 | }, 780 | "ignore-by-default": { 781 | "version": "1.0.1", 782 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 783 | "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", 784 | "dev": true 785 | }, 786 | "is-binary-path": { 787 | "version": "2.1.0", 788 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 789 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 790 | "dev": true, 791 | "requires": { 792 | "binary-extensions": "^2.0.0" 793 | } 794 | }, 795 | "is-extglob": { 796 | "version": "2.1.1", 797 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 798 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 799 | "dev": true 800 | }, 801 | "is-glob": { 802 | "version": "4.0.3", 803 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 804 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 805 | "dev": true, 806 | "requires": { 807 | "is-extglob": "^2.1.1" 808 | } 809 | }, 810 | "is-number": { 811 | "version": "7.0.0", 812 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 813 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 814 | "dev": true 815 | }, 816 | "make-error": { 817 | "version": "1.3.4", 818 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", 819 | "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", 820 | "dev": true 821 | }, 822 | "minimatch": { 823 | "version": "3.1.2", 824 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 825 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 826 | "dev": true, 827 | "requires": { 828 | "brace-expansion": "^1.1.7" 829 | } 830 | }, 831 | "ms": { 832 | "version": "2.1.3", 833 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 834 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 835 | "dev": true 836 | }, 837 | "nodemon": { 838 | "version": "2.0.20", 839 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", 840 | "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", 841 | "dev": true, 842 | "requires": { 843 | "chokidar": "^3.5.2", 844 | "debug": "^3.2.7", 845 | "ignore-by-default": "^1.0.1", 846 | "minimatch": "^3.1.2", 847 | "pstree.remy": "^1.1.8", 848 | "semver": "^5.7.1", 849 | "simple-update-notifier": "^1.0.7", 850 | "supports-color": "^5.5.0", 851 | "touch": "^3.1.0", 852 | "undefsafe": "^2.0.5" 853 | } 854 | }, 855 | "nopt": { 856 | "version": "1.0.10", 857 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 858 | "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", 859 | "dev": true, 860 | "requires": { 861 | "abbrev": "1" 862 | } 863 | }, 864 | "normalize-path": { 865 | "version": "3.0.0", 866 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 867 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 868 | "dev": true 869 | }, 870 | "picomatch": { 871 | "version": "2.3.1", 872 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 873 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 874 | "dev": true 875 | }, 876 | "pstree.remy": { 877 | "version": "1.1.8", 878 | "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 879 | "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", 880 | "dev": true 881 | }, 882 | "readdirp": { 883 | "version": "3.6.0", 884 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 885 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 886 | "dev": true, 887 | "requires": { 888 | "picomatch": "^2.2.1" 889 | } 890 | }, 891 | "rete": { 892 | "version": "1.5.0", 893 | "resolved": "https://registry.npmjs.org/rete/-/rete-1.5.0.tgz", 894 | "integrity": "sha512-JLQXjSbYuz7XBq+BcN2KTSRErwZ7X/MoHmlO1wGlyAmEdaMzog+nLWRwouBD8b5yEeKj1Lkf46eajVVLxYHUgA==" 895 | }, 896 | "semver": { 897 | "version": "5.7.1", 898 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 899 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 900 | "dev": true 901 | }, 902 | "simple-update-notifier": { 903 | "version": "1.1.0", 904 | "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", 905 | "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", 906 | "dev": true, 907 | "requires": { 908 | "semver": "~7.0.0" 909 | }, 910 | "dependencies": { 911 | "semver": { 912 | "version": "7.0.0", 913 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", 914 | "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", 915 | "dev": true 916 | } 917 | } 918 | }, 919 | "supports-color": { 920 | "version": "5.5.0", 921 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 922 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 923 | "dev": true, 924 | "requires": { 925 | "has-flag": "^3.0.0" 926 | } 927 | }, 928 | "to-regex-range": { 929 | "version": "5.0.1", 930 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 931 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 932 | "dev": true, 933 | "requires": { 934 | "is-number": "^7.0.0" 935 | } 936 | }, 937 | "touch": { 938 | "version": "3.1.0", 939 | "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", 940 | "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", 941 | "dev": true, 942 | "requires": { 943 | "nopt": "~1.0.10" 944 | } 945 | }, 946 | "ts-node": { 947 | "version": "10.9.1", 948 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", 949 | "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", 950 | "dev": true, 951 | "requires": { 952 | "@cspotcode/source-map-support": "^0.8.0", 953 | "@tsconfig/node10": "^1.0.7", 954 | "@tsconfig/node12": "^1.0.7", 955 | "@tsconfig/node14": "^1.0.0", 956 | "@tsconfig/node16": "^1.0.2", 957 | "acorn": "^8.4.1", 958 | "acorn-walk": "^8.1.1", 959 | "arg": "^4.1.0", 960 | "create-require": "^1.1.0", 961 | "diff": "^4.0.1", 962 | "make-error": "^1.1.1", 963 | "v8-compile-cache-lib": "^3.0.1", 964 | "yn": "3.1.1" 965 | } 966 | }, 967 | "typescript": { 968 | "version": "4.9.4", 969 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", 970 | "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", 971 | "dev": true 972 | }, 973 | "undefsafe": { 974 | "version": "2.0.5", 975 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", 976 | "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", 977 | "dev": true 978 | }, 979 | "v8-compile-cache-lib": { 980 | "version": "3.0.1", 981 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 982 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", 983 | "dev": true 984 | }, 985 | "yn": { 986 | "version": "3.1.1", 987 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 988 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 989 | "dev": true 990 | } 991 | } 992 | } 993 | -------------------------------------------------------------------------------- /nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs-rete", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "start": "ts-node index.ts", 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "rete": "^1.5.0" 13 | }, 14 | "devDependencies": { 15 | "@types/node": "^18.11.18", 16 | "nodemon": "^2.0.20", 17 | "ts-node": "^10.9.1", 18 | "typescript": "^4.9.4" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /nodejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["ES2016", "DOM"], 4 | "outDir": "build" 5 | }, 6 | "include": [ 7 | "*.ts" 8 | ] 9 | } 10 | --------------------------------------------------------------------------------