Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge master into developer-tools #2183

Merged
merged 24 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e2f9019
chore: run eslint and prettier on some examples
alicialics Nov 9, 2023
7a5af58
chore: run prettier
alicialics Nov 10, 2023
337e322
chore: format custom-renderer-codelab
alicialics Nov 10, 2023
3279255
chore: remove unnecessary lint entries
alicialics Nov 10, 2023
28d0f8e
chore: prettier rest of examples
alicialics Nov 10, 2023
a00e5fb
chore: format examples root
alicialics Nov 10, 2023
1e10bcb
remove empty line
alicialics Nov 10, 2023
f9e879f
add back codelabs
alicialics Nov 11, 2023
37be70b
Merge branch 'master' into examples_format
alicialics Nov 14, 2023
bd2702f
Publish
github-actions[bot] Jan 18, 2024
8fb5fa3
Fix link typo (#2156)
TechplexEngineer Jan 18, 2024
abe8b59
chore(deps-dev): Bump vite in /examples/blockly-vue3 (#2160)
dependabot[bot] Jan 22, 2024
09b650a
fix: Use the referencesVariables() method to identify variable-relate…
gonfunko Jan 22, 2024
0187b56
chore(deps-dev): Bump follow-redirects in /examples/blockly-rtc (#2138)
dependabot[bot] Jan 23, 2024
9354ea7
chore(deps-dev): Bump follow-redirects in /examples/sample-app-ts (#2…
dependabot[bot] Jan 23, 2024
949d920
chore(deps-dev): Bump follow-redirects in /examples (#2143)
dependabot[bot] Jan 23, 2024
24ca787
chore(deps-dev): Bump follow-redirects (#2145)
dependabot[bot] Jan 23, 2024
9a83a2c
chore(deps-dev): Bump follow-redirects from 1.14.9 to 1.15.4 (#2147)
dependabot[bot] Jan 23, 2024
f89bb8b
Publish
github-actions[bot] Jan 25, 2024
ed56b79
feat: Use intermediate change events for HSV sliders. (#2173)
johnnesky Jan 29, 2024
49bbc2a
Merge branch 'master' into examples_format
maribethb Jan 30, 2024
90b2620
fix: scroll options accessing internal properties (#2181)
BeksOmega Jan 30, 2024
3959a52
chore: reformat examples
maribethb Jan 30, 2024
b0904b9
chore: run prettier on examples
maribethb Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# All examples, codelabs, etc.
examples/*
# Examples, codelabs, etc.
**/acorn_interpreter.js
examples/interpreter-demo/acorn.js
examples/interpreter-demo/diff_match_patch.js
examples/interpreter-demo/interpreter.js
node_modules/*
codelabs/*
gh-pages/*

# All build artifacts, etc.
**/dist/*
**/build/*
examples/blockly-svelte/public/bundle.js
examples/blockly-angular/.angular
**/node_modules/*
**/CHANGELOG.md
CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion codelabs/custom_generator/custom_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This codelab will demonstrate how to add code to the Blockly sample app to creat

### The application

Use the (`npx @blockly/create-package app`)[https://www.npmjs.com/package/@blockly/create-package) command to create a standalone application that contains a sample setup of Blockly, including custom blocks and a display of the generated code and output.
Use the [`npx @blockly/create-package app`](https://www.npmjs.com/package/@blockly/create-package) command to create a standalone application that contains a sample setup of Blockly, including custom blocks and a display of the generated code and output.
1. Run `npx @blockly/create-package app custom-generator-codelab`. This will create a blockly application in the folder `custom-generator-codelab`.
1. `cd` into the new directory: `cd custom-generator-codelab`.
1. Run `npm start` to start the server and run the sample application.
Expand Down
19 changes: 18 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,28 @@ const compat = new FlatCompat();
module.exports = [
{
ignores: [
'examples/',
'codelabs/',
'gh-pages/',
'examples/backpack-demo',
'examples/blockly-angular',
'examples/blockly-react',
'examples/blockly-rtc',
'examples/blockly-vue3',
'examples/context-menu-codelab',
'examples/custom-dialogs-demo',
'examples/custom-toolbox-codelab',
'examples/devsite-demo',
'examples/devsite-landing-demo',
'examples/getting-started-codelab',
'examples/interpreter-demo',
'examples/pitch-field-demo',
'examples/sample-app-ts',
'examples/theme-extension-codelab',
'examples/turtle-field-demo',
'examples/validation-and-warnings-codelab',
'**/dist/',
'**/build/',
'examples/blockly-svelte/public/bundle.js',
// specific examples that are sometimes copied into plugins
'plugins/dev-create/templates/sample-app',
'plugins/dev-create/templates/sample-app-ts',
Expand Down
63 changes: 33 additions & 30 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,44 @@ to include and extend the [Blockly](http://github.com/google/blockly) library.

### Usage Demos

- [``backpack-demo``](backpack-demo/): A demo of two Blockly instances with a shared backpack.
- [``custom-dialogs-demo``](custom-dialogs-demo/): A demo overriding Blockly browser dialogs with custom implementations.
- [``custom-tooltips-demo``](custom-tooltips-demo/): An example of using a custom tooltip renderer.
- [``fixed-demo``](fixed-demo/): A demo injecting Blockly into a page as a fixed element.
- [``generator-demo``](generator-demo/): A demo of generating code from blocks and running it in a sandboxed JavaScript interpreter
- [``graph-demo``](graph-demo/): A demo of giving instant feedback as blocks are changed.
- [``headless-demo``](headless-demo/): A demo of generating Python code from JSON with no graphics.
- [``interpreter-demo``](interpreter-demo/): A demo of executing code step-by-step with a sandboxed JavaScript interpreter.
- [``max-blocks-demo``](max-blocks-demo/): A demo limiting the total number of blocks allowed for academic exercises.
- [``mirror-demo``](mirror-demo/): A demo using two Blockly instances connected as leader-follower.
- [``pitch-field-demo``](pitch-field-demo/): A demo of creating custom block fields.
- [``resizable-demo``](resizable-demo/): A demo of injecting Blockly into a page as a resizable element.
- [``rtl-demo``](rtl-demo/): A demo of what Blockly looks like in right-to-left mode (for Arabic and Hebrew).
- [``single-direction-scroll-demo``](single-direction-scroll-demo/): A demo of configuring single-direction scrollbars.
- [``toolbox-demo``](toolbox-demo/): A demo of a complex category structure for the toolbox.
- [``turtle-field-demo``](turtle-field-demo/): A demo of creating custom block fields.
- [`backpack-demo`](backpack-demo/): A demo of two Blockly instances with a shared backpack.
- [`custom-dialogs-demo`](custom-dialogs-demo/): A demo overriding Blockly browser dialogs with custom implementations.
- [`custom-tooltips-demo`](custom-tooltips-demo/): An example of using a custom tooltip renderer.
- [`fixed-demo`](fixed-demo/): A demo injecting Blockly into a page as a fixed element.
- [`generator-demo`](generator-demo/): A demo of generating code from blocks and running it in a sandboxed JavaScript interpreter
- [`graph-demo`](graph-demo/): A demo of giving instant feedback as blocks are changed.
- [`headless-demo`](headless-demo/): A demo of generating Python code from JSON with no graphics.
- [`interpreter-demo`](interpreter-demo/): A demo of executing code step-by-step with a sandboxed JavaScript interpreter.
- [`max-blocks-demo`](max-blocks-demo/): A demo limiting the total number of blocks allowed for academic exercises.
- [`mirror-demo`](mirror-demo/): A demo using two Blockly instances connected as leader-follower.
- [`pitch-field-demo`](pitch-field-demo/): A demo of creating custom block fields.
- [`resizable-demo`](resizable-demo/): A demo of injecting Blockly into a page as a resizable element.
- [`rtl-demo`](rtl-demo/): A demo of what Blockly looks like in right-to-left mode (for Arabic and Hebrew).
- [`single-direction-scroll-demo`](single-direction-scroll-demo/): A demo of configuring single-direction scrollbars.
- [`toolbox-demo`](toolbox-demo/): A demo of a complex category structure for the toolbox.
- [`turtle-field-demo`](turtle-field-demo/): A demo of creating custom block fields.

### Codelabs

The [Blockly Codelabs](https://blocklycodelabs.dev/) refer to this example code.

- [``context-menu-codelab``](context-menu-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/context-menu-option/index.html) on context menu options.
- [``custom-toolbox-codelab``](custom-toolbox-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/custom_toolbox/index.html) on how to customize your toolbox.
- [``getting-started-codelab``](getting-started-codelab/): Code for the [Blockly getting started codelab](https://blocklycodelabs.dev/codelabs/getting-started/index.html).
- [``theme-extension-codelab``](theme-extension-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/theme-extension-identifier/index.html) on applying themes.
- [``validation-and-warnings-codelab``](validation-and-warnings-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/validation-and-warnings/index.html) on validating blocks and displaying warnings.
- [`context-menu-codelab`](context-menu-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/context-menu-option/index.html) on context menu options.
- [`custom-toolbox-codelab`](custom-toolbox-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/custom_toolbox/index.html) on how to customize your toolbox.
- [`getting-started-codelab`](getting-started-codelab/): Code for the [Blockly getting started codelab](https://blocklycodelabs.dev/codelabs/getting-started/index.html).
- [`theme-extension-codelab`](theme-extension-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/theme-extension-identifier/index.html) on applying themes.
- [`validation-and-warnings-codelab`](validation-and-warnings-codelab/): Starter code and completed code for the [codelab](https://blocklycodelabs.dev/codelabs/validation-and-warnings/index.html) on validating blocks and displaying warnings.

### Integrating Blockly

- [``blockly-angular-sample``](blockly-angular/): Blockly in an Angular project, defines an Angular Blockly Component.
- [``blockly-react-sample``](blockly-react/): Blockly in a React project, defines a React Blockly Component.
- [``blockly-svelte-sample``](blockly-svelte/): Blockly in a Svelte project, defines a Svelte Blockly Component.
- [``blockly-vue3-sample``](blockly-vue3/): Blockly in a Vue3 project, defines a Vue Blockly Component.
- [``blockly-parcel``](blockly-parcel/): Using Blockly with Parcel.
- [`blockly-angular-sample`](blockly-angular/): Blockly in an Angular project, defines an Angular Blockly Component.
- [`blockly-react-sample`](blockly-react/): Blockly in a React project, defines a React Blockly Component.
- [`blockly-svelte-sample`](blockly-svelte/): Blockly in a Svelte project, defines a Svelte Blockly Component.
- [`blockly-vue3-sample`](blockly-vue3/): Blockly in a Vue3 project, defines a Vue Blockly Component.
- [`blockly-parcel`](blockly-parcel/): Using Blockly with Parcel.

### Real-time Collaboration

- [``blockly-rtc``](blockly-rtc/): Real-time collaboration environment on top of the Blockly framework.
- [`blockly-rtc`](blockly-rtc/): Real-time collaboration environment on top of the Blockly framework.

## Prerequisites

Expand All @@ -57,6 +57,7 @@ cd <any sample folder>
npm install
npm run start
```

Browse to http://localhost:3000

You may need to refer to a sample's README for further setup and running instructions.
Expand All @@ -68,17 +69,19 @@ You may need to refer to a sample's README for further setup and running instruc
```
npm run boot
```
This will run ``npm install`` on every example.

This will run `npm install` on every example.

### Maintenance

```
npm run update
```
This will run ``npm update`` on every example.

This will run `npm update` on every example.

```
npm run audit
```
This will run ``npm audit fix`` on every example.

This will run `npm audit fix` on every example.
72 changes: 37 additions & 35 deletions examples/backpack-demo/index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Blockly Demo: Backpack</title>
<script src="./node_modules/blockly/blockly_compressed.js"></script>
<script src="./node_modules/blockly/blocks_compressed.js"></script>
<script src="./node_modules/blockly/msg/en.js"></script>
<script src="./node_modules/@blockly/workspace-backpack/dist/index.js"></script>
<script src="./notification_backpack.js"></script>
<script src="./index.js"></script>
<style>
body {
background-color: #fff;
font-family: sans-serif;
}
h1 {
font-weight: normal;
font-size: 140%;
}
</style>
</head>
<body onload="init()">
<p>This is a demo of two Blockly instances with a custom Backpack "sharing" Backpack contents.</p>
<head>
<meta charset="utf-8" />
<title>Blockly Demo: Backpack</title>
<script src="./node_modules/blockly/blockly_compressed.js"></script>
<script src="./node_modules/blockly/blocks_compressed.js"></script>
<script src="./node_modules/blockly/msg/en.js"></script>
<script src="./node_modules/@blockly/workspace-backpack/dist/index.js"></script>
<script src="./notification_backpack.js"></script>
<script src="./index.js"></script>
<style>
body {
background-color: #fff;
font-family: sans-serif;
}
h1 {
font-weight: normal;
font-size: 140%;
}
</style>
</head>
<body onload="init()">
<p>
This is a demo of two Blockly instances with a custom Backpack "sharing"
Backpack contents.
</p>

<table width="100%">
<tr>
<td>
<div id="primaryDiv" style="height: 480px; width: 600px;"></div>
</td>
<td>
<div id="secondaryDiv" style="height: 480px; width: 600px;"></div>
</td>
</tr>
</table>

</body>
<table width="100%">
<tr>
<td>
<div id="primaryDiv" style="height: 480px; width: 600px"></div>
</td>
<td>
<div id="secondaryDiv" style="height: 480px; width: 600px"></div>
</td>
</tr>
</table>
</body>
</html>
Loading
Loading