Git Product home page Git Product logo

droplet's Introduction

Droplet Editor

Build Status

Droplet seeks to re-envision "block programming" as "text editing". It is useful as a transitional tool for beginners using languages like Scratch, and is a go-to text editor for everyone on mobile devices (where keyboards don't work so well).

How to Embed

Droplet is a browserify package, so you can include it with npm, requirejs, or as a browser global. To embed, call new droplet.Editor() on a div.

<html>
<head>
<style>
#editor {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
</style>
</head>
<script src="dist/droplet-full.min.js"></script>
<script src="index.coffee" type="text-coffeescript"></script>
<div id="editor"></div>
</html>
editor = new droplet.Editor document.getElementById('editor'), {
  # Language
  mode: 'coffeescript'

  # Options for the CoffeeScript parser
  # (the JavaScript parser currently takes the same options)
  modeOptions: {
    functions: {
      fd: { command: true, color: 'red'}
      bk: { command: true, color: 'blue'}
      sin: { command: false, value: true, color: 'green' }
    }
    categories: {
      conditionals: { color: 'purple' }
      loops: { color: 'green' }
      functions: { color: '#49e' }
    }
  }

  # Palette description
  palette: [
   {
      name: 'Palette category'
      color: 'blue' # Header color
      blocks: [
        {
          block: "for [1..3]\n  ``"
          title: "Repeat some code" # title-text
        },
        {
          block: "playSomething()"
          expansion: "playSomething 'arguments', 100, 'too long to show'"
        },
      ]
    }
  ]
}

editor.setValue '''
for i in [1..10]
  document.write 'hello world'
'''

Contributing

Droplet uses Grunt and npm to build. Run:

git pull https://github.com/dabbler0/droplet.git
cd droplet
npm install
grunt all

When developing, run:

grunt testserver

This will run the development server and watch the src/ and example/ directories for recompilation. Visit localhost:8000/example/example.html for a simple running environment. A view debugger is available at localhost:8000/example/test.html.

Run grunt all to run the tests.

Adding a Language

Make a CoffeeScript (or JavaScript) file that looks like this:

helper = require './helper.coffee'
parser = require './parser.coffee'

class MyParser extends parser.Parser
  markRoot: ->

module.exports = parser.wrapParser MyParser

Put it in src/myparser.coffee.

Require it from modes.coffee:

javascript = require './javascript.coffee'
coffee = require './coffee.coffee'
myparser = require './myparser.coffee'

module.exports = {
  'javascript': javascript
  'coffee': coffee
  'coffeescript': coffee
  'myparser': myparser
  'myparser-alias': myparser
}

Then grunt. Your mode is integrated!

To have your parser actually put blocks in, you will need to do some things in the markRoot function. Fields and methods you need to know about:

# Get the raw text passed into the parser:
@text

# Get the `modeOptions` passed down from editor instantiation
@opts

# Add a Block
@addBlock({
  # Configure the location of the block (all required)
  bounds: {
    start: {line: Number, column: Number} # Lines and columns are zero-indexed
    end: {line: Number, column: Number}
  }
  depth: Number # Depth in the tree

  # Configure the block you're about to add (all optional)
  color: '#HEXCOLOR'
  precedence: Number
  classes: [] # Array of strings.
  buttons: {
    addButton: Boolean
    subtractButton: Boolean
  }
})

# Add a Socket
@addSocket({
  # Configure the location of the socket (all required)
  bounds: {
    start: {line: Number, column: Number} # Lines and columns are zero-indexed
    end: {line: Number, column: Number}
  }
  depth: Number # Depth in the tree

  # Configure the block you're about to add (all optional)
  precedence: Number
  classes: [] # Array of strings
})

# Add an Indent
@addIndent({
  # Configure the location of the socket (all required)
  bounds: {
    start: {line: Number, column: Number} # Lines and columns are zero-indexed
    end: {line: Number, column: Number}
  }
  depth: Number # Depth in the tree

  # Configure the indent you're about to add (all optional)
  prefix: '  ' # String that is a prefix of all the lines
  classes: [] # Array of strings
})

Call these in markRoot to insert Blocks, Sockets and Indents.

You may also want to override the following callbacks:

# Parens is called whenever a block is dropped into
# another block; you are allowed to change the leading
# and trailing text of the block at this moment (for parentheses, semicolons, etc.)
#
# The default for this is based on the precedence numbers.
MyParser.parens = (leading, trailing, node, context) ->
  # "leading" is the leading text owned by the block and not its children;
  # "trailing" is similar trailing text. "node" is the Block that is being dropped,
  # and context is the Socket or Indent it is being dropped into.
  return [newLeading, newTrailing]

# Text to fill in an empty socket when switching modes:
MyParser.empty = "blarg"

MyParser.drop = (block, context, preceding, succeeding) ->
  # block: the block that user is dragging
  # context: the place the user is dropping that block into
  # preceding: if in sequence, the block immediately before
  # succeeding: if in sequence, the block immediately after

  # block, context, preceding and succeeding will have
  # properties `classes` (from when you created the block),
  # `precedence`, and `type` ('block', 'socket', 'indent', or 'segment')
  if allowedIn(block, context)
    return helper.ENCOURAGE
  else if maybe(block, context)
    return helper.DISCOURAGE
  else
    return helper.FORBID

# HandleButton is called whenever a button is clicked
# You are allowed to modify this text provided
# the new text forms a single block
# which will replace the original block
MyParser.handleButton = (text, command, block) ->
  # "text" is the text of the block whose button was clicked
  # "command" is the button which was clicked
  # and is equal to 'add-button'
  # or 'subtract-button' telling which block was clicked
  # "block" contains information about the original block
  switch command
    when 'add-button'
      return newText
    when 'subtract-button'
      return newText
  # Return 'text' is you don't want to change anything
  return text

View Options

You can pass a viewSettings object into the options to configure various aspects of the renderer.

{
  viewSettings: {
    padding: 5, // Padding around each block
    indentWidth: 20, // Width of the left side of indent C-shaped blocks
    indentTongueHeight: 20, // Height of the bottom of indent C-shaped blocks when there is no other text on that bottom line (used mainly in Python/Coffee modes) 
    tabOffset: 10, // Distance from the left side of the puzzle-piece tab to the left side of the block
    tabWidth: 15, // Width of the bottom of the tab (from top point to top point)
    tabHeight: 4, // Height of the tab
    tabSideWidth: 1, / 4 // Fraction the width that is taken up by the sides of the tab (larger means flatter/fatter slanted sides)
    emptySocketWidth: 20, // Size of a socket with no text in it
    emptyLineHeight: 25, // Height of a line with no blocks on it
    shadowBlur: 5, // Blur factor for the drop shadow when dragging
    colors: { // Color aliases used in various places elsewhere; changing these will change lots of colors
      error: '#ff0000',
      comment: '#c0c0c0',  // currently grayish
      return: '#fff59d',   // currently yellowish
      control: '#ffcc80',  // currently orangeish
      value: '#a5d6a7',    // currently greenish
      command: '#90caf9' // currently blueish
    }
  }
}

droplet's People

Contributors

bjvanminnen avatar cpirich avatar dabbler0 avatar davidbau avatar gonfunko avatar hypercubed avatar joshlory avatar sakagg avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droplet's Issues

Refactor controller.coffee

Refactor controller.coffee into a by-feature scheme. Sections should be:

  • Block move support
  • Lasso Select support
  • Scrolling support
  • Undo support
  • Melt/Freeze support
  • Handwritten line support
  • Text input support

small bug in the read-only mode

Tested with the text-paste branch: when setReadOnly = true, you can still edit the socket contents by double-clicking the text and typing.

`rememberedSocket` data corrupted when +/- buttons clicked

if a
  fd 10
else
  fd 20

Select the "20" in fd 20
Click the "+" button so it becomes

if a
  fd 10
else if ``
  fd 20
else
  ``

Now the rememberedSocket location for fd 20 is corrupted, because the if is a new extra token. Any drags will throw errors.

ctrl-enter or command-enter should not add a line

When ctrl- (non-mac) or command- (on mac) is held down when keying, it should not type letters, because they are used as command keys by applications.

In particular, command-enter should not insert extra blank line blocks in block mode. Pencil Code uses command-enter to run a program.

'model.getLinesToParent is not a function' error in HTML mode on a specific file

There is a specific file that fails to render in HTML mode. To repro, just visit the following file:

http://shalynn.pencilcode.net/edit/shalynntaboutme.html

<!DOCTYPE html>
<html>
<head>
<title>About Shalynn</title>
<link rel="stylesheet" href="shalynntstylesheet.css">
</head>  
<body> 
<h1>About Shalynn</h1>
<hr>
<a href="shalynntindexi.html">Home</a>
<hr>
<h2>Thing You Might Want To Know About Me</h2>
<ul>
<li>I am fifteen years old.</li>
<li>I love country, hip hop, and Rap.</li>
<li>My favorite color is pink and purple.</li>
<li>I have two tattoos and a nose piercing.</li>
<li>My favorite animal is a cat and a dog.</li>
</ul>

</body>
</html>

When loading in HTML mode, we get the following exception:

editor.js:this.model.getLinesToParent is not a function:formatted:84642

Uncaught TypeError: this.model.getLinesToParent is not a function
114.c.View.a.computeDimensions @ editor.js:formatted:84642
114.c.View.a.computeDimensions @ editor.js:formatted:84666
114.c.View.a.computeDimensions @ editor.js:formatted:84666
114.c.View.a.computeDimensions @ editor.js:formatted:84666
114.c.View.a.computeDimensions @ editor.js:formatted:84666
114.c.View.a.computeDimensions @ editor.js:formatted:84666
114.c.View.b.layout @ editor.js:formatted:85024
100.r.redrawMain @ editor.js:formatted:75586
100.r.setTopNubbyStyle @ editor.js:formatted:75510
100.r.resizeNubby @ editor.js:formatted:75514
100.c.Editor.a.resizeBlockMode @ editor.js:formatted:75
453(anonymous function) @ editor.js:formatted:75344

Error running grunt all

I have researched a lot but I can't find a solution for my problem setting up droplet...

basically, I can clone and do a npm install very well, but I can't execute grunt all

I have installed node v6.17.1 and npm v3.10.10 on Ubuntu 22.04,

when i clone the project...

https://github.com/droplet-editor/droplet.git
cd droplet

and do a install process

npm install

It shows this output...

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: The package has been renamed to `open`
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: Mocha v1.x is no longer supported.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.

> [email protected] install /home/chipacu/algo-blocks-droplet/droplet/node_modules/phantomjs
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
  [========================----------------] 61%
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/chipacu/algo-blocks-droplet/droplet/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1687472713688/phantomjs-1.9.8-linux-x86_64 -> /home/chipacu/algo-blocks-droplet/droplet/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/chipacu/algo-blocks-droplet/droplet/node_modules/phantomjs/lib/phantom/bin/phantomjs
[email protected] /home/chipacu/algo-blocks-droplet/droplet
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └─┬ [email protected]
│ │ │ │     └── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]
│ │     └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]
│ │     ├── [email protected]
│ │     └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ ├── [email protected]
│ │   │ ├── [email protected]
│ │   │ ├── [email protected]
│ │   │ └── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
**├─┬ UNMET PEER DEPENDENCY [email protected]**
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   └─┬ [email protected]
│ │ │ │ │     └── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └─┬ [email protected]
│ │ │       ├── [email protected]
│ │ │       └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └─┬ [email protected]
│ │ │   │   └─┬ [email protected]
│ │ │   │     └── [email protected]
│ │ │   ├── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ ├── [email protected]
│ │   │ ├─┬ [email protected]
│ │   │ │ ├── [email protected]
│ │   │ │ ├── [email protected]
│ │   │ │ └── [email protected]
│ │   │ └── [email protected]
│ │   ├─┬ [email protected]
│ │   │ ├── [email protected]
│ │   │ ├── [email protected]
│ │   │ └─┬ [email protected]
│ │   │   └── [email protected]
│ │   └─┬ [email protected]
│ │     ├── [email protected]
│ │     ├── [email protected]
│ │     └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   └─┬ [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├─┬ [email protected]
│     │ ├── [email protected]
│     │ └── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├─┬ [email protected]
│   │ │ └─┬ [email protected]
│   │ │   └── [email protected]
│   │ └─┬ [email protected]
│   │   └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └─┬ [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   └── [email protected]
│   │ │ ├── [email protected]
│   │ │ └─┬ [email protected]
│   │ │   └─┬ [email protected]
│   │ │     └── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ └─┬ [email protected]
│   │ │   └── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └─┬ [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   └── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └─┬ [email protected]
│   │ │ │   └── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └─┬ [email protected]
│   │ │ │   ├─┬ [email protected]
│   │ │ │   │ └── [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   └── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ ├── [email protected]
│   │ │ │ ├── [email protected]
│   │ │ │ ├── [email protected]
│   │ │ │ └── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ ├── [email protected]
│   │ │ │ ├─┬ [email protected]
│   │ │ │ │ ├── [email protected]
│   │ │ │ │ ├── [email protected]
│   │ │ │ │ ├── [email protected]
│   │ │ │ │ └─┬ [email protected]
│   │ │ │ │   ├── [email protected]
│   │ │ │ │   └── [email protected]
│   │ │ │ └─┬ [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   ├─┬ [email protected]
│   │ │ │   │ └── [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   ├─┬ [email protected]
│   │ │ │   │ └── [email protected]
│   │ │ │   ├── [email protected]
│   │ │ │   └── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ └── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ └─┬ [email protected]
│   │   └── [email protected]
│   ├── [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       ├── [email protected]
│       ├─┬ [email protected]
│       │ ├── [email protected]
│       │ └── [email protected]
│       └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]
│   │ └─┬ [email protected]
│   │   └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]
│ │     └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
└─┬ [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └─┬ [email protected]
  │ │ │   ├── [email protected]
  │ │ │   └── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├── [email protected]
  │ │ │ └── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ └─┬ [email protected]
  │ │ │ │   ├── [email protected]
  │ │ │ │   └── [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ └── [email protected]
  │ │ │ └── [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └─┬ [email protected]
  │ │ │   └── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ │ ├── [email protected]
  │ │ │ │ │ │ └── [email protected]
  │ │ │ │ │ ├── [email protected]
  │ │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ │ └─┬ [email protected]
  │ │ │ │ │ │   └── [email protected]
  │ │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ │ └── [email protected]
  │ │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ │ └── [email protected]
  │ │ │ │ │ ├── [email protected]
  │ │ │ │ │ └─┬ [email protected]
  │ │ │ │ │   └─┬ [email protected]
  │ │ │ │ │     ├── [email protected]
  │ │ │ │ │     └─┬ [email protected]
  │ │ │ │ │       └── [email protected]
  │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ ├── [email protected]
  │ │ │ │ │ ├── [email protected]
  │ │ │ │ │ └─┬ [email protected]
  │ │ │ │ │   ├── [email protected]
  │ │ │ │ │   └─┬ [email protected]
  │ │ │ │ │     ├── [email protected]
  │ │ │ │ │     ├── [email protected]
  │ │ │ │ │     └── [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ └─┬ [email protected]
  │ │ │ │ │   ├── [email protected]
  │ │ │ │ │   └── [email protected]
  │ │ │ │ ├─┬ [email protected]
  │ │ │ │ │ └── [email protected]
  │ │ │ │ └── [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ └─┬ [email protected]
  │ │ │ │   ├─┬ [email protected]
  │ │ │ │   │ └── [email protected]
  │ │ │ │   ├─┬ [email protected]
  │ │ │ │   │ └── [email protected]
  │ │ │ │   └── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ ├── [email protected]
  │ │ │ │ └── [email protected]
  │ │ │ └── [email protected]
  │ │ └── [email protected]
  │ └─┬ [email protected]
  │   └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   ├── [email protected]
  │ │   └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   ├── [email protected]
  │ │   ├── [email protected]
  │ │   └── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ └── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ └── [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├─┬ [email protected]
  │ │ │ │ └─┬ [email protected]
  │ │ │ │   ├── [email protected]
  │ │ │ │   └── [email protected]
  │ │ │ └─┬ [email protected]
  │ │ │   └── [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └─┬ [email protected]
  │ │   ├── [email protected]
  │ │   ├── [email protected]
  │ │   └── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  └── [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
**npm WARN [email protected] requires a peer of grunt@>=1.4.1 but none was installed.**

I have made a lot of things here, I don't understand what should I do to get the grunt all working. I'll resume everything I made:

  • Installed grunt npm install grunt
  • Removed grunt npm remove -f grunt
  • Installed and removed grunt in other versions npm install grunt@>=1.4.1 [email protected] and grunt@=1.4.1 none of these worked...
  • I installed them locally and globally, and I installed too the npm install grunt-cli in the same versions

I can respond anything more you want, and give more context if necesary, It's really complicated for me to get this working 😭

Need textToScreenCoordinates

For a debug annotation project, cali stenson needs a "textToScreenCoordinates" type of functionality in droplet. It would be used for drawing things like additional annotation text, arrows, or boxes on top of code in droplet.

Cloning an Indent loses classes

When using .clone for Indent class in src/model.coffee, the indent loses classes because they are not passed in the underlying _cloneEmpty() (line - 812)

Link is broken on landing page!

Your link "Block language reenvisioned as a text editor http://experiment.pencilcode.net/anth…" on the landing page here is broken. Please fix it. I'd like to learn more about droplet. The idea of not only using a "Blockly-like" visual block editor to translate to code, but to translate code back to blocks is fantastic. I'd like to learn more about how you do it.

It would be great if you could fix the broken link so I can get a better idea of what you are doing, and it would be doubly nice if you could post some links to some documentation that discusses it in detail. This is an idea whose time has come.

By the way, I can't find one, but I was wondering if you have released an official "dockerized" version.

Thanks!

Rendering upgrades

High priority rendering upgrade: make Sockets render like Blocks, so that triple-quoted strings and regexes work.

Low priority rendering upgrade: allow Indents to render while sharing their first line (thus not being rectangular), so that object literals and JavaScript can work.

Too easy to delete a block that extends off the screen

When you have a block that's large enough to extend off the screen to the top, and you grab the bottom of it, you can delete by picking up and immediately putting it down again because anywhere off the screen is a delete region.

Fix parser bug

Currently, the parser does not assign precedences properly in a situation like:
(a + b) + c
since the socket surrounding (a+b) is an auto-repair. Adjust coffee.coffee to insert the proper sockets by hand.

C/Java examples broken

Hello,

I would like to try C and Java examples but they looks broken, can you give me an update about what has to be done to fix them?

Thank you

Update npm package, use grunt-release to manage releases

I recently tried installing using npm (and webpack), and noticed the npm package is fairly outdated. I'd recommend using grunt-release to make it easier to release consistently on github and npm. This also has the advantage of creating tags on github so that users can inspect changes from one release to the next.

Multiline sockets

I noticed that multiline sockets don't work. It forms a rectangle but with 3 sides. Error Message: 'Uncaught TypeError: Failed to execute 'fillRect' on 'CanvasRenderingContext2D': 4 arguments required, but only 3 present.'
To recreate it - open example/example.html - with input -

for i in [1..1000]
  if i % 5 is 0
    see '''f
    i
    z
    z'''
  if i % 3 is 0
    see 'buzz'
  if i % 3 isnt 0 and i % 5 isnt 0
    see i

and try editing the socket with '''fizz'''

screenshot from 2015-05-30 17 12 20

Clicking on scrollbar ends up dragging elements underneath

If you drag the scrollbar of the main editing region, the clicks end up going through to elements that are underneath the scrollbar. To repro,

  1. create a page with big blocks that go past the right and bottom edges, like this one: http://david.pencilcode.net/edit/about.html#blocks=1
  2. then click on the scrollbar where some block is underneath, and drag the scrollbar.
  3. observe: hovering highlights the block, and click-drag drags the block.

expect: the click shouldn't go through the scrollbar.

HTML mode should use html comment character

When dragging a block off into space, it surrounds with /* */ C-style comments even if not in a C-style language.

Two problems: first, it can be overridden, so HTML mode should use .

Second: if a mode doesn't specify, then no comment punctuation should be shown.

Indent is wrong for a very simple program.

Repros on pencilcode.net:

(1) Drag a for [1..3] loop into a new program.
(2) Add a nested [1..3] loop
(3) Add an "fd 100" block innnermost.
(4) switch to code.
(5) see: indenting is wrong.

Editor::setValue can fail silently in text mode

In some situations, calling Editor::setValue will have no effect.

Ran across this issue on our site with our "Start Over" feature. Repro was starting a level, switching from block mode to text mode, typing a few lines, and then clicking "Start Over."

Root cause seems to be an outdated @lastAceSeenValue. This check is not checking the current value of the editor, because it's only updated when getAceValue is called, which does not include when typing into the editor. Thus the function can mistakenly think no change is needed, when in fact it is.

Either this check should query the actual current value of the ace editor, or it might not be necessary at all - hopefully Ace swallows redundant set calls internally.

Incorrect parentheses inserted around constructor invocation (coffeescript)

Parentheses are put in the wrong place near a constructor. This is the weirdest part of the JavaScript (and CoffeeScript) grammar, and we get it wrong.

To repro, enter this file in text mode:

url = 'https://upload.wikimedia.org/wikipedia/commons/2/27/Rainstick.ogg'
new Audio(url).play()
  1. Play it. Hear a nice sound.
  2. Switch to block mode. Click on the (url) parameter and click away.
  3. Notice new (Audio(url)).play(). This means something different.
  4. Try to play it. Get an error message about invoking Audio with out "new".

We should detect the new case and be particularly careful about reparsing.

HTML mode throws on mismatched tags

Parse5 is able to parse the following document:

<b>
  <i>
</b>

But when the HTML mode tries to blockify it it thows Improper parser: block cannot nest immediately inside another block.

Adding A New Language (Ada)

Hello Everybody,

First thank you for making Droplet. I have been studying and learning it for about a week now.
I am adding Ada language to droplet. So far so good I have been following the instructions from https://github.com/cacticouncil/droplet/blob/master/docs/AddingLanguages.docx and been able to run Antlr to generate required files (parser, lexer, listener, etc..)

But I have hit a block on how to modify the grammar file to add _DropletFile and EOF and which section/part of the anltlr4 Ada.g4 grammar should I modify/Duplicate? Is there a script file to run on the grammar file?

I have looked at c.g4 and java.g4 but I need more help and tips. Many thanks!
Is there a document that I could follow more on this? many thanks!

Once again many thanks for your support!

Hear from you soon!

God blesses!!!

Best regards,
Sanyaade

Possible Typo in src/view.coffee:1036

I think there is a typo in file src/view.coffee at line number 1036
The line should be
@minDistanceToBase[line].below = @view.opts.textPadding
instead of
@minDistanceToBase[line].above = @view.opts.textPadding

Note the .below instead of .above

Touchscreen doesn't seem to work on IE

Touschreen drags Droplet in Pencilcode on a Microsoft Surface in IE don't fire, and instead get interpreted as a back- or forward- swipe by the browser to perform the back- or forward- button operations.

Syntax error programs throw unhandled exceptions

The reparse operation that happens every time we drop a block throws an unhandled error if the resulting combination is a syntax error. Example:

1 + 1;
function hello(a) {
  return a;
}

Drag the 1+1 block to make:

function hello(1 + 1) {
  return a;
}

In this case the drop appears not to "complete"; the 1+1 block will continue to be dragged until another mouse event. This is because the process that cleans up the end of the drag has thrown an error while trying to reparse the function block and had not recovered.

Ideally, in this situation, Droplet would undo the drop or forbid the drop to begin with.

Indent is wrong for nested drops - HTML

In HTML mode, drag-drop a block inside the work-area.
Drag-drop a compound node inside it and another one inside this one. Switch to text mode, and voila, the indent is not correct.
Attaching images
screenshot from 2015-07-19 01 53 57
screenshot from 2015-07-19 01 54 03

Line comments should not be treated as separate blocks

One of the bits of feedback from teachers at CSTA is that code documentations is really important for teaching, and that our block implementation is weak on this.

To improve comments, comments should be attached to the code that they comment.

For example, clicking to the right of a block line of code should allow you to type a comment that would be prefixed by # or // or even <!-- --> in the appropriate language.

Then dragging that block should bring the comment along with it.

The block should not be rendered as if the comment is its own block - the comment should be treated differently than a block for rendering.

The other common position for comments is above lines of code. A comment on its own line (or on multiple lines) immediately above a block should be attached to the block below the comment.

Current status of Python support, and how to help?

Hello,
I see that your homepage says EarSketch has done some work on Python support. I also see that you have done a fair amount of work on Python in these two pull requests (163, 187). I may be interested in contributing to Python support; where do you recommend I start?

EDIT: edited to make clear that I am not yet sure I'll have time 😅

HTML Attributes Support

Is there a way to configure droplet to support attributes on HTML blocks? It would also be nice to have a kind of dropdown to add common attributes, such as id, class, etc.

Socket gets erased after a typing correction

If you press "enter" in a socket that gets autocorrected in a specific situation, a different socket gets erased.

Repro: in pencil code

  1. Enter a call with a string and a second argument, e.g: write 'answer', atan 1
  2. Enter a mismatched quote string in the string socket: e.g.: write 'here's', atan 1 - don't click away
  3. Press enter from within the string socket.

Observe: the "1" in atan 1 is gone, replaced by a newline character.

We have blocks that are directly of this form await '?', defer x which invite this problem, so it's pretty visible.

image
image
image

Is this project active?

Hi everyone.

I want to help, but I want to know if this project is active. Is this project active?

Is there anything I can do to help this community, this open project?

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.