morphic-blocks 0.3.0 → 0.5.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.
- package/README.md +26 -21
- package/definitions.schema.json +147 -14
- package/dist/cli.js +6 -17
- package/dist/copy-media-CllRyMqQ.js +21 -0
- package/dist/copy-media.d.ts +8 -0
- package/dist/esbuild.d.ts +3 -0
- package/dist/esbuild.js +10 -0
- package/dist/index.d.ts +4 -1
- package/dist/morphic/MorphicBlocks.d.ts +141 -66
- package/dist/morphic/asset-urls.d.ts +9 -0
- package/dist/morphic/block-sets.d.ts +12 -0
- package/dist/morphic/block-view.d.ts +72 -4
- package/dist/morphic/check-definitions.d.ts +31 -0
- package/dist/morphic/code-editor.d.ts +22 -3
- package/dist/morphic/constants.d.ts +6 -0
- package/dist/morphic/dropdown-fields.d.ts +72 -0
- package/dist/morphic/element-types.d.ts +1 -1
- package/dist/morphic/operators.d.ts +73 -0
- package/dist/morphic/parent-field.d.ts +7 -0
- package/dist/morphic/repeat-slots.d.ts +31 -0
- package/dist/morphic/resize.d.ts +7 -2
- package/dist/morphic/strict-slots.d.ts +10 -0
- package/dist/morphic/styles.d.ts +5 -0
- package/dist/morphic/template-codegen.d.ts +16 -0
- package/dist/morphic/template.d.ts +42 -1
- package/dist/morphic/text-to-blocks.d.ts +34 -0
- package/dist/morphic/toolbar.d.ts +8 -11
- package/dist/morphic/toolbox-canvas.d.ts +34 -11
- package/dist/morphic/types.d.ts +350 -67
- package/dist/morphic/validate-definitions.d.ts +4 -1
- package/dist/morphic/value-type.d.ts +13 -0
- package/dist/morphic/view-resolver.d.ts +5 -0
- package/dist/morphic-blocks.js +4432 -2511
- package/dist/morphic-blocks.umd.cjs +43 -23
- package/dist/plugin-h3QH8ods.js +19 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/rollup.d.ts +3 -0
- package/dist/rollup.js +10 -0
- package/dist/rspack.d.ts +3 -0
- package/dist/rspack.js +10 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +10 -0
- package/dist/webpack.d.ts +3 -0
- package/dist/webpack.js +10 -0
- package/package.json +24 -3
package/README.md
CHANGED
|
@@ -28,21 +28,22 @@ npm i morphic-blocks
|
|
|
28
28
|
|
|
29
29
|
Blockly comes with it. Its images and sounds (trash can, zoom buttons, clicks)
|
|
30
30
|
load from your own site, so visitors' browsers never contact another server.
|
|
31
|
-
|
|
31
|
+
A bundler plugin copies them to `public/blockly-media/` when `dev` or `build`
|
|
32
|
+
starts:
|
|
32
33
|
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
34
|
+
```ts
|
|
35
|
+
// vite.config.ts (also morphic-blocks/webpack, /rspack, /rollup, /esbuild)
|
|
36
|
+
import blocklyMedia from "morphic-blocks/vite";
|
|
37
|
+
export default { plugins: [blocklyMedia()] };
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
You can still load them
|
|
40
|
+
With Parcel, Turbopack or no bundler, run `morphic-blocks copy-media
|
|
41
|
+
public/blockly-media` before `dev` and `build` instead. You can still load them
|
|
42
|
+
from Blockly's server; see
|
|
42
43
|
[Privacy & External Requests](https://docs.morphicblocks.com/guides/privacy/).
|
|
43
44
|
|
|
44
|
-
The text views (codespace,
|
|
45
|
-
|
|
45
|
+
The text views (codespace, code editor) use CodeMirror. Install it only if
|
|
46
|
+
you use them:
|
|
46
47
|
|
|
47
48
|
```sh
|
|
48
49
|
npm i @codemirror/state @codemirror/view @codemirror/lang-javascript
|
|
@@ -57,19 +58,19 @@ A block is defined once, with one element per representation:
|
|
|
57
58
|
{
|
|
58
59
|
"elementTypes": {
|
|
59
60
|
"title": "text",
|
|
60
|
-
"
|
|
61
|
+
"concept": "code",
|
|
61
62
|
"python": "code"
|
|
62
63
|
},
|
|
63
64
|
"modes": [
|
|
64
|
-
{ "name": "
|
|
65
|
-
{ "name": "python",
|
|
65
|
+
{ "name": "concept-tiles", "elements": ["title", "concept"] },
|
|
66
|
+
{ "name": "python-tiles", "elements": ["title", "python"] }
|
|
66
67
|
],
|
|
67
68
|
"blocks": [
|
|
68
69
|
{
|
|
69
70
|
"identifier": "text_print",
|
|
70
71
|
"elements": {
|
|
71
72
|
"title": "Print",
|
|
72
|
-
"
|
|
73
|
+
"concept": "Output %1",
|
|
73
74
|
"python": "print(%1)"
|
|
74
75
|
},
|
|
75
76
|
"inputSlots": {
|
|
@@ -109,30 +110,34 @@ engine.mount({
|
|
|
109
110
|
});
|
|
110
111
|
|
|
111
112
|
// Switch the representation at runtime; the same blocks re-render.
|
|
112
|
-
engine.
|
|
113
|
+
engine.show({ toolbox: "python-tiles", views: { workspace: "python" } });
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
## How it works
|
|
116
117
|
|
|
117
118
|
1. **Definitions** name each block's elements: labels, images and code
|
|
118
119
|
templates.
|
|
119
|
-
2. **Modes** choose which elements show
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
2. **Modes** choose which elements the toolbox tiles show; one CSS file per
|
|
121
|
+
mode styles them.
|
|
122
|
+
3. **Views** (workspaces and codespaces, declared by name) each show a code
|
|
123
|
+
element, and presets switch the toolbox and the views together.
|
|
122
124
|
|
|
123
125
|
## Features
|
|
124
126
|
|
|
125
127
|
- **One definition, many representations:** define a block once and show it
|
|
126
128
|
as icons, blocks or source text, switchable at runtime.
|
|
127
|
-
- **Blocks and text side by side:**
|
|
128
|
-
|
|
129
|
+
- **Blocks and text side by side:** editable and read-only text views of the
|
|
130
|
+
program, any number of views, and selection that follows across them.
|
|
129
131
|
- **Config driven:** blocks in JSON, behaviors in TypeScript, one CSS file per
|
|
130
132
|
mode, with no duplication per representation.
|
|
131
133
|
- **Headless and embeddable:** bring your own UI; the framework stays unstyled.
|
|
132
134
|
- **Accessible toolbox:** tiles work with a mouse, a finger, a pen or the
|
|
133
|
-
keyboard, with names for screen readers
|
|
135
|
+
keyboard, with names for screen readers; categories have headings, collapse,
|
|
136
|
+
or show as tabs.
|
|
134
137
|
- **No external requests:** the framework never contacts another server,
|
|
135
138
|
Blockly's media included.
|
|
139
|
+
- **Themes:** ready-made code view colors in
|
|
140
|
+
[`@morphicblocks/themes`](https://www.npmjs.com/package/@morphicblocks/themes).
|
|
136
141
|
|
|
137
142
|
## Documentation
|
|
138
143
|
|
package/definitions.schema.json
CHANGED
|
@@ -21,10 +21,20 @@
|
|
|
21
21
|
"type": "array",
|
|
22
22
|
"items": { "$ref": "#/$defs/mode" }
|
|
23
23
|
},
|
|
24
|
+
"views": {
|
|
25
|
+
"description": "The views by name; mount() sets up each one it gets a container for. The first workspace with a container holds the program.",
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": { "$ref": "#/$defs/view" }
|
|
28
|
+
},
|
|
24
29
|
"presets": {
|
|
25
30
|
"type": "array",
|
|
26
31
|
"items": { "$ref": "#/$defs/preset" }
|
|
27
32
|
},
|
|
33
|
+
"blockSets": {
|
|
34
|
+
"description": "Named lists of blocks for the toolbox, used by presets and show({ blockSet }).",
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": { "$ref": "#/$defs/blockSet" }
|
|
37
|
+
},
|
|
28
38
|
"code": {
|
|
29
39
|
"description": "How each code element's language is written, keyed by code element name.",
|
|
30
40
|
"type": "object",
|
|
@@ -42,7 +52,7 @@
|
|
|
42
52
|
"additionalProperties": false,
|
|
43
53
|
"$defs": {
|
|
44
54
|
"elementType": {
|
|
45
|
-
"enum": ["text", "code", "image"]
|
|
55
|
+
"enum": ["text", "code", "image", "custom"]
|
|
46
56
|
},
|
|
47
57
|
"elementTypeEntry": {
|
|
48
58
|
"oneOf": [
|
|
@@ -77,6 +87,38 @@
|
|
|
77
87
|
"description": "Written into an empty statement slot where an empty body is invalid, e.g. \"pass\" for Python.",
|
|
78
88
|
"type": "string"
|
|
79
89
|
},
|
|
90
|
+
"types": {
|
|
91
|
+
"description": "Names %1:type writes, keyed by the value's type (its output check, or the slot's check while empty), e.g. { \"Number\": \"int\", \"default\": \"var\" }.",
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": { "type": "string" }
|
|
94
|
+
},
|
|
95
|
+
"operators": {
|
|
96
|
+
"description": "The order of this language's operators, by the sign as it is written. The common signs have an order without it; an entry changes one sign, null takes a sign's order away, false turns the order off (every value built from others is written in brackets).",
|
|
97
|
+
"oneOf": [
|
|
98
|
+
{ "const": false },
|
|
99
|
+
{
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": {
|
|
102
|
+
"oneOf": [
|
|
103
|
+
{ "type": "null" },
|
|
104
|
+
{ "type": "number", "description": "The rank between two values: the higher, the tighter the sign binds." },
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"rank": { "type": "number", "description": "The rank between two values: the higher, the tighter the sign binds." },
|
|
109
|
+
"direction": {
|
|
110
|
+
"enum": ["left", "right", "none", "any"],
|
|
111
|
+
"description": "How the same rank reads without brackets: from the left (default), from the right, or not at all. \"any\": the grouping of this sign does not matter, so no brackets are written between two of it."
|
|
112
|
+
},
|
|
113
|
+
"prefix": { "type": "number", "description": "The rank of the sign in front of one value (-x, not x)." }
|
|
114
|
+
},
|
|
115
|
+
"additionalProperties": false
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
80
122
|
"highlighting": { "$ref": "#/$defs/highlight" },
|
|
81
123
|
"values": {
|
|
82
124
|
"description": "How printed values are written while this element is shown, e.g. Python's True, None and ['a', 'b'].",
|
|
@@ -125,41 +167,72 @@
|
|
|
125
167
|
"elements": {
|
|
126
168
|
"type": "array",
|
|
127
169
|
"items": { "type": "string" }
|
|
170
|
+
},
|
|
171
|
+
"render": {
|
|
172
|
+
"description": "How the mode's code elements are drawn on toolbox tiles, by element name. Blocks unless \"text-based\".",
|
|
173
|
+
"type": "object",
|
|
174
|
+
"additionalProperties": { "enum": ["block-based", "text-based"] }
|
|
128
175
|
}
|
|
129
176
|
},
|
|
130
177
|
"additionalProperties": false
|
|
131
178
|
},
|
|
132
|
-
"
|
|
179
|
+
"view": {
|
|
133
180
|
"oneOf": [
|
|
134
|
-
{ "
|
|
181
|
+
{ "enum": ["workspace", "codespace"] },
|
|
135
182
|
{
|
|
136
183
|
"type": "object",
|
|
137
|
-
"required": ["
|
|
184
|
+
"required": ["kind"],
|
|
138
185
|
"properties": {
|
|
139
|
-
"
|
|
140
|
-
"
|
|
186
|
+
"kind": { "enum": ["workspace", "codespace"] },
|
|
187
|
+
"editable": { "description": "Whether the program can be changed in the view. Default true.", "type": "boolean" },
|
|
188
|
+
"rtl": { "description": "Right to left (true) or left to right (false). Left out, a workspace follows blockly.rtl and a codespace the page.", "type": "boolean" },
|
|
189
|
+
"delete": {
|
|
190
|
+
"description": "How blocks are deleted in a codespace; each way is on unless set to false.",
|
|
141
191
|
"type": "object",
|
|
142
|
-
"
|
|
192
|
+
"properties": {
|
|
193
|
+
"lineButtons": { "type": "boolean" },
|
|
194
|
+
"keys": { "type": "boolean" },
|
|
195
|
+
"toolbarButton": { "type": "boolean" }
|
|
196
|
+
},
|
|
197
|
+
"additionalProperties": false
|
|
143
198
|
}
|
|
144
199
|
},
|
|
145
200
|
"additionalProperties": false
|
|
146
201
|
}
|
|
147
202
|
]
|
|
148
203
|
},
|
|
204
|
+
"blockSet": {
|
|
205
|
+
"description": "A list of block identifiers, or another set with blocks added at the end and removed.",
|
|
206
|
+
"oneOf": [
|
|
207
|
+
{ "type": "array", "items": { "type": "string" } },
|
|
208
|
+
{
|
|
209
|
+
"type": "object",
|
|
210
|
+
"required": ["extends"],
|
|
211
|
+
"properties": {
|
|
212
|
+
"extends": { "type": "string" },
|
|
213
|
+
"add": { "type": "array", "items": { "type": "string" } },
|
|
214
|
+
"remove": { "type": "array", "items": { "type": "string" } }
|
|
215
|
+
},
|
|
216
|
+
"additionalProperties": false
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
},
|
|
149
220
|
"preset": {
|
|
150
221
|
"type": "object",
|
|
151
|
-
"required": ["name", "toolbox"],
|
|
222
|
+
"required": ["name", "toolbox", "views"],
|
|
152
223
|
"properties": {
|
|
153
224
|
"name": { "type": "string" },
|
|
154
225
|
"label": { "type": "string" },
|
|
155
|
-
"toolbox": { "
|
|
156
|
-
"workspace": { "type": "string" },
|
|
157
|
-
"codespace": { "type": "string" },
|
|
158
|
-
"preview": { "type": "string" },
|
|
226
|
+
"toolbox": { "description": "The mode of the toolbox tiles.", "type": "string" },
|
|
159
227
|
"views": {
|
|
160
|
-
"description": "
|
|
228
|
+
"description": "What each view the preset shows shows, by view name.",
|
|
161
229
|
"type": "object",
|
|
162
230
|
"additionalProperties": { "type": "string" }
|
|
231
|
+
},
|
|
232
|
+
"blockSet": { "description": "The block set the toolbox shows; without it, all blocks.", "type": "string" },
|
|
233
|
+
"categories": {
|
|
234
|
+
"description": "false shows the toolbox's tiles as one list instead of under their categories. Default true.",
|
|
235
|
+
"type": "boolean"
|
|
163
236
|
}
|
|
164
237
|
},
|
|
165
238
|
"additionalProperties": false
|
|
@@ -217,6 +290,22 @@
|
|
|
217
290
|
"type": ["string", "array"],
|
|
218
291
|
"items": { "type": "string" }
|
|
219
292
|
},
|
|
293
|
+
"strict": { "type": "boolean" },
|
|
294
|
+
"repeat": {
|
|
295
|
+
"description": "Let a value slot hold any number of values, written one after the other.",
|
|
296
|
+
"type": "object",
|
|
297
|
+
"properties": {
|
|
298
|
+
"separator": {
|
|
299
|
+
"description": "What is written between two entries: one text, or a text per element name. \", \" by default.",
|
|
300
|
+
"oneOf": [
|
|
301
|
+
{ "type": "string" },
|
|
302
|
+
{ "type": "object", "additionalProperties": { "type": "string" } }
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
"count": { "description": "Entries a new block starts with (1 by default).", "type": "integer", "minimum": 0 }
|
|
306
|
+
},
|
|
307
|
+
"additionalProperties": false
|
|
308
|
+
},
|
|
220
309
|
"align": { "enum": ["left", "centre", "right"] },
|
|
221
310
|
"label": { "type": "string" },
|
|
222
311
|
"default": { "$ref": "#/$defs/emptyDefault" }
|
|
@@ -237,7 +326,24 @@
|
|
|
237
326
|
"required": ["value"],
|
|
238
327
|
"properties": {
|
|
239
328
|
"value": { "type": "string" },
|
|
240
|
-
"label": {
|
|
329
|
+
"label": {
|
|
330
|
+
"description": "Text, or a picture (image file or color swatch) shown on the block instead of text (text views still write the value).",
|
|
331
|
+
"oneOf": [
|
|
332
|
+
{ "type": "string" },
|
|
333
|
+
{
|
|
334
|
+
"type": "object",
|
|
335
|
+
"oneOf": [{ "required": ["src"] }, { "required": ["color"] }],
|
|
336
|
+
"properties": {
|
|
337
|
+
"src": { "type": "string" },
|
|
338
|
+
"color": { "type": "string", "description": "A CSS color drawn as a swatch, e.g. #e53935." },
|
|
339
|
+
"alt": { "type": "string", "description": "What screen readers say. Default: the value." },
|
|
340
|
+
"width": { "type": "number", "description": "Default 16." },
|
|
341
|
+
"height": { "type": "number", "description": "Default 16." }
|
|
342
|
+
},
|
|
343
|
+
"additionalProperties": false
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
241
347
|
"display": {
|
|
242
348
|
"type": "object",
|
|
243
349
|
"description": "Per-element display text (element name → shown text). Overrides label/value when that element is rendered; the value still drives execution and codegen.",
|
|
@@ -260,6 +366,29 @@
|
|
|
260
366
|
},
|
|
261
367
|
"additionalProperties": false
|
|
262
368
|
},
|
|
369
|
+
{
|
|
370
|
+
"type": "object",
|
|
371
|
+
"required": ["type", "to"],
|
|
372
|
+
"properties": {
|
|
373
|
+
"type": { "const": "reference" },
|
|
374
|
+
"to": {
|
|
375
|
+
"description": "The field whose values this field lists, as \"block.FIELD\" (e.g. \"class_define.NAME\"), or a list of them.",
|
|
376
|
+
"oneOf": [
|
|
377
|
+
{ "type": "string" },
|
|
378
|
+
{ "type": "array", "items": { "type": "string" }, "minItems": 1 }
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
"default": { "type": "string" },
|
|
382
|
+
"scope": {
|
|
383
|
+
"description": "A block identifier, or a list: only names declared inside the nearest such block around the field are listed.",
|
|
384
|
+
"oneOf": [
|
|
385
|
+
{ "type": "string" },
|
|
386
|
+
{ "type": "array", "items": { "type": "string" }, "minItems": 1 }
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"additionalProperties": false
|
|
391
|
+
},
|
|
263
392
|
{
|
|
264
393
|
"type": "object",
|
|
265
394
|
"required": ["type"],
|
|
@@ -322,6 +451,10 @@
|
|
|
322
451
|
"output": { "$ref": "#/$defs/connectionSpec" },
|
|
323
452
|
"previousStatement": { "$ref": "#/$defs/connectionSpec" },
|
|
324
453
|
"nextStatement": { "$ref": "#/$defs/connectionSpec" },
|
|
454
|
+
"strict": {
|
|
455
|
+
"description": "Let the block go only where the place above it has a check matching its previousStatement or output check.",
|
|
456
|
+
"type": "boolean"
|
|
457
|
+
},
|
|
325
458
|
"inputsInline": { "type": "boolean" },
|
|
326
459
|
"tooltip": { "type": "string" },
|
|
327
460
|
"helpUrl": { "type": "string" }
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { c as copyBlocklyMedia } from "./copy-media-CllRyMqQ.js";
|
|
3
|
+
import "node:fs";
|
|
4
|
+
import "node:module";
|
|
5
|
+
import "node:path";
|
|
5
6
|
const USAGE = `Usage: morphic-blocks copy-media <folder>
|
|
6
7
|
|
|
7
8
|
Copies Blockly's images, cursors and sounds into <folder>, so your app serves
|
|
@@ -12,7 +13,6 @@ unless you set blockly.media, so copy them to the folder served there:
|
|
|
12
13
|
|
|
13
14
|
Copies only when the folder is new or Blockly was updated, so it can run
|
|
14
15
|
before every dev or build.`;
|
|
15
|
-
const MARKER = ".blockly-version";
|
|
16
16
|
const [command, folder, ...rest] = process.argv.slice(2);
|
|
17
17
|
if (command === "--help" || command === "-h") {
|
|
18
18
|
console.log(USAGE);
|
|
@@ -20,17 +20,6 @@ if (command === "--help" || command === "-h") {
|
|
|
20
20
|
console.error(USAGE);
|
|
21
21
|
process.exitCode = 1;
|
|
22
22
|
} else {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const version = JSON.parse(readFileSync(join(blockly, "package.json"), "utf8")).version;
|
|
26
|
-
const target = resolve(folder);
|
|
27
|
-
const marker = join(target, MARKER);
|
|
28
|
-
if (existsSync(marker) && readFileSync(marker, "utf8").trim() === version) {
|
|
29
|
-
console.log(`Blockly ${version} media is already in ${folder}`);
|
|
30
|
-
} else {
|
|
31
|
-
cpSync(join(blockly, "media"), target, { recursive: true });
|
|
32
|
-
writeFileSync(marker, `${version}
|
|
33
|
-
`);
|
|
34
|
-
console.log(`Copied Blockly ${version} media to ${folder}`);
|
|
35
|
-
}
|
|
23
|
+
const { version, copied } = copyBlocklyMedia(folder);
|
|
24
|
+
console.log(copied ? `Copied Blockly ${version} media to ${folder}` : `Blockly ${version} media is already in ${folder}`);
|
|
36
25
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { readFileSync, existsSync, cpSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
const MARKER = ".blockly-version";
|
|
5
|
+
function copyBlocklyMedia(folder) {
|
|
6
|
+
const require2 = createRequire(import.meta.url);
|
|
7
|
+
const blockly = dirname(require2.resolve("blockly"));
|
|
8
|
+
const version = JSON.parse(readFileSync(join(blockly, "package.json"), "utf8")).version;
|
|
9
|
+
const target = resolve(folder);
|
|
10
|
+
const marker = join(target, MARKER);
|
|
11
|
+
if (existsSync(marker) && readFileSync(marker, "utf8").trim() === version) {
|
|
12
|
+
return { version, copied: false };
|
|
13
|
+
}
|
|
14
|
+
cpSync(join(blockly, "media"), target, { recursive: true });
|
|
15
|
+
writeFileSync(marker, `${version}
|
|
16
|
+
`);
|
|
17
|
+
return { version, copied: true };
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
copyBlocklyMedia as c
|
|
21
|
+
};
|
package/dist/esbuild.js
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,13 @@ import "blockly/blocks";
|
|
|
2
2
|
export { MorphicBlocks } from "./morphic/MorphicBlocks";
|
|
3
3
|
export { MorphicToolboxCanvas } from "./morphic/toolbox-canvas";
|
|
4
4
|
export { toCleanId } from "./morphic/block-namespace";
|
|
5
|
+
export { toModeClassToken as toClassToken } from "./morphic/template";
|
|
5
6
|
export { toolbarItems, renderToolbar } from "./morphic/toolbar";
|
|
6
7
|
export type { MorphicRunEventDetail, MorphicToolbarHandle, } from "./morphic/toolbar";
|
|
7
8
|
export { makeResizable } from "./morphic/resize";
|
|
8
9
|
export { validateDefinitions } from "./morphic/validate-definitions";
|
|
10
|
+
export { checkDefinitions } from "./morphic/check-definitions";
|
|
11
|
+
export { resolveBlockSets, type ResolvedBlockSets } from "./morphic/block-sets";
|
|
9
12
|
export type { ValidateDefinitionsArgs, DefinitionValidationResult, } from "./morphic/validate-definitions";
|
|
10
13
|
export type { MorphicResizeOptions, MorphicResizeHandle, } from "./morphic/resize";
|
|
11
|
-
export type { MorphicElementType, MorphicElementTypeConfig, MorphicElementTypeEntry, MorphicEmptyDefaultConfig, MorphicHighlightDefinition, MorphicJavaScriptConfig, MorphicBehaviorContext, MorphicBehaviorDefinition, MorphicBehaviorMap, MorphicBehaviorProxy, MorphicBlockBehavior, MorphicBlockDefinition, MorphicBlockShape, MorphicBlocksFormat, MorphicBlocksFormatJson, MorphicCodeElementConfig, MorphicValueFormat, MorphicViewHandle, MorphicViewKind, MorphicViewOptions, MorphicCodeBehavior, MorphicCodeBlockPosition, MorphicCodeEditorOptions, MorphicCodeEditorTheme, MorphicCodeGenerationResult, MorphicCodeMetadata, MorphicConnectionSpec, MorphicDropdownOption, MorphicFieldDefinition, MorphicInputAlign, MorphicInputKind, MorphicInputSlotDefinition, MorphicModeName, MorphicMountConfig, MorphicPlaceholderEditTarget, MorphicPlaceholderRange, MorphicRenderContext, MorphicResolvedView, MorphicStyleBundle, MorphicToolbarConfig, MorphicToolbarCtx, MorphicToolbarDisplay, MorphicToolbarItem,
|
|
14
|
+
export type { MorphicElementType, MorphicElementTypeConfig, MorphicElementTypeEntry, MorphicEmptyDefaultConfig, MorphicHighlightDefinition, MorphicJavaScriptConfig, MorphicBehaviorContext, MorphicBehaviorDefinition, MorphicBehaviorMap, MorphicBehaviorProxy, MorphicBlockBehavior, MorphicBlockDefinition, MorphicBlockShape, MorphicBlocksFormat, MorphicBlocksFormatJson, MorphicCodeElementConfig, MorphicOperatorOrder, MorphicValueFormat, MorphicViewHandle, MorphicViewDeclaration, MorphicViewKind, MorphicViewOptions, MorphicCodeBehavior, MorphicCodeBlockPosition, MorphicCodeEditorOptions, MorphicCodeEditorTheme, MorphicCodespaceDeleteOptions, MorphicCodeGenerationResult, MorphicCodeMetadata, MorphicConnectionSpec, MorphicDropdownImage, MorphicElementRenderContext, MorphicElementRenderer, MorphicDropdownOption, MorphicFieldDefinition, MorphicInputAlign, MorphicInputKind, MorphicInputSlotDefinition, MorphicModeName, MorphicMountConfig, MorphicPlaceholderEditTarget, MorphicPlaceholderRange, MorphicRepeatConfig, MorphicRepeatRange, MorphicTextLoadResult, MorphicRenderContext, MorphicResolvedView, MorphicStyleBundle, MorphicToolbarConfig, MorphicToolbarCtx, MorphicToolbarDisplay, MorphicToolbarItem, MorphicToolbarRender, MorphicToolboxCanvasOptions, MorphicToolboxCategory, MorphicToolboxConfig, MorphicToolboxLayout, MorphicToolboxModeLabel, MorphicBlockElements, MorphicModeDefinition, MorphicTileRender, MorphicPresetDefinition, MorphicBlockSet, MorphicRunOutputLine, MorphicRunResult, MorphicSelectionSyncOptions, } from "./morphic/types";
|