Giter VIP home page Giter VIP logo

platform-terminal's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform-terminal's Issues

Can we run our code on terminal as well as on browser?

I can run angular application on terminal. Can we run this in browser?
I have made below changes but did not get blessed component. I was not getting any error because schemas: [NO_ERRORS_SCHEMA] was added module.

Main.ts
// import { platformTerminalDynamic } from 'platform-terminal';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

// platformTerminalDynamic().bootstrapModule(AppModule)
// .catch(err => console.error(err));
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

AppModule:
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
// import { TerminalModule } from 'platform-terminal';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

import { TextExampleComponent } from './text/text-example.component';
import { BoxExampleComponent } from './box/box-example.component';
import { TableExampleComponent } from './table/table-example.component';
import { ProgressbarExampleComponent } from './progressbar/progressbar-example.component';

@NgModule({
declarations: [
AppComponent,
TextExampleComponent,
BoxExampleComponent,
TableExampleComponent,
ProgressbarExampleComponent,
],
imports: [
CommonModule,
BrowserModule, // added broswer module
// TerminalModule
],
bootstrap: [AppComponent],
schemas: [NO_ERRORS_SCHEMA],
})
export class AppModule {
}

Can you please guild me to render this in browser? We are trying to run our project on terminal as well as in browser.

Can't seem to build with Node 10.16.0

`> [email protected] link:platform /Users/scottwalter/Library/Mobile Documents/comappleCloudDocs/Sandbox/platform-terminal

npm link dist/platform-terminal && npm link platform-terminal

npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #2: Expected array but got string
npm ERR! typeerror at EventEmitter.install (/Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/install.js:190:3)
npm ERR! typeerror at Object.commandCache.(anonymous function) (/Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/npm.js:156:13)
npm ERR! typeerror at /Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/link.js:93:24
npm ERR! typeerror at /Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:282:31
npm ERR! typeerror at FSReqWrap.oncomplete (fs.js:153:21)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror https://npm.community`

I can't run the demo application (shown in the readme file)

I changed app.component.ts to:

import { ChangeDetectionStrategy, Component } from '@angular/core';


@Component({
  selector: 'pl-root',
  template: `<pl-3-dashboard></pl-3-dashboard>`,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
}

But when I yarn start, I get:

this.rows.forEach is not a function TypeError: this.rows.forEach is not a function
    at Table._calculateMaxes (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/table.js:69:13)
    at Table.render (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/table.js:175:8)
    at /Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2334:8
    at Array.forEach (<anonymous>)
    at Box.Element.render (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2327:17)
    at /Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2334:8
    at Array.forEach (<anonymous>)
    at Box.Element.render (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2327:17)
    at /Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/screen.js:738:8
    at Array.forEach (<anonymous>)

Refactor TerminalRenderer

DOD:
TerminalPlatform provides all the required UI elements:

  • tables
  • progress bar
  • grid/layout
  • log
  • etc.

Added textbox for input but unable set focus

I have clone this repository and added input control but not able to set the focus:
I have added textbox to elementFactories using .set('textbox', blessed.textbox) and created a component to get user input

import { Component } from '@angular/core';
@component({
selector: 'pl-box-example',
template: <box #test top="center" left="center" height="10" width="21" [keyable]="'true'"> </box> <textbox left="center" [style]="style" top="5" keyable="true" value="first" height="2" width="10"></textbox>,
})
export class TextBoxComponent {
style = {
underline: true,
fg: 'white',
bg: 'yellow',
border: {
fg: 'red',
},
};
}
can you please help me to set focus to an input component?

Further development

Congrats for the effort! There are a variety of use cases for such a project.

  • Do you have plans for further development of platform-terminal? If you're planning to grow the project, we may sync to make sure everything will work in the future with Ivy.
  • Have you considered adding more primitive components (maybe get inspiration from ink)?
  • Have you considered implementing ng-add schematics and a custom builder for serve/build?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.