Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-nteract-app

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-nteract-app - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

src/template/components/code-state.js

2

package.json
{
"name": "create-nteract-app",
"version": "0.2.0",
"version": "0.3.0",
"description": "create an nteractive computing app!",

@@ -5,0 +5,0 @@ "repository": {

@@ -5,2 +5,4 @@ const _ = require("lodash");

import CodeMirrorEditor from "@nteract/editor";
const transforms = require("@nteract/transforms");

@@ -7,0 +9,0 @@ const messaging = require("@nteract/messaging");

@@ -10,2 +10,5 @@ import * as React from "react";

const transforms = require("@nteract/transforms");
const messaging = require("@nteract/messaging");
import CodeMirrorEditor from "@nteract/editor";

@@ -18,8 +21,16 @@

this.submit = () => {
console.log(this.state.source);
console.log("Submitting", this.state.source);
if (this.props.kernel && this.props.kernel.channels) {
this.props.kernel.channels.next(
messaging.executeRequest(this.state.source)
);
console.log("submitted!");
} else {
console.warn("Could not submit, kernel not connected");
debugger;
}
};
this.state = {
source: this.props.source,
messageCollections: {},
source: this.props.children,
codeMirrorOptions: {

@@ -38,2 +49,32 @@ extraKeys: {

render() {
const outputs = _.map(
this.props.messageCollections,
(collection, parent_id) => {
return _.map(collection, msg => {
switch (msg.msg_type) {
case "execute_result":
case "display_data":
if (msg.content.data) {
const mimetype = transforms.richestMimetype(msg.content.data);
if (!mimetype) {
return null;
}
const Transform = transforms.transforms[mimetype];
return (
<Transform
key={msg.header.msg_id}
data={msg.content.data[mimetype]}
/>
);
}
case "stream":
return <pre key={msg.header.msg_id}>{msg.content.text}</pre>;
default:
return null;
}
}).filter(x => x !== null);
}
);
return (

@@ -56,2 +97,3 @@ <div className="omg">

</Input>
{outputs && outputs.length > 0 ? <Outputs>{outputs}</Outputs> : null}
</Cell>

@@ -67,1 +109,5 @@ <style>{`

}
PresentationCell.defaultProps = {
children: ""
};

@@ -17,6 +17,2 @@ import Document, { Head, Main, NextScript } from "next/document";

/>
<link
rel="stylesheet"
href="https://unpkg.com/awsm.css/dist/awsm.min.css"
/>
<style>{`body { margin: 0 } /* custom! */`}</style>

@@ -23,0 +19,0 @@ </Head>

@@ -13,3 +13,3 @@ import { Kernel } from "@mybinder/host-cache";

return (
<>
<div className="app">
<center>

@@ -34,3 +34,8 @@ <WideLogo height={80} theme="light" />

</Kernel>
</>
<style jsx>{`
.app {
padding: 30px;
}
`}</style>
</div>
);

@@ -37,0 +42,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc