Skip to content

Commit 6720cae

Browse files
committed
Fix syntax errors
1 parent 9db09f8 commit 6720cae

File tree

12 files changed

+25
-17
lines changed

12 files changed

+25
-17
lines changed

browser.es.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
const scratchblocks = require("./index")(window)
1+
import init from "./index.js"
2+
3+
const scratchblocks = init(window)
4+
5+
// add our CSS to the page
26
scratchblocks.appendStyles()
3-
module.exports = scratchblocks
7+
8+
export default scratchblocks

browser.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
var scratchblocks =
2-
(window.scratchblocks =
3-
module.exports =
4-
require("./index")(window))
1+
import init from "./index.js"
2+
3+
const scratchblocks = (window.scratchblocks = init(window))
54

65
// add our CSS to the page
76
scratchblocks.appendStyles()
7+
8+
export default scratchblocks

index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* http://opensource.org/licenses/MIT
88
*/
99
import {
10+
parse,
1011
allLanguages,
1112
loadLanguages,
1213
Label,
@@ -16,9 +17,9 @@ import {
1617
Comment,
1718
Script,
1819
Document,
19-
} from "./syntax"
20-
import * as scratch2 from "./scratch2"
21-
import * as scratch3 from "./scratch3"
20+
} from "./syntax/index.js"
21+
import * as scratch2 from "./scratch2/index.js"
22+
import * as scratch3 from "./scratch3/index.js"
2223

2324
export default function (window) {
2425
var document = window.document
@@ -31,10 +32,6 @@ export default function (window) {
3132
document.head.appendChild(scratch3.makeStyle())
3233
}
3334

34-
function parse(code, options) {
35-
return syntax.parse(code, options)
36-
}
37-
3835
function newView(doc, options) {
3936
var options = Object.assign(
4037
{

scratch2/blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
extensions,
1111
movedExtensions,
1212
aliasExtensions,
13-
} from "../syntax"
13+
} from "../syntax/index.js"
1414

1515
import SVG from "./draw.js"
1616

scratch2/draw.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var directProps = {
1515
textContent: true,
1616
}
1717

18+
var SVG
1819
export default SVG = {
1920
init(window) {
2021
document = window.document

scratch2/filter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function extend(src, dest) {
44

55
import SVG from "./draw.js"
66

7+
var Filter
78
export default Filter = function (id, props) {
89
this.el = SVG.el(
910
"filter",

scratch2/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ export function init(window) {
1111
})()
1212
}
1313

14-
export const makeStyle = styles.makeStyle
14+
export const makeStyle = style.makeStyle
1515
export { newView } from "./blocks.js"

scratch2/style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import SVG from "./draw.js"
22
import Filter from "./filter.js"
33
import cssContent from "./style.css.js"
44

5+
var Style
56
export default Style = {
67
cssContent: cssContent,
78

scratch3/blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Document,
1010
extensions,
1111
aliasExtensions,
12-
} from "../syntax"
12+
} from "../syntax/index.js"
1313

1414
import SVG from "./draw.js"
1515
import style from "./style.js"

scratch3/draw.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var directProps = {
1515
textContent: true,
1616
}
1717

18+
let SVG
1819
export default SVG = {
1920
init(window) {
2021
document = window.document

scratch3/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ export function init(window) {
1111
})()
1212
}
1313

14-
export const makeStyle = styles.makeStyle
14+
export const makeStyle = style.makeStyle
1515
export { newView } from "./blocks.js"

scratch3/style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import SVG from "./draw.js"
22
import cssContent from "./style.css.js"
33

4+
var Style
45
export default Style = {
56
cssContent: cssContent,
67

0 commit comments

Comments
 (0)