Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cd383eb
rollup deps
aminya May 28, 2020
3e56a45
scripts
aminya May 28, 2020
8d92797
rollup config
aminya May 28, 2020
b946ab6
babel config
aminya May 28, 2020
021168f
remove 'use babel'
aminya May 28, 2020
3d50f55
Update package.json
aminya May 28, 2020
b1021cc
Create ppublish.sh
aminya May 28, 2020
8638486
Update rollup.config.js
aminya May 28, 2020
5b1ff1f
Update package-lock.json
aminya May 28, 2020
3b7ed1d
views export
aminya May 28, 2020
e365b7d
tooltip import/export
aminya May 28, 2020
5799a63
pane-item copy of focusEditorPane
aminya May 28, 2020
d5d1411
loading import/export
aminya May 28, 2020
bf4679b
basic-modal typo in makeIcon
aminya May 28, 2020
de4d30a
tree import/export
aminya May 28, 2020
e554dfb
linter missing let subs
aminya May 28, 2020
15ba9b6
highlights import/export
aminya May 28, 2020
c90cb43
docs import/export
aminya May 28, 2020
f9c92f9
block export
aminya May 28, 2020
ebbf92b
stepper import/export
aminya May 28, 2020
2003090
stepper-view import/export
aminya May 28, 2020
f9e9f45
debugger-pane import/export
aminya May 28, 2020
8ad48bf
console/views export default
aminya May 28, 2020
2747ccb
const config
aminya May 28, 2020
299abff
ink decaffeinate + import exportables
aminya May 28, 2020
2348759
remove unused imports
aminya May 28, 2020
acb682b
Merge pull request #1 from aminya/optimize_imports
aminya May 28, 2020
8bb3c83
underscore instead of old plus version
aminya May 28, 2020
89fa9cf
Merge pull request #2 from aminya/underscore
aminya May 28, 2020
8df34b4
disable drop console
aminya May 28, 2020
4c5922c
use env to support cmd
aminya May 29, 2020
0c24319
debug coffee files
aminya May 30, 2020
93e4280
Move katex to julia client
aminya May 30, 2020
039f803
Update package-lock.json
aminya May 30, 2020
81ba795
simplify provide code
aminya Jun 11, 2020
0fdaa95
import everything as matchHighlighter
aminya Jun 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
npm-debug.log
node_modules
dist
16 changes: 16 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let presets = ["@babel/preset-react"];

let plugins = [
"@babel/plugin-proposal-class-properties"
];

if (process.env.BABEL_ENV === "development") {
plugins.push("@babel/plugin-transform-modules-commonjs")
}

module.exports = {
presets: presets,
plugins: plugins,
exclude: "node_modules/**",
sourceMaps: "inline"
}
4 changes: 2 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use babel'

