|
1 | | -'use strict'; |
2 | | - |
3 | | -const isString = (a) => typeof a === 'string'; |
4 | | - |
5 | 1 | /* global ace */ |
6 | 2 | /* global join */ |
7 | | -require('../css/edward.css'); |
8 | | - |
9 | | -const {createPatch} = require('daffy'); |
10 | | -const exec = require('execon'); |
11 | | -const Emitify = require('emitify'); |
12 | | -const load = require('load.js'); |
13 | | -const loadremote = require('./loadremote'); |
14 | | -const wraptile = require('wraptile'); |
15 | | -const smalltalk = require('smalltalk'); |
16 | | -const jssha = require('jssha'); |
17 | | -const restafary = require('restafary/client'); |
18 | | -const {tryToCatch} = require('try-to-catch'); |
| 3 | +import '../css/edward.css'; |
| 4 | +import {createPatch} from 'daffy'; |
| 5 | +import exec from 'execon'; |
| 6 | +import Emitify from 'emitify'; |
| 7 | +import load from 'load.js'; |
| 8 | +import wraptile from 'wraptile'; |
| 9 | +import * as smalltalk from 'smalltalk'; |
| 10 | +import jssha from 'jssha'; |
| 11 | +import restafary from 'restafary/client'; |
| 12 | +import {tryToCatch} from 'try-to-catch'; |
| 13 | +import loadremote from './loadremote.js'; |
| 14 | +import Story from './story.js'; |
| 15 | +import _clipboard from './_clipboard.js'; |
| 16 | +import _setEmmet from './_set-emmet.js'; |
| 17 | +import _initSocket from './_init-socket.js'; |
| 18 | +import setKeyMap from './set-key-map.js'; |
| 19 | +import showMessage from './show-message.js'; |
| 20 | +import save from './save.js'; |
| 21 | +import {_onSave} from './_on-save.js'; |
| 22 | + |
| 23 | +const isString = (a) => typeof a === 'string'; |
19 | 24 |
|
20 | 25 | globalThis.load = globalThis.load || load; |
21 | 26 | globalThis.exec = globalThis.exec || exec; |
22 | 27 |
|
23 | | -const Story = require('./story'); |
24 | | -const _clipboard = require('./_clipboard'); |
25 | | -const _setEmmet = require('./_set-emmet'); |
26 | | -const _initSocket = require('./_init-socket'); |
27 | | -const setKeyMap = require('./set-key-map'); |
28 | | -const showMessage = require('./show-message'); |
29 | | -const save = require('./save'); |
30 | | - |
31 | 28 | function empty() {} |
32 | 29 |
|
33 | | -module.exports = Edward; |
34 | | - |
35 | | -function Edward(el, options, callback) { |
| 30 | +export default function Edward(el, options, callback) { |
36 | 31 | if (!(this instanceof Edward)) |
37 | 32 | return new Edward(el, options, callback); |
38 | 33 |
|
@@ -488,7 +483,7 @@ Edward.prototype._writeHttp = function(path, result) { |
488 | 483 | restafary.write(path, result, onSave); |
489 | 484 | }; |
490 | 485 |
|
491 | | -Edward.prototype._onSave = require('./_on-save'); |
| 486 | +Edward.prototype._onSave = _onSave; |
492 | 487 |
|
493 | 488 | Edward.prototype._doDiff = async function(path) { |
494 | 489 | const value = this.getValue(); |
|
0 commit comments