You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,15 @@ npm run serve
35
35
36
36
The build folder is now served at http://localhost:3000/.
37
37
38
+
## Linting
39
+
40
+
```bash
41
+
# check formatting:
42
+
npm run format:check
43
+
# fix formatting:
44
+
npm run format
45
+
```
46
+
38
47
## Generating reference docs
39
48
40
49
The API reference pages are auto-generated from the Blockly TypeScript source using `@microsoft/api-extractor` and `@microsoft/api-documenter`. This is a separate step from the Docusaurus build and must be run from the `packages/blockly` directory:
@@ -80,6 +78,10 @@ you will never need to make a new `ContextMenuRegistry`. Always use the singleto
80
78
81
79
Reload your web page and open a context menu on the workspace (right-click with a mouse, or press `Ctrl+Enter` (Windows) or `Command+Enter` (Mac) if you are navigating Blockly with the keyboard). You should see a new option labeled "Hello World" at the bottom of the context menu.
82
80
83
-
<CodelabImage>  </CodelabImage>
Next, drag a block onto the workspace and open a context menu on the block. You'll see "Hello World" at the bottom of the block's context menu. Finally, open a context menu on the workspace and create a comment, then open a context menu on the comment's header. "Hello World" should be at the bottom of the context menu.
Copy file name to clipboardExpand all lines: packages/docs/docs/codelabs/context-menu-option/precondition-external-state.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,4 +29,4 @@ Use of the `preconditionFn` is not limited to checking the type of the Blockly c
29
29
30
30
Reload your workspace, check your watch, and open a context menu on the workspace to confirm the timing. The option will always be in the menu, but will sometimes be greyed out.
31
31
32
-

32
+

Copy file name to clipboardExpand all lines: packages/docs/docs/codelabs/context-menu-option/precondition-node-type.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The `scope` argument is an object that is passed to `preconditionFn`. You'll use
17
17
18
18
The return value of `preconditionFn` is `'enabled'`, `'disabled'`, or `'hidden'`. An **enabled** option is shown with black text and is selectable. A **disabled** option is shown with grey text and is not selectable. A **hidden** option is not included in the context menu at all.
19
19
20
-
### Write the function
20
+
### Write the function
21
21
22
22
You can now test `scope.focusedNode` to display the "Hello World" option in workspace and block context menus, but not on any others. Change `preconditionFn` to:
If you downloaded the source as a zip, unpacking it should give you a root folder named `blockly-main`.
25
25
26
26
The relevant files are in `docs/docs/codelabs/context-menu-option`. There are two versions of the app:
27
+
27
28
-`starter-code/`: The starter code that you'll build upon in this codelab.
28
29
-`complete-code/`: The code after completing the codelab, in case you get lost or want to compare to your version.
29
30
30
31
Each folder contains:
32
+
31
33
-`index.js` - The codelab's logic. To start, it just injects a simple workspace.
32
34
-`index.html` - A web page containing a simple blockly workspace.
33
35
34
36
To run the code, simple open `starter-code/index.html` in a browser. You should see a Blockly workspace with an always-open flyout.
35
37
36
-
<CodelabImage></CodelabImage>
38
+
<CodelabImage>
39
+
![A web page with the text "Context Menu Codelab" and a simple Blockly
0 commit comments