export default config = {

export const config = {
'terminal': {
type: 'object',
oder: 1,
Expand Down
3 changes: 1 addition & 2 deletions lib/console/console.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use babel'

/** @jsx etch.dom */

import etch from 'etch'
Expand All @@ -11,7 +11,6 @@ import { Unicode11Addon } from 'xterm-addon-unicode11'
import { FitAddon } from 'xterm-addon-fit'
import TerminalElement from './view'
import PaneItem from '../util/pane-item'
import { debounce, throttle } from 'underscore-plus'
import { closest } from './helpers'
import { openExternal } from 'shell'
import SearchUI from './searchui'
Expand Down
2 changes: 1 addition & 1 deletion lib/console/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use babel'


export function closest(element, selector) {
return element == null || element.matches(selector) ? element :
Expand Down
6 changes: 3 additions & 3 deletions lib/console/searchui.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use babel'

/** @jsx etch.dom */

import etch from 'etch'
import { Raw, Button, toView } from '../util/etch.js'
import { CompositeDisposable, Emitter, TextEditor } from 'atom'
import { Button, toView } from '../util/etch.js'
import { TextEditor } from 'atom'

export default class TerminalSearchUI {
constructor (terminal, searcher) {
Expand Down
6 changes: 3 additions & 3 deletions lib/console/view.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use babel'


import { CompositeDisposable } from 'atom'
import { WebglAddon } from 'xterm-addon-webgl'
import ResizeDetector from 'element-resize-detector'
import { debounce, throttle } from 'underscore-plus'
import { debounce } from 'underscore'
import chroma from 'chroma-js'

class TerminalElement extends HTMLElement {
Expand Down Expand Up @@ -151,4 +151,4 @@ function rgb2hex (rgb) {
}
}

module.exports = TerminalElement = document.registerElement('ink-terminal', {prototype: TerminalElement.prototype})
export default TerminalElement = document.registerElement('ink-terminal', {prototype: TerminalElement.prototype})
2 changes: 1 addition & 1 deletion lib/debugger/breakpoints.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use babel'

/** @jsx etch.dom */

import {CompositeDisposable, Emitter} from 'atom'
Expand Down
6 changes: 3 additions & 3 deletions lib/debugger/debugger-pane.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use babel'

/** @jsx etch.dom */

import etch from 'etch'
import { toView, Toolbar, Tip, Button, Icon, makeicon, Etch, Raw } from '../util/etch'
import { toView, Tip, Button } from '../util/etch'
import { showBasicModal } from '../util/basic-modal'
import { CompositeDisposable, TextEditor } from 'atom'
import PaneItem from '../util/pane-item'
import { open } from '../util/opener'
import views from '../util/views'
import { DebuggerToolbar, buttonView } from './toolbar'
import { DebuggerToolbar } from './toolbar'

// pane for side-to-side view of compiled code and source code
export default class DebuggerPane extends PaneItem {
Expand Down
5 changes: 2 additions & 3 deletions lib/debugger/stepper-view.coffee
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{CompositeDisposable} = require 'atom'
import {CompositeDisposable} from 'atom'

MIN_RESULT_WIDTH = 30
RESULT_OFFSET = 20

module.exports =
class StepperView
export default class StepperView

createView: ->
@disposables = new CompositeDisposable
Expand Down
15 changes: 7 additions & 8 deletions lib/debugger/stepper.coffee
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
StepperView = require './stepper-view'
# {DebuggerToolbar} = require('./toolbar')
views = require '../util/views'
{Emitter} = require 'atom'
{focusEditorPane} = require '../util/pane-item'
import StepperView from './stepper-view'
# import {DebuggerToolbar} from './toolbar'
import views from '../util/views'
import {Emitter} from 'atom'
import {focusEditorPane} from '../util/pane-item'
{span} = views.tags
{open, isUntitled, getUntitledId, editorMatchesFile} = require '../util/opener'
import {open, editorMatchesFile} from '../util/opener'

module.exports =
class Stepper
export default class Stepper
constructor: ({@buttons, @pending}) ->
@views = []
# @bars = []
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use babel'


import { CompositeDisposable } from 'atom'

Expand Down
4 changes: 2 additions & 2 deletions lib/docs/docpane.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use babel'

/** @jsx etch.dom */

import etch from 'etch'

import { TextEditor, CompositeDisposable } from 'atom'
import PaneItem from '../util/pane-item'
import { toView, Toolbar, Button, Icon, makeIcon, Etch } from '../util/etch'
import { toView, Button, makeIcon, Etch } from '../util/etch'

export default class DocPane extends PaneItem {
constructor () {
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/block.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports =
export default block =
timeout: (t, f) -> setTimeout f, t

# highlights the start-end range of the provided editor object for 20 ms
Expand Down
5 changes: 2 additions & 3 deletions lib/editor/docs.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{CompositeDisposable} = require 'atom'
import {CompositeDisposable} from 'atom'

module.exports =
class InlineDoc
export default class InlineDoc
constructor: (@editor, range, opts={}) ->
@disposables = new CompositeDisposable
InlineDoc.removeRangeRows @editor, range
Expand Down
4 changes: 2 additions & 2 deletions lib/editor/highlights.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{editorMatchesFile} = require '../util/opener'
import {editorMatchesFile} from '../util/opener'

module.exports =
export default highlights =
observeLines: (ls, f) ->
atom.workspace.observeTextEditors (ed) =>
for l in ls
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/result-view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use babel'

import { CompositeDisposable } from 'atom'
import views from '../util/views'
import ansiToHTML from '../util/ansitohtml'
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/result.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use babel'

import {CompositeDisposable, Emitter} from 'atom'
import ResultView from './result-view'

Expand Down
75 changes: 0 additions & 75 deletions lib/ink.coffee

This file was deleted.

104 changes: 104 additions & 0 deletions lib/ink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
import etch from 'etch';
import {once} from 'underscore';
// these need to be loaded first so deserialization works fine
import PaneItem from './util/pane-item';
import PlotPane from './plots/pane';
import HTMLPane from './plots/htmlpane';
import DocPane from './docs/docpane';
import NotePane from './note/notepane';
import DebuggerPane from './debugger/debugger-pane';
import InkTerminal from './console/console';
import Workspace from './workspace/workspace';
import Outline from './outline/outline';
import * as Linter from './linter/linter'
export {config} from './config.js';

// exportables
import Loading from './util/loading'
import * as progress from './util/progress'
import Tooltip from './util/tooltip'
import block from './editor/block'
import highlights from './editor/highlights'
import Result from './editor/result'
import InlineDoc from './editor/docs'
import Stepper from './debugger/stepper'
import breakpoints from './debugger/breakpoints'
import {Pannable} from './plots/canopy'
import {ProfileViewer as Profiler} from './plots/profiler'
import tree from './tree'
import * as Opener from './util/opener'
import * as matchHighlighter from './util/matchHighlighter'
import ansiToHTML from './util/ansitohtml'

const exportables = {
PaneItem: once(() => PaneItem),
PlotPane: once(() => PlotPane),
DocPane: once(() => DocPane),
NotePane: once(() => NotePane),
DebuggerPane: once(() => DebuggerPane),
InkTerminal: once(() => InkTerminal),
Workspace: once(() => Workspace),
Outline: once(() => Outline),
Linter: once(() => Linter),
HTMLPane: once(() => HTMLPane),
Loading: once(() => Loading),
progress: once(() => progress),
Tooltip: once(() => Tooltip),
block: once(() => block),
highlights: once(() => highlights),
Result: once(() => Result),
InlineDoc: once(() => InlineDoc),
Stepper: once(() => Stepper),
breakpoints: once(() => breakpoints),
Pannable: once(() => Pannable),
Profiler: once(() => Profiler),
tree: once(() => tree),
Opener: once(() => Opener),
matchHighlighter: once(() => matchHighlighter),
ansiToHTML: once(() => ansiToHTML)
};

export function activate() {
etch.setScheduler(atom.views);
[exportables.Opener(), exportables.PaneItem(), exportables.Result(), exportables.InlineDoc(), exportables.PlotPane(), exportables.InkTerminal(), exportables.Linter()].map((mod) => mod.activate());
}

export function deactivate() {
// const pkg = atom.packages.getActivePackage('ink');
// localStorage.setItem(pkg.getCanDeferMainModuleRequireStorageKey(), exportables.false());
[exportables.Opener(), exportables.PaneItem(), exportables.Result(), exportables.DocPane(), exportables.InlineDoc(), exportables.PlotPane(), exportables.InkTerminal(), exportables.Linter()].map((mod) => mod.deactivate());
}

export function consumeStatusBar(bar) {
return exportables.progress().consumeStatusBar(bar);
}

export function consumeRemoteFileOpener(opener) {
return exportables.Opener().consumeRemoteFileOpener(opener);
}

export function provide() {
const obj = {
util: {
focusEditorPane() {
exportables.PaneItem().focusEditorPane();
}
},
highlight: (ed, start, end, clas) => {
return exportables.block().highlight(ed, start, end, clas);
}
};

for (const key in exportables) {
const val = exportables[key];
Object.defineProperty(obj, key, {
get: () => val()
})
}
return obj;
}
6 changes: 3 additions & 3 deletions lib/linter/compiled-pane.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use babel'

/** @jsx etch.dom */

import etch from 'etch'
import { Raw } from '../util/etch.js'
import { CompositeDisposable } from 'atom'
import PaneItem from '../util/pane-item'
import { open } from '../util/opener'

let subs;

// pane for side-to-side view of compiled code and source code
export default class CompiledPane extends PaneItem {
Expand Down
Loading