scratchblocks-plus 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +193 -0
  3. package/browser.es.js +8 -0
  4. package/browser.js +8 -0
  5. package/build/scratchblocks-plus.min.es.js +12 -0
  6. package/build/scratchblocks-plus.min.es.js.map +1 -0
  7. package/build/scratchblocks-plus.min.js +12 -0
  8. package/build/scratchblocks-plus.min.js.map +1 -0
  9. package/build/translations-all-es.js +11 -0
  10. package/build/translations-all-es.js.map +1 -0
  11. package/build/translations-all.js +11 -0
  12. package/build/translations-all.js.map +1 -0
  13. package/build/translations-es.js +11 -0
  14. package/build/translations-es.js.map +1 -0
  15. package/build/translations.js +11 -0
  16. package/build/translations.js.map +1 -0
  17. package/index.d.ts +297 -0
  18. package/index.js +229 -0
  19. package/locales/ab.json +1630 -0
  20. package/locales/af.json +1630 -0
  21. package/locales/all.d.ts +108 -0
  22. package/locales/all.js +161 -0
  23. package/locales/am.json +1925 -0
  24. package/locales/an.json +1630 -0
  25. package/locales/ar.json +1924 -0
  26. package/locales/ast.json +1630 -0
  27. package/locales/az.json +1925 -0
  28. package/locales/be.json +1630 -0
  29. package/locales/bg.json +1924 -0
  30. package/locales/bn.json +1630 -0
  31. package/locales/ca.json +1930 -0
  32. package/locales/ckb.json +1630 -0
  33. package/locales/cs.json +1930 -0
  34. package/locales/cy.json +1929 -0
  35. package/locales/da.json +1924 -0
  36. package/locales/de.json +1929 -0
  37. package/locales/el.json +1931 -0
  38. package/locales/eo.json +1630 -0
  39. package/locales/es-419.json +1924 -0
  40. package/locales/es.json +1929 -0
  41. package/locales/et.json +1924 -0
  42. package/locales/eu.json +1924 -0
  43. package/locales/fa.json +1929 -0
  44. package/locales/fi.json +1924 -0
  45. package/locales/fil.json +1631 -0
  46. package/locales/forums.js +37 -0
  47. package/locales/fr.json +1929 -0
  48. package/locales/fy.json +1630 -0
  49. package/locales/ga.json +1924 -0
  50. package/locales/gd.json +1929 -0
  51. package/locales/gl.json +1924 -0
  52. package/locales/ha.json +1630 -0
  53. package/locales/he.json +1929 -0
  54. package/locales/hi.json +1635 -0
  55. package/locales/hr.json +1929 -0
  56. package/locales/ht.json +1630 -0
  57. package/locales/hu.json +1930 -0
  58. package/locales/hy.json +1630 -0
  59. package/locales/id.json +1929 -0
  60. package/locales/is.json +1924 -0
  61. package/locales/it.json +1929 -0
  62. package/locales/ja-Hira.json +1637 -0
  63. package/locales/ja.json +1931 -0
  64. package/locales/ka.json +1630 -0
  65. package/locales/kk.json +1632 -0
  66. package/locales/km.json +1630 -0
  67. package/locales/ko.json +1924 -0
  68. package/locales/ku.json +1632 -0
  69. package/locales/lt.json +1924 -0
  70. package/locales/lv.json +1924 -0
  71. package/locales/mi.json +1924 -0
  72. package/locales/mn.json +1631 -0
  73. package/locales/nb.json +1929 -0
  74. package/locales/nl.json +1929 -0
  75. package/locales/nn.json +1630 -0
  76. package/locales/nso.json +1630 -0
  77. package/locales/oc.json +1630 -0
  78. package/locales/or.json +1631 -0
  79. package/locales/pl.json +1929 -0
  80. package/locales/pt-br.json +1924 -0
  81. package/locales/pt.json +1929 -0
  82. package/locales/qu.json +1630 -0
  83. package/locales/rap.json +1632 -0
  84. package/locales/ro.json +1929 -0
  85. package/locales/ru.json +1929 -0
  86. package/locales/sk.json +1924 -0
  87. package/locales/sl.json +1929 -0
  88. package/locales/sr.json +1924 -0
  89. package/locales/sv.json +1924 -0
  90. package/locales/sw.json +1630 -0
  91. package/locales/th.json +1924 -0
  92. package/locales/tn.json +1630 -0
  93. package/locales/tr.json +1932 -0
  94. package/locales/uk.json +1924 -0
  95. package/locales/uz.json +1631 -0
  96. package/locales/vi.json +1925 -0
  97. package/locales/xh.json +1630 -0
  98. package/locales/zh-cn.json +1930 -0
  99. package/locales/zh-tw.json +1930 -0
  100. package/locales/zu.json +1918 -0
  101. package/package.json +81 -0
  102. package/scratch2/blocks.js +1000 -0
  103. package/scratch2/draw.js +452 -0
  104. package/scratch2/filter.js +78 -0
  105. package/scratch2/index.js +12 -0
  106. package/scratch2/style.css.js +148 -0
  107. package/scratch2/style.js +214 -0
  108. package/scratch3/blocks.js +1134 -0
  109. package/scratch3/draw.js +334 -0
  110. package/scratch3/index.js +12 -0
  111. package/scratch3/style.css.js +280 -0
  112. package/scratch3/style.js +877 -0
  113. package/syntax/blocks.js +921 -0
  114. package/syntax/commands.js +1755 -0
  115. package/syntax/dropdowns.js +688 -0
  116. package/syntax/extensions.js +34 -0
  117. package/syntax/index.js +17 -0
  118. package/syntax/model.js +566 -0
  119. package/syntax/syntax.js +1091 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.js","sources":["../locales/forums.js","../locales-src/translations.js"],"sourcesContent":["import de from \"./de.json\"\nimport es from \"./es.json\"\nimport fr from \"./fr.json\"\nimport zh_cn from \"./zh-cn.json\"\nimport pl from \"./pl.json\"\nimport ja from \"./ja.json\"\nimport nl from \"./nl.json\"\nimport pt from \"./pt.json\"\nimport it from \"./it.json\"\nimport he from \"./he.json\"\nimport ko from \"./ko.json\"\nimport nb from \"./nb.json\"\nimport tr from \"./tr.json\"\nimport el from \"./el.json\"\nimport ru from \"./ru.json\"\nimport ca from \"./ca.json\"\nimport id from \"./id.json\"\n\nexport default {\n de,\n es,\n fr,\n zh_cn,\n pl,\n ja,\n nl,\n pt,\n it,\n he,\n ko,\n nb,\n tr,\n el,\n ru,\n ca,\n id,\n}\n","import languages from \"../locales/forums.js\"\nwindow.scratchblocks.loadLanguages(languages)\n"],"names":["de","es","fr","zh_cn","pl","ja","nl","pt","it","he","ko","nb","tr","el","ru","ca","id","window","scratchblocks","loadLanguages","languages"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAE;AACFC,CAAAA,CAAAA,CAAAA,CAAAA,EAAE,CAAA,CAAFA,CAAAA;EACF,CAAC;;ACnCDC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAM,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAa,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAa,CAACC,SAAS,CAAC;;"}
package/index.d.ts ADDED
@@ -0,0 +1,297 @@
1
+ /**
2
+ * A label/text element in a block
3
+ */
4
+ export class Label {
5
+ constructor(value: string, cls?: string)
6
+ value: string
7
+ cls: string
8
+ el: SVGElement | null
9
+ height: number
10
+ metrics: { width: number } | null
11
+ x: number
12
+ readonly isLabel: true
13
+ stringify(): string
14
+ }
15
+
16
+ /**
17
+ * An icon in a block (e.g., greenFlag, stopSign)
18
+ */
19
+ export class Icon {
20
+ constructor(name: string)
21
+ name: string
22
+ isArrow: boolean
23
+ readonly isIcon: true
24
+ static icons: Record<string, boolean>
25
+ stringify(): string
26
+ }
27
+
28
+ /**
29
+ * Block information object
30
+ */
31
+ export interface BlockInfo {
32
+ id?: string
33
+ spec?: string
34
+ parts?: string[]
35
+ selector?: string
36
+ inputs?: string[]
37
+ shape: string
38
+ category: string
39
+ categoryIsDefault?: boolean
40
+ hasLoopArrow?: boolean
41
+ argument?: "boolean" | "number" | "string"
42
+ call?: string
43
+ names?: string[]
44
+ color?: string
45
+ diff?: "+" | "-"
46
+ hash?: string
47
+ isReset?: boolean
48
+ shapeIsDefault?: boolean
49
+ language?: LanguageData
50
+ isRTL?: boolean
51
+ }
52
+
53
+ /**
54
+ * An input element in a block (text input, dropdown, etc.)
55
+ */
56
+ export class Input {
57
+ constructor(shape: string, value: string | number | boolean | Matrix | null)
58
+ shape: string
59
+ value: string | number | boolean | Matrix | null
60
+ menu?: string
61
+ label: Label | null
62
+ x: number
63
+ readonly isInput: true
64
+ isRound: boolean
65
+ isBoolean: boolean
66
+ isStack: boolean
67
+ isInset: boolean
68
+ isColor: boolean
69
+ isMatrix: boolean
70
+ hasArrow: boolean
71
+ isDarker: boolean
72
+ isSquare: boolean
73
+ hasLabel: boolean
74
+ setMenu(value: string): void
75
+ stringify(parentPrefix?: string): string
76
+ translate(lang: LanguageData): void
77
+ }
78
+
79
+ /**
80
+ * A matrix element in a block
81
+ */
82
+ export class Matrix {
83
+ constructor(rows: boolean[][])
84
+ rows: boolean[][]
85
+ readonly isMatrix: true
86
+ stringify(): string
87
+ translate(lang?: LanguageData): void
88
+ }
89
+
90
+ /**
91
+ * A block definition
92
+ */
93
+ export class Block {
94
+ constructor(info: BlockInfo, children: (Label | Icon | Input | Block | Script | Comment | Glow)[], comment?: Comment | null)
95
+ info: BlockInfo
96
+ children: (Label | Icon | Input | Block | Script | Comment | Glow)[]
97
+ comment: Comment | null
98
+ diff: "+" | "-" | null
99
+ blockPath: string | null
100
+ readonly isBlock: true
101
+ isHat: boolean
102
+ hasPuzzle: boolean
103
+ isFinal: boolean
104
+ isCommand: boolean
105
+ isOutline: boolean
106
+ isReporter: boolean
107
+ isBoolean: boolean
108
+ isRing: boolean
109
+ hasScript: boolean
110
+ isElse: boolean
111
+ isEnd: boolean
112
+ stringify(extras?: string): string
113
+ translate(lang: LanguageData): void
114
+ }
115
+
116
+ /**
117
+ * A comment element
118
+ */
119
+ export class Comment {
120
+ constructor(value: string, hasBlock?: boolean)
121
+ label: Label
122
+ width: number | null
123
+ hasBlock?: boolean
124
+ readonly isComment: true
125
+ stringify(): string
126
+ translate(): void
127
+ }
128
+
129
+ /**
130
+ * A glow effect (highlight) wrapper for blocks
131
+ */
132
+ export class Glow {
133
+ constructor(child: Block | Script)
134
+ child: Block | Script
135
+ shape: string
136
+ info?: BlockInfo
137
+ readonly isGlow: true
138
+ stringify(): string
139
+ translate(lang: LanguageData): void
140
+ }
141
+
142
+ /**
143
+ * A script (sequence of blocks)
144
+ */
145
+ export class Script {
146
+ constructor(blocks: Block[])
147
+ blocks: Block[]
148
+ isEmpty: boolean
149
+ isFinal: boolean
150
+ scriptIndex: number | null
151
+ readonly isScript: true
152
+ stringify(): string
153
+ translate(lang: LanguageData): void
154
+ }
155
+
156
+ /**
157
+ * A parsed document containing scripts
158
+ */
159
+ export class Document {
160
+ constructor(scripts: Script[])
161
+ scripts: Script[]
162
+ blockMap: Map<string, Block>
163
+ getBlockByPath(path: string): Block | null
164
+ stringify(): string
165
+ translate(lang: LanguageData): void
166
+ }
167
+
168
+ export interface ScriptView {
169
+ blocks: Array<Block | Glow>
170
+ isEmpty: boolean
171
+ isFinal: boolean
172
+ scriptIndex: number | null
173
+ readonly isScript: true
174
+ width: number
175
+ height: number
176
+ y: number
177
+ draw(iconStyle: string, inside?: boolean): SVGElement
178
+ measure(): void
179
+ }
180
+
181
+ /**
182
+ * A view of a rendered document
183
+ */
184
+ export interface DocumentView {
185
+ scripts: ScriptView[]
186
+ doc: Document
187
+ width: number | null
188
+ height: number | null
189
+ el: SVGElement | null
190
+ defs: SVGDefsElement | null
191
+ scale: number
192
+ elementMap: Map<string, { el: SVGElement }>
193
+
194
+ measure(): void
195
+ render(): SVGElement
196
+ highlightBlock(path: string, options?: HighlightOptions): boolean
197
+ clearHighlight(path?: string | null): void
198
+ getElementByPath(path: string): SVGElement | null
199
+ exportSVGString(): string
200
+ exportSVG(): string
201
+ toCanvas(cb: (canvas: HTMLCanvasElement) => void, exportScale?: number): void
202
+ exportPNG(cb: (url: string) => void, scale?: number): void
203
+ }
204
+
205
+ /**
206
+ * Options for rendering
207
+ */
208
+ export interface RenderOptions {
209
+ style?: "scratch2" | "scratch3" | "scratch3-high-contrast" | string
210
+ inline?: boolean
211
+ languages?: string[]
212
+ scale?: number
213
+ read?: (el: HTMLElement, options: RenderOptions) => string
214
+ parse?: (code: string, options: RenderOptions) => Document
215
+ render?: (doc: Document, options: RenderOptions) => SVGElement
216
+ replace?: (el: HTMLElement, svg: SVGElement, doc: Document, options: RenderOptions) => void
217
+ }
218
+
219
+ /**
220
+ * Options for highlighting blocks
221
+ */
222
+ export interface HighlightOptions {
223
+ blink?: boolean
224
+ colorShift?: boolean
225
+ }
226
+
227
+ /**
228
+ * Language data object containing dropdowns and block information
229
+ */
230
+ export interface LanguageData {
231
+ code?: string
232
+ commands: Record<string, string>
233
+ dropdowns: Record<string, { value: string; parents?: string[] }>
234
+ aliases: Record<string, string>
235
+ renamedBlocks: Record<string, string>
236
+ definePrefix: string[]
237
+ defineSuffix: string[]
238
+ ignorelt: string[]
239
+ math: string[]
240
+ name: string
241
+ faceParts: string[]
242
+ soundEffects: string[]
243
+ microbitWhen: string[]
244
+ osis: string[]
245
+ palette: Record<string, string>
246
+ percentTranslated: number
247
+ categories: Record<string, string>
248
+ blocksByHash?: Record<string, BlockInfo[]>
249
+ nativeAliases?: Record<string, string[]>
250
+ nativeDropdowns?: Record<string, Array<{ id: string; parents?: string[] }>>
251
+ }
252
+
253
+ /**
254
+ * Main scratchblocks API returned by the default export function
255
+ */
256
+ export interface ScratchblocksAPI {
257
+ // Languages
258
+ readonly allLanguages: Record<string, LanguageData>
259
+ loadLanguages(languages: Record<string, LanguageData>): void
260
+
261
+ // Parsing and rendering
262
+ parse(code: string, options?: RenderOptions): Document
263
+ stringify(doc: Document): string
264
+ newView(doc: Document, options?: RenderOptions): DocumentView
265
+ render(doc: Document, options?: RenderOptions): SVGElement
266
+ renderMatching(selector?: string, options?: RenderOptions): void
267
+
268
+ // Reading and replacing
269
+ read(el: HTMLElement, options?: { inline?: boolean }): string
270
+ replace(el: HTMLElement, svg: SVGElement, doc: Document, options?: RenderOptions): void
271
+
272
+ // Styles
273
+ appendStyles(): void
274
+
275
+ // Classes
276
+ Label: typeof Label
277
+ Icon: typeof Icon
278
+ Input: typeof Input
279
+ Block: typeof Block
280
+ Comment: typeof Comment
281
+ Script: typeof Script
282
+ Document: typeof Document
283
+
284
+ // Highlight API
285
+ highlightBlock(view: DocumentView, path: string, options?: HighlightOptions): boolean
286
+ clearHighlight(view: DocumentView, path?: string | null): void
287
+ getBlockByPath(doc: Document, path: string): Block | null
288
+ getElementByPath(view: DocumentView, path: string): SVGElement | null
289
+ }
290
+
291
+ /**
292
+ * Initializes scratchblocks with a window object and returns the scratchblocks API
293
+ * When imported from npm, this is the default export
294
+ */
295
+ declare const scratchblocks: ScratchblocksAPI
296
+
297
+ export default scratchblocks
package/index.js ADDED
@@ -0,0 +1,229 @@
1
+ /*
2
+ * scratchblocks
3
+ * http://scratchblocks.github.io/
4
+ *
5
+ * Copyright 2013-2016, Tim Radvan
6
+ * @license MIT
7
+ * http://opensource.org/licenses/MIT
8
+ */
9
+ import {
10
+ parse,
11
+ allLanguages,
12
+ loadLanguages,
13
+ Label,
14
+ Icon,
15
+ Input,
16
+ Block,
17
+ Comment,
18
+ Script,
19
+ Document,
20
+ } from "./syntax/index.js"
21
+ import * as scratch2 from "./scratch2/index.js"
22
+ import * as scratch3 from "./scratch3/index.js"
23
+
24
+ export default function (window) {
25
+ const document = window.document
26
+
27
+ scratch2.init(window)
28
+ scratch3.init(window)
29
+
30
+ function appendStyles() {
31
+ document.head.appendChild(scratch2.makeStyle())
32
+ document.head.appendChild(scratch3.makeStyle())
33
+ }
34
+
35
+ function newView(doc, options) {
36
+ options = {
37
+ style: "scratch2",
38
+ ...options,
39
+ }
40
+
41
+ options.scale = options.scale || 1
42
+
43
+ if (options.style === "scratch2") {
44
+ return scratch2.newView(doc, options)
45
+ } else if (/^scratch3($|-)/.test(options.style)) {
46
+ return scratch3.newView(doc, options)
47
+ }
48
+
49
+ throw new Error(`Unknown style: ${options.style}`)
50
+ }
51
+
52
+ function render(doc, options) {
53
+ if (typeof options === "function") {
54
+ throw new Error("render() no longer takes a callback")
55
+ }
56
+ const view = newView(doc, options)
57
+ const svg = view.render()
58
+ // Used in high contrast theme
59
+ svg.classList.add(`scratchblocks-style-${options.style}`)
60
+ return svg
61
+ }
62
+
63
+ /*****************************************************************************/
64
+
65
+ /*** Highlight API ***/
66
+
67
+ /**
68
+ * Highlight a block by its path
69
+ * @param {DocumentView} view - The rendered view from newView()
70
+ * @param {string} path - Block path (e.g., "S1.2.1")
71
+ * @param {Object} options - { blink: boolean } - If blink is true, the block will flash 3 times
72
+ * @returns {boolean} - Whether the block was found and highlighted
73
+ */
74
+ function highlightBlock(view, path, options = {}) {
75
+ if (view && typeof view.highlightBlock === "function") {
76
+ return view.highlightBlock(path, options)
77
+ }
78
+ return false
79
+ }
80
+
81
+ /**
82
+ * Clear highlight from a block or all blocks
83
+ * @param {DocumentView} view - The rendered view from newView()
84
+ * @param {string|null} path - Block path to clear, or null to clear all highlights
85
+ */
86
+ function clearHighlight(view, path = null) {
87
+ if (view && typeof view.clearHighlight === "function") {
88
+ view.clearHighlight(path)
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Get a block by its path from the parsed document
94
+ * @param {Document} doc - The parsed document from parse()
95
+ * @param {string} path - Block path (e.g., "S1.2.1")
96
+ * @returns {Block|null}
97
+ */
98
+ function getBlockByPath(doc, path) {
99
+ if (doc && typeof doc.getBlockByPath === "function") {
100
+ return doc.getBlockByPath(path)
101
+ }
102
+ return null
103
+ }
104
+
105
+ /**
106
+ * Get the SVG element for a block by its path
107
+ * @param {DocumentView} view - The rendered view from newView()
108
+ * @param {string} path - Block path (e.g., "S1.2.1")
109
+ * @returns {SVGElement|null}
110
+ */
111
+ function getElementByPath(view, path) {
112
+ if (view && typeof view.getElementByPath === "function") {
113
+ return view.getElementByPath(path)
114
+ }
115
+ return null
116
+ }
117
+
118
+ /*****************************************************************************/
119
+
120
+ /*** Render ***/
121
+
122
+ // read code from a DOM element
123
+ function readCode(el, options) {
124
+ options = {
125
+ inline: false,
126
+ ...options,
127
+ }
128
+
129
+ const html = el.innerHTML.replace(/<br>\s?|\n|\r\n|\r/gi, "\n")
130
+ const pre = document.createElement("pre")
131
+ pre.innerHTML = html
132
+ let code = pre.textContent
133
+ if (options.inline) {
134
+ code = code.replace("\n", "")
135
+ }
136
+ return code
137
+ }
138
+
139
+ // insert 'svg' into 'el', with appropriate wrapper elements
140
+ function replace(el, svg, doc, options) {
141
+ let container
142
+ if (options.inline) {
143
+ container = document.createElement("span")
144
+ let cls = "scratchblocks scratchblocks-inline"
145
+ if (doc.scripts[0] && !doc.scripts[0].isEmpty) {
146
+ cls += ` scratchblocks-inline-${doc.scripts[0].blocks[0].shape}`
147
+ }
148
+ container.className = cls
149
+ container.style.display = "inline-block"
150
+ container.style.verticalAlign = "middle"
151
+ } else {
152
+ container = document.createElement("div")
153
+ container.className = "scratchblocks"
154
+ }
155
+ container.appendChild(svg)
156
+
157
+ el.innerHTML = ""
158
+ el.appendChild(container)
159
+ }
160
+
161
+ /* Render all matching elements in page to shiny scratch blocks.
162
+ * Accepts a CSS selector as an argument.
163
+ *
164
+ * scratchblocks.renderMatching("pre.blocks");
165
+ *
166
+ * Like the old 'scratchblocks2.parse().
167
+ */
168
+ const renderMatching = function (selector, options) {
169
+ selector = selector || "pre.blocks"
170
+ options = {
171
+ // Default values for the options
172
+ style: "scratch2",
173
+ inline: false,
174
+ languages: ["en"],
175
+ scale: 1,
176
+
177
+ read: readCode, // function(el, options) => code
178
+ parse: parse, // function(code, options) => doc
179
+ render: render, // function(doc) => svg
180
+ replace: replace, // function(el, svg, doc, options)
181
+
182
+ ...options,
183
+ }
184
+
185
+ // find elements
186
+ const results = [].slice.apply(document.querySelectorAll(selector))
187
+ results.forEach(el => {
188
+ const code = options.read(el, options)
189
+
190
+ const doc = options.parse(code, options)
191
+
192
+ const svg = options.render(doc, options)
193
+
194
+ options.replace(el, svg, doc, options)
195
+ })
196
+ }
197
+
198
+ return {
199
+ allLanguages: allLanguages, // read-only
200
+ loadLanguages: loadLanguages,
201
+
202
+ stringify: function (doc) {
203
+ return doc.stringify()
204
+ },
205
+
206
+ Label,
207
+ Icon,
208
+ Input,
209
+ Block,
210
+ Comment,
211
+ Script,
212
+ Document,
213
+
214
+ newView: newView,
215
+ read: readCode,
216
+ parse: parse,
217
+ replace: replace,
218
+ render: render,
219
+ renderMatching: renderMatching,
220
+
221
+ appendStyles: appendStyles,
222
+
223
+ // Highlight API
224
+ highlightBlock: highlightBlock,
225
+ clearHighlight: clearHighlight,
226
+ getBlockByPath: getBlockByPath,
227
+ getElementByPath: getElementByPath,
228
+ }
229
+ }