diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 6b2238bb75..5d7a9d85bf 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -14,22 +14,22 @@ race, religion, or sexual identity and orientation. Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Our Responsibilities @@ -69,8 +69,8 @@ dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe. -Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the -Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +Reports should be directed to _[PROJECT STEWARD NAME(s) AND EMAIL(s)]_, the +Project Steward(s) for _[PROJECT NAME]_. It is the Project Steward’s duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the Open Source Programs Office and the Google Open Source Strategy team. If for any reason you @@ -90,4 +90,4 @@ harassment or threats to anyone's safety, we may take action without notice. This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/.github/workflows/assign_reviewers.yml b/.github/workflows/assign_reviewers.yml index 2395a085d4..042f1553e7 100644 --- a/.github/workflows/assign_reviewers.yml +++ b/.github/workflows/assign_reviewers.yml @@ -16,26 +16,26 @@ jobs: requested-reviewer: runs-on: ubuntu-latest steps: - - name: Assign requested reviewer - uses: actions/github-script@v5 - with: - script: | - try { - if (context.payload.pull_request === undefined) { - throw new Error("Can't get pull_request payload. " + - 'Check a request reviewer event was triggered.'); + - name: Assign requested reviewer + uses: actions/github-script@v5 + with: + script: | + try { + if (context.payload.pull_request === undefined) { + throw new Error("Can't get pull_request payload. " + + 'Check a request reviewer event was triggered.'); + } + const reviewers = context.payload.pull_request.requested_reviewers; + // Assignees takes in a list of logins rather than the + // reviewer object. + const reviewerNames = reviewers.map(reviewer => reviewer.login); + const {number:issue_number} = context.payload.pull_request; + github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + assignees: reviewerNames + }); + } catch (error) { + core.setFailed(error.message); } - const reviewers = context.payload.pull_request.requested_reviewers; - // Assignees takes in a list of logins rather than the - // reviewer object. - const reviewerNames = reviewers.map(reviewer => reviewer.login); - const {number:issue_number} = context.payload.pull_request; - github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue_number, - assignees: reviewerNames - }); - } catch (error) { - core.setFailed(error.message); - } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24d81fcdcb..483eebd894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,35 +15,35 @@ jobs: matrix: node-version: [16.x, 18.x, 20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} - - name: Npm Install - run: npm install + - name: Npm Install + run: npm install - - name: Build - run: npm run build -- -- -- --skip-lint + - name: Build + run: npm run build - - name: Test - run: npm run test -- -- -- --skip-lint + - name: Test + run: npm run test lint: timeout-minutes: 5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 20 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 20 - - name: Npm Install - run: npm install + - name: Npm Install + run: npm install - - name: Lint - run: npm run lint + - name: Lint + run: npm run lint diff --git a/.github/workflows/clean_install_examples.yml b/.github/workflows/clean_install_examples.yml index b7bf772e2c..17f67ad38d 100644 --- a/.github/workflows/clean_install_examples.yml +++ b/.github/workflows/clean_install_examples.yml @@ -3,7 +3,7 @@ name: Check examples install status -on: +on: pull_request: paths: - 'examples/**' diff --git a/.github/workflows/dependabot_update.yml b/.github/workflows/dependabot_update.yml index b7d0c5a313..24553fd2c1 100644 --- a/.github/workflows/dependabot_update.yml +++ b/.github/workflows/dependabot_update.yml @@ -6,10 +6,10 @@ name: Clean up after dependabot # Triggered when a PR is (re)opened or synchronized -on: +on: pull_request: paths: - - "plugins/**" + - 'plugins/**' permissions: pull-requests: write # This action modifies PRs @@ -45,7 +45,7 @@ jobs: # Install packages - name: Npm install run: npm ci - + # Run lerna bootstrap again, this time using `install` instead of `ci` so that # it will do the magic update we need to remove local dependencies. - name: Fix package locks diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5f6b687010..a708d1fad5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,13 +3,13 @@ name: publish on: - workflow_dispatch: # Manually trigger. Colon is required. + workflow_dispatch: # Manually trigger. Colon is required. schedule: - cron: '5 17 * * 4' # Thursdays at 17:05 UTC (09:05 PST / 10:05 PDT) permissions: - contents: write # For checkout and tag. - packages: write # For publish. + contents: write # For checkout and tag. + packages: write # For publish. jobs: publish: @@ -21,44 +21,44 @@ jobs: environment: release steps: - - name: Checkout - uses: actions/checkout@v3 - # fetch all tags and commits so that lerna can version appropriately - with: - fetch-depth: 0 - ref: 'master' + - name: Checkout + uses: actions/checkout@v3 + # fetch all tags and commits so that lerna can version appropriately + with: + fetch-depth: 0 + ref: 'master' - # This uses a reverse-engineered email for the github actions bot. See - # https://github.com/actions/checkout/issues/13#issuecomment-724415212 - - name: Git Identity - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email '<41898282+github-actions[bot]@users.noreply.github.com' + # This uses a reverse-engineered email for the github actions bot. See + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 + - name: Git Identity + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '<41898282+github-actions[bot]@users.noreply.github.com' - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 20 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 20 - - name: Configure npm - run: npm config set //wombat-dressing-room.appspot.com/:_authToken=$NODE_AUTH_TOKEN - env: - NODE_AUTH_TOKEN: ${{ secrets.RELEASE_BACKED_NPM_TOKEN }} + - name: Configure npm + run: npm config set //wombat-dressing-room.appspot.com/:_authToken=$NODE_AUTH_TOKEN + env: + NODE_AUTH_TOKEN: ${{ secrets.RELEASE_BACKED_NPM_TOKEN }} - - name: NPM install - # Use CI so that we don't update dependencies in this step. - run: npm ci + - name: NPM install + # Use CI so that we don't update dependencies in this step. + run: npm ci - - name: Build - run: npm run build -- -- -- --skip-lint + - name: Build + run: npm run build - - name: Test - run: npm run test -- -- -- --skip-lint + - name: Test + run: npm run test - - name: Publish - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx lerna publish --no-private --conventional-commits --create-release github --yes + - name: Publish + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx lerna publish --no-private --conventional-commits --create-release github --yes update-gh-pages: name: Update GitHub Pages diff --git a/.github/workflows/update_gh_pages.yml b/.github/workflows/update_gh_pages.yml index 44ce16bcf3..013bed1e96 100644 --- a/.github/workflows/update_gh_pages.yml +++ b/.github/workflows/update_gh_pages.yml @@ -3,7 +3,7 @@ name: Update GitHub Pages on: - workflow_dispatch: # Manually trigger. Colon is required. + workflow_dispatch: # Manually trigger. Colon is required. inputs: branch: description: 'Branch to publish from' @@ -13,37 +13,37 @@ on: workflow_call: # Allow this workflow to be called from publish workflow. permissions: - contents: write # For checkout and push. + contents: write # For checkout and push. jobs: update-github-pages: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch || 'master' }} - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: NPM install - # Use CI so that we don't update dependencies in this step. - # TODO(#1511): remove --force flag from installing examples - # Until then, don't block updating just because some dependencies are out of date. - run: | - npm ci - (cd examples && npm ci --force) - - - name: Deploy to GH Pages - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # deploys to the current repo, - # so you can use this workflow from a fork to update your personal gh-pages - run: | - npm run deploy:prepare - git remote set-url origin https://git:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - npx gh-pages -d gh-pages -t -u "github-actions-bot " + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ inputs.branch || 'master' }} + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: NPM install + # Use CI so that we don't update dependencies in this step. + # TODO(#1511): remove --force flag from installing examples + # Until then, don't block updating just because some dependencies are out of date. + run: | + npm ci + (cd examples && npm ci --force) + + - name: Deploy to GH Pages + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # deploys to the current repo, + # so you can use this workflow from a fork to update your personal gh-pages + run: | + npm run deploy:prepare + git remote set-url origin https://git:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + npx gh-pages -d gh-pages -t -u "github-actions-bot " diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..bf200a37bc --- /dev/null +++ b/.prettierignore @@ -0,0 +1,18 @@ +# All examples, codelabs, etc. +examples/* +node_modules/* +codelabs/* +gh-pages/* + +# All build artifacts, etc. +**/dist/* +**/build/* +**/node_modules/* +**/CHANGELOG.md +CHANGELOG.md +PULL_REQUEST_TEMPLATE.md + +# Specific examples that are sometimes copied into plugins +plugins/dev-create/templates/sample-app/* +plugins/dev-create/templates/sample-app-ts/* + diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000..bbfb466399 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,13 @@ +// This config attempts to match google-style code. + +module.exports = { + // Prefer single quotes, but minimize escaping. + singleQuote: true, + // Some properties must be quoted to preserve closure compiler behavior. + // Don't ever change whether properties are quoted. + quoteProps: 'preserve', + // Don't add spaces around braces for object literals. + bracketSpacing: false, + // Put HTML tag closing brackets on same line as last attribute. + bracketSameLine: true, +}; diff --git a/README.md b/README.md index e6150892e6..bd54b0fe2e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ Please see our [GitHub Pages site](https://google.github.io/blockly-samples/inde Blockly has an active [developer forum](https://groups.google.com/forum/#!forum/blockly). Please drop by and say hello. Show us your prototypes early; collectively we have a lot of experience and can offer hints which will save you time. We actively monitor the forums and typically respond to questions within 2 working days. - ## License Apache 2.0 diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000..5fe8001db5 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,246 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +const jsdoc = require('eslint-plugin-jsdoc'); +const js = require('@eslint/js'); +const {FlatCompat} = require('@eslint/eslintrc'); +const babelParser = require('@babel/eslint-parser'); +const globals = require('globals'); +const tsParser = require('@typescript-eslint/parser'); +const typescript = require('@typescript-eslint/eslint-plugin'); +const eslintConfigPrettier = require('eslint-config-prettier'); + +// Used to convert the Google eslint config into flat config format. +const compat = new FlatCompat(); + +module.exports = [ + { + ignores: [ + 'examples/', + 'codelabs/', + 'gh-pages/', + '**/dist/', + '**/build/', + // specific examples that are sometimes copied into plugins + 'plugins/dev-create/templates/sample-app', + 'plugins/dev-create/templates/sample-app-ts', + ], + }, + js.configs.recommended, // eslint-recommended + ...compat.extends('eslint-config-google'), + jsdoc.configs['flat/recommended'], // jsdoc-recommended + eslintConfigPrettier, // Must be last in the list of imported configs so it can override. + // Following is default configuration that applies to all files. + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.commonjs, + ...globals.node, + ...globals.es5, + 'Blockly': true, + 'goog': true, + }, + parser: babelParser, + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + requireConfigFile: false, + }, + }, + + linterOptions: { + reportUnusedDisableDirectives: true, + }, + + plugins: { + jsdoc, + }, + + settings: { + jsdoc: { + tagNamePreference: { + 'returns': 'returns', + }, + mode: 'closure', + }, + }, + + rules: { + // http://eslint.org/docs/rules/ + 'camelcase': 'warn', + 'new-cap': ['error', {'capIsNewExceptionPattern': '^.*Error'}], + // Allow TODO comments. + 'no-warning-comments': 'off', + 'no-invalid-this': 'off', + // valid-jsdoc does not work properly for interface methods. + // https://github.com/eslint/eslint/issues/9978 + 'valid-jsdoc': 'off', + + // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules + 'require-jsdoc': 'off', + 'jsdoc/newline-after-description': 'off', + // This should warn instead, but it's broken for long record type params. + 'jsdoc/require-description-complete-sentence': 'off', + 'jsdoc/require-returns': [ + 'error', + { + 'forceRequireReturn': false, + }, + ], + 'jsdoc/require-description': [ + 'warn', + { + // Don't require descriptions if these tags are present. + 'exemptedBy': ['inheritdoc', 'param', 'return', 'returns', 'type'], + }, + ], + 'jsdoc/check-tag-names': 'off', + 'jsdoc/check-access': 'warn', + 'jsdoc/check-types': 'off', + 'jsdoc/check-values': 'off', + 'jsdoc/require-jsdoc': [ + 'warn', + { + 'enableFixer': false, + 'require': { + 'FunctionDeclaration': true, + 'ClassDeclaration': true, + 'MethodDefinition': true, + }, + }, + ], + }, + }, + { + files: ['**/*.mocha.js'], + languageOptions: { + globals: { + ...globals.mocha, + }, + }, + }, + { + files: ['**/*.ts'], + languageOptions: { + parser: tsParser, + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + warnOnUnsupportedTypeScriptVersion: true, + }, + }, + settings: { + jsdoc: { + mode: 'typescript', + }, + }, + plugins: { + '@typescript-eslint': typescript, + }, + rules: { + // The types are specified in TS rather than JsDoc. + 'jsdoc/no-types': 'warn', + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-property-type': 'off', + 'jsdoc/require-returns-type': 'off', + // Don't auto-add missing jsdoc. Only required on exported items. + 'jsdoc/require-jsdoc': [ + 'warn', + { + 'enableFixer': false, + 'publicOnly': true, + }, + ], + // params and returns docs are optional. + 'jsdoc/require-param-description': ['off'], + 'jsdoc/require-returns': ['off'], + // Ensure there is a blank line between the body and any @tags, + // as required by the tsdoc spec. + // TODO: Re-enable soon. + // 'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}], + 'jsdoc/tag-lines': 'off', + + // Already handled by tsc. + 'no-dupe-class-members': 'off', + 'no-undef': 'off', + + // Add TypeScript specific rules (and turn off ESLint equivalents) + '@typescript-eslint/array-type': [ + 'error', + { + 'default': 'array-simple', + }, + ], + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/ban-types': [ + 'error', + { + 'types': { + 'Object': { + 'message': "Use {} or 'object' instead.", + }, + 'String': { + 'message': "Use 'string' instead.", + }, + 'Number': { + 'message': "Use 'number' instead.", + }, + 'Boolean': { + 'message': "Use 'boolean' instead.", + }, + }, + }, + ], + 'camelcase': 'off', + '@typescript-eslint/naming-convention': [ + 'error', + { + 'selector': 'default', + 'format': ['camelCase', 'PascalCase'], + }, + { + 'selector': 'class', + 'format': ['PascalCase'], + }, + { + // Disallow starting interaces with 'I' + 'selector': 'interface', + 'format': ['PascalCase'], + 'custom': { + 'regex': '^I[A-Z]', + 'match': false, + }, + }, + ], + '@typescript-eslint/consistent-type-assertions': 'error', + + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + + '@typescript-eslint/no-empty-interface': 'error', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-assertion': 'warn', + '@typescript-eslint/no-this-alias': 'error', + + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['warn', {args: 'none'}], + + '@typescript-eslint/no-var-requires': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/explicit-member-accessibility': [ + 'error', + {'accessibility': 'no-public'}, + ], + '@typescript-eslint/no-require-imports': 'error', + }, + }, +]; diff --git a/gulpfile.js b/gulpfile.js index f4a13f10ea..22d785ee48 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -34,14 +34,14 @@ function checkLicenses() { // Check root package.json. promises.push(checker.checkLocalDirectory('.')); fs.readdirSync(pluginsDir) - .filter((file) => { - return fs.statSync(path.join(pluginsDir, file)).isDirectory(); - }) - .forEach((plugin) => { - const pluginDir = path.join(pluginsDir, plugin); - // Check each plugin package.json. - promises.push(checker.checkLocalDirectory(pluginDir)); - }); + .filter((file) => { + return fs.statSync(path.join(pluginsDir, file)).isDirectory(); + }) + .forEach((plugin) => { + const pluginDir = path.join(pluginsDir, plugin); + // Check each plugin package.json. + promises.push(checker.checkLocalDirectory(pluginDir)); + }); return Promise.all(promises); } @@ -61,11 +61,14 @@ function prepareForPublish(done) { } // Clone a fresh copy of blockly-samples. - console.log(`Checking out a fresh copy of blockly-samples under ` + - `${path.resolve(releaseDir)}`); + console.log( + `Checking out a fresh copy of blockly-samples under ` + + `${path.resolve(releaseDir)}`, + ); execSync( - `git clone https://github.com/google/blockly-samples ${releaseDir}`, - {stdio: 'pipe'}); + `git clone https://github.com/google/blockly-samples ${releaseDir}`, + {stdio: 'pipe'}, + ); // Run npm ci. console.log('Running npm ci to install.'); @@ -81,9 +84,9 @@ function prepareForPublish(done) { // Login to npm. console.log('Logging in to npm.'); - execSync( - `npm login --registry https://wombat-dressing-room.appspot.com`, - {stdio: 'inherit'}); + execSync(`npm login --registry https://wombat-dressing-room.appspot.com`, { + stdio: 'inherit', + }); done(); } @@ -96,8 +99,9 @@ function exitIfNoReleaseDir(releaseDir, done) { // Check that release directory exists. if (!fs.existsSync(releaseDir)) { console.error( - `No release directory ${releaseDir} exists. ` + - `Did you run 'npm run publish:prepare'?`); + `No release directory ${releaseDir} exists. ` + + `Did you run 'npm run publish:prepare'?`, + ); done(); process.exit(1); } @@ -119,9 +123,10 @@ function publish(force) { // creates the release on GitHub. console.log(`Publishing ${force ? 'all' : 'changed'} plugins.`); execSync( - `lerna publish --no-private --conventional-commits --create-release github` + - `${force ? ' --force-publish=*' : ''}`, - {cwd: releaseDir, stdio: 'inherit'}); + `lerna publish --no-private --conventional-commits --create-release github` + + `${force ? ' --force-publish=*' : ''}`, + {cwd: releaseDir, stdio: 'inherit'}, + ); console.log('Removing release directory.'); rimraf.sync(releaseDir); @@ -163,9 +168,10 @@ function publishFromPackage(done) { // Run lerna publish. Will not update versions. console.log(`Publishing plugins from package.json versions.`); - execSync( - `lerna publish --no-private --from-package`, - {cwd: releaseDir, stdio: 'inherit'}); + execSync(`lerna publish --no-private --from-package`, { + cwd: releaseDir, + stdio: 'inherit', + }); console.log('Removing release directory.'); rimraf.sync(releaseDir); @@ -183,12 +189,15 @@ function checkVersions(done) { exitIfNoReleaseDir(releaseDir, done); // Check version numbers that would be created. - console.log('Running lerna version.', - 'These version numbers will not be pushed and no tags will be created,', - 'even if you answer yes to the prompt.'); + console.log( + 'Running lerna version.', + 'These version numbers will not be pushed and no tags will be created,', + 'even if you answer yes to the prompt.', + ); execSync( - `lerna version --no-private --conventional-commits --no-git-tag-version --no-push`, - {cwd: releaseDir, stdio: 'inherit'}); + `lerna version --no-private --conventional-commits --no-git-tag-version --no-push`, + {cwd: releaseDir, stdio: 'inherit'}, + ); done(); } @@ -203,15 +212,17 @@ function deployToGhPages(repo) { const d = new Date(); const m = `Deploying ${d.getMonth() + 1}-${d.getDate()}-${d.getFullYear()}`; ghpages.publish( - 'gh-pages', { - message: m, - repo, - // Include .nojekyll file to tell GitHub to publish without building. - // By default, dotfiles are excluded. - // TODO: make the github action include .nojekyll. - src: ['**/*', '.nojekyll'] - }, - done); + 'gh-pages', + { + message: m, + repo, + // Include .nojekyll file to tell GitHub to publish without building. + // By default, dotfiles are excluded. + // TODO: make the github action include .nojekyll. + src: ['**/*', '.nojekyll'], + }, + done, + ); }; } @@ -224,7 +235,9 @@ function deployToGhPages(repo) { function preparePluginsForLocal(isBeta) { return (done) => { if (isBeta) { - execSync(`npx lerna exec -- npm install blockly@beta --force `, {stdio: 'inherit'}); + execSync(`npx lerna exec -- npm install blockly@beta --force `, { + stdio: 'inherit', + }); } execSync(`npm run boot`, {stdio: 'inherit'}); // Bundles all the plugins. @@ -243,8 +256,10 @@ function prepareExamplesForLocal(isBeta) { return (done) => { const examplesDirectory = 'examples'; if (isBeta) { - execSync( - `npx lerna exec -- npm install blockly@beta --force`, {cwd: examplesDirectory, stdio: 'inherit'}); + execSync(`npx lerna exec -- npm install blockly@beta --force`, { + cwd: examplesDirectory, + stdio: 'inherit', + }); } execSync(`npm run boot`, {cwd: examplesDirectory, stdio: 'inherit'}); // Bundles any examples that define a predeploy script (ex. blockly-react). @@ -262,15 +277,17 @@ function prepareExamplesForLocal(isBeta) { */ function testGhPagesLocally(isBeta) { return gulp.series( - gulp.parallel( - preparePluginsForLocal(isBeta), prepareExamplesForLocal(isBeta)), - predeployTasks.predeployAllLocal, - function(done) { - console.log('Starting server using http-server'); - execSync( - `npx http-server`, {cwd: 'gh-pages', stdio: 'inherit'}); - done(); - }); + gulp.parallel( + preparePluginsForLocal(isBeta), + prepareExamplesForLocal(isBeta), + ), + predeployTasks.predeployAllLocal, + function (done) { + console.log('Starting server using http-server'); + execSync(`npx http-server`, {cwd: 'gh-pages', stdio: 'inherit'}); + done(); + }, + ); } /** diff --git a/lerna.json b/lerna.json index 61dd54162b..bc296be7d4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,5 @@ { - "packages": [ - "plugins/**/**/**" - ], + "packages": ["plugins/**/**/**"], "version": "independent", "npmClient": "npm", "command": { diff --git a/package-lock.json b/package-lock.json index 05c70f491b..f7ff084769 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,19 +10,51 @@ "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { - "@blockly/eslint-config": "^3.0.0", + "@babel/eslint-parser": "^7.22.15", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.49.0", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "@typescript-eslint/parser": "^6.7.2", "conventional-changelog-conventionalcommits": "^5.0.0", - "eslint": "^7.15.0", + "eslint": "^8.49.0", + "eslint-config-google": "^0.14.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-jsdoc": "^46.8.2", "gh-pages": "^3.1.0", + "globals": "^13.22.0", "gulp": "^4.0.2", "gulp-header": "^2.0.9", "http-server": "^14.1.1", "js-green-licenses": "^1.1.0", "lerna": "^6.5.1", + "prettier": "^3.0.3", "rimraf": "^3.0.2", "showdown": "^2.1.0" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", @@ -36,11 +68,97 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/compat-data": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", + "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", + "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "dev": true, + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helpers": "^7.23.2", + "@babel/parser": "^7.23.0", + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "peer": true + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/eslint-parser": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz", + "integrity": "sha512-yc8OOBIQk1EcRrpizuARSQS0TWAcOMpEJ1aafhNznaeYkeL+OhqnDObGFylB8ka8VFF/sZc+S4RzHyO+3LjQxg==", + "dev": true, + "dependencies": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0", + "eslint": "^7.5.0 || ^8.0.0" + } + }, + "node_modules/@babel/eslint-parser/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, + "peer": true, "dependencies": { "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", @@ -51,11 +169,56 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.15", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "peer": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "peer": true + }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, + "peer": true, "engines": { "node": ">=6.9.0" } @@ -65,6 +228,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, + "peer": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/types": "^7.23.0" @@ -78,6 +242,53 @@ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", + "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, + "peer": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -90,6 +301,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, + "peer": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -102,6 +314,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, + "peer": true, "engines": { "node": ">=6.9.0" } @@ -115,6 +328,31 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-validator-option": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", + "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/highlight": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", @@ -134,6 +372,7 @@ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, + "peer": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -146,6 +385,7 @@ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, + "peer": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", @@ -160,6 +400,7 @@ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, + "peer": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.23.0", @@ -176,11 +417,22 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, + "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.20", @@ -190,93 +442,116 @@ "node": ">=6.9.0" } }, - "node_modules/@blockly/eslint-config": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@blockly/eslint-config/-/eslint-config-3.0.0.tgz", - "integrity": "sha512-8xqQ09plxuonCNqy4YsAphK0onowRWzLiRhRp0Ubcmkm0veMDgMdqxmn5D1ppKyUH9WUI7G4HQ2EgbnA9577nA==", + "node_modules/@es-joy/jsdoccomment": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.40.1.tgz", + "integrity": "sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "babel-eslint": "^10.1.0", - "eslint-config-google": "^0.14.0", - "eslint-plugin-jsdoc": "^46.2.6" + "comment-parser": "1.4.0", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=16" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "peerDependencies": { - "eslint": "7.x" + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@es-joy/jsdoccomment": { - "version": "0.39.4", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.39.4.tgz", - "integrity": "sha512-Jvw915fjqQct445+yron7Dufix9A+m9j1fCJYlCo1FWlRvTxa3pjJelxdSTdaLWcTwRU6vbL+NYjO4YuNIS5Qg==", + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "comment-parser": "1.3.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, "engines": { - "node": ">=16" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" + "argparse": "^2.0.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">= 4" + "node": "*" } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/@eslint/js": { + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@gar/promisify": { @@ -286,23 +561,36 @@ "dev": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "node_modules/@hutson/parse-repository-url": { @@ -325,6 +613,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "peer": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -339,6 +628,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, + "peer": true, "engines": { "node": ">=6.0.0" } @@ -348,6 +638,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, + "peer": true, "engines": { "node": ">=6.0.0" } @@ -356,13 +647,15 @@ "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -568,6 +861,15 @@ "semver": "^7.0.0" } }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "dependencies": { + "eslint-scope": "5.1.1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -914,183 +1216,55 @@ "nx": "15.8.3" } }, - "node_modules/@nrwl/devkit": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.8.3.tgz", - "integrity": "sha512-0DLaCMz0dhHyN+9oD1h2mpOxomuCfflZKrZ7NmOFSyQjkBiMJwh4ztt52W53MDL5/eBq5Jf4mBsPpbsYZvwQhg==", - "dev": true, - "dependencies": { - "@phenomnomnominal/tsquery": "4.1.1", - "ejs": "^3.1.7", - "ignore": "^5.0.4", - "semver": "7.3.4", - "tmp": "~0.2.1", - "tslib": "^2.3.0" - }, - "peerDependencies": { - "nx": ">= 14.1 <= 16" - } - }, - "node_modules/@nrwl/devkit/node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@nrwl/devkit/node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", - "dev": true - }, - "node_modules/@nrwl/nx-darwin-arm64": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.8.3.tgz", - "integrity": "sha512-kN4e4YjmPdgGIQq3jZdKuDQvVlMwC5J9rn0MUaNNXq4bwLypEtd7eUjiejqEU0TvSuK3kApsjnnEOhDQvDFBKw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-darwin-x64": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.8.3.tgz", - "integrity": "sha512-N4dwNwFYYhH2+/wHNEZAY4qtVp0BhAEAOrW01pZgoJIu6KlefKpphdjXT0H8rWgqzLOkeEA8xiCKEFJJalhIgg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-linux-arm-gnueabihf": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.8.3.tgz", - "integrity": "sha512-hUSIs1V0jIBvr0+CTmYHSuyGLW5QSLUg/37U3oqVHbPLz5ZsHIIz3+q6Q0ShdmxPck56usgnuV5yj0sHukkEYg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-linux-arm64-gnu": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.8.3.tgz", - "integrity": "sha512-Q0DXImRpwxf5LGYU6+24Kx1jtixRvKJLsMW6ZQyLeTau91DH8ppjsfMehf7qfGJLr5h8ssiER1A9XCjsKfZYGA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-linux-arm64-musl": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.8.3.tgz", - "integrity": "sha512-QU7ohSyAN4MN3GFMX10rvzILMlfSYosz/o81kEmjhuuSCx+uoAdHQSEfKzaV3jqK90vpNntjR9Wr2BILKiuk7Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-linux-x64-gnu": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.8.3.tgz", - "integrity": "sha512-4czf0u9kJPsiNt1yVmAzoliONL2ZOVXQs6rh+9BjypwHztfeOs2DO+8WGEd7f3TNgQRUeen0KzU3XALVmcGA6g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-linux-x64-musl": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.8.3.tgz", - "integrity": "sha512-Ia2qwL4RJhUaaiEH/qAu+Sa9FKEFvZ1oL1ItqGN8FjCYkgJvzKNTUQWvb5c7vboHcsHB3RGh+/aFok7l3yuBxQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nrwl/nx-win32-arm64-msvc": { + "node_modules/@nrwl/devkit": { "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.8.3.tgz", - "integrity": "sha512-fFwDoE/JOC0cclx1/byeCmWtitdYzJvSGXENPYPvghl2gEkQ/DA9l1yoGLqSBRIIg34bMUtyOJ494/BjflDfxA==", - "cpu": [ - "arm64" - ], + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.8.3.tgz", + "integrity": "sha512-0DLaCMz0dhHyN+9oD1h2mpOxomuCfflZKrZ7NmOFSyQjkBiMJwh4ztt52W53MDL5/eBq5Jf4mBsPpbsYZvwQhg==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@phenomnomnominal/tsquery": "4.1.1", + "ejs": "^3.1.7", + "ignore": "^5.0.4", + "semver": "7.3.4", + "tmp": "~0.2.1", + "tslib": "^2.3.0" + }, + "peerDependencies": { + "nx": ">= 14.1 <= 16" + } + }, + "node_modules/@nrwl/devkit/node_modules/semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": ">= 10" + "node": ">=10" } }, - "node_modules/@nrwl/nx-win32-x64-msvc": { + "node_modules/@nrwl/devkit/node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, + "node_modules/@nrwl/nx-darwin-x64": { "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.8.3.tgz", - "integrity": "sha512-dqieCWFFkr48h/0dIKVqn1/dhIBPPu5YMe+w5nnoVwLDGplEkwhcBA865dF+WY2kgosG1+JgQEdRlk11KuPQ5A==", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.8.3.tgz", + "integrity": "sha512-N4dwNwFYYhH2+/wHNEZAY4qtVp0BhAEAOrW01pZgoJIu6KlefKpphdjXT0H8rWgqzLOkeEA8xiCKEFJJalhIgg==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "win32" + "darwin" ], "engines": { "node": ">= 10" @@ -1364,9 +1538,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", + "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", "dev": true }, "node_modules/@types/minimatch": { @@ -1393,32 +1567,40 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", - "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.0.tgz", + "integrity": "sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/type-utils": "5.10.2", - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.2.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.9.0", + "@typescript-eslint/type-utils": "6.9.0", + "@typescript-eslint/utils": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1426,25 +1608,53 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", - "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.0.tgz", + "integrity": "sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", - "tsutils": "^3.21.0" + "@typescript-eslint/scope-manager": "6.9.0", + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/typescript-estree": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0", + "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1452,188 +1662,202 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", - "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz", + "integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/@typescript-eslint/type-utils": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.0.tgz", + "integrity": "sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/typescript-estree": "6.9.0", + "@typescript-eslint/utils": "6.9.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": ">=5" + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/@typescript-eslint/type-utils/node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, "engines": { - "node": ">=10" + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/@typescript-eslint/type-utils/node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, - "dependencies": { - "tslib": "^1.8.1" + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, "engines": { - "node": ">= 6" + "node": ">=14.17" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz", + "integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", - "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz", + "integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", - "debug": "^4.3.2" + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", - "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=16.13.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependencies": { + "typescript": ">=4.2.0" } }, - "node_modules/@typescript-eslint/types": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", - "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "engines": { + "node": ">=14.17" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", - "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", + "node_modules/@typescript-eslint/utils": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.0.tgz", + "integrity": "sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2", - "debug": "^4.3.2", - "globby": "^11.0.4", - "is-glob": "^4.0.3", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.9.0", + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/typescript-estree": "6.9.0", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz", + "integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==", "dev": true, "dependencies": { - "tslib": "^1.8.1" + "@typescript-eslint/types": "6.9.0", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": ">= 6" + "node": "^16.0.0 || >=18.0.0" }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", - "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.10.2", - "eslint-visitor-keys": "^3.0.0" - }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", @@ -1696,9 +1920,9 @@ } }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2256,15 +2480,6 @@ "node": ">=0.10.0" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -2345,36 +2560,6 @@ "proxy-from-env": "^1.1.0" } }, - "node_modules/babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "eslint": ">= 4.12.1" - } - }, - "node_modules/babel-eslint/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/bach": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", @@ -2607,6 +2792,39 @@ "node": ">=0.10.0" } }, + "node_modules/browserslist": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -2871,6 +3089,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001554", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz", + "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3249,9 +3488,9 @@ "dev": true }, "node_modules/comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.0.tgz", + "integrity": "sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==", "dev": true, "engines": { "node": ">= 12.0.0" @@ -4049,6 +4288,13 @@ "node": ">=0.10.0" } }, + "node_modules/electron-to-chromium": { + "version": "1.4.567", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.567.tgz", + "integrity": "sha512-8KR114CAYQ4/r5EIEsOmOMqQ9j0MRbJZR3aXD/KFA8RuKzyoUB4XrUCg+l8RUGqTVQgKNIgTpjaG8YHRPAbX2w==", + "dev": true, + "peer": true + }, "node_modules/email-addresses": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", @@ -4204,57 +4450,55 @@ } }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -4272,20 +4516,32 @@ "eslint": ">=5.16.0" } }, + "node_modules/eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-plugin-jsdoc": { - "version": "46.4.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.4.3.tgz", - "integrity": "sha512-Prc7ol+vCIghPeECpwZq5+P+VZfoi87suywvbYCiCnkI1kTmVSdcOC2M8mioglWxBbd28wbb1OVjg/8OzGzatA==", + "version": "46.8.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz", + "integrity": "sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.39.4", + "@es-joy/jsdoccomment": "~0.40.1", "are-docs-informative": "^0.0.2", - "comment-parser": "1.3.1", + "comment-parser": "1.4.0", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "esquery": "^1.5.0", "is-builtin-module": "^3.2.1", - "semver": "^7.5.1", + "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1" }, "engines": { @@ -4320,46 +4576,13 @@ "node": ">=8.0.0" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-visitor-keys": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", - "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" + "node": ">=10" } }, "node_modules/eslint/node_modules/ansi-styles": { @@ -4377,6 +4600,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -4423,30 +4652,71 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "type-fest": "^0.20.2" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4456,32 +4726,68 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, "engines": { - "node": ">= 4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, "engines": { "node": ">=10" }, @@ -4489,27 +4795,45 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -4851,7 +5175,7 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "node_modules/fastq": { @@ -5326,12 +5650,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "node_modules/gauge": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", @@ -5367,6 +5685,16 @@ "node": ">=8.10.0" } }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -5847,12 +6175,30 @@ } }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globby": { @@ -5937,6 +6283,12 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/gulp": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", @@ -6380,9 +6732,9 @@ ] }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -6963,6 +7315,15 @@ "node": ">=8" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -7255,6 +7616,7 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, + "peer": true, "bin": { "jsesc": "bin/jsesc" }, @@ -8113,12 +8475,6 @@ "lodash._reinterpolate": "^3.0.0" } }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -9262,6 +9618,13 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true, + "peer": true + }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -10147,17 +10510,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -10741,6 +11104,13 @@ "node": ">=8" } }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true, + "peer": true + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -10860,6 +11230,21 @@ "node": ">=4" } }, + "node_modules/prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -10884,15 +11269,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/promise-all-reject-late": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", @@ -11607,18 +11983,6 @@ "node": ">=0.10.0" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/registry-auth-token": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", @@ -11726,15 +12090,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", @@ -11966,9 +12321,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -12121,56 +12476,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -12727,44 +13032,6 @@ "es6-symbol": "^3.1.1" } }, - "node_modules/table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", - "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -12901,6 +13168,7 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true, + "peer": true, "engines": { "node": ">=4" } @@ -13128,12 +13396,6 @@ "node": ">=4" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -13375,6 +13637,37 @@ "yarn": "*" } }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -13623,15 +13916,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -14066,9 +14350,38 @@ "camelcase": "^3.0.0", "object.assign": "^4.1.0" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } }, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, + "@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "peer": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", @@ -14079,11 +14392,78 @@ "chalk": "^2.4.2" } }, + "@babel/compat-data": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", + "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", + "dev": true, + "peer": true + }, + "@babel/core": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", + "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "dev": true, + "peer": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helpers": "^7.23.2", + "@babel/parser": "^7.23.0", + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "peer": true + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "peer": true + } + } + }, + "@babel/eslint-parser": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz", + "integrity": "sha512-yc8OOBIQk1EcRrpizuARSQS0TWAcOMpEJ1aafhNznaeYkeL+OhqnDObGFylB8ka8VFF/sZc+S4RzHyO+3LjQxg==", + "dev": true, + "requires": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, "@babel/generator": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, + "peer": true, "requires": { "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", @@ -14091,17 +14471,59 @@ "jsesc": "^2.5.1" } }, + "@babel/helper-compilation-targets": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "dev": true, + "peer": true, + "requires": { + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.15", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "peer": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "peer": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "peer": true + } + } + }, "@babel/helper-environment-visitor": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "dev": true + "dev": true, + "peer": true }, "@babel/helper-function-name": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, + "peer": true, "requires": { "@babel/template": "^7.22.15", "@babel/types": "^7.23.0" @@ -14112,6 +14534,41 @@ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, + "peer": true, + "requires": { + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dev": true, + "peer": true, + "requires": { + "@babel/types": "^7.22.15" + } + }, + "@babel/helper-module-transforms": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", + "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "dev": true, + "peer": true, + "requires": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + } + }, + "@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, + "peer": true, "requires": { "@babel/types": "^7.22.5" } @@ -14121,6 +14578,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, + "peer": true, "requires": { "@babel/types": "^7.22.5" } @@ -14129,7 +14587,8 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", - "dev": true + "dev": true, + "peer": true }, "@babel/helper-validator-identifier": { "version": "7.22.20", @@ -14137,6 +14596,25 @@ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, + "@babel/helper-validator-option": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "dev": true, + "peer": true + }, + "@babel/helpers": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", + "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "dev": true, + "peer": true, + "requires": { + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0" + } + }, "@babel/highlight": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", @@ -14152,13 +14630,15 @@ "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", - "dev": true + "dev": true, + "peer": true }, "@babel/template": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, + "peer": true, "requires": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", @@ -14170,6 +14650,7 @@ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, + "peer": true, "requires": { "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.23.0", @@ -14181,6 +14662,15 @@ "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "peer": true + } } }, "@babel/types": { @@ -14188,76 +14678,96 @@ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, + "peer": true, "requires": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, - "@blockly/eslint-config": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@blockly/eslint-config/-/eslint-config-3.0.0.tgz", - "integrity": "sha512-8xqQ09plxuonCNqy4YsAphK0onowRWzLiRhRp0Ubcmkm0veMDgMdqxmn5D1ppKyUH9WUI7G4HQ2EgbnA9577nA==", + "@es-joy/jsdoccomment": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.40.1.tgz", + "integrity": "sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "babel-eslint": "^10.1.0", - "eslint-config-google": "^0.14.0", - "eslint-plugin-jsdoc": "^46.2.6" + "comment-parser": "1.4.0", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" } }, - "@es-joy/jsdoccomment": { - "version": "0.39.4", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.39.4.tgz", - "integrity": "sha512-Jvw915fjqQct445+yron7Dufix9A+m9j1fCJYlCo1FWlRvTxa3pjJelxdSTdaLWcTwRU6vbL+NYjO4YuNIS5Qg==", + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "requires": { - "comment-parser": "1.3.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } } }, + "@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true + }, "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "dependencies": { - "globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "type-fest": "^0.20.2" + "argparse": "^2.0.1" } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } } } }, + "@eslint/js": { + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", + "dev": true + }, "@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -14265,20 +14775,26 @@ "dev": true }, "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.0", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" } }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "@hutson/parse-repository-url": { @@ -14298,6 +14814,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "peer": true, "requires": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -14308,25 +14825,29 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true + "dev": true, + "peer": true }, "@jridgewell/set-array": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true + "dev": true, + "peer": true }, "@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "dev": true, + "peer": true }, "@jridgewell/trace-mapping": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -14496,6 +15017,15 @@ } } }, + "@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "requires": { + "eslint-scope": "5.1.1" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -14808,13 +15338,6 @@ } } }, - "@nrwl/nx-darwin-arm64": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.8.3.tgz", - "integrity": "sha512-kN4e4YjmPdgGIQq3jZdKuDQvVlMwC5J9rn0MUaNNXq4bwLypEtd7eUjiejqEU0TvSuK3kApsjnnEOhDQvDFBKw==", - "dev": true, - "optional": true - }, "@nrwl/nx-darwin-x64": { "version": "15.8.3", "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.8.3.tgz", @@ -14822,55 +15345,6 @@ "dev": true, "optional": true }, - "@nrwl/nx-linux-arm-gnueabihf": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.8.3.tgz", - "integrity": "sha512-hUSIs1V0jIBvr0+CTmYHSuyGLW5QSLUg/37U3oqVHbPLz5ZsHIIz3+q6Q0ShdmxPck56usgnuV5yj0sHukkEYg==", - "dev": true, - "optional": true - }, - "@nrwl/nx-linux-arm64-gnu": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.8.3.tgz", - "integrity": "sha512-Q0DXImRpwxf5LGYU6+24Kx1jtixRvKJLsMW6ZQyLeTau91DH8ppjsfMehf7qfGJLr5h8ssiER1A9XCjsKfZYGA==", - "dev": true, - "optional": true - }, - "@nrwl/nx-linux-arm64-musl": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.8.3.tgz", - "integrity": "sha512-QU7ohSyAN4MN3GFMX10rvzILMlfSYosz/o81kEmjhuuSCx+uoAdHQSEfKzaV3jqK90vpNntjR9Wr2BILKiuk7Q==", - "dev": true, - "optional": true - }, - "@nrwl/nx-linux-x64-gnu": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.8.3.tgz", - "integrity": "sha512-4czf0u9kJPsiNt1yVmAzoliONL2ZOVXQs6rh+9BjypwHztfeOs2DO+8WGEd7f3TNgQRUeen0KzU3XALVmcGA6g==", - "dev": true, - "optional": true - }, - "@nrwl/nx-linux-x64-musl": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.8.3.tgz", - "integrity": "sha512-Ia2qwL4RJhUaaiEH/qAu+Sa9FKEFvZ1oL1ItqGN8FjCYkgJvzKNTUQWvb5c7vboHcsHB3RGh+/aFok7l3yuBxQ==", - "dev": true, - "optional": true - }, - "@nrwl/nx-win32-arm64-msvc": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.8.3.tgz", - "integrity": "sha512-fFwDoE/JOC0cclx1/byeCmWtitdYzJvSGXENPYPvghl2gEkQ/DA9l1yoGLqSBRIIg34bMUtyOJ494/BjflDfxA==", - "dev": true, - "optional": true - }, - "@nrwl/nx-win32-x64-msvc": { - "version": "15.8.3", - "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.8.3.tgz", - "integrity": "sha512-dqieCWFFkr48h/0dIKVqn1/dhIBPPu5YMe+w5nnoVwLDGplEkwhcBA865dF+WY2kgosG1+JgQEdRlk11KuPQ5A==", - "dev": true, - "optional": true - }, "@nrwl/tao": { "version": "15.8.3", "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.8.3.tgz", @@ -15085,9 +15559,9 @@ "dev": true }, "@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", + "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", "dev": true }, "@types/minimatch": { @@ -15114,140 +15588,174 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "@types/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", - "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.0.tgz", + "integrity": "sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/type-utils": "5.10.2", - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.2.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.9.0", + "@typescript-eslint/type-utils": "6.9.0", + "@typescript-eslint/utils": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "dependencies": { - "@typescript-eslint/type-utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", - "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", - "dev": true, - "requires": { - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", - "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", + "ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - } - } - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true + "requires": {} }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, - "requires": { - "tslib": "^1.8.1" - } + "peer": true } } }, "@typescript-eslint/parser": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", - "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.0.tgz", + "integrity": "sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "6.9.0", + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/typescript-estree": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0", + "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", - "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz", + "integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.0.tgz", + "integrity": "sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2" + "@typescript-eslint/typescript-estree": "6.9.0", + "@typescript-eslint/utils": "6.9.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "dependencies": { + "ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "requires": {} + }, + "typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "peer": true + } } }, "@typescript-eslint/types": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", - "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz", + "integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", - "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz", + "integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/visitor-keys": "6.9.0", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "dependencies": { - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, - "requires": { - "tslib": "^1.8.1" - } + "requires": {} + }, + "typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "peer": true } } }, + "@typescript-eslint/utils": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.0.tgz", + "integrity": "sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.9.0", + "@typescript-eslint/types": "6.9.0", + "@typescript-eslint/typescript-estree": "6.9.0", + "semver": "^7.5.4" + } + }, "@typescript-eslint/visitor-keys": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", - "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz", + "integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.2", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "6.9.0", + "eslint-visitor-keys": "^3.4.1" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } } }, + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", @@ -15305,9 +15813,9 @@ } }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true }, "acorn-jsx": { @@ -15732,12 +16240,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -15803,28 +16305,6 @@ "proxy-from-env": "^1.1.0" } }, - "babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, "bach": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", @@ -16010,6 +16490,19 @@ "to-regex": "^3.0.1" } }, + "browserslist": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "dev": true, + "peer": true, + "requires": { + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.13" + } + }, "buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -16207,6 +16700,13 @@ "quick-lru": "^4.0.1" } }, + "caniuse-lite": { + "version": "1.0.30001554", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz", + "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==", + "dev": true, + "peer": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -16515,9 +17015,9 @@ "dev": true }, "comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.0.tgz", + "integrity": "sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==", "dev": true }, "common-ancestor-path": { @@ -17163,6 +17663,13 @@ "jake": "^10.8.5" } }, + "electron-to-chromium": { + "version": "1.4.567", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.567.tgz", + "integrity": "sha512-8KR114CAYQ4/r5EIEsOmOMqQ9j0MRbJZR3aXD/KFA8RuKzyoUB4XrUCg+l8RUGqTVQgKNIgTpjaG8YHRPAbX2w==", + "dev": true, + "peer": true + }, "email-addresses": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", @@ -17299,62 +17806,51 @@ "dev": true }, "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -17364,6 +17860,12 @@ "color-convert": "^2.0.1" } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -17395,19 +17897,45 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true }, - "globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "type-fest": "^0.20.2" + "is-glob": "^4.0.3" } }, "has-flag": { @@ -17416,11 +17944,50 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } }, "supports-color": { "version": "7.2.0", @@ -17430,12 +17997,6 @@ "requires": { "has-flag": "^4.0.0" } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true } } }, @@ -17446,20 +18007,27 @@ "dev": true, "requires": {} }, + "eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "requires": {} + }, "eslint-plugin-jsdoc": { - "version": "46.4.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.4.3.tgz", - "integrity": "sha512-Prc7ol+vCIghPeECpwZq5+P+VZfoi87suywvbYCiCnkI1kTmVSdcOC2M8mioglWxBbd28wbb1OVjg/8OzGzatA==", + "version": "46.8.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz", + "integrity": "sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==", "dev": true, "requires": { - "@es-joy/jsdoccomment": "~0.39.4", + "@es-joy/jsdoccomment": "~0.40.1", "are-docs-informative": "^0.0.2", - "comment-parser": "1.3.1", + "comment-parser": "1.4.0", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "esquery": "^1.5.0", "is-builtin-module": "^3.2.1", - "semver": "^7.5.1", + "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1" }, "dependencies": { @@ -17481,44 +18049,27 @@ "estraverse": "^4.1.1" } }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, "eslint-visitor-keys": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", - "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "dependencies": { "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true } } @@ -17801,7 +18352,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fastq": { @@ -18169,12 +18720,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "gauge": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", @@ -18204,6 +18749,13 @@ "node-fetch": "^2.3.0" } }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "peer": true + }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -18583,10 +19135,21 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } }, "globby": { "version": "11.1.0", @@ -18657,6 +19220,12 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "gulp": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", @@ -18987,9 +19556,9 @@ "dev": true }, "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, "ignore-walk": { @@ -19432,6 +20001,12 @@ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -19647,7 +20222,8 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true + "dev": true, + "peer": true }, "json-buffer": { "version": "3.0.0", @@ -20351,12 +20927,6 @@ "lodash._reinterpolate": "^3.0.0" } }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -21236,6 +21806,13 @@ "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", "dev": true }, + "node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true, + "peer": true + }, "nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -21920,17 +22497,17 @@ "dev": true }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" } }, "ora": { @@ -22366,6 +22943,13 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true, + "peer": true + }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -22451,6 +23035,12 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true + }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -22469,12 +23059,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "promise-all-reject-late": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", @@ -23035,12 +23619,6 @@ } } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "registry-auth-token": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", @@ -23121,12 +23699,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", @@ -23304,9 +23876,9 @@ "dev": true }, "semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -23422,43 +23994,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -23910,39 +24445,6 @@ "es6-symbol": "^3.1.1" } }, - "table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", - "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, "tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -24056,7 +24558,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true + "dev": true, + "peer": true }, "to-object-path": { "version": "0.3.0", @@ -24230,12 +24733,6 @@ } } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -24421,6 +24918,17 @@ "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, + "update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "peer": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -24633,12 +25141,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -24991,6 +25493,12 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index 0a24512ccd..1ca0ac8723 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ "deploy:prepare:plugins": "npm run clean && lerna run build && lerna run predeploy", "deploy": "npm run deploy:prepare && gulp deploy", "deploy:upstream": "npm run deploy:prepare && gulp deployUpstream", + "format": "prettier --write .", + "format:check": "prettier --check .", "license": "gulp checkLicenses", - "lint": "lerna run lint --no-bail", - "lint:fix": "lerna run lint -- -- --fix", + "lint": "eslint .", + "lint:fix": "eslint . --fix", "postinstall": "npm run boot", "test": "lerna run test", "publish:prepare": "gulp prepareForPublish", @@ -29,23 +31,29 @@ "test:ghpages": "gulp testGhPages" }, "devDependencies": { - "@blockly/eslint-config": "^3.0.0", + "@babel/eslint-parser": "^7.22.15", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.49.0", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "@typescript-eslint/parser": "^6.7.2", "conventional-changelog-conventionalcommits": "^5.0.0", - "eslint": "^7.15.0", + "eslint": "^8.49.0", + "eslint-config-google": "^0.14.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-jsdoc": "^46.8.2", "gh-pages": "^3.1.0", + "globals": "^13.22.0", "gulp": "^4.0.2", "gulp-header": "^2.0.9", "http-server": "^14.1.1", "js-green-licenses": "^1.1.0", "lerna": "^6.5.1", + "prettier": "^3.0.3", "rimraf": "^3.0.2", "showdown": "^2.1.0" }, "publishConfig": { "access": "public", "registry": "https://wombat-dressing-room.appspot.com" - }, - "eslintConfig": { - "extends": "@blockly/eslint-config" } } diff --git a/plugins/README.md b/plugins/README.md index a6a24e8c04..42c9d1e19a 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -2,116 +2,116 @@ This directory is where [Blockly](http://github.com/google/blockly) plugins are authored and stored. These plugin packages are released to npm under the -``@blockly`` scope. +`@blockly` scope. -A full list of published packages can be found by searching for the ``@blockly`` +A full list of published packages can be found by searching for the `@blockly` tag on [npm](https://www.npmjs.com/search?q=%40blockly). ## Plugins ### Fields -- [``@blockly/field-bitmap``](field-bitmap/): A Blockly field that allows for -user-inputted pixel grids. -- [``@blockly/field-colour-hsv-sliders``](field-colour-hsv-sliders/): A colour -picker field that uses HSV sliders. -- [``@blockly/field-date``](field-date/): A date picker field that uses the -Google Closure date picker. -- [``@blockly/field-dependent-dropdown``](field-dependent-dropdown/): A dropdown -field where the available options depend on the value of a parent field. -- [``@blockly/field-grid-dropdown``](field-grid-dropdown/): A Blockly dropdown -field with grid layout. -- [``@blockly/field-slider``](field-slider/): A slider field. +- [`@blockly/field-bitmap`](field-bitmap/): A Blockly field that allows for + user-inputted pixel grids. +- [`@blockly/field-colour-hsv-sliders`](field-colour-hsv-sliders/): A colour + picker field that uses HSV sliders. +- [`@blockly/field-date`](field-date/): A date picker field that uses the + Google Closure date picker. +- [`@blockly/field-dependent-dropdown`](field-dependent-dropdown/): A dropdown + field where the available options depend on the value of a parent field. +- [`@blockly/field-grid-dropdown`](field-grid-dropdown/): A Blockly dropdown + field with grid layout. +- [`@blockly/field-slider`](field-slider/): A slider field. ### Blocks -- [``@blockly/block-plus-minus``](block-plus-minus/): A group of blocks that -replace the built-in mutator UI with a +/- based UI. -- [``@blockly/block-dynamic-connection``](block-dynamic-connection/): A group of -blocks that add connections dynamically. -- [``@blockly-block-shareable-procedures``](block-shareable-procedures): A group -of blocks that replace the built-in procedures with ones that can be shared -between workspaces. -- [``@blockly/block-test``](block-test/): A group of Blockly test blocks. -- [``@blockly/renderer-inline-row-separators``](renderer-inline-row-separators/): -A renderer that allows putting inline value input connectors on separate rows, -and blocks that demonstrate the feature. +- [`@blockly/block-plus-minus`](block-plus-minus/): A group of blocks that + replace the built-in mutator UI with a +/- based UI. +- [`@blockly/block-dynamic-connection`](block-dynamic-connection/): A group of + blocks that add connections dynamically. +- [`@blockly-block-shareable-procedures`](block-shareable-procedures): A group + of blocks that replace the built-in procedures with ones that can be shared + between workspaces. +- [`@blockly/block-test`](block-test/): A group of Blockly test blocks. +- [`@blockly/renderer-inline-row-separators`](renderer-inline-row-separators/): + A renderer that allows putting inline value input connectors on separate rows, + and blocks that demonstrate the feature. ### Dev -- [``@blockly/create-package``](dev-create/): A tool for creating a Blockly -plugin based on a pre-existing template. -- [``@blockly/migrate``](migration/): A tool for migrating apps built on Blockly -to newer versions of Blockly that make breaking changes. -- [``@blockly/eslint-config``](eslint-config/): ESlint configuration used by -Blockly plugins. -- [``@blockly/dev-tool``](dev-tools/): A library of common utilities for Blockly -plugin development. -- [``@blockly/dev-scripts``](dev-scripts/): Configuration and scripts for Blockly -plugins. +- [`@blockly/create-package`](dev-create/): A tool for creating a Blockly + plugin based on a pre-existing template. +- [`@blockly/migrate`](migration/): A tool for migrating apps built on Blockly + to newer versions of Blockly that make breaking changes. +- [`@blockly/eslint-config`](eslint-config/): ESlint configuration used by + Blockly plugins. +- [`@blockly/dev-tool`](dev-tools/): A library of common utilities for Blockly + plugin development. +- [`@blockly/dev-scripts`](dev-scripts/): Configuration and scripts for Blockly + plugins. ### Themes -- [``@blockly/theme-modern``](theme-modern/): A Blockly modern theme. -- [``@blockly/theme-dark``](theme-dark/): A Blockly dark theme. -- [``@blockly/theme-highcontrast``](theme-highcontrast/): A Blockly high -contrast theme. -- [``@blockly/theme-deuteranopia``](theme-deuteranopia/): A Blockly theme for -people who have deuteranopia. -- [``@blockly/theme-tritanopia``](theme-tritanopia/): A Blockly theme for people -who have tritanopia. +- [`@blockly/theme-modern`](theme-modern/): A Blockly modern theme. +- [`@blockly/theme-dark`](theme-dark/): A Blockly dark theme. +- [`@blockly/theme-highcontrast`](theme-highcontrast/): A Blockly high + contrast theme. +- [`@blockly/theme-deuteranopia`](theme-deuteranopia/): A Blockly theme for + people who have deuteranopia. +- [`@blockly/theme-tritanopia`](theme-tritanopia/): A Blockly theme for people + who have tritanopia. ### Workspace -- [``@blockly/continuous-toolbox``](continuous-toolbox/): A Blockly plugin -that adds a continous-scrolling style toolbox and flyout. -- [``@blockly/workspace-content-highlight``](content-highlight/): A Blockly -plugin that highlights the content on the workspace. -- [``@blockly/disable-top-blocks``](disable-top-blocks/): A Blockly plugin that -shows the 'disable' context menu option only on non-orphan blocks. -- [``@blockly/fixed-edges``](fixed-edges/): A Blockly MetricsManager for -configuring fixed sides. -- [``@blockly/keyboard-navigation``](keyboard-navigation/): A Blockly plugin -that adds keyboard navigation support. -- [``@blockly/plugin-strict-connection-checker``](strict-connection-checker/): A -Blockly plugin that makes connection checks strict. -- [``@blockly/plugin-workspace-search``](workspace-search/): A plugin that adds -workspace search support. -- [``@blockly/zoom-to-fit``](zoom-to-fit/): A Blockly plugin that adds a -zoom-to-fit control to the workspace. -- [``@blockly/plugin-scroll-options``](scroll-options/): A Blockly plugin that -adds additional scrolling features. -- [``@blockly/plugin-cross-tab-copy-paste``](cross-tab-copy-paste/): A Blockly plugin -that allows a user to copy and paste blocks between tabs. -- [``@blockly/shadow-block-converter``](shadow-block-converter/): A Blockly plugin -that automatically converts shadow blocks to real blocks when the user edits them. -- [``@blockly/workspace-backpack``](workspace-backpack/): A Blockly plugin that -adds Backpack support. -- [``@blockly/workspace-minimap``](workspace-minimap/): A Blockly plugin that -adds a minimap of the workspace to the workspace. (private; in development) +- [`@blockly/continuous-toolbox`](continuous-toolbox/): A Blockly plugin + that adds a continous-scrolling style toolbox and flyout. +- [`@blockly/workspace-content-highlight`](content-highlight/): A Blockly + plugin that highlights the content on the workspace. +- [`@blockly/disable-top-blocks`](disable-top-blocks/): A Blockly plugin that + shows the 'disable' context menu option only on non-orphan blocks. +- [`@blockly/fixed-edges`](fixed-edges/): A Blockly MetricsManager for + configuring fixed sides. +- [`@blockly/keyboard-navigation`](keyboard-navigation/): A Blockly plugin + that adds keyboard navigation support. +- [`@blockly/plugin-strict-connection-checker`](strict-connection-checker/): A + Blockly plugin that makes connection checks strict. +- [`@blockly/plugin-workspace-search`](workspace-search/): A plugin that adds + workspace search support. +- [`@blockly/zoom-to-fit`](zoom-to-fit/): A Blockly plugin that adds a + zoom-to-fit control to the workspace. +- [`@blockly/plugin-scroll-options`](scroll-options/): A Blockly plugin that + adds additional scrolling features. +- [`@blockly/plugin-cross-tab-copy-paste`](cross-tab-copy-paste/): A Blockly plugin + that allows a user to copy and paste blocks between tabs. +- [`@blockly/shadow-block-converter`](shadow-block-converter/): A Blockly plugin + that automatically converts shadow blocks to real blocks when the user edits them. +- [`@blockly/workspace-backpack`](workspace-backpack/): A Blockly plugin that + adds Backpack support. +- [`@blockly/workspace-minimap`](workspace-minimap/): A Blockly plugin that + adds a minimap of the workspace to the workspace. (private; in development) ### Serializers -- [``@blockly/serialize-disabled-interactions``](serialize-disabled-interactions/): A serializer that serializes movable, deltable, and editable attributes. +- [`@blockly/serialize-disabled-interactions`](serialize-disabled-interactions/): A serializer that serializes movable, deltable, and editable attributes. ### Toolbox -- [``@blockly/toolbox-search``](toolbox-search/): A toolbox category that provides a -search field to filter the available blocks in the toolbox. +- [`@blockly/toolbox-search`](toolbox-search/): A toolbox category that provides a + search field to filter the available blocks in the toolbox. ### Other -- [``@blockly/plugin-modal``](modal/): A Blockly plugin that creates a modal. -- [``@blockly/plugin-typed-variable-modal``](typed-variable-modal/): A plugin to -create a modal for creating typed variables. +- [`@blockly/plugin-modal`](modal/): A Blockly plugin that creates a modal. +- [`@blockly/plugin-typed-variable-modal`](typed-variable-modal/): A plugin to + create a modal for creating typed variables. ## Using Lerna [Lerna](https://lerna.js.org/) is being used to manage all the packages released -under the ``@blockly`` npm scope. +under the `@blockly` npm scope. When you first check out the repo, or if additional packages are added, run -``npm run boot`` from the project root to bootstrap all packages. +`npm run boot` from the project root to bootstrap all packages. -Once you've bootstrapped the packages, you no longer need to run ``npm install`` +Once you've bootstrapped the packages, you no longer need to run `npm install` in each of the packages. diff --git a/plugins/block-dynamic-connection/README.md b/plugins/block-dynamic-connection/README.md index b40993d403..6fb7f62d7b 100644 --- a/plugins/block-dynamic-connection/README.md +++ b/plugins/block-dynamic-connection/README.md @@ -4,6 +4,7 @@ A group of [Blockly](https://www.npmjs.com/package/blockly) blocks that add and remove connections dynamically. ## Installation + ``` npm install @blockly/block-dynamic-connection --save ``` @@ -16,16 +17,17 @@ import * as BlockDynamicConnection from '@blockly/block-dynamic-connection'; ``` ## API + - `overrideOldBlockDefinitions`: Replaces the Blockly default blocks with the dynamic connection blocks. This enables projects to use the dynamic block plugin without changing existing XML/JSON. - ## Blocks -* `dynamic_text_join` replaces `text_join` -* `dynamic_list_create` replaces `lists_create_with` -* `dynamic_if` replaces `controls_if` +- `dynamic_text_join` replaces `text_join` +- `dynamic_list_create` replaces `lists_create_with` +- `dynamic_if` replaces `controls_if` ## License + Apache 2.0 diff --git a/plugins/block-dynamic-connection/package.json b/plugins/block-dynamic-connection/package.json index a69033d41f..048d77e314 100644 --- a/plugins/block-dynamic-connection/package.json +++ b/plugins/block-dynamic-connection/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "prepublishOnly": "npm run clean && npm run build", "predeploy": "npm run build && blockly-scripts predeploy", "start": "blockly-scripts start", @@ -54,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/block-dynamic-connection/src/dynamic_if.ts b/plugins/block-dynamic-connection/src/dynamic_if.ts index 6406b5dad0..22a1541fc4 100644 --- a/plugins/block-dynamic-connection/src/dynamic_if.ts +++ b/plugins/block-dynamic-connection/src/dynamic_if.ts @@ -66,7 +66,7 @@ const DYNAMIC_IF_MIXIN = { * Create XML to represent if/elseif/else inputs. * @returns XML storage element. */ - mutationToDom(this: DynamicIfBlock): Element|null { + mutationToDom(this: DynamicIfBlock): Element | null { // If we call finalizeConnections here without disabling events, we get into // an event loop. Blockly.Events.disable(); @@ -114,17 +114,19 @@ const DYNAMIC_IF_MIXIN = { } const first = inputNumbers[0]; this.appendValueInput('IF' + first) - .setCheck('Boolean') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_IF'], 'if'); - this.appendStatementInput('DO' + first) - .appendField(Blockly.Msg['CONTROLS_IF_MSG_THEN']); + .setCheck('Boolean') + .appendField(Blockly.Msg['CONTROLS_IF_MSG_IF'], 'if'); + this.appendStatementInput('DO' + first).appendField( + Blockly.Msg['CONTROLS_IF_MSG_THEN'], + ); for (let i = 1; i < inputNumbers.length; i++) { this.appendValueInput('IF' + inputNumbers[i]) - .setCheck('Boolean') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF'], 'elseif'); - this.appendStatementInput('DO' + inputNumbers[i]) - .appendField(Blockly.Msg['CONTROLS_IF_MSG_THEN']); + .setCheck('Boolean') + .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF'], 'elseif'); + this.appendStatementInput('DO' + inputNumbers[i]).appendField( + Blockly.Msg['CONTROLS_IF_MSG_THEN'], + ); } } const hasElse = xmlElement.getAttribute('else'); @@ -138,8 +140,8 @@ const DYNAMIC_IF_MIXIN = { * @param xmlElement XML storage element. */ deserializeCounts(this: DynamicIfBlock, xmlElement: Element): void { - this.elseifCount = parseInt( - xmlElement.getAttribute('elseif') ?? '0', 10) || 0; + this.elseifCount = + parseInt(xmlElement.getAttribute('elseif') ?? '0', 10) || 0; this.elseCount = parseInt(xmlElement.getAttribute('else') ?? '0', 10) || 0; for (let i = 1; i <= this.elseifCount; i++) { this.insertElseIf(this.inputList.length, i); @@ -153,7 +155,7 @@ const DYNAMIC_IF_MIXIN = { * Returns the state of this block as a JSON serializable object. * @returns The state of this block, ie the else if count and else state. */ - saveExtraState: function(this: DynamicIfBlock): IfExtraState | null { + saveExtraState: function (this: DynamicIfBlock): IfExtraState | null { // If we call finalizeConnections here without disabling events, we get into // an event loop. Blockly.Events.disable(); @@ -179,7 +181,10 @@ const DYNAMIC_IF_MIXIN = { * @param state The state to apply to this block, ie the else if count * and else state. */ - loadExtraState: function(this: DynamicIfBlock, state: IfExtraState | string) { + loadExtraState: function ( + this: DynamicIfBlock, + state: IfExtraState | string, + ) { if (typeof state === 'string') { this.domToMutation(Blockly.utils.xml.textToDom(state)); return; @@ -202,7 +207,9 @@ const DYNAMIC_IF_MIXIN = { * @returns The index of the connection in the this.inputList. */ findInputIndexForConnection( - this: DynamicIfBlock, connection: Blockly.Connection): number | null { + this: DynamicIfBlock, + connection: Blockly.Connection, + ): number | null { for (let i = 0; i < this.inputList.length; i++) { const input = this.inputList[i]; if (input.connection == connection) { @@ -220,13 +227,16 @@ const DYNAMIC_IF_MIXIN = { * @returns The added inputs. */ insertElseIf( - this: DynamicIfBlock, index: number, id: string | number + this: DynamicIfBlock, + index: number, + id: string | number, ): CaseInputPair { const ifInput = this.appendValueInput('IF' + id) - .setCheck('Boolean') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF'], 'elseif'); - const doInput = this.appendStatementInput('DO' + id) - .appendField(Blockly.Msg['CONTROLS_IF_MSG_THEN']); + .setCheck('Boolean') + .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF'], 'elseif'); + const doInput = this.appendStatementInput('DO' + id).appendField( + Blockly.Msg['CONTROLS_IF_MSG_THEN'], + ); this.moveInputBefore('IF' + id, this.inputList[index].name); this.moveInputBefore('DO' + id, this.inputList[index + 1].name); return {ifInput, doInput}; @@ -239,7 +249,9 @@ const DYNAMIC_IF_MIXIN = { * connection. */ onPendingConnection( - this: DynamicIfBlock, connection: Blockly.Connection): void { + this: DynamicIfBlock, + connection: Blockly.Connection, + ): void { if (connection.type === Blockly.NEXT_STATEMENT && !this.getInput('ELSE')) { this.addElseInput(); } @@ -254,9 +266,9 @@ const DYNAMIC_IF_MIXIN = { this.insertElseIf(inputIndex + 2, Blockly.utils.idGenerator.genUid()); } else { const nextIfConnection = - nextIfInput && - nextIfInput.connection && - nextIfInput.connection.targetConnection; + nextIfInput && + nextIfInput.connection && + nextIfInput.connection.targetConnection; if ( nextIfConnection && !nextIfConnection.getSourceBlock().isInsertionMarker() @@ -297,10 +309,8 @@ const DYNAMIC_IF_MIXIN = { collectTargetCaseConns(this: DynamicIfBlock): CaseConnectionPair[] { const targetConns = []; for (let i = 0; i < this.inputList.length - 1; i += 2) { - const ifTarget = - this.inputList[i].connection?.targetConnection; - const doTarget = - this.inputList[i + 1].connection?.targetConnection; + const ifTarget = this.inputList[i].connection?.targetConnection; + const doTarget = this.inputList[i + 1].connection?.targetConnection; if (!ifTarget && !doTarget) continue; targetConns.push({ifTarget, doTarget}); } @@ -341,8 +351,9 @@ const DYNAMIC_IF_MIXIN = { * @returns The appended input. */ addElseInput(this: DynamicIfBlock): Blockly.Input { - return this.appendStatementInput('ELSE') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSE']); + return this.appendStatementInput('ELSE').appendField( + Blockly.Msg['CONTROLS_IF_MSG_ELSE'], + ); }, /** @@ -351,10 +362,11 @@ const DYNAMIC_IF_MIXIN = { */ addFirstCase(this: DynamicIfBlock): void { this.appendValueInput('IF0') - .setCheck('Boolean') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_IF'], 'if'); - this.appendStatementInput('DO0') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_THEN']); + .setCheck('Boolean') + .appendField(Blockly.Msg['CONTROLS_IF_MSG_IF'], 'if'); + this.appendStatementInput('DO0').appendField( + Blockly.Msg['CONTROLS_IF_MSG_THEN'], + ); }, }; diff --git a/plugins/block-dynamic-connection/src/dynamic_list_create.ts b/plugins/block-dynamic-connection/src/dynamic_list_create.ts index 7d75770c5e..a485983dd4 100644 --- a/plugins/block-dynamic-connection/src/dynamic_list_create.ts +++ b/plugins/block-dynamic-connection/src/dynamic_list_create.ts @@ -81,8 +81,9 @@ const DYNAMIC_LIST_CREATE_MIXIN = { const inputNames = items.split(','); this.inputList = []; inputNames.forEach((name) => this.appendValueInput(name)); - this.inputList[0] - .appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); + this.inputList[0].appendField( + Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH'], + ); } }, @@ -92,7 +93,9 @@ const DYNAMIC_LIST_CREATE_MIXIN = { */ deserializeCounts(this: DynamicListCreateBlock, xmlElement: Element): void { this.itemCount = Math.max( - parseInt(xmlElement.getAttribute('items') ?? '0', 10), this.minInputs); + parseInt(xmlElement.getAttribute('items') ?? '0', 10), + this.minInputs, + ); // minInputs are added automatically. for (let i = this.minInputs; i < this.itemCount; i++) { this.appendValueInput('ADD' + i); @@ -103,7 +106,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * Returns the state of this block as a JSON serializable object. * @returns The state of this block, ie the item count. */ - saveExtraState: function(this: DynamicListCreateBlock): {itemCount: number} { + saveExtraState: function (this: DynamicListCreateBlock): {itemCount: number} { // If we call finalizeConnections here without disabling events, we get into // an event loop. Blockly.Events.disable(); @@ -120,8 +123,10 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * Applies the given state to this block. * @param state The state to apply to this block, ie the item count. */ - loadExtraState: function( - this: DynamicListCreateBlock, state: ({[x: string]: any} | string)) { + loadExtraState: function ( + this: DynamicListCreateBlock, + state: {[x: string]: any} | string, + ) { if (typeof state === 'string') { this.domToMutation(Blockly.utils.xml.textToDom(state)); return; @@ -141,8 +146,9 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * should be added. */ findInputIndexForConnection( - this: DynamicListCreateBlock, - connection: Blockly.Connection): number | null { + this: DynamicListCreateBlock, + connection: Blockly.Connection, + ): number | null { if (!connection.targetConnection) { // this connection is available return null; @@ -163,8 +169,10 @@ const DYNAMIC_LIST_CREATE_MIXIN = { const nextInput = this.inputList[connectionIndex + 1]; const nextConnection = nextInput?.connection?.targetConnection; - if (nextConnection && - !nextConnection.getSourceBlock().isInsertionMarker()) { + if ( + nextConnection && + !nextConnection.getSourceBlock().isInsertionMarker() + ) { return connectionIndex + 1; } @@ -179,7 +187,9 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * connection. */ onPendingConnection( - this: DynamicListCreateBlock, connection: Blockly.Connection): void { + this: DynamicListCreateBlock, + connection: Blockly.Connection, + ): void { const insertIndex = this.findInputIndexForConnection(connection); if (insertIndex == null) { return; @@ -193,9 +203,9 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * drag ends if the dragged block had a pending connection with this block. */ finalizeConnections(this: DynamicListCreateBlock): void { - const targetConns = - this.removeUnnecessaryEmptyConns( - this.inputList.map((i) => i.connection?.targetConnection)); + const targetConns = this.removeUnnecessaryEmptyConns( + this.inputList.map((i) => i.connection?.targetConnection), + ); this.tearDownBlock(); this.addItemInputs(targetConns); this.itemCount = targetConns.length; @@ -217,7 +227,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * be attached to inputs. */ removeUnnecessaryEmptyConns( - targetConns: Array + targetConns: Array, ): Array { const filteredConns = [...targetConns]; for (let i = filteredConns.length - 1; i >= 0; i--) { @@ -236,8 +246,8 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * @param targetConns The connections defining the inputs to add. */ addItemInputs( - this: DynamicListCreateBlock, - targetConns: Array, + this: DynamicListCreateBlock, + targetConns: Array, ): void { const input = this.addFirstInput(); const firstConn = targetConns[0]; @@ -256,8 +266,9 @@ const DYNAMIC_LIST_CREATE_MIXIN = { * @returns The added input. */ addFirstInput(this: DynamicListCreateBlock): Blockly.Input { - return this.appendValueInput('ADD0') - .appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); + return this.appendValueInput('ADD0').appendField( + Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH'], + ); }, }; diff --git a/plugins/block-dynamic-connection/src/dynamic_text_join.ts b/plugins/block-dynamic-connection/src/dynamic_text_join.ts index 83cf7a8812..de8b03380b 100644 --- a/plugins/block-dynamic-connection/src/dynamic_text_join.ts +++ b/plugins/block-dynamic-connection/src/dynamic_text_join.ts @@ -79,8 +79,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { const inputNames = items.split(','); this.inputList = []; inputNames.forEach((name) => this.appendValueInput(name)); - this.inputList[0] - .appendField(Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH']); + this.inputList[0].appendField(Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH']); } }, @@ -90,7 +89,9 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { */ deserializeCounts(this: DynamicTextJoinBlock, xmlElement: Element): void { this.itemCount = Math.max( - parseInt(xmlElement.getAttribute('items') ?? '0', 10), this.minInputs); + parseInt(xmlElement.getAttribute('items') ?? '0', 10), + this.minInputs, + ); // minInputs are added automatically. for (let i = this.minInputs; i < this.itemCount; i++) { this.appendValueInput('ADD' + i); @@ -101,7 +102,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * Returns the state of this block as a JSON serializable object. * @returns The state of this block, ie the item count. */ - saveExtraState: function(this: DynamicTextJoinBlock): {itemCount: number} { + saveExtraState: function (this: DynamicTextJoinBlock): {itemCount: number} { // If we call finalizeConnections here without disabling events, we get into // an event loop. Blockly.Events.disable(); @@ -118,8 +119,10 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * Applies the given state to this block. * @param state The state to apply to this block, ie the item count. */ - loadExtraState: function( - this: DynamicTextJoinBlock, state: ({[x: string]: any} | string)) { + loadExtraState: function ( + this: DynamicTextJoinBlock, + state: {[x: string]: any} | string, + ) { if (typeof state === 'string') { this.domToMutation(Blockly.utils.xml.textToDom(state)); return; @@ -139,8 +142,9 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * should be added. */ findInputIndexForConnection( - this: DynamicTextJoinBlock, - connection: Blockly.Connection): number | null { + this: DynamicTextJoinBlock, + connection: Blockly.Connection, + ): number | null { if (!connection.targetConnection) { // this connection is available return null; @@ -160,10 +164,11 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { } const nextInput = this.inputList[connectionIndex + 1]; - const nextConnection = - nextInput?.connection?.targetConnection; - if (nextConnection && - !nextConnection.getSourceBlock().isInsertionMarker()) { + const nextConnection = nextInput?.connection?.targetConnection; + if ( + nextConnection && + !nextConnection.getSourceBlock().isInsertionMarker() + ) { return connectionIndex + 1; } @@ -178,7 +183,9 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * connection. */ onPendingConnection( - this: DynamicTextJoinBlock, connection: Blockly.Connection): void { + this: DynamicTextJoinBlock, + connection: Blockly.Connection, + ): void { const insertIndex = this.findInputIndexForConnection(connection); if (insertIndex == null) { return; @@ -192,9 +199,9 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * drag ends if the dragged block had a pending connection with this block. */ finalizeConnections(this: DynamicTextJoinBlock): void { - const targetConns = - this.removeUnnecessaryEmptyConns( - this.inputList.map((i) => i.connection?.targetConnection)); + const targetConns = this.removeUnnecessaryEmptyConns( + this.inputList.map((i) => i.connection?.targetConnection), + ); this.tearDownBlock(); this.addItemInputs(targetConns); this.itemCount = targetConns.length; @@ -216,8 +223,8 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * be attached to inputs. */ removeUnnecessaryEmptyConns( - this: DynamicTextJoinBlock, - targetConns: Array + this: DynamicTextJoinBlock, + targetConns: Array, ): Array { const filteredConns = [...targetConns]; for (let i = filteredConns.length - 1; i >= 0; i--) { @@ -236,8 +243,8 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * @param targetConns The connections defining the inputs to add. */ addItemInputs( - this: DynamicTextJoinBlock, - targetConns: Array, + this: DynamicTextJoinBlock, + targetConns: Array, ): void { const input = this.addFirstInput(); const firstConn = targetConns[0]; @@ -256,8 +263,9 @@ const DYNAMIC_TEXT_JOIN_MIXIN = { * @returns The added input. */ addFirstInput(this: DynamicTextJoinBlock): Blockly.Input { - return this.appendValueInput('ADD0') - .appendField(Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH']); + return this.appendValueInput('ADD0').appendField( + Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH'], + ); }, }; diff --git a/plugins/block-dynamic-connection/src/index.ts b/plugins/block-dynamic-connection/src/index.ts index fe93f39b61..7c1c1733f6 100644 --- a/plugins/block-dynamic-connection/src/index.ts +++ b/plugins/block-dynamic-connection/src/index.ts @@ -15,7 +15,7 @@ import './dynamic_if'; import './dynamic_text_join'; import './dynamic_list_create'; -export const overrideOldBlockDefinitions = function(): void { +export const overrideOldBlockDefinitions = function (): void { Blockly.Blocks['lists_create_with'] = Blockly.Blocks['dynamic_list_create']; Blockly.Blocks['text_join'] = Blockly.Blocks['dynamic_text_join']; Blockly.Blocks['controls_if'] = Blockly.Blocks['dynamic_if']; diff --git a/plugins/block-dynamic-connection/src/insertion_marker_manager_monkey_patch.ts b/plugins/block-dynamic-connection/src/insertion_marker_manager_monkey_patch.ts index 83afb1c320..d1a3eb9334 100644 --- a/plugins/block-dynamic-connection/src/insertion_marker_manager_monkey_patch.ts +++ b/plugins/block-dynamic-connection/src/insertion_marker_manager_monkey_patch.ts @@ -16,7 +16,7 @@ import * as Blockly from 'blockly/core'; // MonkeyPatchedInsertionMarkerManager overrides the update and dispose methods, // and adds a new property called pendingBlocks. interface MonkeyPatchedInsertionMarkerManager - extends Blockly.InsertionMarkerManager { + extends Blockly.InsertionMarkerManager { pendingBlocks: Set; } @@ -31,46 +31,48 @@ interface DynamicBlock extends Blockly.Block { // Hack: Private methods of InsertionMarkerManager are called using the array // index syntax, bypassing access checking. The private methods are also missing // type information in the d.ts files and are considered to return any here. -Blockly.InsertionMarkerManager.prototype.update = - function( - this: MonkeyPatchedInsertionMarkerManager, - dxy: Blockly.utils.Coordinate, - dragTarget: Blockly.IDragTarget | null): void { - const newCandidate = this['getCandidate'](dxy); +Blockly.InsertionMarkerManager.prototype.update = function ( + this: MonkeyPatchedInsertionMarkerManager, + dxy: Blockly.utils.Coordinate, + dragTarget: Blockly.IDragTarget | null, +): void { + const newCandidate = this['getCandidate'](dxy); - this.wouldDeleteBlock = this['shouldDelete'](!!newCandidate, dragTarget); + this.wouldDeleteBlock = this['shouldDelete'](!!newCandidate, dragTarget); - const shouldUpdate: boolean = this.wouldDeleteBlock || - this['shouldUpdatePreviews'](newCandidate, dxy); + const shouldUpdate: boolean = + this.wouldDeleteBlock || this['shouldUpdatePreviews'](newCandidate, dxy); - if (shouldUpdate) { - // Begin monkey patch - if (newCandidate?.closest?.sourceBlock_.onPendingConnection) { - newCandidate.closest.sourceBlock_ - .onPendingConnection(newCandidate.closest); - if (!this.pendingBlocks) { - this.pendingBlocks = new Set(); - } - this.pendingBlocks.add(newCandidate.closest.sourceBlock_); - } - // End monkey patch - // Don't fire events for insertion marker creation or movement. - Blockly.Events.disable(); - this['maybeHidePreview'](newCandidate); - this['maybeShowPreview'](newCandidate); - Blockly.Events.enable(); + if (shouldUpdate) { + // Begin monkey patch + if (newCandidate?.closest?.sourceBlock_.onPendingConnection) { + newCandidate.closest.sourceBlock_.onPendingConnection( + newCandidate.closest, + ); + if (!this.pendingBlocks) { + this.pendingBlocks = new Set(); } - }; + this.pendingBlocks.add(newCandidate.closest.sourceBlock_); + } + // End monkey patch + // Don't fire events for insertion marker creation or movement. + Blockly.Events.disable(); + this['maybeHidePreview'](newCandidate); + this['maybeShowPreview'](newCandidate); + Blockly.Events.enable(); + } +}; const oldDispose = Blockly.InsertionMarkerManager.prototype.dispose; -Blockly.InsertionMarkerManager.prototype.dispose = - function(this: MonkeyPatchedInsertionMarkerManager) { - if (this.pendingBlocks) { - this.pendingBlocks.forEach((block) => { - if ((block as DynamicBlock).finalizeConnections) { - (block as DynamicBlock).finalizeConnections(); - } - }); +Blockly.InsertionMarkerManager.prototype.dispose = function ( + this: MonkeyPatchedInsertionMarkerManager, +) { + if (this.pendingBlocks) { + this.pendingBlocks.forEach((block) => { + if ((block as DynamicBlock).finalizeConnections) { + (block as DynamicBlock).finalizeConnections(); } - oldDispose.call(this); - }; + }); + } + oldDispose.call(this); +}; diff --git a/plugins/block-dynamic-connection/test/dynamic_if.mocha.js b/plugins/block-dynamic-connection/test/dynamic_if.mocha.js index 9dfb5cfd34..67b3872678 100644 --- a/plugins/block-dynamic-connection/test/dynamic_if.mocha.js +++ b/plugins/block-dynamic-connection/test/dynamic_if.mocha.js @@ -11,7 +11,7 @@ const {overrideOldBlockDefinitions} = require('../src/index'); const assert = chai.assert; -suite('If block', function() { +suite('If block', function () { /** * Asserts that the if block has the expected inputs. * @param {!Blockly.Block} block The block to check. @@ -51,22 +51,22 @@ suite('If block', function() { connection.connect(targetConnection); } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); overrideOldBlockDefinitions(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Creation', function() { + test('Creation', function () { const block = this.workspace.newBlock('dynamic_if'); assertBlockStructure(block, [/IF0/, /DO0/]); }); - suite('adding inputs', function() { - test('attaching the first predicate does not create a case', function() { + suite('adding inputs', function () { + test('attaching the first predicate does not create a case', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('IF0').connection; @@ -75,7 +75,7 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/]); }); - test('attaching the second predicate creates a case', function() { + test('attaching the second predicate creates a case', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('IF0').connection; connectBooleanBlockToConnection(this.workspace, connection); @@ -85,7 +85,7 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/, /IF.*/, /DO.*/]); }); - test('attaching the first statement creates an else', function() { + test('attaching the first statement creates an else', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('DO0').connection; @@ -94,7 +94,7 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/, /ELSE/]); }); - test('attaching the second statement creates an else', function() { + test('attaching the second statement creates an else', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('DO0').connection; connectStatementBlockToConnection(this.workspace, connection); @@ -104,7 +104,7 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/, /ELSE/]); }); - test('attaching to the next connection creates an else', function() { + test('attaching to the next connection creates an else', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.nextConnection; @@ -114,8 +114,8 @@ suite('If block', function() { }); }); - suite('finalizing inputs', function() { - test('the block does not go below one case', function() { + suite('finalizing inputs', function () { + test('the block does not go below one case', function () { const block = this.workspace.newBlock('dynamic_if'); block.finalizeConnections(); @@ -123,7 +123,7 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/]); }); - test('a case with no blocks is removed', function() { + test('a case with no blocks is removed', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('IF0').connection; connectBooleanBlockToConnection(this.workspace, connection); @@ -134,48 +134,56 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/]); }); - test('a case with a predicate and statements is kept', function() { + test('a case with a predicate and statements is kept', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('IF0').connection; connectBooleanBlockToConnection(this.workspace, connection); block.onPendingConnection(connection); connectBooleanBlockToConnection( - this.workspace, block.inputList[2].connection); + this.workspace, + block.inputList[2].connection, + ); connectStatementBlockToConnection( - this.workspace, block.inputList[3].connection); + this.workspace, + block.inputList[3].connection, + ); block.finalizeConnections(); assertBlockStructure(block, [/IF0/, /DO0/, /IF1/, /DO1/]); }); - test('a case with only a predicate is kept', function() { + test('a case with only a predicate is kept', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('IF0').connection; connectBooleanBlockToConnection(this.workspace, connection); block.onPendingConnection(connection); connectBooleanBlockToConnection( - this.workspace, block.inputList[2].connection); + this.workspace, + block.inputList[2].connection, + ); block.finalizeConnections(); assertBlockStructure(block, [/IF0/, /DO0/, /IF1/, /DO1/]); }); - test('a case with only statements is kept', function() { + test('a case with only statements is kept', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('IF0').connection; connectBooleanBlockToConnection(this.workspace, connection); block.onPendingConnection(connection); connectStatementBlockToConnection( - this.workspace, block.inputList[3].connection); + this.workspace, + block.inputList[3].connection, + ); block.finalizeConnections(); assertBlockStructure(block, [/IF0/, /DO0/, /IF1/, /DO1/]); }); - test('an else with no statements is removed', function() { + test('an else with no statements is removed', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('DO0').connection; block.onPendingConnection(connection); @@ -185,12 +193,14 @@ suite('If block', function() { assertBlockStructure(block, [/IF0/, /DO0/]); }); - test('an else with statements is kept', function() { + test('an else with statements is kept', function () { const block = this.workspace.newBlock('dynamic_if'); const connection = block.getInput('DO0').connection; block.onPendingConnection(connection); connectStatementBlockToConnection( - this.workspace, block.getInput('ELSE').connection); + this.workspace, + block.getInput('ELSE').connection, + ); block.finalizeConnections(); @@ -203,9 +213,9 @@ suite('If block', function() { title: 'empty XML', xml: '', expectedXml: - '' + - '', + '' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/IF0/, /DO0/]); }, @@ -213,43 +223,43 @@ suite('If block', function() { { title: 'one if one else - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' TRUE\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' TRUE\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' TRUE\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' TRUE\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/IF0/, /DO0/, /ELSE/]); }, @@ -257,92 +267,99 @@ suite('If block', function() { { title: 'multiple inputs with children - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' TRUE\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' TRUE\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' TRUE\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' TRUE\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' TRUE\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' TRUE\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' TRUE\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' TRUE\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { - assertBlockStructure( - block, [/IF0/, /DO0/, /IF1/, /DO1/, /IF2/, /DO2/, /ELSE/]); + assertBlockStructure(block, [ + /IF0/, + /DO0/, + /IF1/, + /DO1/, + /IF2/, + /DO2/, + /ELSE/, + ]); }, }, { @@ -441,8 +458,7 @@ suite('If block', function() { ' \n' + '', assertBlockStructure: (block) => { - assertBlockStructure( - block, [/IF0/, /DO0/, /IF1/, /DO1/, /IF2/, /DO2/]); + assertBlockStructure(block, [/IF0/, /DO0/, /IF1/, /DO1/, /IF2/, /DO2/]); }, }, { @@ -456,8 +472,7 @@ suite('If block', function() { '', assertBlockStructure: (block) => { - assertBlockStructure( - block, [/IF0/, /DO0/], 'dynamic_if'); + assertBlockStructure(block, [/IF0/, /DO0/], 'dynamic_if'); }, }, { @@ -482,7 +497,10 @@ suite('If block', function() { '', assertBlockStructure: (block) => { assertBlockStructure( - block, [/IF0/, /DO0/, /IF1/, /DO1/, /ELSE/], 'dynamic_if'); + block, + [/IF0/, /DO0/, /IF1/, /DO1/, /ELSE/], + 'dynamic_if', + ); }, }, { @@ -523,7 +541,10 @@ suite('If block', function() { }, assertBlockStructure: (block) => { assertBlockStructure( - block, [/IF0/, /DO0/, /IF1/, /DO1/, /ELSE/], 'dynamic_if'); + block, + [/IF0/, /DO0/, /IF1/, /DO1/, /ELSE/], + 'dynamic_if', + ); }, }, { @@ -532,7 +553,7 @@ suite('If block', function() { 'type': 'dynamic_if', 'id': '1', 'extraState': - '', + '', 'inputs': { 'IF1': { 'block': { @@ -614,9 +635,10 @@ suite('If block', function() { }, assertBlockStructure: (block) => { assertBlockStructure( - block, - [/IF0/, /DO0/, /IF1/, /DO1/, /IF2/, /DO2/, /ELSE/], - 'dynamic_if'); + block, + [/IF0/, /DO0/, /IF1/, /DO1/, /IF2/, /DO2/, /ELSE/], + 'dynamic_if', + ); }, }, ]; diff --git a/plugins/block-dynamic-connection/test/dynamic_list_create.mocha.js b/plugins/block-dynamic-connection/test/dynamic_list_create.mocha.js index 31f9280b8e..d3fbbeeef9 100644 --- a/plugins/block-dynamic-connection/test/dynamic_list_create.mocha.js +++ b/plugins/block-dynamic-connection/test/dynamic_list_create.mocha.js @@ -11,7 +11,7 @@ const {overrideOldBlockDefinitions} = require('../src/index'); const assert = chai.assert; -suite('List create block', function() { +suite('List create block', function () { /** * Asserts that the list create block has the expected inputs. * @param {!Blockly.Block} block The block to check. @@ -19,7 +19,9 @@ suite('List create block', function() { * @type {string=} The block type expected. Defaults to 'dynamic_list_create'. */ function assertBlockStructure( - block, expectedInputs, type = 'dynamic_list_create' + block, + expectedInputs, + type = 'dynamic_list_create', ) { assert.equal(block.type, type); assert.equal(block.inputList.length, expectedInputs.length); @@ -40,7 +42,7 @@ suite('List create block', function() { connection.connect(targetConnection); } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); overrideOldBlockDefinitions(); @@ -53,28 +55,29 @@ suite('List create block', function() { Blockly.Blocks['dynamic_list_5_inputs'] = def5; }); - teardown(function() { + teardown(function () { this.workspace.dispose(); delete Blockly.Blocks['dynamic_list_5_inputs']; }); - suite('Creation', function() { - test('the default definition has two inputs', function() { + suite('Creation', function () { + test('the default definition has two inputs', function () { const block = this.workspace.newBlock('dynamic_list_create'); assertBlockStructure(block, [/ADD0/, /ADD1/]); }); - test('minInputs controls the number of inputs', function() { + test('minInputs controls the number of inputs', function () { const block = this.workspace.newBlock('dynamic_list_5_inputs'); assertBlockStructure( - block, - [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], - 'dynamic_list_5_inputs'); + block, + [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], + 'dynamic_list_5_inputs', + ); }); }); - suite('adding inputs', function() { - test('attaching min items does not add an input', function() { + suite('adding inputs', function () { + test('attaching min items does not add an input', function () { const block = this.workspace.newBlock('dynamic_list_1_input'); const connection = block.getInput('ADD0').connection; @@ -83,7 +86,7 @@ suite('List create block', function() { assertBlockStructure(block, [/ADD0/], 'dynamic_list_1_input'); }); - test('attaching three items creates an input', function() { + test('attaching three items creates an input', function () { const block = this.workspace.newBlock('dynamic_list_1_input'); const connection = block.getInput('ADD0').connection; connectBlockToConnection(this.workspace, connection); @@ -94,19 +97,20 @@ suite('List create block', function() { }); }); - suite('finalizing inputs', function() { - test('the block does not go below min inputs', function() { + suite('finalizing inputs', function () { + test('the block does not go below min inputs', function () { const block = this.workspace.newBlock('dynamic_list_5_inputs'); block.finalizeConnections(); assertBlockStructure( - block, - [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], - 'dynamic_list_5_inputs'); + block, + [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], + 'dynamic_list_5_inputs', + ); }); - test('an extra input with no blocks is removed', function() { + test('an extra input with no blocks is removed', function () { const block = this.workspace.newBlock('dynamic_list_1_input'); const connection = block.getInput('ADD0').connection; connectBlockToConnection(this.workspace, connection); @@ -117,7 +121,7 @@ suite('List create block', function() { assertBlockStructure(block, [/ADD0/], 'dynamic_list_1_input'); }); - test('an extra input with blocks is kept', function() { + test('an extra input with blocks is kept', function () { const block = this.workspace.newBlock('dynamic_list_1_input'); const connection = block.getInput('ADD0').connection; connectBlockToConnection(this.workspace, connection); @@ -129,7 +133,7 @@ suite('List create block', function() { assertBlockStructure(block, [/ADD0/, /ADD1/], 'dynamic_list_1_input'); }); - test('extra inputs are removed starting at the end', function() { + test('extra inputs are removed starting at the end', function () { const block = this.workspace.newBlock('dynamic_list_5_inputs'); const connection0 = block.getInput('ADD0').connection; const connection1 = block.getInput('ADD1').connection; @@ -140,13 +144,15 @@ suite('List create block', function() { block.finalizeConnections(); assertBlockStructure( - block, - [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], - 'dynamic_list_5_inputs'); + block, + [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], + 'dynamic_list_5_inputs', + ); assert.isOk(block.getInputTargetBlock('ADD0')); assert.isNotOk( - block.getInputTargetBlock('ADD1'), - 'Expected the empty input created by pending to still exist.'); + block.getInputTargetBlock('ADD1'), + 'Expected the empty input created by pending to still exist.', + ); assert.isOk(block.getInputTargetBlock('ADD2')); }); }); @@ -156,9 +162,9 @@ suite('List create block', function() { title: 'empty XML', xml: '', expectedXml: - '\n' + - ' \n', + '\n' + + ' \n', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -166,15 +172,15 @@ suite('List create block', function() { { title: 'default state - old serialization', xml: - '\n' + - ' \n' + - '', + '\n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - '', + '\n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -182,25 +188,25 @@ suite('List create block', function() { { title: 'two inputs with one child - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -208,49 +214,49 @@ suite('List create block', function() { { title: 'multiple inputs with children - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/, /ADD2/, /ADD3/]); }, @@ -258,49 +264,49 @@ suite('List create block', function() { { title: 'multiple non-sequential inputs with children - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/, /ADD2/, /ADD3/]); }, @@ -308,15 +314,15 @@ suite('List create block', function() { { title: 'two inputs one child - standard serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -324,27 +330,27 @@ suite('List create block', function() { { title: 'multiple inputs with children - standard serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/, /ADD2/, /ADD3/]); }, @@ -356,9 +362,9 @@ suite('List create block', function() { ' ' + '', expectedXml: - '\n' + - ' \n', + '\n' + + ' \n', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/], 'lists_create_with'); }, @@ -444,7 +450,7 @@ suite('List create block', function() { 'type': 'dynamic_list_create', 'id': '1', 'extraState': - '', + '', 'inputs': { 'ADD1': { 'block': { diff --git a/plugins/block-dynamic-connection/test/dynamic_text_join.mocha.js b/plugins/block-dynamic-connection/test/dynamic_text_join.mocha.js index 8265106e1f..4ecf07b214 100644 --- a/plugins/block-dynamic-connection/test/dynamic_text_join.mocha.js +++ b/plugins/block-dynamic-connection/test/dynamic_text_join.mocha.js @@ -11,7 +11,7 @@ const {overrideOldBlockDefinitions} = require('../src/index'); const assert = chai.assert; -suite('Text join block', function() { +suite('Text join block', function () { /** * Asserts that the text join block has the expected inputs. * @param {!Blockly.Block} block The block to check. @@ -19,7 +19,9 @@ suite('Text join block', function() { * @type {string=} The block type expected. Defaults to 'dynamic_text_join'. */ function assertBlockStructure( - block, expectedInputs, type = 'dynamic_text_join' + block, + expectedInputs, + type = 'dynamic_text_join', ) { assert.equal(block.type, type); assert.equal(block.inputList.length, expectedInputs.length); @@ -40,7 +42,7 @@ suite('Text join block', function() { connection.connect(targetConnection); } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); overrideOldBlockDefinitions(); @@ -53,28 +55,29 @@ suite('Text join block', function() { Blockly.Blocks['dynamic_text_5_inputs'] = def5; }); - teardown(function() { + teardown(function () { this.workspace.dispose(); delete Blockly.Blocks['dynamic_text_5_inputs']; }); - suite('Creation', function() { - test('the default definition has two inputs', function() { + suite('Creation', function () { + test('the default definition has two inputs', function () { const block = this.workspace.newBlock('dynamic_text_join'); assertBlockStructure(block, [/ADD0/, /ADD1/]); }); - test('minInputs controls the number of inputs', function() { + test('minInputs controls the number of inputs', function () { const block = this.workspace.newBlock('dynamic_text_5_inputs'); assertBlockStructure( - block, - [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], - 'dynamic_text_5_inputs'); + block, + [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], + 'dynamic_text_5_inputs', + ); }); }); - suite('adding inputs', function() { - test('attaching min items does not add an input', function() { + suite('adding inputs', function () { + test('attaching min items does not add an input', function () { const block = this.workspace.newBlock('dynamic_text_1_input'); const connection = block.getInput('ADD0').connection; @@ -83,7 +86,7 @@ suite('Text join block', function() { assertBlockStructure(block, [/ADD0/], 'dynamic_text_1_input'); }); - test('attaching three items creates an input', function() { + test('attaching three items creates an input', function () { const block = this.workspace.newBlock('dynamic_text_1_input'); const connection = block.getInput('ADD0').connection; connectBlockToConnection(this.workspace, connection); @@ -94,19 +97,20 @@ suite('Text join block', function() { }); }); - suite('finalizing inputs', function() { - test('the block does not go below min inputs', function() { + suite('finalizing inputs', function () { + test('the block does not go below min inputs', function () { const block = this.workspace.newBlock('dynamic_text_5_inputs'); block.finalizeConnections(); assertBlockStructure( - block, - [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], - 'dynamic_text_5_inputs'); + block, + [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], + 'dynamic_text_5_inputs', + ); }); - test('an extra input with no blocks is removed', function() { + test('an extra input with no blocks is removed', function () { const block = this.workspace.newBlock('dynamic_text_1_input'); const connection = block.getInput('ADD0').connection; connectBlockToConnection(this.workspace, connection); @@ -117,7 +121,7 @@ suite('Text join block', function() { assertBlockStructure(block, [/ADD0/], 'dynamic_text_1_input'); }); - test('an extra input with blocks is kept', function() { + test('an extra input with blocks is kept', function () { const block = this.workspace.newBlock('dynamic_text_1_input'); const connection = block.getInput('ADD0').connection; connectBlockToConnection(this.workspace, connection); @@ -129,7 +133,7 @@ suite('Text join block', function() { assertBlockStructure(block, [/ADD0/, /ADD1/], 'dynamic_text_1_input'); }); - test('extra inputs are removed starting at the end', function() { + test('extra inputs are removed starting at the end', function () { const block = this.workspace.newBlock('dynamic_text_5_inputs'); const connection0 = block.getInput('ADD0').connection; const connection1 = block.getInput('ADD1').connection; @@ -140,13 +144,15 @@ suite('Text join block', function() { block.finalizeConnections(); assertBlockStructure( - block, - [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], - 'dynamic_text_5_inputs'); + block, + [/ADD0/, /ADD1/, /ADD2/, /ADD3/, /ADD4/], + 'dynamic_text_5_inputs', + ); assert.isOk(block.getInputTargetBlock('ADD0')); assert.isNotOk( - block.getInputTargetBlock('ADD1'), - 'Expected the empty input created by pending to still exist.'); + block.getInputTargetBlock('ADD1'), + 'Expected the empty input created by pending to still exist.', + ); assert.isOk(block.getInputTargetBlock('ADD2')); }); }); @@ -156,9 +162,9 @@ suite('Text join block', function() { title: 'empty XML', xml: '', expectedXml: - '\n' + - ' \n', + '\n' + + ' \n', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -166,15 +172,15 @@ suite('Text join block', function() { { title: 'default state - old serialization', xml: - '\n' + - ' \n' + - '', + '\n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - '', + '\n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -182,25 +188,25 @@ suite('Text join block', function() { { title: 'two inputs with one child - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -208,49 +214,49 @@ suite('Text join block', function() { { title: 'multiple inputs with children - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/, /ADD2/, /ADD3/]); }, @@ -258,49 +264,49 @@ suite('Text join block', function() { { title: 'multiple non-sequential inputs with children - old serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/, /ADD2/, /ADD3/]); }, @@ -308,15 +314,15 @@ suite('Text join block', function() { { title: 'two inputs one child - standard serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' abc\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' abc\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/]); }, @@ -324,27 +330,27 @@ suite('Text join block', function() { { title: 'multiple inputs with children - standard serialization', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' b\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' d\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' c\n' + - ' \n \n' + - ' \n' + - ' \n' + - ' a\n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' b\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' d\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' c\n' + + ' \n \n' + + ' \n' + + ' \n' + + ' a\n' + + ' \n' + + ' \n' + + '', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/, /ADD2/, /ADD3/]); }, @@ -356,9 +362,9 @@ suite('Text join block', function() { ' ' + '', expectedXml: - '\n' + - ' \n', + '\n' + + ' \n', assertBlockStructure: (block) => { assertBlockStructure(block, [/ADD0/, /ADD1/], 'lists_create_with'); }, @@ -439,13 +445,14 @@ suite('Text join block', function() { }, }, { - title: 'multiple non-sequential inputs with children - ' + - 'json with stringified old XML', + title: + 'multiple non-sequential inputs with children - ' + + 'json with stringified old XML', json: { 'type': 'dynamic_text_join', 'id': '1', 'extraState': - '', + '', 'inputs': { 'ADD1': { 'block': { diff --git a/plugins/block-dynamic-connection/test/index.html b/plugins/block-dynamic-connection/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/block-dynamic-connection/test/index.html +++ b/plugins/block-dynamic-connection/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/block-dynamic-connection/test/index.ts b/plugins/block-dynamic-connection/test/index.ts index 6598edf7e2..a887867d19 100644 --- a/plugins/block-dynamic-connection/test/index.ts +++ b/plugins/block-dynamic-connection/test/index.ts @@ -19,12 +19,13 @@ import * as BlockDynamicConnection from '../src/index'; * @returns The created workspace. */ function createWorkspace( - blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { return Blockly.inject(blocklyDiv, options); } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { BlockDynamicConnection.overrideOldBlockDefinitions(); const toolbox = { diff --git a/plugins/block-plus-minus/README.md b/plugins/block-plus-minus/README.md index b3d1c4247d..a0b6c3d319 100644 --- a/plugins/block-plus-minus/README.md +++ b/plugins/block-plus-minus/README.md @@ -1,4 +1,3 @@ - # @blockly/block-plus-minus [![Built on Blockly](https://tinyurl.com/built-on-blockly)](https://github.com/google/blockly) A group of [Blockly](https://www.npmjs.com/package/blockly) blocks that replace the built-in mutator UI with a +/- @@ -15,11 +14,13 @@ in the future. ## Installation ### Yarn + ``` yarn add @blockly/block-plus-minus ``` ### npm + ``` npm install @blockly/block-plus-minus --save ``` @@ -27,20 +28,23 @@ npm install @blockly/block-plus-minus --save ## Usage ### Import + ```js import Blockly from 'blockly'; import '@blockly/block-plus-minus'; ``` ### Blockly Languages + We do not currently support translating the text in this plugin to different languages. However, if you would like to support multiple languages the messages can be translated by assigning the following properties of Blockly.Msg + - `PROCEDURE_VARIABLE` (Default: "variable:"): The label which signals the text - input is a variable. + input is a variable. ```javascript -Blockly.Msg['PROCEDURE_VARIABLE'] = 'variabele:'; // Dutch +Blockly.Msg['PROCEDURE_VARIABLE'] = 'variabele:'; // Dutch // Inject workspace, etc... ``` @@ -54,18 +58,23 @@ add specific mutations of blocks: ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/If.png) + ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/IfElseIf.png) + ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/IfElseIfElse.png) #### Text Join @@ -73,12 +82,15 @@ add specific mutations of blocks: ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/TextJoin.png) + ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/TextJoinNone.png) #### List Create @@ -86,13 +98,17 @@ add specific mutations of blocks: ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/ListCreateWith.png) + ```xml ``` + ![](https://github.com/google/blockly-samples/raw/master/plugins/block-plus-minus/readme-media/ListCreateWithNone.png) ## License + Apache 2.0 diff --git a/plugins/block-plus-minus/package.json b/plugins/block-plus-minus/package.json index 55e4761104..094122bc6e 100644 --- a/plugins/block-plus-minus/package.json +++ b/plugins/block-plus-minus/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", @@ -53,9 +53,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/block-plus-minus/src/field_minus.js b/plugins/block-plus-minus/src/field_minus.js index 47aa3a974c..4ee1060a0a 100644 --- a/plugins/block-plus-minus/src/field_minus.js +++ b/plugins/block-plus-minus/src/field_minus.js @@ -48,14 +48,21 @@ function onClick_(minusField) { const newExtraState = getExtraBlockState(block); if (oldExtraState != newExtraState) { - Blockly.Events.fire(new Blockly.Events.BlockChange( - block, 'mutation', null, oldExtraState, newExtraState)); + Blockly.Events.fire( + new Blockly.Events.BlockChange( + block, + 'mutation', + null, + oldExtraState, + newExtraState, + ), + ); } Blockly.Events.setGroup(false); } const minusImage = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw' + - 'MC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPS' + - 'JNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAw' + - 'IDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K'; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw' + + 'MC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPS' + + 'JNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAw' + + 'IDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K'; diff --git a/plugins/block-plus-minus/src/field_plus.js b/plugins/block-plus-minus/src/field_plus.js index 9f6ce2dee5..f6b1154fe0 100644 --- a/plugins/block-plus-minus/src/field_plus.js +++ b/plugins/block-plus-minus/src/field_plus.js @@ -48,16 +48,23 @@ function onClick_(plusField) { const newExtraState = getExtraBlockState(block); if (oldExtraState != newExtraState) { - Blockly.Events.fire(new Blockly.Events.BlockChange( - block, 'mutation', null, oldExtraState, newExtraState)); + Blockly.Events.fire( + new Blockly.Events.BlockChange( + block, + 'mutation', + null, + oldExtraState, + newExtraState, + ), + ); } Blockly.Events.setGroup(false); } const plusImage = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + - '9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMT' + - 'ggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNz' + - 'FjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MW' + - 'MwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS' + - '44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg=='; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + + '9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMT' + + 'ggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNz' + + 'FjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MW' + + 'MwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS' + + '44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg=='; diff --git a/plugins/block-plus-minus/src/if.js b/plugins/block-plus-minus/src/if.js index 10f6cd2449..11d7b732d5 100644 --- a/plugins/block-plus-minus/src/if.js +++ b/plugins/block-plus-minus/src/if.js @@ -29,7 +29,7 @@ const controlsIfMutator = { * @returns {Element} XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { if (!this.elseIfCount_ && !this.hasElse_) { return null; } @@ -47,12 +47,13 @@ const controlsIfMutator = { * @param {!Element} xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { const targetCount = parseInt(xmlElement.getAttribute('elseif'), 10) || 0; this.hasElse_ = !!parseInt(xmlElement.getAttribute('else'), 10) || 0; if (this.hasElse_ && !this.getInput('ELSE')) { - this.appendStatementInput('ELSE') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSE']); + this.appendStatementInput('ELSE').appendField( + Blockly.Msg['CONTROLS_IF_MSG_ELSE'], + ); } this.updateShape_(targetCount); }, @@ -63,7 +64,7 @@ const controlsIfMutator = { * haseElse: (boolean|undefined)}} The state of this block, ie the else * if count and else state. */ - saveExtraState: function() { + saveExtraState: function () { if (!this.elseIfCount_ && !this.hasElse_) { return null; } @@ -82,12 +83,13 @@ const controlsIfMutator = { * @param {*} state The state to apply to this block, ie the else if count and * else state. */ - loadExtraState: function(state) { + loadExtraState: function (state) { const targetCount = state['elseIfCount'] || 0; this.hasElse_ = state['hasElse'] || false; if (this.hasElse_ && !this.getInput('ELSE')) { - this.appendStatementInput('ELSE') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSE']); + this.appendStatementInput('ELSE').appendField( + Blockly.Msg['CONTROLS_IF_MSG_ELSE'], + ); } this.updateShape_(targetCount); }, @@ -99,7 +101,7 @@ const controlsIfMutator = { * @this {Blockly.Block} * @private */ - updateShape_: function(targetCount) { + updateShape_: function (targetCount) { while (this.elseIfCount_ < targetCount) { this.addElseIf_(); } @@ -111,7 +113,7 @@ const controlsIfMutator = { /** * Callback for the plus field. Adds an else-if input to the block. */ - plus: function() { + plus: function () { this.addElseIf_(); }, @@ -122,7 +124,7 @@ const controlsIfMutator = { * @param {number} index The index of the else-if input to "remove". * @this {Blockly.Block} */ - minus: function(index) { + minus: function (index) { if (this.elseIfCount_ == 0) { return; } @@ -134,16 +136,19 @@ const controlsIfMutator = { * @this {Blockly.Block} * @private */ - addElseIf_: function() { + addElseIf_: function () { // Because else-if inputs are 1-indexed we increment first, decrement last. this.elseIfCount_++; this.appendValueInput('IF' + this.elseIfCount_) - .setCheck('Boolean') - .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF']) - .appendField( - createMinusField(this.elseIfCount_), 'MINUS' + this.elseIfCount_); - this.appendStatementInput('DO' + this.elseIfCount_) - .appendField(Blockly.Msg['CONTROLS_IF_MSG_THEN']); + .setCheck('Boolean') + .appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF']) + .appendField( + createMinusField(this.elseIfCount_), + 'MINUS' + this.elseIfCount_, + ); + this.appendStatementInput('DO' + this.elseIfCount_).appendField( + Blockly.Msg['CONTROLS_IF_MSG_THEN'], + ); // Handle if-elseif-else block. if (this.getInput('ELSE')) { @@ -160,14 +165,14 @@ const controlsIfMutator = { * @this {Blockly.Block} * @private */ - removeElseIf_: function(index = undefined) { + removeElseIf_: function (index = undefined) { // The strategy for removing a part at an index is to: // - Kick any blocks connected to the relevant inputs. // - Move all connect blocks from the other inputs up. // - Remove the last input. // This makes sure all of our indices are correct. - if (index !== undefined && index!= this.elseIfCount_) { + if (index !== undefined && index != this.elseIfCount_) { // Each else-if is two inputs on the block: // the else-if input and the do input. const elseIfIndex = index * 2; @@ -203,12 +208,15 @@ const controlsIfMutator = { * Adds the initial plus button to the if block. * @this {Blockly.Block} */ -const controlsIfHelper = function() { +const controlsIfHelper = function () { this.getInput('IF0').insertFieldAt(0, createPlusField(), 'PLUS'); }; if (Blockly.Extensions.isRegistered('controls_if_mutator')) { Blockly.Extensions.unregister('controls_if_mutator'); } -Blockly.Extensions.registerMutator('controls_if_mutator', - controlsIfMutator, controlsIfHelper); +Blockly.Extensions.registerMutator( + 'controls_if_mutator', + controlsIfMutator, + controlsIfHelper, +); diff --git a/plugins/block-plus-minus/src/list_create.js b/plugins/block-plus-minus/src/list_create.js index 79a2abe1a9..f356c25217 100644 --- a/plugins/block-plus-minus/src/list_create.js +++ b/plugins/block-plus-minus/src/list_create.js @@ -16,25 +16,23 @@ import {createMinusField} from './field_minus'; // https://github.com/google/blockly-samples/issues/768#issuecomment-885663394 delete Blockly.Blocks['lists_create_with']; -/* eslint-disable quotes */ Blockly.defineBlocksWithJsonArray([ { - "type": "lists_create_with", - "message0": "%{BKY_LISTS_CREATE_EMPTY_TITLE} %1", - "args0": [ + 'type': 'lists_create_with', + 'message0': '%{BKY_LISTS_CREATE_EMPTY_TITLE} %1', + 'args0': [ { - "type": "input_dummy", - "name": "EMPTY", + 'type': 'input_dummy', + 'name': 'EMPTY', }, ], - "output": "Array", - "style": "list_blocks", - "helpUrl": "%{BKY_LISTS_CREATE_WITH_HELPURL}", - "tooltip": "%{BKY_LISTS_CREATE_WITH_TOOLTIP}", - "mutator": "new_list_create_with_mutator", + 'output': 'Array', + 'style': 'list_blocks', + 'helpUrl': '%{BKY_LISTS_CREATE_WITH_HELPURL}', + 'tooltip': '%{BKY_LISTS_CREATE_WITH_TOOLTIP}', + 'mutator': 'new_list_create_with_mutator', }, ]); -/* eslint-enable quotes */ const listCreateMutator = { /** @@ -48,7 +46,7 @@ const listCreateMutator = { * @returns {!Element} XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { const container = Blockly.utils.xml.createElement('mutation'); container.setAttribute('items', this.itemCount_); return container; @@ -58,7 +56,7 @@ const listCreateMutator = { * @param {!Element} xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { const targetCount = parseInt(xmlElement.getAttribute('items'), 10); this.updateShape_(targetCount); }, @@ -67,7 +65,7 @@ const listCreateMutator = { * Returns the state of this block as a JSON serializable object. * @returns {{itemCount: number}} The state of this block, ie the item count. */ - saveExtraState: function() { + saveExtraState: function () { return { 'itemCount': this.itemCount_, }; @@ -77,7 +75,7 @@ const listCreateMutator = { * Applies the given state to this block. * @param {*} state The state to apply to this block, ie the item count. */ - loadExtraState: function(state) { + loadExtraState: function (state) { this.updateShape_(state['itemCount']); }, @@ -87,7 +85,7 @@ const listCreateMutator = { * @this {Blockly.Block} * @private */ - updateShape_: function(targetCount) { + updateShape_: function (targetCount) { while (this.itemCount_ < targetCount) { this.addPart_(); } @@ -101,7 +99,7 @@ const listCreateMutator = { * Callback for the plus image. Adds an input to the end of the block and * updates the state of the minus. */ - plus: function() { + plus: function () { this.addPart_(); this.updateMinus_(); }, @@ -110,7 +108,7 @@ const listCreateMutator = { * Callback for the minus image. Removes an input from the end of the block * and updates the state of the minus. */ - minus: function() { + minus: function () { if (this.itemCount_ == 0) { return; } @@ -128,12 +126,12 @@ const listCreateMutator = { * @this {Blockly.Block} * @private */ - addPart_: function() { + addPart_: function () { if (this.itemCount_ == 0) { this.removeInput('EMPTY'); this.topInput_ = this.appendValueInput('ADD' + this.itemCount_) - .appendField(createPlusField(), 'PLUS') - .appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); + .appendField(createPlusField(), 'PLUS') + .appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); } else { this.appendValueInput('ADD' + this.itemCount_); } @@ -146,13 +144,13 @@ const listCreateMutator = { * @this {Blockly.Block} * @private */ - removePart_: function() { + removePart_: function () { this.itemCount_--; this.removeInput('ADD' + this.itemCount_); if (this.itemCount_ == 0) { this.topInput_ = this.appendDummyInput('EMPTY') - .appendField(createPlusField(), 'PLUS') - .appendField(Blockly.Msg['LISTS_CREATE_EMPTY_TITLE']); + .appendField(createPlusField(), 'PLUS') + .appendField(Blockly.Msg['LISTS_CREATE_EMPTY_TITLE']); } }, @@ -160,7 +158,7 @@ const listCreateMutator = { * Makes it so the minus is visible iff there is an input available to remove. * @private */ - updateMinus_: function() { + updateMinus_: function () { const minusField = this.getField('MINUS'); if (!minusField && this.itemCount_ > 0) { this.topInput_.insertFieldAt(1, createMinusField(), 'MINUS'); @@ -174,10 +172,13 @@ const listCreateMutator = { * Updates the shape of the block to have 3 inputs if no mutation is provided. * @this {Blockly.Block} */ -const listCreateHelper = function() { +const listCreateHelper = function () { this.getInput('EMPTY').insertFieldAt(0, createPlusField(), 'PLUS'); this.updateShape_(3); }; -Blockly.Extensions.registerMutator('new_list_create_with_mutator', - listCreateMutator, listCreateHelper); +Blockly.Extensions.registerMutator( + 'new_list_create_with_mutator', + listCreateMutator, + listCreateHelper, +); diff --git a/plugins/block-plus-minus/src/procedures.js b/plugins/block-plus-minus/src/procedures.js index 63e0dccb34..de66bb44cb 100644 --- a/plugins/block-plus-minus/src/procedures.js +++ b/plugins/block-plus-minus/src/procedures.js @@ -19,82 +19,80 @@ Blockly.Msg['PROCEDURE_VARIABLE'] = 'variable:'; delete Blockly.Blocks['procedures_defnoreturn']; delete Blockly.Blocks['procedures_defreturn']; -/* eslint-disable quotes */ Blockly.defineBlocksWithJsonArray([ { - "type": "procedures_defnoreturn", - "message0": "%{BKY_PROCEDURES_DEFNORETURN_TITLE} %1 %2", - "message1": "%{BKY_PROCEDURES_DEFNORETURN_DO} %1", - "args0": [ + 'type': 'procedures_defnoreturn', + 'message0': '%{BKY_PROCEDURES_DEFNORETURN_TITLE} %1 %2', + 'message1': '%{BKY_PROCEDURES_DEFNORETURN_DO} %1', + 'args0': [ { - "type": "field_input", - "name": "NAME", - "text": "", + 'type': 'field_input', + 'name': 'NAME', + 'text': '', }, { - "type": "input_dummy", - "name": "TOP", + 'type': 'input_dummy', + 'name': 'TOP', }, ], - "args1": [ + 'args1': [ { - "type": "input_statement", - "name": "STACK", + 'type': 'input_statement', + 'name': 'STACK', }, ], - "style": "procedure_blocks", - "helpUrl": "%{BKY_PROCEDURES_DEFNORETURN_HELPURL}", - "tooltip": "%{BKY_PROCEDURES_DEFNORETURN_TOOLTIP}", - "extensions": [ - "get_procedure_def_no_return", - "procedure_context_menu", - "procedure_rename", - "procedure_vars", + 'style': 'procedure_blocks', + 'helpUrl': '%{BKY_PROCEDURES_DEFNORETURN_HELPURL}', + 'tooltip': '%{BKY_PROCEDURES_DEFNORETURN_TOOLTIP}', + 'extensions': [ + 'get_procedure_def_no_return', + 'procedure_context_menu', + 'procedure_rename', + 'procedure_vars', ], - "mutator": "procedure_def_mutator", + 'mutator': 'procedure_def_mutator', }, { - "type": "procedures_defreturn", - "message0": "%{BKY_PROCEDURES_DEFRETURN_TITLE} %1 %2", - "message1": "%{BKY_PROCEDURES_DEFRETURN_DO} %1", - "message2": "%{BKY_PROCEDURES_DEFRETURN_RETURN} %1", - "args0": [ + 'type': 'procedures_defreturn', + 'message0': '%{BKY_PROCEDURES_DEFRETURN_TITLE} %1 %2', + 'message1': '%{BKY_PROCEDURES_DEFRETURN_DO} %1', + 'message2': '%{BKY_PROCEDURES_DEFRETURN_RETURN} %1', + 'args0': [ { - "type": "field_input", - "name": "NAME", - "text": "", + 'type': 'field_input', + 'name': 'NAME', + 'text': '', }, { - "type": "input_dummy", - "name": "TOP", + 'type': 'input_dummy', + 'name': 'TOP', }, ], - "args1": [ + 'args1': [ { - "type": "input_statement", - "name": "STACK", + 'type': 'input_statement', + 'name': 'STACK', }, ], - "args2": [ + 'args2': [ { - "type": "input_value", - "align": "right", - "name": "RETURN", + 'type': 'input_value', + 'align': 'right', + 'name': 'RETURN', }, ], - "style": "procedure_blocks", - "helpUrl": "%{BKY_PROCEDURES_DEFRETURN_HELPURL}", - "tooltip": "%{BKY_PROCEDURES_DEFRETURN_TOOLTIP}", - "extensions": [ - "get_procedure_def_return", - "procedure_context_menu", - "procedure_rename", - "procedure_vars", + 'style': 'procedure_blocks', + 'helpUrl': '%{BKY_PROCEDURES_DEFRETURN_HELPURL}', + 'tooltip': '%{BKY_PROCEDURES_DEFRETURN_TOOLTIP}', + 'extensions': [ + 'get_procedure_def_return', + 'procedure_context_menu', + 'procedure_rename', + 'procedure_vars', ], - "mutator": "procedure_def_mutator", + 'mutator': 'procedure_def_mutator', }, ]); -/* eslint-enable quotes */ /** * Defines the what are essentially info-getters for the procedures_defnoreturn @@ -107,7 +105,7 @@ const getDefNoReturn = { * @returns {Array} An array of info. * @this {Blockly.Block} */ - getProcedureDef: function() { + getProcedureDef: function () { const argNames = this.argData_.map((elem) => elem.model.name); return [this.getFieldValue('NAME'), argNames, false]; }, @@ -132,7 +130,7 @@ const getDefReturn = { * @returns {Array} An array of info. * @this {Blockly.Block} */ - getProcedureDef: function() { + getProcedureDef: function () { const argNames = this.argData_.map((elem) => elem.model.name); return [this.getFieldValue('NAME'), argNames, true]; }, @@ -153,7 +151,7 @@ const procedureContextMenu = { * @this {Blockly.Block} * @param {!Array} options The current options for the context menu. */ - customContextMenu: function(options) { + customContextMenu: function (options) { if (this.isInFlyout) { return; } @@ -180,8 +178,10 @@ const procedureContextMenu = { // Add options to create getters for each parameter. const varModels = this.getVarModels(); for (const model of varModels) { - const text = Blockly.Msg['VARIABLES_SET_CREATE_GET'] - .replace('%1', model.name); + const text = Blockly.Msg['VARIABLES_SET_CREATE_GET'].replace( + '%1', + model.name, + ); const xml = Blockly.utils.xml.createElement('block'); xml.setAttribute('type', 'variables_get'); @@ -198,7 +198,9 @@ const procedureContextMenu = { }; Blockly.Extensions.registerMixin( - 'procedure_context_menu', procedureContextMenu); + 'procedure_context_menu', + procedureContextMenu, +); const procedureDefMutator = { /** @@ -209,7 +211,7 @@ const procedureDefMutator = { * @returns {!Element} XML storage element. * @this {Blockly.Block} */ - mutationToDom: function(isForCaller = false) { + mutationToDom: function (isForCaller = false) { const container = Blockly.utils.xml.createElement('mutation'); if (isForCaller) { container.setAttribute('name', this.getFieldValue('NAME')); @@ -240,7 +242,7 @@ const procedureDefMutator = { * @param {!Element} xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { // We have to handle this so that the user doesn't add blocks to the stack, // in which case it would be impossible to return to the old mutators. this.hasStatements_ = xmlElement.getAttribute('statements') !== 'false'; @@ -254,8 +256,9 @@ const procedureDefMutator = { for (const childNode of xmlElement.childNodes) { if (childNode.nodeName.toLowerCase() == 'arg') { names.push(childNode.getAttribute('name')); - varIds.push(childNode.getAttribute('varid') || - childNode.getAttribute('varId')); + varIds.push( + childNode.getAttribute('varid') || childNode.getAttribute('varId'), + ); argIds.push(childNode.getAttribute('argid')); } } @@ -268,7 +271,7 @@ const procedureDefMutator = { * hasStatements: (boolean|undefined)}} The state of this block, eg the * parameters and statements. */ - saveExtraState: function() { + saveExtraState: function () { if (!this.argData_.length && this.hasStatements_) { return null; } @@ -296,7 +299,7 @@ const procedureDefMutator = { * @param {*} state The state to apply to this block, eg the parameters and * statements. */ - loadExtraState: function(state) { + loadExtraState: function (state) { // We have to handle this so that the user doesn't add blocks to the stack, // in which case it would be impossible to return to the old mutators. this.hasStatements_ = state['hasStatements'] !== false; @@ -328,7 +331,7 @@ const procedureDefMutator = { * @this {Blockly.Block} * @private */ - updateShape_: function(names, varIds, argIds) { + updateShape_: function (names, varIds, argIds) { if (names.length != varIds.length) { throw Error('names and varIds must have the same length.'); } @@ -353,7 +356,7 @@ const procedureDefMutator = { * Callback for the plus image. Adds an argument to the block and mutates * callers to match. */ - plus: function() { + plus: function () { this.addArg_(); Blockly.Procedures.mutateCallers(this); }, @@ -364,7 +367,7 @@ const procedureDefMutator = { * @param {string} argId The argId of the argument to remove. * @this {Blockly.Block} */ - minus: function(argId) { + minus: function (argId) { if (!this.argData_.length) { return; } @@ -382,19 +385,27 @@ const procedureDefMutator = { * @this {Blockly.Block} * @private */ - addArg_: function(name = null, varId = null, argId = null) { + addArg_: function (name = null, varId = null, argId = null) { if (!this.argData_.length) { const withField = new Blockly.FieldLabel( - Blockly.Msg['PROCEDURES_BEFORE_PARAMS']); - this.getInput('TOP') - .appendField(withField, 'WITH'); + Blockly.Msg['PROCEDURES_BEFORE_PARAMS'], + ); + this.getInput('TOP').appendField(withField, 'WITH'); } const argNames = this.argData_.map((elem) => elem.model.name); - name = name || Blockly.Variables.generateUniqueNameFromOptions( - Blockly.Procedures.DEFAULT_ARG, argNames); + name = + name || + Blockly.Variables.generateUniqueNameFromOptions( + Blockly.Procedures.DEFAULT_ARG, + argNames, + ); const variable = Blockly.Variables.getOrCreateVariablePackage( - this.workspace, varId, name, ''); + this.workspace, + varId, + name, + '', + ); argId = argId || Blockly.utils.idGenerator.genUid(); this.addVarInput_(name, argId); @@ -415,9 +426,10 @@ const procedureDefMutator = { * @param {string} argId An ID used to track arguments on the block. * @private */ - removeArg_: function(argId) { + removeArg_: function (argId) { if (this.removeInput(argId, true)) { - if (this.argData_.length == 1) { // Becoming argumentless. + if (this.argData_.length == 1) { + // Becoming argumentless. this.getInput('TOP').removeField('WITH'); } this.argData_ = this.argData_.filter((element) => element.argId != argId); @@ -432,17 +444,17 @@ const procedureDefMutator = { * @this {Blockly.Block} * @private */ - addVarInput_: function(name, argId) { + addVarInput_: function (name, argId) { const nameField = new Blockly.FieldTextInput(name, this.validator_); nameField.onFinishEditing_ = this.finishEditing_.bind(nameField); nameField.varIdsToDelete_ = []; nameField.preEditVarModel_ = null; this.appendDummyInput(argId) - .setAlign(Blockly.ALIGN_RIGHT) - .appendField(createMinusField(argId)) - .appendField(Blockly.Msg['PROCEDURE_VARIABLE']) // Untranslated! - .appendField(nameField, argId); // The name of the field is the arg id. + .setAlign(Blockly.ALIGN_RIGHT) + .appendField(createMinusField(argId)) + .appendField(Blockly.Msg['PROCEDURE_VARIABLE']) // Untranslated! + .appendField(nameField, argId); // The name of the field is the arg id. }, /** @@ -451,12 +463,13 @@ const procedureDefMutator = { * @returns {?string} The field's new value. * @this {Blockly.FieldTextInput} */ - validator_: function(newName) { + validator_: function (newName) { const sourceBlock = this.getSourceBlock(); const workspace = sourceBlock.workspace; const argData = sourceBlock.argData_; const argDatum = sourceBlock.argData_.find( - (element) => element.argId == this.name); + (element) => element.argId == this.name, + ); const currId = argDatum.model.getId(); // Replace all whitespace with normal spaces, then trim. @@ -475,8 +488,10 @@ const procedureDefMutator = { */ const hasDifName = (argDatum) => { // The field name (aka id) is always equal to the arg id. - return argDatum.argId == this.name || - caselessName != argDatum.model.name.toLowerCase(); + return ( + argDatum.argId == this.name || + caselessName != argDatum.model.name.toLowerCase() + ); }; /** * Returns true if the variable associated with this field is only used @@ -486,9 +501,11 @@ const procedureDefMutator = { */ const varOnlyUsedHere = () => { return workspace.getVariableUsesById(currId).every((block) => { - return block.id == sourceBlock.id || - (block.getProcedureCall && - block.getProcedureCall() == sourceBlock.getProcedureDef()[0]); + return ( + block.id == sourceBlock.id || + (block.getProcedureCall && + block.getProcedureCall() == sourceBlock.getProcedureDef()[0]) + ); }); }; @@ -531,10 +548,11 @@ const procedureDefMutator = { * @param {string} _finalName The final value of the field. * @this {Blockly.FieldTextInput} */ - finishEditing_: function(_finalName) { + finishEditing_: function (_finalName) { const source = this.getSourceBlock(); const argDatum = source.argData_.find( - (element) => element.argId == this.name); + (element) => element.argId == this.name, + ); const currentVarId = argDatum.model.getId(); this.varIdsToDelete_.forEach((id) => { @@ -551,7 +569,7 @@ const procedureDefMutator = { * Initializes some private variables for procedure blocks. * @this {Blockly.Block} */ -const procedureDefHelper = function() { +const procedureDefHelper = function () { /** * An array of objects containing data about the args belonging to the * procedure definition. @@ -572,14 +590,17 @@ const procedureDefHelper = function() { this.getInput('TOP').insertFieldAt(0, createPlusField(), 'PLUS'); }; -Blockly.Extensions.registerMutator('procedure_def_mutator', - procedureDefMutator, procedureDefHelper); +Blockly.Extensions.registerMutator( + 'procedure_def_mutator', + procedureDefMutator, + procedureDefHelper, +); /** * Sets the validator for the procedure's name field. * @this {Blockly.Block} */ -const procedureRename = function() { +const procedureRename = function () { this.getField('NAME').setValidator(Blockly.Procedures.rename); }; @@ -589,7 +610,7 @@ Blockly.Extensions.register('procedure_rename', procedureRename); * Defines functions for dealing with variables and renaming variables. * @this {Blockly.Block} */ -const procedureVars = function() { +const procedureVars = function () { // This is a hack to get around the don't-override-builtins check. const mixin = { /** @@ -597,7 +618,7 @@ const procedureVars = function() { * @returns {!Array.} List of variable names. * @this {Blockly.Block} */ - getVars: function() { + getVars: function () { return this.argData_.map((elem) => elem.model.name); }, @@ -606,7 +627,7 @@ const procedureVars = function() { * @returns {!Array.} List of variable models. * @this {Blockly.Block} */ - getVarModels: function() { + getVarModels: function () { return this.argData_.map((elem) => elem.model); }, @@ -618,9 +639,10 @@ const procedureVars = function() { * @param {string} newId The ID of the variable that was already using * the name. */ - renameVarById: function(oldId, newId) { + renameVarById: function (oldId, newId) { const argData = this.argData_.find( - (element) => element.model.getId() == oldId); + (element) => element.model.getId() == oldId, + ); if (!argData) { return; // Not on this block. } @@ -642,10 +664,11 @@ const procedureVars = function() { * @override * @this {Blockly.Block} */ - updateVarName: function(variable) { + updateVarName: function (variable) { const id = variable.getId(); const argData = this.argData_.find( - (element) => element.model.getId() == id); + (element) => element.model.getId() == id, + ); if (!argData) { return; // Not on this block. } diff --git a/plugins/block-plus-minus/src/text_join.js b/plugins/block-plus-minus/src/text_join.js index 76f2789ead..c213870c9f 100644 --- a/plugins/block-plus-minus/src/text_join.js +++ b/plugins/block-plus-minus/src/text_join.js @@ -24,7 +24,7 @@ const textJoinMutator = { * @returns {!Element} XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { const container = Blockly.utils.xml.createElement('mutation'); container.setAttribute('items', this.itemCount_); return container; @@ -35,7 +35,7 @@ const textJoinMutator = { * @param {!Element} xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { const targetCount = parseInt(xmlElement.getAttribute('items'), 10); this.updateShape_(targetCount); }, @@ -44,7 +44,7 @@ const textJoinMutator = { * Returns the state of this block as a JSON serializable object. * @returns {{itemCount: number}} The state of this block, ie the item count. */ - saveExtraState: function() { + saveExtraState: function () { return { 'itemCount': this.itemCount_, }; @@ -54,7 +54,7 @@ const textJoinMutator = { * Applies the given state to this block. * @param {*} state The state to apply to this block, ie the item count. */ - loadExtraState: function(state) { + loadExtraState: function (state) { this.updateShape_(state['itemCount']); }, @@ -64,7 +64,7 @@ const textJoinMutator = { * @this {Blockly.Block} * @private */ - updateShape_: function(targetCount) { + updateShape_: function (targetCount) { while (this.itemCount_ < targetCount) { this.addPart_(); } @@ -79,7 +79,7 @@ const textJoinMutator = { * state of the minus. * @this {Blockly.Block} */ - plus: function() { + plus: function () { this.addPart_(); this.updateMinus_(); }, @@ -89,7 +89,7 @@ const textJoinMutator = { * updates the state of the minus. * @this {Blockly.Block} */ - minus: function() { + minus: function () { if (this.itemCount_ == 0) { return; } @@ -103,14 +103,14 @@ const textJoinMutator = { * @this {Blockly.Block} * @private */ - addPart_: function() { + addPart_: function () { if (this.itemCount_ == 0) { if (this.getInput('EMPTY')) { this.removeInput('EMPTY'); } this.topInput_ = this.appendValueInput('ADD' + this.itemCount_) - .appendField(createPlusField(), 'PLUS') - .appendField(Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH']); + .appendField(createPlusField(), 'PLUS') + .appendField(Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH']); } else { this.appendValueInput('ADD' + this.itemCount_); } @@ -124,14 +124,14 @@ const textJoinMutator = { * @this {Blockly.Block} * @private */ - removePart_: function() { + removePart_: function () { this.itemCount_--; this.removeInput('ADD' + this.itemCount_); if (this.itemCount_ == 0) { this.topInput_ = this.appendDummyInput('EMPTY') - .appendField(createPlusField(), 'PLUS') - .appendField(this.newQuote_(true)) - .appendField(this.newQuote_(false)); + .appendField(createPlusField(), 'PLUS') + .appendField(this.newQuote_(true)) + .appendField(this.newQuote_(false)); } }, @@ -139,7 +139,7 @@ const textJoinMutator = { * Makes it so the minus is visible iff there is an input available to remove. * @private */ - updateMinus_: function() { + updateMinus_: function () { const minusField = this.getField('MINUS'); if (!minusField && this.itemCount_ > 0) { this.topInput_.insertFieldAt(1, createMinusField(), 'MINUS'); @@ -154,7 +154,7 @@ const textJoinMutator = { * mutator is provided the block has two inputs. * @this {Blockly.Block} */ -const textJoinHelper = function() { +const textJoinHelper = function () { Blockly.Extensions.apply('text_quotes', this, false); this.updateShape_(2); }; @@ -162,5 +162,8 @@ const textJoinHelper = function() { if (Blockly.Extensions.isRegistered('text_join_mutator')) { Blockly.Extensions.unregister('text_join_mutator'); } -Blockly.Extensions.registerMutator('text_join_mutator', - textJoinMutator, textJoinHelper); +Blockly.Extensions.registerMutator( + 'text_join_mutator', + textJoinMutator, + textJoinHelper, +); diff --git a/plugins/block-plus-minus/test/if.mocha.js b/plugins/block-plus-minus/test/if.mocha.js index 9a50648212..f555309929 100644 --- a/plugins/block-plus-minus/test/if.mocha.js +++ b/plugins/block-plus-minus/test/if.mocha.js @@ -18,10 +18,14 @@ require('../src/index'); const assert = chai.assert; -const {CodeGenerationTestSuite, runCodeGenerationTestSuites, - runSerializationTestSuite, SerializationTestCase} = testHelpers; +const { + CodeGenerationTestSuite, + runCodeGenerationTestSuites, + runSerializationTestSuite, + SerializationTestCase, +} = testHelpers; -suite('If block', function() { +suite('If block', function () { /** * Asserts that the if block has the expected inputs and fields. * @param {!Blockly.Block} block The if block to check. @@ -47,20 +51,20 @@ suite('If block', function() { } } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Creation', function() { + test('Creation', function () { this.block = this.workspace.newBlock('controls_if'); assertIfBlockStructure(this.block, 1); }); - suite('Code generation', function() { + suite('Code generation', function () { const trivialCreateBlock = (workspace) => { return workspace.newBlock('controls_if'); }; @@ -70,36 +74,66 @@ suite('If block', function() { * @type {Array} */ const testSuites = [ - {title: 'Dart', generator: dartGenerator, + { + title: 'Dart', + generator: dartGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'if (false) {\n}\n', - createBlock: trivialCreateBlock}, - ]}, - {title: 'JavaScript', generator: javascriptGenerator, + { + title: 'Trivial', + expectedCode: 'if (false) {\n}\n', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'JavaScript', + generator: javascriptGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'if (false) {\n}\n', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Lua', generator: luaGenerator, + { + title: 'Trivial', + expectedCode: 'if (false) {\n}\n', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Lua', + generator: luaGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'if false then\nend\n', - createBlock: trivialCreateBlock}, - ]}, - {title: 'PHP', generator: phpGenerator, + { + title: 'Trivial', + expectedCode: 'if false then\nend\n', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'PHP', + generator: phpGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'if (false) {\n}\n', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Python', generator: pythonGenerator, + { + title: 'Trivial', + expectedCode: 'if (false) {\n}\n', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Python', + generator: pythonGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'if False:\n pass\n', - createBlock: trivialCreateBlock}, - ]}, + { + title: 'Trivial', + expectedCode: 'if False:\n pass\n', + createBlock: trivialCreateBlock, + }, + ], + }, ]; runCodeGenerationTestSuites(testSuites); }); - suite('XML', function() { + suite('XML', function () { /** * Test cases for serialization tests. * @type {Array} @@ -109,42 +143,39 @@ suite('If block', function() { title: 'Empty Xml', xml: '', expectedXml: - '', - assertBlockStructure: - (block) => { - assertIfBlockStructure(block, 1); - }, + '', + assertBlockStructure: (block) => { + assertIfBlockStructure(block, 1); + }, }, { title: '2 elseif no else', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertIfBlockStructure(block, 3); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertIfBlockStructure(block, 3); + }, }, { title: '3 elseif with else', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertIfBlockStructure(block, 4, true); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertIfBlockStructure(block, 4, true); + }, }, ]; runSerializationTestSuite(testCases); }); - suite('JSON', function() { + suite('JSON', function () { /** * Test cases for serialization tests. * @type {Array} @@ -159,10 +190,9 @@ suite('If block', function() { 'type': 'controls_if', 'id': '1', }, - assertBlockStructure: - (block) => { - assertIfBlockStructure(block, 1); - }, + assertBlockStructure: (block) => { + assertIfBlockStructure(block, 1); + }, }, { title: '2 elseif no else', @@ -173,10 +203,9 @@ suite('If block', function() { }, 'id': '1', }, - assertBlockStructure: - (block) => { - assertIfBlockStructure(block, 3); - }, + assertBlockStructure: (block) => { + assertIfBlockStructure(block, 3); + }, }, { title: '3 elseif with else', @@ -188,15 +217,13 @@ suite('If block', function() { }, 'id': '1', }, - assertBlockStructure: - (block) => { - assertIfBlockStructure(block, 4, true); - }, + assertBlockStructure: (block) => { + assertIfBlockStructure(block, 4, true); + }, }, ]; runSerializationTestSuite(testCases); }); - runPlusMinusTestSuite('controls_if', 1, 1, 'IF', - assertIfBlockStructure); + runPlusMinusTestSuite('controls_if', 1, 1, 'IF', assertIfBlockStructure); }); diff --git a/plugins/block-plus-minus/test/index.html b/plugins/block-plus-minus/test/index.html index 08f0c22dcc..cf52f2924b 100644 --- a/plugins/block-plus-minus/test/index.html +++ b/plugins/block-plus-minus/test/index.html @@ -1,19 +1,19 @@ - + - - + + Blockly Plus/Minus Mutators Test - + - +
- - + diff --git a/plugins/block-plus-minus/test/index.js b/plugins/block-plus-minus/test/index.js index c6a99ee097..c4140f6983 100644 --- a/plugins/block-plus-minus/test/index.js +++ b/plugins/block-plus-minus/test/index.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly'; import {createPlayground} from '@blockly/dev-tools'; import '../src/index.js'; - /** * Create a workspace. * @param {HTMLElement} blocklyDiv The blockly container div. @@ -24,8 +23,7 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -const toolbox = -{ +const toolbox = { 'kind': 'categoryToolbox', 'contents': [ { @@ -80,10 +78,13 @@ const toolbox = ], }; -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolbox, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/block-plus-minus/test/list_create.mocha.js b/plugins/block-plus-minus/test/list_create.mocha.js index aa9741d7b2..5886014e46 100644 --- a/plugins/block-plus-minus/test/list_create.mocha.js +++ b/plugins/block-plus-minus/test/list_create.mocha.js @@ -17,10 +17,14 @@ const {pythonGenerator} = require('blockly/python'); require('../src/index'); const assert = chai.assert; -const {CodeGenerationTestSuite, runCodeGenerationTestSuites, - runSerializationTestSuite, SerializationTestCase} = testHelpers; +const { + CodeGenerationTestSuite, + runCodeGenerationTestSuites, + runSerializationTestSuite, + SerializationTestCase, +} = testHelpers; -suite('List create block', function() { +suite('List create block', function () { /** * Asserts that the list block has the inputs and fields we expect. * @param {!Blockly.Block} block The list block. @@ -48,20 +52,20 @@ suite('List create block', function() { assert.notEqual(block.toString(), 'create empty list'); } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Creation', function() { + test('Creation', function () { this.block = this.workspace.newBlock('lists_create_with'); assertListBlockStructure(this.block, 3); }); - suite('Code generation', function() { + suite('Code generation', function () { const trivialCreateBlock = (workspace) => { return workspace.newBlock('lists_create_with'); }; @@ -71,37 +75,66 @@ suite('List create block', function() { * @type {Array} */ const testSuites = [ - {title: 'Dart', generator: dartGenerator, + { + title: 'Dart', + generator: dartGenerator, testCases: [ - {title: 'Trivial', expectedCode: '[null, null, null]', - createBlock: trivialCreateBlock}, - ]}, - {title: 'JavaScript', generator: javascriptGenerator, + { + title: 'Trivial', + expectedCode: '[null, null, null]', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'JavaScript', + generator: javascriptGenerator, testCases: [ - - {title: 'Trivial', expectedCode: '[null, null, null]', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Lua', generator: luaGenerator, + { + title: 'Trivial', + expectedCode: '[null, null, null]', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Lua', + generator: luaGenerator, testCases: [ - {title: 'Trivial', expectedCode: '{None, None, None}', - createBlock: trivialCreateBlock}, - ]}, - {title: 'PHP', generator: phpGenerator, + { + title: 'Trivial', + expectedCode: '{None, None, None}', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'PHP', + generator: phpGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'array(null, null, null)', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Python', generator: pythonGenerator, + { + title: 'Trivial', + expectedCode: 'array(null, null, null)', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Python', + generator: pythonGenerator, testCases: [ - {title: 'Trivial', expectedCode: '[None, None, None]', - createBlock: trivialCreateBlock}, - ]}, + { + title: 'Trivial', + expectedCode: '[None, None, None]', + createBlock: trivialCreateBlock, + }, + ], + }, ]; runCodeGenerationTestSuites(testSuites); }); - suite('Xml', function() { + suite('Xml', function () { /** * Test cases for serialization tests. * @type {Array} @@ -111,77 +144,72 @@ suite('List create block', function() { title: 'Empty XML', xml: '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 3); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertListBlockStructure(block, 3); + }, }, { title: '3 items', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 3); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertListBlockStructure(block, 3); + }, }, { title: '5 items', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 5); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertListBlockStructure(block, 5); + }, }, { title: '0 items', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 0); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertListBlockStructure(block, 0); + }, }, { title: '4 items with child attached', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' FALSE\n' + - ' \n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 4); - const child = block.getInputTargetBlock('ADD3'); - assert.isNotNull(child); - assert.equal(child.type, 'logic_boolean'); - assert.equal(child.getFieldValue('BOOL'), 'FALSE'); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' FALSE\n' + + ' \n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertListBlockStructure(block, 4); + const child = block.getInputTargetBlock('ADD3'); + assert.isNotNull(child); + assert.equal(child.type, 'logic_boolean'); + assert.equal(child.getFieldValue('BOOL'), 'FALSE'); + }, }, ]; runSerializationTestSuite(testCases); }); - suite('Json', function() { + suite('Json', function () { /** * Test cases for serialization tests. * @type {Array} @@ -199,10 +227,9 @@ suite('List create block', function() { 'itemCount': 3, }, }, - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 3); - }, + assertBlockStructure: (block) => { + assertListBlockStructure(block, 3); + }, }, { title: '3 items', @@ -213,10 +240,9 @@ suite('List create block', function() { 'itemCount': 3, }, }, - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 3); - }, + assertBlockStructure: (block) => { + assertListBlockStructure(block, 3); + }, }, { title: '5 items', @@ -227,10 +253,9 @@ suite('List create block', function() { 'itemCount': 5, }, }, - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 5); - }, + assertBlockStructure: (block) => { + assertListBlockStructure(block, 5); + }, }, { title: '0 items', @@ -241,10 +266,9 @@ suite('List create block', function() { 'itemCount': 0, }, }, - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 0); - }, + assertBlockStructure: (block) => { + assertListBlockStructure(block, 0); + }, }, { title: '4 items with child attached', @@ -266,19 +290,23 @@ suite('List create block', function() { }, }, }, - assertBlockStructure: - (block) => { - assertListBlockStructure(block, 4); - const child = block.getInputTargetBlock('ADD3'); - assert.isNotNull(child); - assert.equal(child.type, 'logic_boolean'); - assert.equal(child.getFieldValue('BOOL'), 'FALSE'); - }, + assertBlockStructure: (block) => { + assertListBlockStructure(block, 4); + const child = block.getInputTargetBlock('ADD3'); + assert.isNotNull(child); + assert.equal(child.type, 'logic_boolean'); + assert.equal(child.getFieldValue('BOOL'), 'FALSE'); + }, }, ]; runSerializationTestSuite(testCases); }); - runPlusMinusTestSuite('lists_create_with', 3, 0, 'ADD', - assertListBlockStructure); + runPlusMinusTestSuite( + 'lists_create_with', + 3, + 0, + 'ADD', + assertListBlockStructure, + ); }); diff --git a/plugins/block-plus-minus/test/procedures.mocha.js b/plugins/block-plus-minus/test/procedures.mocha.js index afd234b631..1089033a7d 100644 --- a/plugins/block-plus-minus/test/procedures.mocha.js +++ b/plugins/block-plus-minus/test/procedures.mocha.js @@ -18,19 +18,27 @@ const {pythonGenerator} = require('blockly/python'); require('../src/index'); const assert = chai.assert; -const {CodeGenerationTestSuite, runCodeGenerationTestSuites, - runSerializationTestSuite, SerializationTestCase} = testHelpers; -const {assertDefBlockStructure, assertCallBlockStructure, - assertProcBlocksStructure, createProcDefBlock, - createProcCallBlock} = procedureTestHelpers; +const { + CodeGenerationTestSuite, + runCodeGenerationTestSuites, + runSerializationTestSuite, + SerializationTestCase, +} = testHelpers; +const { + assertDefBlockStructure, + assertCallBlockStructure, + assertProcBlocksStructure, + createProcDefBlock, + createProcCallBlock, +} = procedureTestHelpers; -suite('Procedure blocks', function() { - setup(function() { +suite('Procedure blocks', function () { + setup(function () { this.workspace = new Blockly.Workspace(); this.clock = sinon.useFakeTimers(); }); - teardown(function() { + teardown(function () { // We have to make sure the procedure call gets the change event before // we teardown. Otherwise we get a race condition where it tries to create // a new def. @@ -39,28 +47,36 @@ suite('Procedure blocks', function() { }); const testSuites = [ - {title: 'with return', hasReturn: true, defType: 'procedures_defreturn', - callType: 'procedures_callreturn'}, - {title: 'no return', hasReturn: false, defType: 'procedures_defnoreturn', - callType: 'procedures_callnoreturn'}, + { + title: 'with return', + hasReturn: true, + defType: 'procedures_defreturn', + callType: 'procedures_callreturn', + }, + { + title: 'no return', + hasReturn: false, + defType: 'procedures_defnoreturn', + callType: 'procedures_callnoreturn', + }, ]; testSuites.forEach((testSuite) => { - suite(testSuite.title, function() { - suite('Structure', function() { - test('Definition block', function() { + suite(testSuite.title, function () { + suite('Structure', function () { + test('Definition block', function () { const defBlock = this.workspace.newBlock(testSuite.defType); assertDefBlockStructure(defBlock, testSuite.hasReturn); }); - test('Call block', function() { + test('Call block', function () { this.workspace.newBlock(testSuite.defType); const callBlock = this.workspace.newBlock(testSuite.callType); assertCallBlockStructure(callBlock); }); }); - suite('Code generation', function() { + suite('Code generation', function () { const createBlockFn = (numArgs) => { return (workspace) => { const block = createProcDefBlock(workspace, testSuite.hasReturn); @@ -76,94 +92,110 @@ suite('Procedure blocks', function() { * @type {Array} */ const codeGenerationTestSuites = [ - {title: 'Dart', generator: dartGenerator, + { + title: 'Dart', + generator: dartGenerator, testCases: [ - {title: 'No arguments', + { + title: 'No arguments', useWorkspaceToCode: true, expectedCode: - 'void proc_name() {\n' + - '}\n\n\n' + - 'main() {\n' + - '}', - createBlock: createBlockFn(0)}, - {title: 'One argument', + 'void proc_name() {\n' + '}\n\n\n' + 'main() {\n' + '}', + createBlock: createBlockFn(0), + }, + { + title: 'One argument', useWorkspaceToCode: true, expectedCode: - 'var x;\n\n' + - 'void proc_name(x) {\n' + - '}\n\n\n' + - 'main() {\n' + - '}', - createBlock: createBlockFn(1)}, - ]}, - {title: 'JavaScript', generator: javascriptGenerator, + 'var x;\n\n' + + 'void proc_name(x) {\n' + + '}\n\n\n' + + 'main() {\n' + + '}', + createBlock: createBlockFn(1), + }, + ], + }, + { + title: 'JavaScript', + generator: javascriptGenerator, testCases: [ - {title: 'No arguments', + { + title: 'No arguments', useWorkspaceToCode: true, - expectedCode: - 'function proc_name() {\n' + - '}\n', - createBlock: createBlockFn(0)}, - {title: 'One argument', + expectedCode: 'function proc_name() {\n' + '}\n', + createBlock: createBlockFn(0), + }, + { + title: 'One argument', useWorkspaceToCode: true, expectedCode: - 'var x;\n\n' + - 'function proc_name(x) {\n' + - '}\n', - createBlock: createBlockFn(1)}, - ]}, - {title: 'Lua', generator: luaGenerator, + 'var x;\n\n' + 'function proc_name(x) {\n' + '}\n', + createBlock: createBlockFn(1), + }, + ], + }, + { + title: 'Lua', + generator: luaGenerator, testCases: [ - {title: 'No arguments', + { + title: 'No arguments', useWorkspaceToCode: true, - expectedCode: - 'function proc_name()\n' + - 'end\n', - createBlock: createBlockFn(0)}, - {title: 'One argument', + expectedCode: 'function proc_name()\n' + 'end\n', + createBlock: createBlockFn(0), + }, + { + title: 'One argument', useWorkspaceToCode: true, - expectedCode: - 'function proc_name(x)\n' + - 'end\n', - createBlock: createBlockFn(1)}, - ]}, - {title: 'PHP', generator: phpGenerator, + expectedCode: 'function proc_name(x)\n' + 'end\n', + createBlock: createBlockFn(1), + }, + ], + }, + { + title: 'PHP', + generator: phpGenerator, testCases: [ - {title: 'No arguments', + { + title: 'No arguments', useWorkspaceToCode: true, - expectedCode: - 'function proc_name() {\n' + - '}\n', - createBlock: createBlockFn(0)}, - {title: 'One argument', + expectedCode: 'function proc_name() {\n' + '}\n', + createBlock: createBlockFn(0), + }, + { + title: 'One argument', useWorkspaceToCode: true, - expectedCode: - 'function proc_name($x) {\n' + - '}\n', - createBlock: createBlockFn(1)}, - ]}, - {title: 'Python', generator: pythonGenerator, + expectedCode: 'function proc_name($x) {\n' + '}\n', + createBlock: createBlockFn(1), + }, + ], + }, + { + title: 'Python', + generator: pythonGenerator, testCases: [ - {title: 'No arguments', + { + title: 'No arguments', useWorkspaceToCode: true, - expectedCode: - 'def proc_name():\n' + - ' pass\n', - createBlock: createBlockFn(0)}, - {title: 'One argument', + expectedCode: 'def proc_name():\n' + ' pass\n', + createBlock: createBlockFn(0), + }, + { + title: 'One argument', useWorkspaceToCode: true, expectedCode: - 'x = None\n\n' + - 'def proc_name(x):\n' + - ' pass\n', - createBlock: createBlockFn(1)}, - ]}, + 'x = None\n\n' + 'def proc_name(x):\n' + ' pass\n', + createBlock: createBlockFn(1), + }, + ], + }, ]; runCodeGenerationTestSuites(codeGenerationTestSuites); }); - suite('Xml', function() { + suite('Xml', function () { /** * Test cases for serialization tests. * @type {Array} @@ -173,132 +205,144 @@ suite('Procedure blocks', function() { title: 'Minimal definition', xml: '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, testSuite.hasReturn); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn); + }, }, { title: 'Common definition', xml: - '' + - ' do something' + - '', + '' + + ' do something' + + '', expectedXml: - '\n' + - ' do something\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, testSuite.hasReturn); - }, + '\n' + + ' do something\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn); + }, }, { title: 'With vars definition', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' do something\n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' do something\n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' do something\n' + - ' x\n' + // Because genUID is stubbed. - ' y\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure( - block, testSuite.hasReturn, ['x', 'y']); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' do something\n' + + ' x\n' + // Because genUID is stubbed. + ' y\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn, ['x', 'y']); + }, }, { title: 'No statements definition', xml: - '\n' + - ' \n' + - ' do something\n' + - '', + '\n' + + ' \n' + + ' do something\n' + + '', expectedXml: - '\n' + - ' \n' + - ' do something\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, true, [], false); - }, + '\n' + + ' \n' + + ' do something\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, true, [], false); + }, }, { title: 'Minimal caller', xml: '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'Common caller', xml: - '\n' + - ' \n' + - '', + '\n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'With vars caller', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertCallBlockStructure(block, ['x', 'y']); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertCallBlockStructure(block, ['x', 'y']); + }, }, ]; runSerializationTestSuite(testCases); }); - suite('Json', function() { + suite('Json', function () { /** * Test cases for serialization tests. * @type {Array} @@ -316,10 +360,9 @@ suite('Procedure blocks', function() { 'NAME': '', }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, testSuite.hasReturn); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn); + }, }, { title: 'Common definition', @@ -336,10 +379,9 @@ suite('Procedure blocks', function() { 'NAME': 'do something', }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, testSuite.hasReturn); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn); + }, }, { title: 'With vars definition', @@ -386,11 +428,9 @@ suite('Procedure blocks', function() { ], }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure( - block, testSuite.hasReturn, ['x', 'y']); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn, ['x', 'y']); + }, }, { title: 'No statements definition', @@ -413,11 +453,9 @@ suite('Procedure blocks', function() { 'hasStatements': false, }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure( - block, testSuite.hasReturn, [], false); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, testSuite.hasReturn, [], false); + }, }, { title: 'Minimal caller', @@ -431,10 +469,9 @@ suite('Procedure blocks', function() { 'name': '', }, }, - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'Common caller', @@ -451,10 +488,9 @@ suite('Procedure blocks', function() { 'name': 'do something', }, }, - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'With vars caller', @@ -473,201 +509,260 @@ suite('Procedure blocks', function() { 'params': ['x', 'y'], }, }, - assertBlockStructure: - (block) => { - assertCallBlockStructure(block, ['x', 'y']); - }, + assertBlockStructure: (block) => { + assertCallBlockStructure(block, ['x', 'y']); + }, }, ]; runSerializationTestSuite(testCases); }); - suite('Adding and removing inputs', function() { - setup(function() { + suite('Adding and removing inputs', function () { + setup(function () { this.def = createProcDefBlock(this.workspace, testSuite.hasReturn); this.call = createProcCallBlock(this.workspace, testSuite.hasReturn); }); - test('Add', function() { + test('Add', function () { assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn); this.def.plus(); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x']); + assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, [ + 'x', + ]); }); - test('Add many', function() { + test('Add many', function () { assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn); for (let i = 0; i < 5; i++) { this.def.plus(); } - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x', 'y', 'z', 'a', 'b']); + assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, [ + 'x', + 'y', + 'z', + 'a', + 'b', + ]); }); if (testSuite.hasReturn) { - test('Add, no stack', function() { + test('Add, no stack', function () { this.def = createProcDefBlock( - this.workspace, true, 'proc name2', false); + this.workspace, + true, + 'proc name2', + false, + ); this.call = createProcCallBlock(this.workspace, true, 'proc name2'); - assertProcBlocksStructure(this.def, this.call, true, - [], false); + assertProcBlocksStructure(this.def, this.call, true, [], false); this.def.plus(); - assertProcBlocksStructure(this.def, this.call, true, - ['x'], false); + assertProcBlocksStructure(this.def, this.call, true, ['x'], false); }); } - - test('Remove', function() { + test('Remove', function () { assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn); this.def.plus(); this.def.minus(this.def.argData_[0].argId); assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn); }); - test('Remove many', function() { + test('Remove many', function () { assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn); for (let i = 0; i < 10; i++) { this.def.plus(); } // Remove every other input. Must do it backwards so that the array // doesn't get out of whack. - for (let i = 9; i > 0; i-=2) { + for (let i = 9; i > 0; i -= 2) { this.def.minus(this.def.argData_[i].argId); } - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x', 'z', 'b', 'd', 'f']); + assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, [ + 'x', + 'z', + 'b', + 'd', + 'f', + ]); }); - test('Remove too many (w/ no args)', function() { + test('Remove too many (w/ no args)', function () { this.def.minus('whatevs'); assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn); }); - test('Remove bad arg', function() { + test('Remove bad arg', function () { this.def.plus(); this.def.minus('whatevs'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x']); + assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, [ + 'x', + ]); }); }); - suite('Vars', function() { - setup(function() { - this.assertVars = function(constsArray) { - const constNames = this.workspace.getVariablesOfType('').map( - (model) => model.name ); + suite('Vars', function () { + setup(function () { + this.assertVars = function (constsArray) { + const constNames = this.workspace + .getVariablesOfType('') + .map((model) => model.name); assert.sameMembers(constNames, constsArray); }; }); - teardown(function() { + teardown(function () { delete this.assertVars; }); - suite('Renaming args', function() { - setup(function() { + suite('Renaming args', function () { + setup(function () { this.def = createProcDefBlock(this.workspace, testSuite.hasReturn); - this.call = createProcCallBlock(this.workspace, - testSuite.hasReturn); + this.call = createProcCallBlock( + this.workspace, + testSuite.hasReturn, + ); }); - test('Simple Rename', function() { + test('Simple Rename', function () { this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue('newName'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['newName']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['newName'], + ); this.assertVars(['x', 'newName']); }); - test('Change Case', function() { + test('Change Case', function () { this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue('X'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['X']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['X'], + ); this.assertVars(['X']); }); - test('Empty', function() { + test('Empty', function () { this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue(''); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['x'], + ); this.assertVars(['x']); }); - test('Whitespace', function() { + test('Whitespace', function () { this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue(' newName '); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['newName']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['newName'], + ); this.assertVars(['x', 'newName']); }); - test('Duplicate', function() { + test('Duplicate', function () { this.def.plus(); this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue('y'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x', 'y']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['x', 'y'], + ); this.assertVars(['x', 'y']); }); - test('Duplicate Different Case', function() { + test('Duplicate Different Case', function () { this.def.plus(); this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue('Y'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['x', 'y']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['x', 'y'], + ); this.assertVars(['x', 'y']); }); - test('Match Existing', function() { + test('Match Existing', function () { this.workspace.createVariable('test', ''); this.def.plus(); const field = this.def.inputList[1].fieldRow[2]; field.setValue('test'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['test']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['test'], + ); this.assertVars(['x', 'test']); - assert.equal(this.def.argData_[0].model.getId(), - this.workspace.getVariable('test', '').getId()); + assert.equal( + this.def.argData_[0].model.getId(), + this.workspace.getVariable('test', '').getId(), + ); }); }); - suite('Vars Renamed Elsewhere', function() { - setup(function() { + suite('Vars Renamed Elsewhere', function () { + setup(function () { this.def = createProcDefBlock(this.workspace, testSuite.hasReturn); - this.call = createProcCallBlock(this.workspace, - testSuite.hasReturn); + this.call = createProcCallBlock( + this.workspace, + testSuite.hasReturn, + ); }); - test('Simple Rename', function() { + test('Simple Rename', function () { this.def.plus(); const Variable = this.workspace.getVariable('x', ''); this.workspace.renameVariableById(Variable.getId(), 'test'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['test']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['test'], + ); this.assertVars(['test']); }); // Don't know how we want to react here. - test.skip('Duplicate', function() { + test.skip('Duplicate', function () { this.def.plus(); this.def.plus(); const Variable = this.workspace.getVariable('x', ''); this.workspace.renameVariableById(Variable.getId(), 'y'); // Don't know what we want to have happen. }); - test('Change Case', function() { + test('Change Case', function () { this.def.plus(); const Variable = this.workspace.getVariable('x', ''); this.workspace.renameVariableById(Variable.getId(), 'X'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['X']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['X'], + ); this.assertVars(['X']); }); - test('Coalesce Change Case', function() { + test('Coalesce Change Case', function () { const variable = this.workspace.createVariable('test'); this.def.plus(); this.workspace.renameVariableById(variable.getId(), 'X'); - assertProcBlocksStructure(this.def, this.call, testSuite.hasReturn, - ['X']); + assertProcBlocksStructure( + this.def, + this.call, + testSuite.hasReturn, + ['X'], + ); this.assertVars(['X']); }); }); diff --git a/plugins/block-plus-minus/test/procedures_test_helpers.mocha.js b/plugins/block-plus-minus/test/procedures_test_helpers.mocha.js index 5b0d339b99..329a07d925 100644 --- a/plugins/block-plus-minus/test/procedures_test_helpers.mocha.js +++ b/plugins/block-plus-minus/test/procedures_test_helpers.mocha.js @@ -21,27 +21,45 @@ const assert = chai.assert; * statement input or not. */ function assertDefBlockStructure( - defBlock, hasReturn = false, args = [], hasStatements = true) { + defBlock, + hasReturn = false, + args = [], + hasStatements = true, +) { if (hasStatements) { - assert.isNotNull(defBlock.getInput('STACK'), - 'Def block should have STACK input'); + assert.isNotNull( + defBlock.getInput('STACK'), + 'Def block should have STACK input', + ); } else { - assert.isNull(defBlock.getInput('STACK'), - 'Def block should not have STACK input'); + assert.isNull( + defBlock.getInput('STACK'), + 'Def block should not have STACK input', + ); } if (hasReturn) { - assert.isNotNull(defBlock.getInput('RETURN'), - 'Def block should have RETURN input'); + assert.isNotNull( + defBlock.getInput('RETURN'), + 'Def block should have RETURN input', + ); } else { - assert.isNull(defBlock.getInput('RETURN'), - 'Def block should not have RETURN input'); + assert.isNull( + defBlock.getInput('RETURN'), + 'Def block should not have RETURN input', + ); } if (args.length) { - assert.include(defBlock.toString(), 'with', - 'Def block string should include "with"'); + assert.include( + defBlock.toString(), + 'with', + 'Def block string should include "with"', + ); } else { - assert.notInclude(defBlock.toString(), 'with', - 'Def block string should not include "with"'); + assert.notInclude( + defBlock.toString(), + 'with', + 'Def block string should not include "with"', + ); } assertDefBlockArgsStructure_(defBlock, hasReturn, args, hasStatements); @@ -74,7 +92,11 @@ function assertCallBlockStructure(callBlock, args = []) { * @private */ function assertDefBlockArgsStructure_( - defBlock, hasReturn, args, hasStatements) { + defBlock, + hasReturn, + args, + hasStatements, +) { // inputList also contains "TOP" input and optionally "RETURN" and "STACK" let defArgCount = defBlock.inputList.length - 1; if (hasReturn) { @@ -84,8 +106,11 @@ function assertDefBlockArgsStructure_( defArgCount--; } - assert.equal(defArgCount, args.length, - 'def block has the expected number of args'); + assert.equal( + defArgCount, + args.length, + 'def block has the expected number of args', + ); assert.sameOrderedMembers(defBlock.getVars(), args); @@ -99,15 +124,21 @@ function assertDefBlockArgsStructure_( const defInput = defBlock.inputList[i + 1]; assert.equal(defInput.type, Blockly.DUMMY_INPUT); assert.equal(defInput.name, argIds[i]); - assert.equal(defInput.fieldRow[2].getValue(), expectedName, - 'def block consts did not match expected'); + assert.equal( + defInput.fieldRow[2].getValue(), + expectedName, + 'def block consts did not match expected', + ); } // Assert the last input is not a dummy. Sometimes // arg inputs don't get moved which is bad. const lastInput = defBlock.inputList[defBlock.inputList.length - 1]; - assert.notEqual(lastInput.type, Blockly.DUMMY_INPUT, - 'last input is not a dummy'); + assert.notEqual( + lastInput.type, + Blockly.DUMMY_INPUT, + 'last input is not a dummy', + ); } /** @@ -118,16 +149,22 @@ function assertDefBlockArgsStructure_( */ function assertCallBlockArgsStructure_(callBlock, args) { // inputList also contains "TOPROW" - assert.equal(callBlock.inputList.length - 1, args.length, - 'call block has the expected number of args'); + assert.equal( + callBlock.inputList.length - 1, + args.length, + 'call block has the expected number of args', + ); for (let i = 0; i < args.length; i++) { const expectedName = args[i]; const callInput = callBlock.inputList[i + 1]; assert.equal(callInput.type, Blockly.INPUT_VALUE); assert.equal(callInput.name, 'ARG' + i); - assert.equal(callInput.fieldRow[0].getValue(), expectedName, - 'Call block consts did not match expected.'); + assert.equal( + callInput.fieldRow[0].getValue(), + expectedName, + 'Call block consts did not match expected.', + ); } } @@ -143,7 +180,12 @@ function assertCallBlockArgsStructure_(callBlock, args) { * a statement input or not. */ function assertProcBlocksStructure( - def, call, hasReturn = false, args = [], hasStatements = true) { + def, + call, + hasReturn = false, + args = [], + hasStatements = true, +) { assertDefBlockStructure(def, hasReturn, args, hasStatements); assertCallBlockStructure(call, args); } @@ -158,16 +200,27 @@ function assertProcBlocksStructure( * @returns {Blockly.Block} The created block. */ function createProcDefBlock( - workspace, hasReturn = false, nameId = 'proc name', hasStatements = true) { - const type = hasReturn ? - 'procedures_defreturn' : 'procedures_defnoreturn'; - return Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom( - '' + - ((hasStatements) ? '' : - ' \n') + - ' ' + nameId + '' + - '' - ), workspace); + workspace, + hasReturn = false, + nameId = 'proc name', + hasStatements = true, +) { + const type = hasReturn ? 'procedures_defreturn' : 'procedures_defnoreturn'; + return Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom( + '' + + (hasStatements + ? '' + : ' \n') + + ' ' + + nameId + + '' + + '', + ), + workspace, + ); } /** @@ -179,14 +232,23 @@ function createProcDefBlock( * @returns {Blockly.Block} The created block. */ function createProcCallBlock( - workspace, hasReturn = false, nameId = 'proc name') { - const type = hasReturn ? - 'procedures_callreturn' : 'procedures_callnoreturn'; - return Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom( - '' + - ' ' + - '' - ), workspace); + workspace, + hasReturn = false, + nameId = 'proc name', +) { + const type = hasReturn ? 'procedures_callreturn' : 'procedures_callnoreturn'; + return Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom( + '' + + ' ' + + '', + ), + workspace, + ); } module.exports = { diff --git a/plugins/block-plus-minus/test/test_helpers.mocha.js b/plugins/block-plus-minus/test/test_helpers.mocha.js index d41ba3a2a6..cb6ec108af 100644 --- a/plugins/block-plus-minus/test/test_helpers.mocha.js +++ b/plugins/block-plus-minus/test/test_helpers.mocha.js @@ -16,20 +16,25 @@ const {assert} = require('chai'); * @param {function(Blockly.Block, number)} assertBlockStructure The assertion * function to use. */ -function runPlusMinusTestSuite(blockType, defaultInputCount, - minimumInputCount, inputPrefix, assertBlockStructure) { - suite('Adding and removing inputs', function() { - setup(function() { +function runPlusMinusTestSuite( + blockType, + defaultInputCount, + minimumInputCount, + inputPrefix, + assertBlockStructure, +) { + suite('Adding and removing inputs', function () { + setup(function () { this.block = this.workspace.newBlock(blockType); }); - test('Add', function() { + test('Add', function () { assertBlockStructure(this.block, defaultInputCount); this.block.plus(); assertBlockStructure(this.block, defaultInputCount + 1); }); - test('Add many', function() { + test('Add many', function () { assertBlockStructure(this.block, defaultInputCount); for (let i = 0; i < 8; i++) { this.block.plus(); @@ -38,21 +43,21 @@ function runPlusMinusTestSuite(blockType, defaultInputCount, }); if (defaultInputCount === minimumInputCount) { - test('Remove', function() { + test('Remove', function () { assertBlockStructure(this.block, defaultInputCount); this.block.plus(); this.block.minus(); assertBlockStructure(this.block, defaultInputCount); }); } else { - test('Remove', function() { + test('Remove', function () { assertBlockStructure(this.block, defaultInputCount); this.block.minus(); assertBlockStructure(this.block, defaultInputCount - 1); }); } - test('Remove many', function() { + test('Remove many', function () { assertBlockStructure(this.block, defaultInputCount); for (let i = 0; i < 8; i++) { this.block.plus(); @@ -63,7 +68,7 @@ function runPlusMinusTestSuite(blockType, defaultInputCount, assertBlockStructure(this.block, defaultInputCount + 3); }); - test('Remove too many', function() { + test('Remove too many', function () { assertBlockStructure(this.block, defaultInputCount); for (let i = 0; i < defaultInputCount + 1; i++) { this.block.minus(); @@ -71,7 +76,7 @@ function runPlusMinusTestSuite(blockType, defaultInputCount, assertBlockStructure(this.block, minimumInputCount); }); - test('Remove with child attached', function() { + test('Remove with child attached', function () { const block = this.workspace.newBlock('logic_boolean'); assertBlockStructure(this.block, defaultInputCount); @@ -83,8 +88,9 @@ function runPlusMinusTestSuite(blockType, defaultInputCount, const childInputName = inputPrefix + (inputCount - 1); - this.block.getInput(childInputName).connection - .connect(block.outputConnection); + this.block + .getInput(childInputName) + .connection.connect(block.outputConnection); assert.equal(this.block.getInputTargetBlock(childInputName), block); this.block.minus(); diff --git a/plugins/block-plus-minus/test/text_join.mocha.js b/plugins/block-plus-minus/test/text_join.mocha.js index 8aacde2b63..0f9e08abe4 100644 --- a/plugins/block-plus-minus/test/text_join.mocha.js +++ b/plugins/block-plus-minus/test/text_join.mocha.js @@ -17,10 +17,14 @@ const {pythonGenerator} = require('blockly/python'); require('../src/index'); const assert = chai.assert; -const {CodeGenerationTestSuite, runCodeGenerationTestSuites, - runSerializationTestSuite, SerializationTestCase} = testHelpers; +const { + CodeGenerationTestSuite, + runCodeGenerationTestSuites, + runSerializationTestSuite, + SerializationTestCase, +} = testHelpers; -suite('Text join block', function() { +suite('Text join block', function () { /** * Asserts that the join block has the inputs and fields we expect. * @param {!Blockly.Block} block The text join block. @@ -48,20 +52,20 @@ suite('Text join block', function() { assert.notEqual(block.toString(), '“ ”'); } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Creation', function() { + test('Creation', function () { this.block = this.workspace.newBlock('text_join'); assertTextJoinBlockStructure(this.block, 2); }); - suite('Code generation', function() { + suite('Code generation', function () { const trivialCreateBlock = (workspace) => { return workspace.newBlock('text_join'); }; @@ -71,38 +75,67 @@ suite('Text join block', function() { * @type {Array} */ const testSuites = [ - {title: 'Dart', generator: dartGenerator, + { + title: 'Dart', + generator: dartGenerator, testCases: [ - {title: 'Trivial', expectedCode: '[\'\',\'\'].join()', - createBlock: trivialCreateBlock}, - ]}, - {title: 'JavaScript', generator: javascriptGenerator, + { + title: 'Trivial', + expectedCode: "['',''].join()", + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'JavaScript', + generator: javascriptGenerator, testCases: [ - - {title: 'Trivial', expectedCode: '\'\' + \'\'', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Lua', generator: luaGenerator, + { + title: 'Trivial', + expectedCode: "'' + ''", + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Lua', + generator: luaGenerator, testCases: [ - {title: 'Trivial', expectedCode: '\'\' .. \'\'', - createBlock: trivialCreateBlock}, - ]}, - {title: 'PHP', generator: phpGenerator, + { + title: 'Trivial', + expectedCode: "'' .. ''", + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'PHP', + generator: phpGenerator, testCases: [ - {title: 'Trivial', expectedCode: '\'\' . \'\'', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Python', generator: pythonGenerator, + { + title: 'Trivial', + expectedCode: "'' . ''", + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Python', + generator: pythonGenerator, testCases: [ - {title: 'Trivial', expectedCode: '\'\' + \'\'', - createBlock: trivialCreateBlock}, - ]}, + { + title: 'Trivial', + expectedCode: "'' + ''", + createBlock: trivialCreateBlock, + }, + ], + }, ]; runCodeGenerationTestSuites(testSuites); }); - suite('Xml', function() { + suite('Xml', function () { /** * Test cases for serialization tests. * @type {Array} @@ -112,64 +145,60 @@ suite('Text join block', function() { title: 'Empty XML', xml: '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 2); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 2); + }, }, { title: '0 items', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 0); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 0); + }, }, { title: '3 items', xml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 3); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 3); + }, }, { title: '3 items with child attached', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' FALSE\n' + - ' \n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 3); - const child = block.getInputTargetBlock('ADD2'); - assert.isNotNull(child); - assert.equal(child.getFieldValue('BOOL'), 'FALSE'); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' FALSE\n' + + ' \n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 3); + const child = block.getInputTargetBlock('ADD2'); + assert.isNotNull(child); + assert.equal(child.getFieldValue('BOOL'), 'FALSE'); + }, }, ]; runSerializationTestSuite(testCases); }); - suite('Json', function() { + suite('Json', function () { /** * Test cases for serialization tests. * @type {Array} @@ -187,10 +216,9 @@ suite('Text join block', function() { 'itemCount': 2, }, }, - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 2); - }, + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 2); + }, }, { title: '0 items', @@ -201,10 +229,9 @@ suite('Text join block', function() { 'itemCount': 0, }, }, - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 0); - }, + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 0); + }, }, { title: '3 items', @@ -215,10 +242,9 @@ suite('Text join block', function() { 'itemCount': 3, }, }, - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 3); - }, + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 3); + }, }, { title: '3 items with child attached', @@ -240,19 +266,17 @@ suite('Text join block', function() { }, }, }, - assertBlockStructure: - (block) => { - assertTextJoinBlockStructure(block, 3); - const child = block.getInputTargetBlock('ADD2'); - assert.isNotNull(child); - assert.equal(child.type, 'logic_boolean'); - assert.equal(child.getFieldValue('BOOL'), 'FALSE'); - }, + assertBlockStructure: (block) => { + assertTextJoinBlockStructure(block, 3); + const child = block.getInputTargetBlock('ADD2'); + assert.isNotNull(child); + assert.equal(child.type, 'logic_boolean'); + assert.equal(child.getFieldValue('BOOL'), 'FALSE'); + }, }, ]; runSerializationTestSuite(testCases); }); - runPlusMinusTestSuite('text_join', 2, 0, 'ADD', - assertTextJoinBlockStructure); + runPlusMinusTestSuite('text_join', 2, 0, 'ADD', assertTextJoinBlockStructure); }); diff --git a/plugins/block-shareable-procedures/README.md b/plugins/block-shareable-procedures/README.md index 8fac2b0e12..b961d086fa 100644 --- a/plugins/block-shareable-procedures/README.md +++ b/plugins/block-shareable-procedures/README.md @@ -11,11 +11,13 @@ you can seamlessly upgrade your existing project to use the new blocks. ## Installation ### Yarn + ``` yarn add @blockly/block-shareable-procedures ``` ### npm + ``` npm install @blockly/block-shareable-procedures ``` @@ -26,4 +28,5 @@ See [developers.google.com/blockly/guides/create-custom-blocks/procedures/using- for more information about using this plugin. ## License + Apache 2.0 diff --git a/plugins/block-shareable-procedures/package.json b/plugins/block-shareable-procedures/package.json index 0a1fc64c39..0238479483 100644 --- a/plugins/block-shareable-procedures/package.json +++ b/plugins/block-shareable-procedures/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", @@ -43,7 +43,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@blockly/eslint-config": "^3.0.0", "blockly": "^10.2.0", "chai": "^4.3.7", "jsdom": "^16.4.0", @@ -58,9 +57,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/block-shareable-procedures/src/blocks.ts b/plugins/block-shareable-procedures/src/blocks.ts index df17903379..00c3eaa520 100644 --- a/plugins/block-shareable-procedures/src/blocks.ts +++ b/plugins/block-shareable-procedures/src/blocks.ts @@ -11,7 +11,6 @@ import {ObservableParameterModel} from './observable_parameter_model'; import {IProcedureBlock} from './i_procedure_block'; import {ProcedureCreate} from './events_procedure_create'; - /* eslint-disable @typescript-eslint/naming-convention */ /** @@ -162,7 +161,7 @@ export const blocks = Blockly.common.createBlockDefinitionsFromJsonArray([ }, ]); -const procedureDefGetDefMixin = function() { +const procedureDefGetDefMixin = function () { const mixin = { model_: null, @@ -189,9 +188,10 @@ const procedureDefGetDefMixin = function() { * @returns List of variable names. * @this {Blockly.Block} */ - getVars: function() { - return this.getProcedureModel().getParameters().map( - (p) => p.getVariableModel().name); + getVars: function () { + return this.getProcedureModel() + .getParameters() + .map((p) => p.getVariableModel().name); }, /** @@ -199,23 +199,25 @@ const procedureDefGetDefMixin = function() { * @returns List of variable models. * @this {Blockly.Block} */ - getVarModels: function() { - return this.getProcedureModel().getParameters().map( - (p) => p.getVariableModel()); + getVarModels: function () { + return this.getProcedureModel() + .getParameters() + .map((p) => p.getVariableModel()); }, /** * Disposes of the data model for this procedure block when the block is * disposed. */ - destroy: function() { + destroy: function () { this.workspace.getProcedureMap().delete(this.getProcedureModel().getId()); }, }; mixin.model_ = new ObservableProcedureModel( - this.workspace, - Blockly.Procedures.findLegalName(this.getFieldValue('NAME'), this)); + this.workspace, + Blockly.Procedures.findLegalName(this.getFieldValue('NAME'), this), + ); // Events cannot be fired from instantiation when deserializing or dragging // from the flyout. So make this consistent and never fire from instantiation. @@ -228,9 +230,11 @@ const procedureDefGetDefMixin = function() { // Using register instead of registerMixin to avoid triggering warnings about // overriding built-ins. Blockly.Extensions.register( - 'procedure_def_get_def_mixin', procedureDefGetDefMixin); + 'procedure_def_get_def_mixin', + procedureDefGetDefMixin, +); -const procedureDefVarMixin = function() { +const procedureDefVarMixin = function () { const mixin = { /** * Notification that a variable is renaming. @@ -242,11 +246,12 @@ const procedureDefVarMixin = function() { * @override * @this {Blockly.Block} */ - renameVarById: function(oldId, newId) { + renameVarById: function (oldId, newId) { const oldVar = this.workspace.getVariableById(oldId); const model = this.getProcedureModel(); - const index = model.getParameters().findIndex( - (p) => p.getVariableModel() === oldVar); + const index = model + .getParameters() + .findIndex((p) => p.getVariableModel() === oldVar); if (index === -1) return; // Not found. const newVar = this.workspace.getVariableById(newId); const oldParam = model.getParameter(index); @@ -261,9 +266,10 @@ const procedureDefVarMixin = function() { * @override * @this {Blockly.Block} */ - updateVarName: function(variable) { - const containsVar = this.getProcedureModel().getParameters().some( - (p) => p.getVariableModel() === variable); + updateVarName: function (variable) { + const containsVar = this.getProcedureModel() + .getParameters() + .some((p) => p.getVariableModel() === variable); if (containsVar) { this.doProcedureUpdate(); // Rerender. } @@ -280,7 +286,7 @@ const procedureDefUpdateShapeMixin = { /** * Updates the block to reflect the state of the procedure model. */ - doProcedureUpdate: function() { + doProcedureUpdate: function () { this.setFieldValue(this.getProcedureModel().getName(), 'NAME'); this.setEnabled(this.getProcedureModel().getEnabled()); this.updateParameters_(); @@ -291,12 +297,13 @@ const procedureDefUpdateShapeMixin = { * Updates the parameters field to reflect the parameters in the procedure * model. */ - updateParameters_: function() { - const params = - this.getProcedureModel().getParameters().map((p) => p.getName()); - const paramString = params.length ? - `${Blockly.Msg['PROCEDURES_BEFORE_PARAMS']} ${params.join(', ')}` : - ''; + updateParameters_: function () { + const params = this.getProcedureModel() + .getParameters() + .map((p) => p.getName()); + const paramString = params.length + ? `${Blockly.Msg['PROCEDURES_BEFORE_PARAMS']} ${params.join(', ')}` + : ''; // The field is deterministic based on other events, no need to fire. Blockly.Events.disable(); @@ -311,7 +318,7 @@ const procedureDefUpdateShapeMixin = { * Updates the parameter blocks in the mutator (if it is open) to reflect * the state of the procedure model. */ - updateMutator_: function() { + updateMutator_: function () { const mutator = this.getIcon(Blockly.icons.MutatorIcon.TYPE); if (!mutator?.bubbleIsVisible()) return; @@ -330,13 +337,14 @@ const procedureDefUpdateShapeMixin = { * @param hasStatements True if a statement block is needed. * @this {Blockly.Block} */ - setStatements_: function(hasStatements) { + setStatements_: function (hasStatements) { if (this.hasStatements_ === hasStatements) { return; } if (hasStatements) { this.appendStatementInput('STACK').appendField( - Blockly.Msg['PROCEDURES_DEFNORETURN_DO']); + Blockly.Msg['PROCEDURES_DEFNORETURN_DO'], + ); if (this.getInput('RETURN')) { this.moveInputBefore('STACK', 'RETURN'); } @@ -358,15 +366,19 @@ const procedureDefUpdateShapeMixin = { }, }; Blockly.Extensions.registerMixin( - 'procedure_def_update_shape_mixin', procedureDefUpdateShapeMixin); + 'procedure_def_update_shape_mixin', + procedureDefUpdateShapeMixin, +); -const procedureDefValidatorHelper = function() { +const procedureDefValidatorHelper = function () { const nameField = this.getField('NAME'); nameField.setValue(Blockly.Procedures.findLegalName('', this)); nameField.setValidator(Blockly.Procedures.rename); }; Blockly.Extensions.register( - 'procedure_def_validator_helper', procedureDefValidatorHelper); + 'procedure_def_validator_helper', + procedureDefValidatorHelper, +); const procedureDefMutator = { hasStatements_: true, @@ -377,7 +389,7 @@ const procedureDefMutator = { * @returns XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { const container = Blockly.utils.xml.createElement('mutation'); const params = this.getProcedureModel().getParameters(); for (let i = 0; i < params.length; i++) { @@ -401,15 +413,20 @@ const procedureDefMutator = { * @param xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { for (let i = 0; i < xmlElement.childNodes.length; i++) { const node = xmlElement.childNodes[i]; if (node.nodeName.toLowerCase() !== 'arg') continue; const varId = node.getAttribute('varid'); this.getProcedureModel().insertParameter( - new ObservableParameterModel( - this.workspace, node.getAttribute('name'), undefined, varId), - i); + new ObservableParameterModel( + this.workspace, + node.getAttribute('name'), + undefined, + varId, + ), + i, + ); } this.setStatements_(xmlElement.getAttribute('statements') !== 'false'); }, @@ -421,7 +438,7 @@ const procedureDefMutator = { * model). Used for copy-paste. * @returns The state of this block, eg the parameters and statements. */ - saveExtraState: function(doFullSerialization) { + saveExtraState: function (doFullSerialization) { const state = Object.create(null); state['procedureId'] = this.getProcedureModel().getId(); @@ -451,7 +468,7 @@ const procedureDefMutator = { * @param state The state to apply to this block, eg the parameters and * statements. */ - loadExtraState: function(state) { + loadExtraState: function (state) { const map = this.workspace.getProcedureMap(); const procedureId = state['procedureId']; @@ -474,7 +491,9 @@ const procedureDefMutator = { for (let i = 0; i < newParams.length; i++) { const {name, id, paramId} = state['params'][i]; this.getProcedureModel().insertParameter( - new ObservableParameterModel(this.workspace, name, paramId, id), i); + new ObservableParameterModel(this.workspace, name, paramId, id), + i, + ); } this.doProcedureUpdate(); @@ -487,7 +506,7 @@ const procedureDefMutator = { * @returns Root block in mutator. * @this {Blockly.Block} */ - decompose: function(workspace) { + decompose: function (workspace) { const containerBlockDef = { 'type': 'procedures_mutatorcontainer', 'inputs': { @@ -509,9 +528,10 @@ const procedureDefMutator = { } const containerBlock = Blockly.serialization.blocks.append( - containerBlockDef as unknown as Blockly.serialization.blocks.State, - workspace, - {recordUndo: false}); + containerBlockDef as unknown as Blockly.serialization.blocks.State, + workspace, + {recordUndo: false}, + ); if (this.type === 'procedures_defreturn') { containerBlock.setFieldValue(this.hasStatements_, 'STATEMENTS'); @@ -527,7 +547,7 @@ const procedureDefMutator = { * @param containerBlock Root block in mutator. * @this {Blockly.Block} */ - compose: function(containerBlock) { + compose: function (containerBlock) { // Note that only one of these four things can actually occur for any given // composition, because the user can only drag blocks around so quickly. // So we can use that when making assumptions inside the definitions of @@ -547,7 +567,7 @@ const procedureDefMutator = { * parameter blocks in the mutator. * @param containerBlock Root block in the mutator. */ - deleteParamsFromModel_: function(containerBlock) { + deleteParamsFromModel_: function (containerBlock) { const ids = new Set(containerBlock.getDescendants().map((b) => b.id)); const model = this.getProcedureModel(); const count = model.getParameters().length; @@ -563,20 +583,22 @@ const procedureDefMutator = { * blocks have been renamed. * @param containerBlock Root block in the mutator. */ - renameParamsInModel_: function(containerBlock) { + renameParamsInModel_: function (containerBlock) { const model = this.getProcedureModel(); let i = 0; let paramBlock = containerBlock.getInputTargetBlock('STACK'); while (paramBlock && !paramBlock.isInsertionMarker()) { const param = model.getParameter(i); - if (param && - param.getId() === paramBlock.id && - param.getName() !== paramBlock.getFieldValue('NAME')) { + if ( + param && + param.getId() === paramBlock.id && + param.getName() !== paramBlock.getFieldValue('NAME') + ) { param.setName(paramBlock.getFieldValue('NAME')); } - paramBlock = paramBlock.nextConnection && - paramBlock.nextConnection.targetBlock(); + paramBlock = + paramBlock.nextConnection && paramBlock.nextConnection.targetBlock(); i++; } }, @@ -586,20 +608,24 @@ const procedureDefMutator = { * blocks. * @param containerBlock Root block in the mutator. */ - addParamsToModel_: function(containerBlock) { + addParamsToModel_: function (containerBlock) { const model = this.getProcedureModel(); let i = 0; let paramBlock = containerBlock.getInputTargetBlock('STACK'); while (paramBlock && !paramBlock.isInsertionMarker()) { - if (!model.getParameter(i) || - model.getParameter(i).getId() !== paramBlock.id) { + if ( + !model.getParameter(i) || + model.getParameter(i).getId() !== paramBlock.id + ) { model.insertParameter( - new ObservableParameterModel( - this.workspace, - paramBlock.getFieldValue('NAME'), - paramBlock.id), - i); + new ObservableParameterModel( + this.workspace, + paramBlock.getFieldValue('NAME'), + paramBlock.id, + ), + i, + ); } paramBlock = paramBlock.nextConnection && paramBlock.nextConnection.targetBlock(); @@ -608,8 +634,11 @@ const procedureDefMutator = { }, }; Blockly.Extensions.registerMutator( - 'procedure_def_mutator', procedureDefMutator, undefined, - ['procedures_mutatorarg']); + 'procedure_def_mutator', + procedureDefMutator, + undefined, + ['procedures_mutatorarg'], +); const procedureDefContextMenuMixin = { /** @@ -617,9 +646,12 @@ const procedureDefContextMenuMixin = { * @param options List of menu options to add to. * @this {Blockly.Block} */ - customContextMenu: function( - options: Array) { + customContextMenu: function ( + options: Array< + | Blockly.ContextMenuRegistry.ContextMenuOption + | Blockly.ContextMenuRegistry.LegacyContextMenuOption + >, + ) { if (this.isInFlyout) { return; } @@ -639,11 +671,14 @@ const procedureDefContextMenuMixin = { // Add option to create caller. options.push({ enabled: true, - text: - Blockly.Msg['PROCEDURES_CREATE_DO'] - .replace('%1', this.getFieldValue('NAME')), - callback: - Blockly.ContextMenu.callbackFactory(this, xmlBlock) as () => void, + text: Blockly.Msg['PROCEDURES_CREATE_DO'].replace( + '%1', + this.getFieldValue('NAME'), + ), + callback: Blockly.ContextMenu.callbackFactory( + this, + xmlBlock, + ) as () => void, }); // Add options to create getters for each parameter. @@ -657,84 +692,107 @@ const procedureDefContextMenuMixin = { argXmlBlock.appendChild(argXmlField); options.push({ enabled: true, - text: - Blockly.Msg['VARIABLES_SET_CREATE_GET'].replace('%1', argVar.name), - callback: - Blockly.ContextMenu.callbackFactory(this, argXmlBlock) as - () => void, + text: Blockly.Msg['VARIABLES_SET_CREATE_GET'].replace( + '%1', + argVar.name, + ), + callback: Blockly.ContextMenu.callbackFactory( + this, + argXmlBlock, + ) as () => void, }); } }, }; Blockly.Extensions.registerMixin( - 'procedure_def_context_menu_mixin', procedureDefContextMenuMixin); + 'procedure_def_context_menu_mixin', + procedureDefContextMenuMixin, +); const procedureDefOnChangeMixin = { - onchange: function(e) { + onchange: function (e) { if (e.type === Blockly.Events.BLOCK_CREATE && e.blockId === this.id) { Blockly.Events.fire( - new ProcedureCreate(this.workspace, this.getProcedureModel())); + new ProcedureCreate(this.workspace, this.getProcedureModel()), + ); } - if (e.type === Blockly.Events.BLOCK_CHANGE && e.blockId === this.id && - e.element === 'disabled') { + if ( + e.type === Blockly.Events.BLOCK_CHANGE && + e.blockId === this.id && + e.element === 'disabled' + ) { this.getProcedureModel().setEnabled(!e.newValue); } }, }; Blockly.Extensions.registerMixin( - 'procedure_def_onchange_mixin', procedureDefOnChangeMixin); - -const procedureDefNoReturnSetCommentHelper = function() { - if ((this.workspace.options.comments || - (this.workspace.options.parentWorkspace && - this.workspace.options.parentWorkspace.options.comments)) && - Blockly.Msg['PROCEDURES_DEFNORETURN_COMMENT']) { + 'procedure_def_onchange_mixin', + procedureDefOnChangeMixin, +); + +const procedureDefNoReturnSetCommentHelper = function () { + if ( + (this.workspace.options.comments || + (this.workspace.options.parentWorkspace && + this.workspace.options.parentWorkspace.options.comments)) && + Blockly.Msg['PROCEDURES_DEFNORETURN_COMMENT'] + ) { this.setCommentText(Blockly.Msg['PROCEDURES_DEFNORETURN_COMMENT']); } }; Blockly.Extensions.register( - 'procedure_defnoreturn_set_comment_helper', - procedureDefNoReturnSetCommentHelper); - -const procedureDefReturnSetCommentHelper = function() { - if ((this.workspace.options.comments || - (this.workspace.options.parentWorkspace && - this.workspace.options.parentWorkspace.options.comments)) && - Blockly.Msg['PROCEDURES_DEFRETURN_COMMENT']) { + 'procedure_defnoreturn_set_comment_helper', + procedureDefNoReturnSetCommentHelper, +); + +const procedureDefReturnSetCommentHelper = function () { + if ( + (this.workspace.options.comments || + (this.workspace.options.parentWorkspace && + this.workspace.options.parentWorkspace.options.comments)) && + Blockly.Msg['PROCEDURES_DEFRETURN_COMMENT'] + ) { this.setCommentText(Blockly.Msg['PROCEDURES_DEFRETURN_COMMENT']); } }; Blockly.Extensions.register( - 'procedure_defreturn_set_comment_helper', - procedureDefReturnSetCommentHelper); + 'procedure_defreturn_set_comment_helper', + procedureDefReturnSetCommentHelper, +); const procedureDefNoReturnGetCallerBlockMixin = { callType_: 'procedures_callnoreturn', }; Blockly.Extensions.registerMixin( - 'procedure_defnoreturn_get_caller_block_mixin', - procedureDefNoReturnGetCallerBlockMixin); + 'procedure_defnoreturn_get_caller_block_mixin', + procedureDefNoReturnGetCallerBlockMixin, +); const procedureDefReturnGetCallerBlockMixin = { callType_: 'procedures_callreturn', }; Blockly.Extensions.registerMixin( - 'procedure_defreturn_get_caller_block_mixin', - procedureDefReturnGetCallerBlockMixin); + 'procedure_defreturn_get_caller_block_mixin', + procedureDefReturnGetCallerBlockMixin, +); -const procedureDefSetNoReturnHelper = function() { +const procedureDefSetNoReturnHelper = function () { this.getProcedureModel().setReturnTypes(null); }; Blockly.Extensions.register( - 'procedure_def_set_no_return_helper', procedureDefSetNoReturnHelper); + 'procedure_def_set_no_return_helper', + procedureDefSetNoReturnHelper, +); -const procedureDefSetReturnHelper = function() { +const procedureDefSetReturnHelper = function () { this.getProcedureModel().setReturnTypes([]); }; Blockly.Extensions.register( - 'procedure_def_set_return_helper', procedureDefSetReturnHelper); + 'procedure_def_set_return_helper', + procedureDefSetReturnHelper, +); -const procedureCallerGetDefMixin = function() { +const procedureCallerGetDefMixin = function () { const mixin = { model_: null, @@ -759,16 +817,19 @@ const procedureCallerGetDefMixin = function() { */ findProcedureModel_(name, params = []) { const workspace = this.getTargetWorkspace_(); - const model = workspace.getProcedureMap().getProcedures().find( - (proc) => proc.getName() === name); + const model = workspace + .getProcedureMap() + .getProcedures() + .find((proc) => proc.getName() === name); if (!model) return null; const returnTypes = model.getReturnTypes(); const hasMatchingReturn = this.hasReturn_ ? returnTypes : !returnTypes; if (!hasMatchingReturn) return null; - const hasMatchingParams = - model.getParameters().every((p, i) => p.getName() === params[i]); + const hasMatchingParams = model + .getParameters() + .every((p, i) => p.getName() === params[i]); if (!hasMatchingParams) return null; return model; @@ -781,8 +842,9 @@ const procedureCallerGetDefMixin = function() { * with this block. */ getTargetWorkspace_() { - return this.workspace.isFlyout ? this.workspace.targetWorkspace : - this.workspace; + return this.workspace.isFlyout + ? this.workspace.targetWorkspace + : this.workspace; }, /** @@ -799,9 +861,10 @@ const procedureCallerGetDefMixin = function() { * @returns List of variable names. * @this {Blockly.Block} */ - getVars: function() { - return this.getProcedureModel().getParameters().map( - (p) => p.getVariableModel().name); + getVars: function () { + return this.getProcedureModel() + .getParameters() + .map((p) => p.getVariableModel().name); }, /** @@ -809,9 +872,10 @@ const procedureCallerGetDefMixin = function() { * @returns List of variable models. * @this {Blockly.Block} */ - getVarModels: function() { - return this.getProcedureModel().getParameters().map( - (p) => p.getVariableModel()); + getVarModels: function () { + return this.getProcedureModel() + .getParameters() + .map((p) => p.getVariableModel()); }, }; @@ -820,9 +884,11 @@ const procedureCallerGetDefMixin = function() { // Using register instead of registerMixin to avoid triggering warnings about // overriding built-ins. Blockly.Extensions.register( - 'procedure_caller_get_def_mixin', procedureCallerGetDefMixin); + 'procedure_caller_get_def_mixin', + procedureCallerGetDefMixin, +); -const procedureCallerVarMixin = function() { +const procedureCallerVarMixin = function () { const mixin = { /** * Notification that a variable is renaming but keeping the same ID. If the @@ -832,9 +898,10 @@ const procedureCallerVarMixin = function() { * @override * @this {Blockly.Block} */ - updateVarName: function(variable) { - const containsVar = this.getProcedureModel().getParameters().some( - (p) => p.getVariableModel() === variable); + updateVarName: function (variable) { + const containsVar = this.getProcedureModel() + .getParameters() + .some((p) => p.getVariableModel() === variable); if (containsVar) { this.doProcedureUpdate(); // Rerender. } @@ -846,7 +913,9 @@ const procedureCallerVarMixin = function() { // Using register instead of registerMixin to avoid triggering warnings about // overriding built-ins. Blockly.Extensions.register( - 'procedure_caller_var_mixin', procedureCallerVarMixin); + 'procedure_caller_var_mixin', + procedureCallerVarMixin, +); const procedureCallerMutator = { previousEnabledState_: true, @@ -859,7 +928,7 @@ const procedureCallerMutator = { * @returns XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { const container = Blockly.utils.xml.createElement('mutation'); const model = this.getProcedureModel(); if (!model) return container; @@ -879,7 +948,7 @@ const procedureCallerMutator = { * @param xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { const name = xmlElement.getAttribute('name'); const params = []; for (const n of xmlElement.childNodes) { @@ -895,7 +964,7 @@ const procedureCallerMutator = { * @returns The state of * this block, ie the params and procedure name. */ - saveExtraState: function() { + saveExtraState: function () { const state = Object.create(null); const model = this.getProcedureModel(); if (!model) return state; @@ -911,7 +980,7 @@ const procedureCallerMutator = { * @param state The state to apply to this block, ie the params and * procedure name. */ - loadExtraState: function(state) { + loadExtraState: function (state) { this.deserialize_(state['name'], state['params'] || []); }, @@ -920,7 +989,7 @@ const procedureCallerMutator = { * @param name The name to apply to the block. * @param params The parameters to apply to the block. */ - deserialize_: function(name, params) { + deserialize_: function (name, params) { this.setFieldValue(name, 'NAME'); if (!this.model_) this.model_ = this.findProcedureModel_(name, params); if (this.getProcedureModel()) { @@ -933,7 +1002,9 @@ const procedureCallerMutator = { }, }; Blockly.Extensions.registerMutator( - 'procedure_caller_mutator', procedureCallerMutator); + 'procedure_caller_mutator', + procedureCallerMutator, +); const procedureCallerUpdateShapeMixin = { /** @@ -947,7 +1018,7 @@ const procedureCallerUpdateShapeMixin = { /** * Updates the shape of this block to reflect the state of the data model. */ - doProcedureUpdate: function() { + doProcedureUpdate: function () { if (!this.getProcedureModel()) return; const id = this.getProcedureModel().getId(); if (!this.getTargetWorkspace_().getProcedureMap().has(id)) { @@ -962,12 +1033,12 @@ const procedureCallerUpdateShapeMixin = { /** * Updates the name field of this block to match the state of the data model. */ - updateName_: function() { + updateName_: function () { const name = this.getProcedureModel().getName(); this.setFieldValue(name, 'NAME'); - const baseMsg = this.outputConnection ? - Blockly.Msg['PROCEDURES_CALLRETURN_TOOLTIP'] : - Blockly.Msg['PROCEDURES_CALLNORETURN_TOOLTIP']; + const baseMsg = this.outputConnection + ? Blockly.Msg['PROCEDURES_CALLRETURN_TOOLTIP'] + : Blockly.Msg['PROCEDURES_CALLNORETURN_TOOLTIP']; this.setTooltip(baseMsg.replace('%1', name)); }, @@ -975,7 +1046,7 @@ const procedureCallerUpdateShapeMixin = { * Updates the enabled state of this block to match the state of the data * model. */ - updateEnabled_: function() { + updateEnabled_: function () { if (!this.getProcedureModel().getEnabled()) { this.previousEnabledState_ = this.isEnabled(); this.setEnabled(false); @@ -988,7 +1059,7 @@ const procedureCallerUpdateShapeMixin = { * Updates the parameter fields/inputs of this block to match the state of the * data model. */ - updateParameters_: function() { + updateParameters_: function () { this.syncArgsMap_(); this.deleteAllArgInputs_(); this.addParametersLabel__(); @@ -1003,7 +1074,7 @@ const procedureCallerUpdateShapeMixin = { * not remove entries from the array, since blocks can be disconnected * temporarily during mutation (which triggers this method). */ - syncArgsMap_: function() { + syncArgsMap_: function () { // We look at the prevParams array because the current state of the block // matches the old params, not the new params state. for (const [i, p] of this.prevParams_.entries()) { @@ -1016,7 +1087,7 @@ const procedureCallerUpdateShapeMixin = { * Saves a map of parameter IDs to target blocks attached to the inputs * of this caller block. */ - updateArgsMap_: function() { + updateArgsMap_: function () { for (const [i, p] of this.getProcedureModel().getParameters().entries()) { const target = this.getInputTargetBlock(`ARG${i}`); if (target) { @@ -1030,7 +1101,7 @@ const procedureCallerUpdateShapeMixin = { /** * Deletes all the parameter inputs on this block. */ - deleteAllArgInputs_: function() { + deleteAllArgInputs_: function () { let i = 0; while (this.getInput(`ARG${i}`)) { this.removeInput(`ARG${i}`); @@ -1041,12 +1112,14 @@ const procedureCallerUpdateShapeMixin = { /** * Adds or removes the parameter label to match the state of the data model. */ - addParametersLabel__: function() { + addParametersLabel__: function () { const topRow = this.getInput('TOPROW'); if (this.getProcedureModel().getParameters().length) { if (!this.getField('WITH')) { topRow.appendField( - Blockly.Msg['PROCEDURES_CALL_BEFORE_PARAMS'], 'WITH'); + Blockly.Msg['PROCEDURES_CALL_BEFORE_PARAMS'], + 'WITH', + ); topRow.init(); } } else if (this.getField('WITH')) { @@ -1059,14 +1132,16 @@ const procedureCallerUpdateShapeMixin = { * @param params The params to add to the block, or null to * use the params defined in the procedure model. */ - createArgInputs_: function(params = null) { + createArgInputs_: function (params = null) { if (!params) { - params = this.getProcedureModel().getParameters().map((p) => p.getName()); + params = this.getProcedureModel() + .getParameters() + .map((p) => p.getName()); } for (const [i, p] of params.entries()) { this.appendValueInput(`ARG${i}`) - .appendField(new Blockly.FieldLabel(p), `ARGNAME${i}`) - .setAlign(Blockly.Input.Align.RIGHT); + .appendField(new Blockly.FieldLabel(p), `ARGNAME${i}`) + .setAlign(Blockly.Input.Align.RIGHT); } }, @@ -1074,12 +1149,13 @@ const procedureCallerUpdateShapeMixin = { * Reattaches blocks to this blocks' inputs based on the data saved in the * argsMap_. */ - reattachBlocks_: function() { + reattachBlocks_: function () { const params = this.getProcedureModel().getParameters(); for (const [i, p] of params.entries()) { if (!this.argsMap_.has(p.getId())) continue; this.getInput(`ARG${i}`).connection.connect( - this.argsMap_.get(p.getId()).outputConnection); + this.argsMap_.get(p.getId()).outputConnection, + ); } }, @@ -1090,18 +1166,20 @@ const procedureCallerUpdateShapeMixin = { * @param newName Renamed procedure. * @this {Blockly.Block} */ - renameProcedure: function(oldName, newName) { + renameProcedure: function (oldName, newName) { if (Blockly.Names.equals(oldName, this.getFieldValue('NAME'))) { this.setFieldValue(newName, 'NAME'); - const baseMsg = this.outputConnection ? - Blockly.Msg['PROCEDURES_CALLRETURN_TOOLTIP'] : - Blockly.Msg['PROCEDURES_CALLNORETURN_TOOLTIP']; + const baseMsg = this.outputConnection + ? Blockly.Msg['PROCEDURES_CALLRETURN_TOOLTIP'] + : Blockly.Msg['PROCEDURES_CALLNORETURN_TOOLTIP']; this.setTooltip(baseMsg.replace('%1', newName)); } }, }; Blockly.Extensions.registerMixin( - 'procedure_caller_update_shape_mixin', procedureCallerUpdateShapeMixin); + 'procedure_caller_update_shape_mixin', + procedureCallerUpdateShapeMixin, +); const procedureCallerOnChangeMixin = { /** @@ -1110,11 +1188,14 @@ const procedureCallerOnChangeMixin = { * @param event Change event. * @this {Blockly.Block} */ - onchange: function(event) { + onchange: function (event) { if (this.disposed || this.workspace.isFlyout) return; if (event.type === Blockly.Events.BLOCK_MOVE) this.updateArgsMap_(true); - if (event.type !== Blockly.Events.FINISHED_LOADING && - !this.eventIsCreatingThisBlockDuringPaste_(event)) return; + if ( + event.type !== Blockly.Events.FINISHED_LOADING && + !this.eventIsCreatingThisBlockDuringPaste_(event) + ) + return; // We already found our model, which means we don't need to create a block. if (this.getProcedureModel()) return; @@ -1129,13 +1210,17 @@ const procedureCallerOnChangeMixin = { // We have no def nor procedure model. Blockly.Events.setGroup(event.group); this.model_ = this.createDef_( - this.getFieldValue('NAME'), this.paramsFromSerializedState_); + this.getFieldValue('NAME'), + this.paramsFromSerializedState_, + ); Blockly.Events.setGroup(false); } if (!this.getProcedureModel()) { // We have a def, but no reference to its model. this.model_ = this.findProcedureModel_( - this.getFieldValue('NAME'), this.paramsFromSerializedState_); + this.getFieldValue('NAME'), + this.paramsFromSerializedState_, + ); } this.initBlockWithProcedureModel_(); }, @@ -1145,10 +1230,12 @@ const procedureCallerOnChangeMixin = { * @returns True if the given event is a paste event for this block. */ eventIsCreatingThisBlockDuringPaste_(event) { - return event.type === Blockly.Events.BLOCK_CREATE && - (event.blockId === this.id || event.ids.indexOf(this.id) !== -1) && - // Record undo makes sure this is during paste. - event.recordUndo; + return ( + event.type === Blockly.Events.BLOCK_CREATE && + (event.blockId === this.id || event.ids.indexOf(this.id) !== -1) && + // Record undo makes sure this is during paste. + event.recordUndo + ); }, /** @@ -1158,9 +1245,12 @@ const procedureCallerOnChangeMixin = { * @returns Whether the def block matches or not. */ defMatches_(defBlock) { - return defBlock && defBlock.type === this.defType_ && + return ( + defBlock && + defBlock.type === this.defType_ && JSON.stringify(defBlock.getVars()) === - JSON.stringify(this.paramsFromSerializedState_); + JSON.stringify(this.paramsFromSerializedState_) + ); }, /** @@ -1185,13 +1275,18 @@ const procedureCallerOnChangeMixin = { }, 'fields': {'NAME': newName}, }; - const block = Blockly.serialization.blocks - .append(blockDef, this.getTargetWorkspace_(), {recordUndo: true}); + const block = Blockly.serialization.blocks.append( + blockDef, + this.getTargetWorkspace_(), + {recordUndo: true}, + ); return (block as unknown as IProcedureBlock).getProcedureModel(); }, }; Blockly.Extensions.registerMixin( - 'procedure_caller_onchange_mixin', procedureCallerOnChangeMixin); + 'procedure_caller_onchange_mixin', + procedureCallerOnChangeMixin, +); const procedureCallerContextMenuMixin = { /** @@ -1199,7 +1294,7 @@ const procedureCallerContextMenuMixin = { * @param options List of menu options to add to. * @this {Blockly.Block} */ - customContextMenu: function(options) { + customContextMenu: function (options) { if (!this.workspace.isMovable()) { // If we center on the block and the workspace isn't movable we could // lose blocks at the edges of the workspace. @@ -1208,7 +1303,7 @@ const procedureCallerContextMenuMixin = { const name = this.getFieldValue('NAME'); const workspace = this.workspace; - const callback = function() { + const callback = function () { const def = Blockly.Procedures.getDefinition(name, workspace); if (def && def instanceof Blockly.BlockSvg) { workspace.centerOnBlock(def.id); @@ -1223,20 +1318,24 @@ const procedureCallerContextMenuMixin = { }, }; Blockly.Extensions.registerMixin( - 'procedure_caller_context_menu_mixin', procedureCallerContextMenuMixin); + 'procedure_caller_context_menu_mixin', + procedureCallerContextMenuMixin, +); const procedureCallerNoReturnGetDefBlockMixin = { hasReturn_: false, defType_: 'procedures_defnoreturn', }; Blockly.Extensions.registerMixin( - 'procedure_callernoreturn_get_def_block_mixin', - procedureCallerNoReturnGetDefBlockMixin); + 'procedure_callernoreturn_get_def_block_mixin', + procedureCallerNoReturnGetDefBlockMixin, +); const procedureCallerReturnGetDefBlockMixin = { hasReturn_: true, defType_: 'procedures_defreturn', }; Blockly.Extensions.registerMixin( - 'procedure_callerreturn_get_def_block_mixin', - procedureCallerReturnGetDefBlockMixin); + 'procedure_callerreturn_get_def_block_mixin', + procedureCallerReturnGetDefBlockMixin, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_base.ts b/plugins/block-shareable-procedures/src/events_procedure_base.ts index 0f5445a122..9ac8ab0c51 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_base.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_base.ts @@ -23,8 +23,9 @@ export abstract class ProcedureBase extends Blockly.Events.Abstract { * @param procedure The procedure model associated with this event. */ constructor( - workspace: Blockly.Workspace, - readonly procedure: Blockly.procedures.IProcedureModel) { + workspace: Blockly.Workspace, + readonly procedure: Blockly.procedures.IProcedureModel, + ) { super(); this.workspaceId = workspace.id; } diff --git a/plugins/block-shareable-procedures/src/events_procedure_change_return.ts b/plugins/block-shareable-procedures/src/events_procedure_change_return.ts index e7ae9dbec4..e0282da34f 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_change_return.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_change_return.ts @@ -1,4 +1,3 @@ - /** * @license * Copyright 2022 Google LLC @@ -8,7 +7,6 @@ import * as Blockly from 'blockly/core'; import {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; - /** * Notifies listeners that a procedure's return type/status has changed. */ @@ -19,7 +17,7 @@ export class ProcedureChangeReturn extends ProcedureBase { type = ProcedureChangeReturn.TYPE; /** The new type(s) the procedure's return has been set to. */ - private newTypes: string[]|null; + private newTypes: string[] | null; /** * Constructs the procedure change event. @@ -29,9 +27,10 @@ export class ProcedureChangeReturn extends ProcedureBase { * changed. */ constructor( - workpace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - readonly oldTypes: string[]|null) { + workpace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + readonly oldTypes: string[] | null, + ) { super(workpace, procedure); this.newTypes = procedure.getReturnTypes(); @@ -43,12 +42,14 @@ export class ProcedureChangeReturn extends ProcedureBase { * backward (undo). */ run(forward: boolean) { - const procedureModel = - this.getEventWorkspace_().getProcedureMap().get(this.procedure.getId()); + const procedureModel = this.getEventWorkspace_() + .getProcedureMap() + .get(this.procedure.getId()); if (!procedureModel) { throw new Error( - 'Cannot change the type of a procedure that does not exist ' + - 'in the procedure map'); + 'Cannot change the type of a procedure that does not exist ' + + 'in the procedure map', + ); } if (forward) { procedureModel.setReturnTypes(this.newTypes); @@ -75,23 +76,26 @@ export class ProcedureChangeReturn extends ProcedureBase { * @internal */ static fromJson( - json: ProcedureChangeReturnJson, workspace: Blockly.Workspace + json: ProcedureChangeReturnJson, + workspace: Blockly.Workspace, ): ProcedureChangeReturn { const model = workspace.getProcedureMap().get(json['procedureId']); if (!model) { throw new Error( - 'Cannot deserialize procedure change return event because the ' + - 'target procedure does not exist'); + 'Cannot deserialize procedure change return event because the ' + + 'target procedure does not exist', + ); } return new ProcedureChangeReturn(workspace, model, json['oldTypes']); } } export interface ProcedureChangeReturnJson extends ProcedureBaseJson { - oldTypes: string[]|null; + oldTypes: string[] | null; } Blockly.registry.register( - Blockly.registry.Type.EVENT, - ProcedureChangeReturn.TYPE, - ProcedureChangeReturn); + Blockly.registry.Type.EVENT, + ProcedureChangeReturn.TYPE, + ProcedureChangeReturn, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_create.ts b/plugins/block-shareable-procedures/src/events_procedure_create.ts index 410da14f53..3646421d2d 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_create.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_create.ts @@ -9,7 +9,6 @@ import {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; import {ObservableParameterModel} from './observable_parameter_model'; import {ObservableProcedureModel} from './observable_procedure_model'; - /** * Notifies listeners that a procedure data model has been created. */ @@ -42,8 +41,9 @@ export class ProcedureCreate extends ProcedureBase { */ toJson(): ProcedureCreateJson { const json = super.toJson() as ProcedureCreateJson; - json['procedure'] = - Blockly.serialization.procedures.saveProcedure(this.procedure); + json['procedure'] = Blockly.serialization.procedures.saveProcedure( + this.procedure, + ); return json; } @@ -54,15 +54,19 @@ export class ProcedureCreate extends ProcedureBase { * @returns The new procedure create event. * @internal */ - static fromJson(json: ProcedureCreateJson, workspace: Blockly.Workspace): - ProcedureCreate { + static fromJson( + json: ProcedureCreateJson, + workspace: Blockly.Workspace, + ): ProcedureCreate { return new ProcedureCreate( + workspace, + Blockly.serialization.procedures.loadProcedure( + ObservableProcedureModel, + ObservableParameterModel, + json['procedure'], workspace, - Blockly.serialization.procedures.loadProcedure( - ObservableProcedureModel, - ObservableParameterModel, - json['procedure'], - workspace)); + ), + ); } } @@ -71,4 +75,7 @@ export interface ProcedureCreateJson extends ProcedureBaseJson { } Blockly.registry.register( - Blockly.registry.Type.EVENT, ProcedureCreate.TYPE, ProcedureCreate); + Blockly.registry.Type.EVENT, + ProcedureCreate.TYPE, + ProcedureCreate, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_delete.ts b/plugins/block-shareable-procedures/src/events_procedure_delete.ts index 483cf4f818..d6e2821a6d 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_delete.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_delete.ts @@ -1,4 +1,3 @@ - /** * @license * Copyright 2022 Google LLC @@ -8,7 +7,6 @@ import * as Blockly from 'blockly/core'; import {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; - /** * Notifies listeners that a procedure data model has been deleted. */ @@ -50,13 +48,16 @@ export class ProcedureDelete extends ProcedureBase { * @returns The new procedure delete event. * @internal */ - static fromJson(json: ProcedureDeleteJson, workspace: Blockly.Workspace): - ProcedureDelete { + static fromJson( + json: ProcedureDeleteJson, + workspace: Blockly.Workspace, + ): ProcedureDelete { const model = workspace.getProcedureMap().get(json['procedureId']); if (!model) { throw new Error( - 'Cannot deserialize procedure delete event because the ' + - 'target procedure does not exist'); + 'Cannot deserialize procedure delete event because the ' + + 'target procedure does not exist', + ); } return new ProcedureDelete(workspace, model); } @@ -65,4 +66,7 @@ export class ProcedureDelete extends ProcedureBase { export type ProcedureDeleteJson = ProcedureBaseJson; Blockly.registry.register( - Blockly.registry.Type.EVENT, ProcedureDelete.TYPE, ProcedureDelete); + Blockly.registry.Type.EVENT, + ProcedureDelete.TYPE, + ProcedureDelete, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_enable.ts b/plugins/block-shareable-procedures/src/events_procedure_enable.ts index a9b1860099..bfed23a599 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_enable.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_enable.ts @@ -1,4 +1,3 @@ - /** * @license * Copyright 2022 Google LLC @@ -8,7 +7,6 @@ import * as Blockly from 'blockly/core'; import {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; - /** * Notifies listeners that the procedure data model has been enabled or * disabled. @@ -31,9 +29,10 @@ export class ProcedureEnable extends ProcedureBase { * its current state. */ constructor( - workspace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - newState?: boolean) { + workspace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + newState?: boolean, + ) { super(workspace, procedure); if (newState === undefined) { @@ -51,12 +50,14 @@ export class ProcedureEnable extends ProcedureBase { * backward (undo). */ run(forward: boolean) { - const procedureModel = - this.getEventWorkspace_().getProcedureMap().get(this.procedure.getId()); + const procedureModel = this.getEventWorkspace_() + .getProcedureMap() + .get(this.procedure.getId()); if (!procedureModel) { throw new Error( - 'Cannot change the enabled state of a procedure that does not ' + - 'exist in the procedure map'); + 'Cannot change the enabled state of a procedure that does not ' + + 'exist in the procedure map', + ); } if (forward) { procedureModel.setEnabled(this.newState); @@ -82,13 +83,16 @@ export class ProcedureEnable extends ProcedureBase { * @returns The new procedure enable event. * @internal */ - static fromJson(json: ProcedureEnableJson, workspace: Blockly.Workspace): - ProcedureEnable { + static fromJson( + json: ProcedureEnableJson, + workspace: Blockly.Workspace, + ): ProcedureEnable { const model = workspace.getProcedureMap().get(json['procedureId']); if (!model) { throw new Error( - 'Cannot deserialize procedure enable event because the ' + - 'target procedure does not exist'); + 'Cannot deserialize procedure enable event because the ' + + 'target procedure does not exist', + ); } return new ProcedureEnable(workspace, model, json['newState']); } @@ -99,4 +103,7 @@ export interface ProcedureEnableJson extends ProcedureBaseJson { } Blockly.registry.register( - Blockly.registry.Type.EVENT, ProcedureEnable.TYPE, ProcedureEnable); + Blockly.registry.Type.EVENT, + ProcedureEnable.TYPE, + ProcedureEnable, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_parameter_base.ts b/plugins/block-shareable-procedures/src/events_procedure_parameter_base.ts index 5406aba0f3..02a7c55303 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_parameter_base.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_parameter_base.ts @@ -1,4 +1,3 @@ - /** * @license * Copyright 2022 Google LLC @@ -8,7 +7,6 @@ import * as Blockly from 'blockly/core'; import {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; - /** * The base event for an event associated with a procedure parameter. */ @@ -25,9 +23,10 @@ export abstract class ProcedureParameterBase extends ProcedureBase { * @param parameter The parameter model associated with this event. */ constructor( - workspace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - readonly parameter: Blockly.procedures.IParameterModel) { + workspace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + readonly parameter: Blockly.procedures.IParameterModel, + ) { super(workspace, procedure); this.recordUndo = false; } @@ -43,14 +42,15 @@ export abstract class ProcedureParameterBase extends ProcedureBase { * @internal */ static findMatchingParameter( - workspace: Blockly.Workspace, - procedureId: string, - paramId: string + workspace: Blockly.Workspace, + procedureId: string, + paramId: string, ): ProcedureParameterPair { const procedure = workspace.getProcedureMap().get(procedureId); if (!procedure) return {procedure: undefined, parameter: undefined}; - const parameter = procedure.getParameters() - .find((p) => p.getId() === paramId); + const parameter = procedure + .getParameters() + .find((p) => p.getId() === paramId); if (!parameter) return {procedure, parameter: undefined}; return {procedure, parameter}; } diff --git a/plugins/block-shareable-procedures/src/events_procedure_parameter_create.ts b/plugins/block-shareable-procedures/src/events_procedure_parameter_create.ts index 670b9cff2e..fba6c61573 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_parameter_create.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_parameter_create.ts @@ -5,10 +5,12 @@ */ import * as Blockly from 'blockly/core'; -import {ProcedureParameterBase, ProcedureParameterBaseJson} from './events_procedure_parameter_base'; +import { + ProcedureParameterBase, + ProcedureParameterBaseJson, +} from './events_procedure_parameter_base'; import {ObservableParameterModel} from './observable_parameter_model'; - /** * Notifies listeners that a parameter has been added to a procedure model. */ @@ -28,10 +30,11 @@ export class ProcedureParameterCreate extends ProcedureParameterBase { * @param index The index the parameter was inserted at. */ constructor( - workspace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - parameter: ObservableParameterModel, - readonly index: number) { + workspace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + parameter: ObservableParameterModel, + readonly index: number, + ) { super(workspace, procedure, parameter); } @@ -46,8 +49,9 @@ export class ProcedureParameterCreate extends ProcedureParameterBase { const procedureModel = procedureMap.get(this.procedure.getId()); if (!procedureModel) { throw new Error( - 'Cannot add a parameter to a procedure that does not exist ' + - 'in the procedure map'); + 'Cannot add a parameter to a procedure that does not exist ' + + 'in the procedure map', + ); } if (forward) { procedureModel.insertParameter(this.parameter, this.index); @@ -77,31 +81,38 @@ export class ProcedureParameterCreate extends ProcedureParameterBase { * @internal */ static fromJson( - json: ProcedureParameterCreateJson, - workspace: Blockly.Workspace + json: ProcedureParameterCreateJson, + workspace: Blockly.Workspace, ): ProcedureParameterCreate { const procedure = workspace.getProcedureMap().get(json['procedureId']); if (!procedure) { throw new Error( - 'Cannot deserialize parameter create event because the ' + - 'target procedure does not exist'); + 'Cannot deserialize parameter create event because the ' + + 'target procedure does not exist', + ); } return new ProcedureParameterCreate( + workspace, + procedure, + new ObservableParameterModel( workspace, - procedure, - new ObservableParameterModel( - workspace, json['name'], json['id'], json['varId']), - json['index']); + json['name'], + json['id'], + json['varId'], + ), + json['index'], + ); } } -export interface ProcedureParameterCreateJson extends - ProcedureParameterBaseJson { +export interface ProcedureParameterCreateJson + extends ProcedureParameterBaseJson { parameter: Blockly.serialization.procedures.ParameterState; index: number; } Blockly.registry.register( - Blockly.registry.Type.EVENT, - ProcedureParameterCreate.TYPE, - ProcedureParameterCreate); + Blockly.registry.Type.EVENT, + ProcedureParameterCreate.TYPE, + ProcedureParameterCreate, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_parameter_delete.ts b/plugins/block-shareable-procedures/src/events_procedure_parameter_delete.ts index 39087f017f..4981626a5e 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_parameter_delete.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_parameter_delete.ts @@ -5,8 +5,10 @@ */ import * as Blockly from 'blockly/core'; -import {ProcedureParameterBase, ProcedureParameterBaseJson} from './events_procedure_parameter_base'; - +import { + ProcedureParameterBase, + ProcedureParameterBaseJson, +} from './events_procedure_parameter_base'; /** * Notifies listeners that a parameter has been removed from a procedure. @@ -26,10 +28,11 @@ export class ProcedureParameterDelete extends ProcedureParameterBase { * @param index The index the parameter was at before it was removed. */ constructor( - workspace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - parameter: Blockly.procedures.IParameterModel, - readonly index: number) { + workspace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + parameter: Blockly.procedures.IParameterModel, + readonly index: number, + ) { super(workspace, procedure, parameter); } @@ -44,8 +47,9 @@ export class ProcedureParameterDelete extends ProcedureParameterBase { const procedureModel = procedureMap.get(this.procedure.getId()); if (!procedureModel) { throw new Error( - 'Cannot add a parameter to a procedure that does not exist ' + - 'in the procedure map'); + 'Cannot add a parameter to a procedure that does not exist ' + + 'in the procedure map', + ); } if (forward) { procedureModel.deleteParameter(this.index); @@ -72,25 +76,33 @@ export class ProcedureParameterDelete extends ProcedureParameterBase { * @internal */ static fromJson( - json: ProcedureParameterDeleteJson, - workspace: Blockly.Workspace + json: ProcedureParameterDeleteJson, + workspace: Blockly.Workspace, ): ProcedureParameterDelete { const {procedure, parameter} = ProcedureParameterBase.findMatchingParameter( - workspace, json['procedureId'], json['parameterId']); + workspace, + json['procedureId'], + json['parameterId'], + ); if (!parameter) { throw new Error('Cannot delete a non existant parameter'); } return new ProcedureParameterDelete( - workspace, procedure, parameter, json['index']); + workspace, + procedure, + parameter, + json['index'], + ); } } -export interface ProcedureParameterDeleteJson extends - ProcedureParameterBaseJson { +export interface ProcedureParameterDeleteJson + extends ProcedureParameterBaseJson { index: number; } Blockly.registry.register( - Blockly.registry.Type.EVENT, - ProcedureParameterDelete.TYPE, - ProcedureParameterDelete); + Blockly.registry.Type.EVENT, + ProcedureParameterDelete.TYPE, + ProcedureParameterDelete, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_parameter_rename.ts b/plugins/block-shareable-procedures/src/events_procedure_parameter_rename.ts index 71464115fe..eafdda5858 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_parameter_rename.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_parameter_rename.ts @@ -5,10 +5,12 @@ */ import * as Blockly from 'blockly/core'; -import {ProcedureParameterBase, ProcedureParameterBaseJson} from './events_procedure_parameter_base'; +import { + ProcedureParameterBase, + ProcedureParameterBaseJson, +} from './events_procedure_parameter_base'; import {ObservableParameterModel} from './observable_parameter_model'; - /** * Notifies listeners that a procedure parameter was renamed. */ @@ -38,12 +40,13 @@ export class ProcedureParameterRename extends ProcedureParameterBase { * see what its current name is. */ constructor( - workspace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - parameter: ObservableParameterModel, - readonly oldName: string, - newName?: string, - newVarId?: string) { + workspace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + parameter: ObservableParameterModel, + readonly oldName: string, + newName?: string, + newVarId?: string, + ) { super(workspace, procedure, parameter); this.newName = newName ?? parameter.getName(); @@ -57,13 +60,16 @@ export class ProcedureParameterRename extends ProcedureParameterBase { */ run(forward: boolean) { const {parameter} = ProcedureParameterBase.findMatchingParameter( - this.getEventWorkspace_(), - this.procedure.getId(), - this.parameter.getId()); + this.getEventWorkspace_(), + this.procedure.getId(), + this.parameter.getId(), + ); if (forward) { if (parameter.getName() !== this.oldName) return; - (parameter as ObservableParameterModel) - .setName(this.newName, this.newVarId); + (parameter as ObservableParameterModel).setName( + this.newName, + this.newVarId, + ); } else { if (parameter.getName() !== this.newName) return; parameter.setName(this.oldName); @@ -90,33 +96,37 @@ export class ProcedureParameterRename extends ProcedureParameterBase { * @internal */ static fromJson( - json: ProcedureParameterRenameJson, - workspace: Blockly.Workspace + json: ProcedureParameterRenameJson, + workspace: Blockly.Workspace, ): ProcedureParameterRename { - const {procedure, parameter} = - ProcedureParameterBase.findMatchingParameter( - workspace, json['procedureId'], json['parameterId']); + const {procedure, parameter} = ProcedureParameterBase.findMatchingParameter( + workspace, + json['procedureId'], + json['parameterId'], + ); if (!parameter) { throw new Error('Cannot delete a non existant parameter'); } return new ProcedureParameterRename( - workspace, - procedure, - (parameter as ObservableParameterModel), - json['oldName'], - json['newName'], - json['newVarId']); + workspace, + procedure, + parameter as ObservableParameterModel, + json['oldName'], + json['newName'], + json['newVarId'], + ); } } -export interface ProcedureParameterRenameJson extends - ProcedureParameterBaseJson { +export interface ProcedureParameterRenameJson + extends ProcedureParameterBaseJson { oldName: string; newName: string; newVarId: string; } Blockly.registry.register( - Blockly.registry.Type.EVENT, - ProcedureParameterRename.TYPE, - ProcedureParameterRename); + Blockly.registry.Type.EVENT, + ProcedureParameterRename.TYPE, + ProcedureParameterRename, +); diff --git a/plugins/block-shareable-procedures/src/events_procedure_rename.ts b/plugins/block-shareable-procedures/src/events_procedure_rename.ts index fa46e58e4f..5673f85040 100644 --- a/plugins/block-shareable-procedures/src/events_procedure_rename.ts +++ b/plugins/block-shareable-procedures/src/events_procedure_rename.ts @@ -7,7 +7,6 @@ import * as Blockly from 'blockly/core'; import {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; - /** Notifies listeners that a procedure model has been renamed. */ export class ProcedureRename extends ProcedureBase { static readonly TYPE = 'procedure_rename'; @@ -27,10 +26,11 @@ export class ProcedureRename extends ProcedureBase { * name is. */ constructor( - workspace: Blockly.Workspace, - procedure: Blockly.procedures.IProcedureModel, - readonly oldName: string, - newName?: string) { + workspace: Blockly.Workspace, + procedure: Blockly.procedures.IProcedureModel, + readonly oldName: string, + newName?: string, + ) { super(workspace, procedure); this.newName = newName ?? procedure.getName(); @@ -42,12 +42,14 @@ export class ProcedureRename extends ProcedureBase { * backward (undo). */ run(forward: boolean) { - const procedureModel = - this.getEventWorkspace_().getProcedureMap().get(this.procedure.getId()); + const procedureModel = this.getEventWorkspace_() + .getProcedureMap() + .get(this.procedure.getId()); if (!procedureModel) { throw new Error( - 'Cannot change the type of a procedure that does not exist ' + - 'in the procedure map'); + 'Cannot change the type of a procedure that does not exist ' + + 'in the procedure map', + ); } if (forward) { if (procedureModel.getName() !== this.oldName) return; @@ -76,16 +78,23 @@ export class ProcedureRename extends ProcedureBase { * @returns The new procedure rename event. * @internal */ - static fromJson(json: ProcedureRenameJson, workspace: Blockly.Workspace): - ProcedureRename { + static fromJson( + json: ProcedureRenameJson, + workspace: Blockly.Workspace, + ): ProcedureRename { const model = workspace.getProcedureMap().get(json['procedureId']); if (!model) { throw new Error( - 'Cannot deserialize procedure rename event because the ' + - 'target procedure does not exist'); + 'Cannot deserialize procedure rename event because the ' + + 'target procedure does not exist', + ); } return new ProcedureRename( - workspace, model, json['oldName'], json['newName']); + workspace, + model, + json['oldName'], + json['newName'], + ); } } @@ -95,4 +104,7 @@ export interface ProcedureRenameJson extends ProcedureBaseJson { } Blockly.registry.register( - Blockly.registry.Type.EVENT, ProcedureRename.TYPE, ProcedureRename); + Blockly.registry.Type.EVENT, + ProcedureRename.TYPE, + ProcedureRename, +); diff --git a/plugins/block-shareable-procedures/src/i_procedure_block.ts b/plugins/block-shareable-procedures/src/i_procedure_block.ts index 3d617acee4..1f21d29d9b 100644 --- a/plugins/block-shareable-procedures/src/i_procedure_block.ts +++ b/plugins/block-shareable-procedures/src/i_procedure_block.ts @@ -1,4 +1,3 @@ - /** * @license * Copyright 2023 Google LLC @@ -7,7 +6,6 @@ import * as Blockly from 'blockly/core'; - /* eslint-disable @typescript-eslint/naming-convention */ /** The interface for a block which models a procedure. */ @@ -22,9 +20,12 @@ export interface IProcedureBlock { * @param block The block to check for procedure-y-ness. * @returns Whether this block is a procedure block or not. */ -export function isProcedureBlock(block: Blockly.Block | - IProcedureBlock): block is IProcedureBlock { - return (block as IProcedureBlock).getProcedureModel !== undefined && +export function isProcedureBlock( + block: Blockly.Block | IProcedureBlock, +): block is IProcedureBlock { + return ( + (block as IProcedureBlock).getProcedureModel !== undefined && (block as IProcedureBlock).doProcedureUpdate !== undefined && - (block as IProcedureBlock).isProcedureDef !== undefined; + (block as IProcedureBlock).isProcedureDef !== undefined + ); } diff --git a/plugins/block-shareable-procedures/src/index.ts b/plugins/block-shareable-procedures/src/index.ts index 701ef7b0b2..27acbd794c 100644 --- a/plugins/block-shareable-procedures/src/index.ts +++ b/plugins/block-shareable-procedures/src/index.ts @@ -11,20 +11,32 @@ import {ObservableProcedureModel} from './observable_procedure_model'; export {blocks} from './blocks'; export {IProcedureBlock, isProcedureBlock} from './i_procedure_block'; export {ProcedureBase, ProcedureBaseJson} from './events_procedure_base'; -export {ProcedureChangeReturn, ProcedureChangeReturnJson} from './events_procedure_change_return'; +export { + ProcedureChangeReturn, + ProcedureChangeReturnJson, +} from './events_procedure_change_return'; export {ProcedureCreate, ProcedureCreateJson} from './events_procedure_create'; export {ProcedureDelete, ProcedureDeleteJson} from './events_procedure_delete'; -export {ProcedureParameterBase, ProcedureParameterBaseJson} from './events_procedure_parameter_base'; -export {ProcedureParameterCreate, ProcedureParameterCreateJson} from './events_procedure_parameter_create'; -export {ProcedureParameterDelete, ProcedureParameterDeleteJson} from './events_procedure_parameter_delete'; -export {ProcedureParameterRename, ProcedureParameterRenameJson} from './events_procedure_parameter_rename'; +export { + ProcedureParameterBase, + ProcedureParameterBaseJson, +} from './events_procedure_parameter_base'; +export { + ProcedureParameterCreate, + ProcedureParameterCreateJson, +} from './events_procedure_parameter_create'; +export { + ProcedureParameterDelete, + ProcedureParameterDeleteJson, +} from './events_procedure_parameter_delete'; +export { + ProcedureParameterRename, + ProcedureParameterRenameJson, +} from './events_procedure_parameter_rename'; export {ProcedureRename, ProcedureRenameJson} from './events_procedure_rename'; export {triggerProceduresUpdate} from './update_procedures'; -export { - ObservableParameterModel, - ObservableProcedureModel, -}; +export {ObservableParameterModel, ObservableProcedureModel}; /** * Unregisters all of the procedure blocks. @@ -46,7 +58,10 @@ export function unregisterProcedureBlocks() { export function registerProcedureSerializer() { Blockly.serialization.registry.unregister('procedures'); Blockly.serialization.registry.register( - 'procedures', - new Blockly.serialization.procedures.ProcedureSerializer( - ObservableProcedureModel, ObservableParameterModel)); + 'procedures', + new Blockly.serialization.procedures.ProcedureSerializer( + ObservableProcedureModel, + ObservableParameterModel, + ), + ); } diff --git a/plugins/block-shareable-procedures/src/observable_parameter_model.ts b/plugins/block-shareable-procedures/src/observable_parameter_model.ts index 380ebce15e..c685503a3e 100644 --- a/plugins/block-shareable-procedures/src/observable_parameter_model.ts +++ b/plugins/block-shareable-procedures/src/observable_parameter_model.ts @@ -9,12 +9,13 @@ import {ProcedureParameterRename} from './events_procedure_parameter_rename'; import {triggerProceduresUpdate} from './update_procedures'; /** Represents a procedure parameter. */ -export class ObservableParameterModel implements - Blockly.procedures.IParameterModel { +export class ObservableParameterModel + implements Blockly.procedures.IParameterModel +{ private id: string; private variable: Blockly.VariableModel; private shouldFireEvents = false; - private procedureModel: Blockly.procedures.IProcedureModel|null = null; + private procedureModel: Blockly.procedures.IProcedureModel | null = null; /** * Constructor for the procedure parameter. @@ -25,11 +26,15 @@ export class ObservableParameterModel implements * associated with. */ constructor( - private readonly workspace: Blockly.Workspace, name: string, id?: string, - varId?: string) { + private readonly workspace: Blockly.Workspace, + name: string, + id?: string, + varId?: string, + ) { this.id = id ?? Blockly.utils.idGenerator.genUid(); - this.variable = this.workspace.getVariable(name) ?? - workspace.createVariable(name, '', varId); + this.variable = + this.workspace.getVariable(name) ?? + workspace.createVariable(name, '', varId); } /** @@ -42,13 +47,18 @@ export class ObservableParameterModel implements if (name === this.variable.name) return this; const oldName = this.variable.name; this.variable = - this.workspace.getVariable(name) ?? - this.workspace.createVariable(name, '', id); + this.workspace.getVariable(name) ?? + this.workspace.createVariable(name, '', id); triggerProceduresUpdate(this.workspace); if (this.shouldFireEvents) { Blockly.Events.fire( - new ProcedureParameterRename( - this.workspace, this.procedureModel, this, oldName)); + new ProcedureParameterRename( + this.workspace, + this.procedureModel, + this, + oldName, + ), + ); } return this; } @@ -63,8 +73,9 @@ export class ObservableParameterModel implements */ setTypes(types: string[]): this { throw new Error( - 'The built-in ParameterModel does not support typing. You need to ' + - 'implement your own custom ParameterModel.'); + 'The built-in ParameterModel does not support typing. You need to ' + + 'implement your own custom ParameterModel.', + ); } /** diff --git a/plugins/block-shareable-procedures/src/observable_procedure_model.ts b/plugins/block-shareable-procedures/src/observable_procedure_model.ts index f08b592bce..b3a7fa1144 100644 --- a/plugins/block-shareable-procedures/src/observable_procedure_model.ts +++ b/plugins/block-shareable-procedures/src/observable_procedure_model.ts @@ -17,11 +17,12 @@ import {triggerProceduresUpdate} from './update_procedures'; /** Represents a procedure signature. */ export class ObservableProcedureModel -implements Blockly.procedures.IProcedureModel { + implements Blockly.procedures.IProcedureModel +{ private id: string; private name: string; private parameters: ObservableParameterModel[] = []; - private returnTypes: string[]|null = null; + private returnTypes: string[] | null = null; private enabled = true; private shouldFireEvents = false; private shouldTriggerUpdates = true; @@ -33,9 +34,9 @@ implements Blockly.procedures.IProcedureModel { * @param id The (optional) unique language-neutral ID for the procedure. */ constructor( - private readonly workspace: Blockly.Workspace, - name: string, - id?: string + private readonly workspace: Blockly.Workspace, + name: string, + id?: string, ) { this.id = id ?? Blockly.utils.idGenerator.genUid(); this.name = name; @@ -65,9 +66,13 @@ implements Blockly.procedures.IProcedureModel { * @returns This procedure model. */ insertParameter( - parameterModel: ObservableParameterModel, index: number): this { - if (this.parameters[index] && - this.parameters[index].getId() === parameterModel.getId()) { + parameterModel: ObservableParameterModel, + index: number, + ): this { + if ( + this.parameters[index] && + this.parameters[index].getId() === parameterModel.getId() + ) { return this; } @@ -84,8 +89,13 @@ implements Blockly.procedures.IProcedureModel { if (this.shouldTriggerUpdates) triggerProceduresUpdate(this.workspace); if (this.shouldFireEvents) { Blockly.Events.fire( - new ProcedureParameterCreate( - this.workspace, this, parameterModel, index)); + new ProcedureParameterCreate( + this.workspace, + this, + parameterModel, + index, + ), + ); } return this; } @@ -107,7 +117,8 @@ implements Blockly.procedures.IProcedureModel { if (this.shouldFireEvents) { Blockly.Events.fire( - new ProcedureParameterDelete(this.workspace, this, oldParam, index)); + new ProcedureParameterDelete(this.workspace, this, oldParam, index), + ); } return this; } @@ -121,11 +132,12 @@ implements Blockly.procedures.IProcedureModel { * (empty array) or no return value (null). * @returns This procedure model. */ - setReturnTypes(types: string[]|null): this { + setReturnTypes(types: string[] | null): this { if (types && types.length) { throw new Error( - 'The built-in ProcedureModel does not support typing. You need to ' + - 'implement your own custom ProcedureModel.'); + 'The built-in ProcedureModel does not support typing. You need to ' + + 'implement your own custom ProcedureModel.', + ); } // Either they're both an empty array, or both null. Noop either way. if (!!types === !!this.returnTypes) return this; @@ -134,7 +146,8 @@ implements Blockly.procedures.IProcedureModel { if (this.shouldTriggerUpdates) triggerProceduresUpdate(this.workspace); if (this.shouldFireEvents) { Blockly.Events.fire( - new ProcedureChangeReturn(this.workspace, this, oldReturnTypes)); + new ProcedureChangeReturn(this.workspace, this, oldReturnTypes), + ); } return this; } @@ -208,7 +221,7 @@ implements Blockly.procedures.IProcedureModel { * Null represents a procedure that does not return a value. * @returns the return type of the procedure. */ - getReturnTypes(): string[]|null { + getReturnTypes(): string[] | null { return this.returnTypes; } diff --git a/plugins/block-shareable-procedures/src/update_procedures.ts b/plugins/block-shareable-procedures/src/update_procedures.ts index f454001510..e0365ba05c 100644 --- a/plugins/block-shareable-procedures/src/update_procedures.ts +++ b/plugins/block-shareable-procedures/src/update_procedures.ts @@ -6,7 +6,6 @@ import * as Blockly from 'blockly/core'; - /** * Calls the `doProcedureUpdate` method on all blocks which implement it. * @param workspace The workspace within which to trigger block updates. diff --git a/plugins/block-shareable-procedures/test/data_models.mocha.js b/plugins/block-shareable-procedures/test/data_models.mocha.js index 0a80b6d93d..19bba816a5 100644 --- a/plugins/block-shareable-procedures/test/data_models.mocha.js +++ b/plugins/block-shareable-procedures/test/data_models.mocha.js @@ -14,209 +14,258 @@ const {ObservableParameterModel} = require('../src/observable_parameter_model'); const {ProcedureCreate} = require('../src/events_procedure_create'); const {ProcedureDelete} = require('../src/events_procedure_delete'); const {ProcedureRename} = require('../src/events_procedure_rename'); -const {ProcedureChangeReturn} = - require('../src/events_procedure_change_return'); +const { + ProcedureChangeReturn, +} = require('../src/events_procedure_change_return'); const {ProcedureEnable} = require('../src/events_procedure_enable'); -const {ProcedureParameterCreate} = - require('../src/events_procedure_parameter_create'); -const {ProcedureParameterDelete} = - require('../src/events_procedure_parameter_delete'); -const {ProcedureParameterRename} = - require('../src/events_procedure_parameter_rename'); - - -suite('Procedure data models', function() { - setup(function() { +const { + ProcedureParameterCreate, +} = require('../src/events_procedure_parameter_create'); +const { + ProcedureParameterDelete, +} = require('../src/events_procedure_parameter_delete'); +const { + ProcedureParameterRename, +} = require('../src/events_procedure_parameter_rename'); + +suite('Procedure data models', function () { + setup(function () { this.workspace = new Blockly.Workspace(); this.procedureMap = this.workspace.getProcedureMap(); this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); this.clock.runAll(); this.sandbox.restore(); }); - suite('triggering block updates', function() { - setup(function() { + suite('triggering block updates', function () { + setup(function () { Blockly.Blocks['procedure_mock'] = { - init: function() { }, - doProcedureUpdate: function() { }, - getProcedureModel: function() { }, - isProcedureDef: function() { }, + init: function () {}, + doProcedureUpdate: function () {}, + getProcedureModel: function () {}, + isProcedureDef: function () {}, }; this.procedureBlock = this.workspace.newBlock('procedure_mock'); - this.updateSpy = - this.sandbox.spy(this.procedureBlock, 'doProcedureUpdate'); + this.updateSpy = this.sandbox.spy( + this.procedureBlock, + 'doProcedureUpdate', + ); }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['procedure_mock']; }); - suite('procedure map updates', function() { - test('inserting a procedure does not trigger an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name'); + suite('procedure map updates', function () { + test('inserting a procedure does not trigger an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ); this.procedureMap.set(procedureModel.getId(), procedureModel); chai.assert.isFalse( - this.updateSpy.called, 'Expected no update to be triggered'); + this.updateSpy.called, + 'Expected no update to be triggered', + ); }); - test('adding a procedure does not trigger an update', function() { + test('adding a procedure does not trigger an update', function () { this.procedureMap.add( - new ObservableProcedureModel(this.workspace, 'test name')); + new ObservableProcedureModel(this.workspace, 'test name'), + ); chai.assert.isFalse( - this.updateSpy.called, 'Expected no update to be triggered'); + this.updateSpy.called, + 'Expected no update to be triggered', + ); }); - test('deleting a procedure triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name'); + test('deleting a procedure triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ); this.procedureMap.add(procedureModel); this.procedureMap.delete(procedureModel.getId()); chai.assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); }); - suite('procedure model updates', function() { - test('setting the name triggers an update', function() { - const procedureModel = - new ObservableProcedureModel( - this.workspace, 'test name'); + suite('procedure model updates', function () { + test('setting the name triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ); this.procedureMap.add(procedureModel); procedureModel.setName('new name'); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); - test('setting the return type triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name'); + test('setting the return type triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ); this.procedureMap.add(procedureModel); procedureModel.setReturnTypes([]); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); - test('removing the return type triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name') - .setReturnTypes([]); + test('removing the return type triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ).setReturnTypes([]); this.procedureMap.add(procedureModel); this.updateSpy.resetHistory(); procedureModel.setReturnTypes(null); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); - test('disabling the procedure triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name'); + test('disabling the procedure triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ); this.procedureMap.add(procedureModel); procedureModel.setEnabled(false); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); - test('enabling the procedure triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name') - .setEnabled(false); + test('enabling the procedure triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ).setEnabled(false); this.procedureMap.add(procedureModel); this.updateSpy.resetHistory(); procedureModel.setEnabled(true); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); - test('inserting a parameter triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name'); + test('inserting a parameter triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ); this.procedureMap.add(procedureModel); procedureModel.insertParameter( - new ObservableParameterModel(this.workspace, ''), 0); + new ObservableParameterModel(this.workspace, ''), + 0, + ); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); - test('deleting a parameter triggers an update', function() { - const procedureModel = - new ObservableProcedureModel(this.workspace, 'test name') - .insertParameter( - new ObservableParameterModel(this.workspace, ''), 0); + test('deleting a parameter triggers an update', function () { + const procedureModel = new ObservableProcedureModel( + this.workspace, + 'test name', + ).insertParameter(new ObservableParameterModel(this.workspace, ''), 0); this.procedureMap.add(procedureModel); this.updateSpy.resetHistory(); procedureModel.deleteParameter(0); assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); }); - suite('parameter model updates', function() { - test('setting the name triggers an update', function() { - const parameterModel = - new ObservableParameterModel(this.workspace, 'test1'); + suite('parameter model updates', function () { + test('setting the name triggers an update', function () { + const parameterModel = new ObservableParameterModel( + this.workspace, + 'test1', + ); this.procedureMap.add( - new ObservableProcedureModel(this.workspace, 'test name') - .insertParameter(parameterModel, 0)); + new ObservableProcedureModel( + this.workspace, + 'test name', + ).insertParameter(parameterModel, 0), + ); this.updateSpy.resetHistory(); parameterModel.setName('test2'); chai.assert.isTrue( - this.updateSpy.calledOnce, 'Expected an update to be triggered'); + this.updateSpy.calledOnce, + 'Expected an update to be triggered', + ); }); }); }); - suite('firing events', function() { - setup(function() { + suite('firing events', function () { + setup(function () { this.eventSpy = this.sandbox.spy(); this.spyData = this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.workspace.removeChangeListener(this.spyData); }); - suite('procedure model creation and destruction', function() { - test('inserting a procedure model fires a create event', function() { + suite('procedure model creation and destruction', function () { + test('inserting a procedure model fires a create event', function () { const procedure = new ObservableProcedureModel(this.workspace, 'proc'); this.procedureMap.add(procedure); this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureCreate, - {procedure}, - this.workspace.id); + this.eventSpy, + ProcedureCreate, + {procedure}, + this.workspace.id, + ); }); - test('removing a procedure model fires a delete event', function() { + test('removing a procedure model fires a delete event', function () { const procedure = new ObservableProcedureModel(this.workspace, 'proc'); this.procedureMap.add(procedure); this.clock.runAll(); @@ -226,17 +275,20 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureDelete, - {procedure}, - this.workspace.id); + this.eventSpy, + ProcedureDelete, + {procedure}, + this.workspace.id, + ); }); }); - suite('procedure model changes', function() { - test('setting the name fires a rename event', function() { - const procedure = - new ObservableProcedureModel(this.workspace, 'old name'); + suite('procedure model changes', function () { + test('setting the name fires a rename event', function () { + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ); this.procedureMap.add(procedure); this.clock.runAll(); @@ -245,20 +297,22 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureRename, - { - procedure, - oldName: 'old name', - newName: 'new name', - }, - this.workspace.id); + this.eventSpy, + ProcedureRename, + { + procedure, + oldName: 'old name', + newName: 'new name', + }, + this.workspace.id, + ); }); - test('setting the return type fires a change return event', function() { - const procedure = - new ObservableProcedureModel(this.workspace, 'old name') - .setReturnTypes(null); + test('setting the return type fires a change return event', function () { + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ).setReturnTypes(null); this.procedureMap.add(procedure); this.clock.runAll(); @@ -268,21 +322,23 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureChangeReturn, - { - procedure, - oldTypes: null, - newTypes, - }, - this.workspace.id); + this.eventSpy, + ProcedureChangeReturn, + { + procedure, + oldTypes: null, + newTypes, + }, + this.workspace.id, + ); }); - test('removing the return type fires a change return event', function() { + test('removing the return type fires a change return event', function () { const oldTypes = []; - const procedure = - new ObservableProcedureModel(this.workspace, 'old name') - .setReturnTypes(oldTypes); + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ).setReturnTypes(oldTypes); this.procedureMap.add(procedure); this.clock.runAll(); @@ -291,20 +347,22 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureChangeReturn, - { - procedure, - oldTypes, - newTypes: null, - }, - this.workspace.id); + this.eventSpy, + ProcedureChangeReturn, + { + procedure, + oldTypes, + newTypes: null, + }, + this.workspace.id, + ); }); - test('disabling the procedure fires an enable event', function() { - const procedure = - new ObservableProcedureModel(this.workspace, 'old name') - .setEnabled(true); + test('disabling the procedure fires an enable event', function () { + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ).setEnabled(true); this.procedureMap.add(procedure); this.clock.runAll(); @@ -313,20 +371,22 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureEnable, - { - procedure, - oldState: true, - newState: false, - }, - this.workspace.id); + this.eventSpy, + ProcedureEnable, + { + procedure, + oldState: true, + newState: false, + }, + this.workspace.id, + ); }); - test('enabling the procedure fires an enable event', function() { - const procedure = - new ObservableProcedureModel(this.workspace, 'old name') - .setEnabled(false); + test('enabling the procedure fires an enable event', function () { + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ).setEnabled(false); this.procedureMap.add(procedure); this.clock.runAll(); @@ -335,19 +395,22 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureEnable, - { - procedure, - oldState: false, - newState: true, - }, - this.workspace.id); + this.eventSpy, + ProcedureEnable, + { + procedure, + oldState: false, + newState: true, + }, + this.workspace.id, + ); }); - test('inserting a parameter fires a parameter create event', function() { - const procedure = - new ObservableProcedureModel(this.workspace, 'old name'); + test('inserting a parameter fires a parameter create event', function () { + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ); this.procedureMap.add(procedure); this.clock.runAll(); const parameter = new ObservableParameterModel(this.workspace, 'param'); @@ -357,21 +420,23 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterCreate, - { - procedure, - parameter, - index: 0, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterCreate, + { + procedure, + parameter, + index: 0, + }, + this.workspace.id, + ); }); - test('deleting a parameter fires a parameter delete event', function() { + test('deleting a parameter fires a parameter delete event', function () { const parameter = new ObservableParameterModel(this.workspace, 'param'); - const procedure = - new ObservableProcedureModel(this.workspace, 'old name') - .insertParameter(parameter, 0); + const procedure = new ObservableProcedureModel( + this.workspace, + 'old name', + ).insertParameter(parameter, 0); this.procedureMap.add(procedure); this.clock.runAll(); @@ -380,24 +445,30 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterDelete, - { - procedure, - parameter, - index: 0, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterDelete, + { + procedure, + parameter, + index: 0, + }, + this.workspace.id, + ); }); }); - suite('parameter model changes', function() { - test('setting the name fires a procedure rename event', function() { - const parameter = - new ObservableParameterModel(this.workspace, 'old name'); + suite('parameter model changes', function () { + test('setting the name fires a procedure rename event', function () { + const parameter = new ObservableParameterModel( + this.workspace, + 'old name', + ); this.procedureMap.add( - new ObservableProcedureModel(this.workspace, 'proc') - .insertParameter(parameter, 0)); + new ObservableProcedureModel(this.workspace, 'proc').insertParameter( + parameter, + 0, + ), + ); this.clock.runAll(); this.eventSpy.resetHistory(); @@ -405,72 +476,72 @@ suite('Procedure data models', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterRename, - { - parameter, - oldName: 'old name', - newName: 'new name', - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterRename, + { + parameter, + oldName: 'old name', + newName: 'new name', + }, + this.workspace.id, + ); }); }); }); - suite('backing variable to parameters', function() { - test( - 'construction references an existing variable if available', - function() { - const variable = this.workspace.createVariable('test1'); - const param = new ObservableParameterModel(this.workspace, 'test1'); - - chai.assert.equal( - variable, - param.getVariableModel(), - 'Expected the parameter model to reference the existing variable' - ); - }); - - test('construction creates a variable if none exists', function() { + suite('backing variable to parameters', function () { + test('construction references an existing variable if available', function () { + const variable = this.workspace.createVariable('test1'); + const param = new ObservableParameterModel(this.workspace, 'test1'); + + chai.assert.equal( + variable, + param.getVariableModel(), + 'Expected the parameter model to reference the existing variable', + ); + }); + + test('construction creates a variable if none exists', function () { const param = new ObservableParameterModel(this.workspace, 'test1'); chai.assert.equal( - this.workspace.getVariable('test1'), - param.getVariableModel(), - 'Expected the parameter model to create a variable'); + this.workspace.getVariable('test1'), + param.getVariableModel(), + 'Expected the parameter model to create a variable', + ); }); - test('setName references an existing variable if available', function() { + test('setName references an existing variable if available', function () { const variable = this.workspace.createVariable('test2'); const param = new ObservableParameterModel(this.workspace, 'test1'); param.setName('test2'); chai.assert.equal( - variable, - param.getVariableModel(), - 'Expected the parameter model to reference the existing variable'); + variable, + param.getVariableModel(), + 'Expected the parameter model to reference the existing variable', + ); }); - test('setName creates a variable if none exits', function() { + test('setName creates a variable if none exits', function () { const param = new ObservableParameterModel(this.workspace, 'test1'); param.setName('test2'); chai.assert.equal( - this.workspace.getVariable('test2'), - param.getVariableModel(), - 'Expected the parameter model to create a variable'); + this.workspace.getVariable('test2'), + param.getVariableModel(), + 'Expected the parameter model to create a variable', + ); }); - test('setTypes is unimplemented', function() { + test('setTypes is unimplemented', function () { const param = new ObservableParameterModel(this.workspace, 'test1'); - chai.assert.throws( - () => { - param.setTypes(['some', 'types']); - }, - 'The built-in ParameterModel does not support typing'); + chai.assert.throws(() => { + param.setTypes(['some', 'types']); + }, 'The built-in ParameterModel does not support typing'); }); }); }); diff --git a/plugins/block-shareable-procedures/test/event_procedure_change_return.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_change_return.mocha.js index 6f6468daf2..02257d0fd0 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_change_return.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_change_return.mocha.js @@ -11,15 +11,15 @@ const Blockly = require('blockly/node'); const eventTestHelpers = require('./event_test_helpers'); const {testHelpers} = require('@blockly/dev-tools'); const {ObservableProcedureModel} = require('../src/observable_procedure_model'); -const {ProcedureChangeReturn} = - require('../src/events_procedure_change_return'); +const { + ProcedureChangeReturn, +} = require('../src/events_procedure_change_return'); - -suite('Procedure Change Return Event', function() { +suite('Procedure Change Return Event', function () { const DEFAULT_TYPES = null; const NON_DEFAULT_TYPES = []; - setup(function() { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -28,30 +28,30 @@ suite('Procedure Change Return Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (id) => { - return new ObservableProcedureModel( - this.workspace, 'test name', id); + return new ObservableProcedureModel(this.workspace, 'test name', id); }; this.createEventToState = (procedureModel) => { const event = new ProcedureChangeReturn( - this.workspace, - procedureModel, - procedureModel.getReturnTypes() === DEFAULT_TYPES ? - NON_DEFAULT_TYPES : - DEFAULT_TYPES); + this.workspace, + procedureModel, + procedureModel.getReturnTypes() === DEFAULT_TYPES + ? NON_DEFAULT_TYPES + : DEFAULT_TYPES, + ); return event; }; }); - suite('forward (redo)', function() { - test('the procedure with the matching ID has its return set', function() { + suite('forward (redo)', function () { + test('the procedure with the matching ID has its return set', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); final.setReturnTypes(NON_DEFAULT_TYPES); @@ -62,12 +62,13 @@ suite('Procedure Change Return Event', function() { this.clock.runAll(); assert.equal( - initial.getReturnTypes(), - final.getReturnTypes(), - 'Expected the procedure\'s return type to be toggled'); + initial.getReturnTypes(), + final.getReturnTypes(), + "Expected the procedure's return type to be toggled", + ); }); - test('one changing the return fires a change return event', function() { + test('one changing the return fires a change return event', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); final.setReturnTypes(NON_DEFAULT_TYPES); @@ -79,16 +80,17 @@ suite('Procedure Change Return Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureChangeReturn, - { - procedure: initial, - oldTypes: DEFAULT_TYPES, - }, - this.workspace.id); + this.eventSpy, + ProcedureChangeReturn, + { + procedure: initial, + oldTypes: DEFAULT_TYPES, + }, + this.workspace.id, + ); }); - test('noop return changes do not fire change return events', function() { + test('noop return changes do not fire change return events', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); const event = this.createEventToState(final); @@ -99,27 +101,29 @@ suite('Procedure Change Return Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureChangeReturn, - {}, - this.workspace.id); + this.eventSpy, + ProcedureChangeReturn, + {}, + this.workspace.id, + ); }); test( - 'attempting to change the return of a procedure that ' + + 'attempting to change the return of a procedure that ' + 'does not exist in the map throws', - function() { - const final = this.createProcedureModel('test id'); - const event = this.createEventToState(final); + function () { + const final = this.createProcedureModel('test id'); + const event = this.createEventToState(final); - assert.throws(() => { - event.run(/* forward= */ true); - }); + assert.throws(() => { + event.run(/* forward= */ true); }); + }, + ); }); - suite('backward (undo)', function() { - test('the procedure with the matching ID has its return set', function() { + suite('backward (undo)', function () { + test('the procedure with the matching ID has its return set', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); initial.setReturnTypes(NON_DEFAULT_TYPES); @@ -131,12 +135,13 @@ suite('Procedure Change Return Event', function() { this.clock.runAll(); assert.equal( - initial.getReturnTypes(), - DEFAULT_TYPES, - 'Expected the procedure\'s return type to be toggled'); + initial.getReturnTypes(), + DEFAULT_TYPES, + "Expected the procedure's return type to be toggled", + ); }); - test('changing the return fires a change return event', function() { + test('changing the return fires a change return event', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); initial.setReturnTypes(NON_DEFAULT_TYPES); @@ -149,16 +154,17 @@ suite('Procedure Change Return Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureChangeReturn, - { - procedure: initial, - oldTypes: NON_DEFAULT_TYPES, - }, - this.workspace.id); + this.eventSpy, + ProcedureChangeReturn, + { + procedure: initial, + oldTypes: NON_DEFAULT_TYPES, + }, + this.workspace.id, + ); }); - test('noop return changes do not fire change return events', function() { + test('noop return changes do not fire change return events', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); undoable.setReturnTypes(NON_DEFAULT_TYPES); @@ -170,36 +176,44 @@ suite('Procedure Change Return Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureChangeReturn, - {}, - this.workspace.id); + this.eventSpy, + ProcedureChangeReturn, + {}, + this.workspace.id, + ); }); test( - 'attempting to change the return of a procedure that ' + + 'attempting to change the return of a procedure that ' + 'does not exist throws', - function() { - const initial = this.createProcedureModel('test id'); - const undoable = this.createProcedureModel('test id'); - initial.setReturnTypes(NON_DEFAULT_TYPES); - undoable.setReturnTypes(NON_DEFAULT_TYPES); - const event = this.createEventToState(undoable); - - assert.throws(() => { - event.run(/* forward= */ false); - }); + function () { + const initial = this.createProcedureModel('test id'); + const undoable = this.createProcedureModel('test id'); + initial.setReturnTypes(NON_DEFAULT_TYPES); + undoable.setReturnTypes(NON_DEFAULT_TYPES); + const event = this.createEventToState(undoable); + + assert.throws(() => { + event.run(/* forward= */ false); }); + }, + ); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const model = new ObservableProcedureModel( - this.workspace, 'test name', 'test id'); + this.workspace, + 'test name', + 'test id', + ); this.procedureMap.add(model); const origEvent = new ProcedureChangeReturn( - this.workspace, model, NON_DEFAULT_TYPES); + this.workspace, + model, + NON_DEFAULT_TYPES, + ); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_create.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_create.mocha.js index 4a73fb528f..dbe0ac6eee 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_create.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_create.mocha.js @@ -14,9 +14,8 @@ const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ProcedureCreate} = require('../src/events_procedure_create'); const {ProcedureDelete} = require('../src/events_procedure_delete'); - -suite('Procedure Create Event', function() { - setup(function() { +suite('Procedure Create Event', function () { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -25,15 +24,14 @@ suite('Procedure Create Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (name, id) => { - return new ObservableProcedureModel( - this.workspace, name, id); + return new ObservableProcedureModel(this.workspace, name, id); }; this.createEventToState = (procedureModel) => { @@ -41,8 +39,8 @@ suite('Procedure Create Event', function() { }; }); - suite('forward', function() { - test('a procedure model is created if it does not exist', function() { + suite('forward', function () { + test('a procedure model is created if it does not exist', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); @@ -52,16 +50,18 @@ suite('Procedure Create Event', function() { const createdProc = this.procedureMap.get('test id'); assert.isDefined(createdProc, 'Expected the procedure to exist'); assert.equal( - createdProc.getName(), - model.getName(), - 'Expected the procedure\'s name to match the model'); + createdProc.getName(), + model.getName(), + "Expected the procedure's name to match the model", + ); assert.equal( - createdProc.getId(), - model.getId(), - 'Expected the procedure\'s id to match the model'); + createdProc.getId(), + model.getId(), + "Expected the procedure's id to match the model", + ); }); - test('creating a procedure model fires a create event', function() { + test('creating a procedure model fires a create event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); @@ -70,31 +70,34 @@ suite('Procedure Create Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureCreate, - {procedure: this.procedureMap.get('test id')}, - this.workspace.id); + this.eventSpy, + ProcedureCreate, + {procedure: this.procedureMap.get('test id')}, + this.workspace.id, + ); }); test( - 'a procedure model is not created if a model with a ' + + 'a procedure model is not created if a model with a ' + 'matching ID exists', - function() { - const model = this.createProcedureModel('test name', 'test id'); - const event = this.createEventToState(model); - this.procedureMap.add(model); - - event.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - this.procedureMap.get('test id'), - model, - 'Expected the model in the procedure map to be the same ' + - 'as the original model'); - }); - - test('not creating a model does not fire a create event', function() { + function () { + const model = this.createProcedureModel('test name', 'test id'); + const event = this.createEventToState(model); + this.procedureMap.add(model); + + event.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + this.procedureMap.get('test id'), + model, + 'Expected the model in the procedure map to be the same ' + + 'as the original model', + ); + }, + ); + + test('not creating a model does not fire a create event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); this.procedureMap.add(model); @@ -104,30 +107,30 @@ suite('Procedure Create Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureCreate, - {}, - this.workspace.id); + this.eventSpy, + ProcedureCreate, + {}, + this.workspace.id, + ); }); }); - suite('backward', function() { - test( - 'a procedure model is deleted if a model with a matching ID exists', - function() { - const model = this.createProcedureModel('test name', 'test id'); - const event = this.createEventToState(model); - this.procedureMap.add(model); + suite('backward', function () { + test('a procedure model is deleted if a model with a matching ID exists', function () { + const model = this.createProcedureModel('test name', 'test id'); + const event = this.createEventToState(model); + this.procedureMap.add(model); - event.run(/* forward= */ false); - this.clock.runAll(); + event.run(/* forward= */ false); + this.clock.runAll(); - assert.isUndefined( - this.procedureMap.get('test id'), - 'Expected the procedure to be deleted'); - }); + assert.isUndefined( + this.procedureMap.get('test id'), + 'Expected the procedure to be deleted', + ); + }); - test('deleting a model fires a delete event', function() { + test('deleting a model fires a delete event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); this.procedureMap.add(model); @@ -137,13 +140,14 @@ suite('Procedure Create Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureDelete, - {procedure: model}, - this.workspace.id); + this.eventSpy, + ProcedureDelete, + {procedure: model}, + this.workspace.id, + ); }); - test('not deleting a model does not fire a delete event', function() { + test('not deleting a model does not fire a delete event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); @@ -152,20 +156,23 @@ suite('Procedure Create Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureDelete, - {}, - this.workspace.id); + this.eventSpy, + ProcedureDelete, + {}, + this.workspace.id, + ); }); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const model = new ObservableProcedureModel( - this.workspace, 'test name', 'test id'); - const origEvent = - new ProcedureCreate(this.workspace, model); + this.workspace, + 'test name', + 'test id', + ); + const origEvent = new ProcedureCreate(this.workspace, model); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_delete.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_delete.mocha.js index c7c50494ad..16e0474e33 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_delete.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_delete.mocha.js @@ -14,9 +14,8 @@ const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ProcedureDelete} = require('../src/events_procedure_delete'); const {ProcedureCreate} = require('../src/events_procedure_create'); - -suite('Procedure Delete Event', function() { - setup(function() { +suite('Procedure Delete Event', function () { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -25,15 +24,14 @@ suite('Procedure Delete Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (name, id) => { - return new ObservableProcedureModel( - this.workspace, name, id); + return new ObservableProcedureModel(this.workspace, name, id); }; this.createEventToState = (procedureModel) => { @@ -41,23 +39,22 @@ suite('Procedure Delete Event', function() { }; }); - suite('forward', function() { - test( - 'a procedure model is deleted if a model with a matching ID exists', - function() { - const model = this.createProcedureModel('test name', 'test id'); - const event = this.createEventToState(model); - this.procedureMap.add(model); + suite('forward', function () { + test('a procedure model is deleted if a model with a matching ID exists', function () { + const model = this.createProcedureModel('test name', 'test id'); + const event = this.createEventToState(model); + this.procedureMap.add(model); - event.run(/* forward= */ true); - this.clock.runAll(); + event.run(/* forward= */ true); + this.clock.runAll(); - assert.isUndefined( - this.procedureMap.get('test id'), - 'Expected the procedure to be deleted'); - }); + assert.isUndefined( + this.procedureMap.get('test id'), + 'Expected the procedure to be deleted', + ); + }); - test('deleting a model fires a delete event', function() { + test('deleting a model fires a delete event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); this.procedureMap.add(model); @@ -67,13 +64,14 @@ suite('Procedure Delete Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureDelete, - {procedure: model}, - this.workspace.id); + this.eventSpy, + ProcedureDelete, + {procedure: model}, + this.workspace.id, + ); }); - test('not deleting a model does not fire a delete event', function() { + test('not deleting a model does not fire a delete event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); @@ -82,15 +80,16 @@ suite('Procedure Delete Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureDelete, - {}, - this.workspace.id); + this.eventSpy, + ProcedureDelete, + {}, + this.workspace.id, + ); }); }); - suite('backward', function() { - test('a procedure model is created if it does not exist', function() { + suite('backward', function () { + test('a procedure model is created if it does not exist', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); @@ -100,16 +99,18 @@ suite('Procedure Delete Event', function() { const createdProc = this.procedureMap.get('test id'); assert.isDefined(createdProc, 'Expected the procedure to exist'); assert.equal( - createdProc.getName(), - model.getName(), - 'Expected the procedure\'s name to match the model'); + createdProc.getName(), + model.getName(), + "Expected the procedure's name to match the model", + ); assert.equal( - createdProc.getId(), - model.getId(), - 'Expected the procedure\'s id to match the model'); + createdProc.getId(), + model.getId(), + "Expected the procedure's id to match the model", + ); }); - test('creating a procedure model fires a create event', function() { + test('creating a procedure model fires a create event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); @@ -118,31 +119,34 @@ suite('Procedure Delete Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureCreate, - {procedure: this.procedureMap.get('test id')}, - this.workspace.id); + this.eventSpy, + ProcedureCreate, + {procedure: this.procedureMap.get('test id')}, + this.workspace.id, + ); }); test( - 'a procedure model is not created if a model with a ' + + 'a procedure model is not created if a model with a ' + 'matching ID exists', - function() { - const model = this.createProcedureModel('test name', 'test id'); - const event = this.createEventToState(model); - this.procedureMap.add(model); - - event.run(/* forward= */ false); - this.clock.runAll(); - - assert.equal( - this.procedureMap.get('test id'), - model, - 'Expected the model in the procedure map to be the same ' + - 'as the original model'); - }); - - test('not creating a model does not fire a create event', function() { + function () { + const model = this.createProcedureModel('test name', 'test id'); + const event = this.createEventToState(model); + this.procedureMap.add(model); + + event.run(/* forward= */ false); + this.clock.runAll(); + + assert.equal( + this.procedureMap.get('test id'), + model, + 'Expected the model in the procedure map to be the same ' + + 'as the original model', + ); + }, + ); + + test('not creating a model does not fire a create event', function () { const model = this.createProcedureModel('test name', 'test id'); const event = this.createEventToState(model); this.procedureMap.add(model); @@ -152,21 +156,24 @@ suite('Procedure Delete Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureCreate, - {}, - this.workspace.id); + this.eventSpy, + ProcedureCreate, + {}, + this.workspace.id, + ); }); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const model = new ObservableProcedureModel( - this.workspace, 'test name', 'test id'); + this.workspace, + 'test name', + 'test id', + ); this.procedureMap.add(model); - const origEvent = new ProcedureDelete( - this.workspace, model); + const origEvent = new ProcedureDelete(this.workspace, model); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_enable.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_enable.mocha.js index 40765cbe0f..46e11f332c 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_enable.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_enable.mocha.js @@ -13,9 +13,8 @@ const {testHelpers} = require('@blockly/dev-tools'); const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ProcedureEnable} = require('../src/events_procedure_enable'); - -suite('Procedure Enable Event', function() { - setup(function() { +suite('Procedure Enable Event', function () { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -24,15 +23,14 @@ suite('Procedure Enable Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (id) => { - return new ObservableProcedureModel( - this.workspace, 'test name', id); + return new ObservableProcedureModel(this.workspace, 'test name', id); }; this.createEventToState = (procedureModel) => { @@ -40,8 +38,8 @@ suite('Procedure Enable Event', function() { }; }); - suite('forward', function() { - test('the procedure with the matching ID is toggled', function() { + suite('forward', function () { + test('the procedure with the matching ID is toggled', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); final.setEnabled(!final.getEnabled()); // Set it to the non-default. @@ -52,12 +50,13 @@ suite('Procedure Enable Event', function() { this.clock.runAll(); assert.equal( - initial.getEnabled(), - final.getEnabled(), - 'Expected the procedure\'s enabled state to be flipped'); + initial.getEnabled(), + final.getEnabled(), + "Expected the procedure's enabled state to be flipped", + ); }); - test('toggling a procedure fires an enable event', function() { + test('toggling a procedure fires an enable event', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); final.setEnabled(!final.getEnabled()); // Set it to the non-default. @@ -69,13 +68,14 @@ suite('Procedure Enable Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureEnable, - {procedure: initial}, - this.workspace.id); + this.eventSpy, + ProcedureEnable, + {procedure: initial}, + this.workspace.id, + ); }); - test('noop toggles do not fire enable events', function() { + test('noop toggles do not fire enable events', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); const event = this.createEventToState(final); @@ -86,46 +86,46 @@ suite('Procedure Enable Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureEnable, - this.workspace.id); + this.eventSpy, + ProcedureEnable, + this.workspace.id, + ); + }); + + test('attempting to toggle a procedure that does not exist throws', function () { + const final = this.createProcedureModel('test id'); + final.setEnabled(!final.getEnabled()); // Set it to the non-default. + const event = this.createEventToState(final); + + assert.throws(() => { + event.run(/* forward= */ true); + }); }); - test( - 'attempting to toggle a procedure that does not exist throws', - function() { - const final = this.createProcedureModel('test id'); - final.setEnabled(!final.getEnabled()); // Set it to the non-default. - const event = this.createEventToState(final); - - assert.throws(() => { - event.run(/* forward= */ true); - }); - }); - - test( - 'deserializing the event and running it triggers the effect', - function() { - const initial = this.createProcedureModel('test id'); - const final = this.createProcedureModel('test id'); - final.setEnabled(!final.getEnabled()); // Set it to the non-default. - const event = this.createEventToState(final); - this.procedureMap.add(initial); - - const newEvent = Blockly.Events.fromJson( - event.toJson(), this.workspace); - newEvent.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - initial.getEnabled(), - final.getEnabled(), - 'Expected the procedure\'s enabled state to be flipped'); - }); + test('deserializing the event and running it triggers the effect', function () { + const initial = this.createProcedureModel('test id'); + const final = this.createProcedureModel('test id'); + final.setEnabled(!final.getEnabled()); // Set it to the non-default. + const event = this.createEventToState(final); + this.procedureMap.add(initial); + + const newEvent = Blockly.Events.fromJson( + event.toJson(), + this.workspace, + ); + newEvent.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + initial.getEnabled(), + final.getEnabled(), + "Expected the procedure's enabled state to be flipped", + ); + }); }); - suite('backward', function() { - test('the procedure with the matching ID is toggled', function() { + suite('backward', function () { + test('the procedure with the matching ID is toggled', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); // Set them to be non-default. @@ -139,12 +139,13 @@ suite('Procedure Enable Event', function() { this.clock.runAll(); assert.equal( - initial.getEnabled(), - defaultEnabled, - 'Expected the procedure\'s enabled state to be flipped'); + initial.getEnabled(), + defaultEnabled, + "Expected the procedure's enabled state to be flipped", + ); }); - test('toggling a procedure fires an enable event', function() { + test('toggling a procedure fires an enable event', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); // Set them to be non-default. @@ -159,13 +160,14 @@ suite('Procedure Enable Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureEnable, - {procedure: initial}, - this.workspace.id); + this.eventSpy, + ProcedureEnable, + {procedure: initial}, + this.workspace.id, + ); }); - test('noop toggles do not fire enable events', function() { + test('noop toggles do not fire enable events', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); // Set them to be non-default. @@ -179,37 +181,38 @@ suite('Procedure Enable Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureEnable, - {}, - this.workspace.id); + this.eventSpy, + ProcedureEnable, + {}, + this.workspace.id, + ); }); - test( - 'attempting to toggle a procedure that does not exist throws', - function() { - const initial = this.createProcedureModel('test id'); - const undoable = this.createProcedureModel('test id'); - // Set them to be non-default. - const defaultEnabled = initial.getEnabled(); - initial.setEnabled(!defaultEnabled); - undoable.setEnabled(!defaultEnabled); - const event = this.createEventToState(undoable); - - assert.throws(() => { - event.run(/* forward= */ false); - }); - }); + test('attempting to toggle a procedure that does not exist throws', function () { + const initial = this.createProcedureModel('test id'); + const undoable = this.createProcedureModel('test id'); + // Set them to be non-default. + const defaultEnabled = initial.getEnabled(); + initial.setEnabled(!defaultEnabled); + undoable.setEnabled(!defaultEnabled); + const event = this.createEventToState(undoable); + + assert.throws(() => { + event.run(/* forward= */ false); + }); + }); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const model = new ObservableProcedureModel( - this.workspace, 'test name', 'test id'); + this.workspace, + 'test name', + 'test id', + ); this.procedureMap.add(model); - const origEvent = new ProcedureEnable( - this.workspace, model); + const origEvent = new ProcedureEnable(this.workspace, model); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_parameter_create.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_parameter_create.mocha.js index 1433b6ae6f..e0e7a7d3ef 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_parameter_create.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_parameter_create.mocha.js @@ -12,14 +12,15 @@ const eventTestHelpers = require('./event_test_helpers'); const {testHelpers} = require('@blockly/dev-tools'); const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ObservableParameterModel} = require('../src/observable_parameter_model'); -const {ProcedureParameterCreate} = - require('../src/events_procedure_parameter_create'); -const {ProcedureParameterDelete} = - require('../src/events_procedure_parameter_delete'); - - -suite('Procedure Parameter Create Event', function() { - setup(function() { +const { + ProcedureParameterCreate, +} = require('../src/events_procedure_parameter_create'); +const { + ProcedureParameterDelete, +} = require('../src/events_procedure_parameter_delete'); + +suite('Procedure Parameter Create Event', function () { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -28,38 +29,58 @@ suite('Procedure Parameter Create Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (name, id, workspace) => { return new ObservableProcedureModel( - workspace ?? this.workspace, name, id); + workspace ?? this.workspace, + name, + id, + ); }; - this.createProcedureAndParameter = - (procName, procId, paramName, paramId) => { - const param = new ObservableParameterModel( - this.workspace, paramName, paramId); - const proc = new ObservableProcedureModel( - this.workspace, procName, procId) - .insertParameter(param, 0); - return {param, proc}; - }; + this.createProcedureAndParameter = ( + procName, + procId, + paramName, + paramId, + ) => { + const param = new ObservableParameterModel( + this.workspace, + paramName, + paramId, + ); + const proc = new ObservableProcedureModel( + this.workspace, + procName, + procId, + ).insertParameter(param, 0); + return {param, proc}; + }; this.createEventToState = (procedureModel, parameterModel) => { return new ProcedureParameterCreate( - this.workspace, procedureModel, parameterModel, 0); + this.workspace, + procedureModel, + parameterModel, + 0, + ); }; }); - suite('forward', function() { - test('a parameter is inserted if it does not exist', function() { + suite('forward', function () { + test('a parameter is inserted if it does not exist', function () { const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(modelProc, modelParam); const actualProc = this.createProcedureModel('test name', 'test id'); this.procedureMap.add(actualProc); @@ -70,19 +91,25 @@ suite('Procedure Parameter Create Event', function() { const createdParam = actualProc.getParameter(0); assert.isDefined(createdParam, 'Expected the parameter to exist'); assert.equal( - createdParam.getName(), - modelParam.getName(), - 'Expected the parameter\'s name to match the model'); + createdParam.getName(), + modelParam.getName(), + "Expected the parameter's name to match the model", + ); assert.equal( - createdParam.getId(), - modelParam.getId(), - 'Expected the parameter\'s id to match the model'); + createdParam.getId(), + modelParam.getId(), + "Expected the parameter's id to match the model", + ); }); - test('inserting a parameter fires a create event', function() { + test('inserting a parameter fires a create event', function () { const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(modelProc, modelParam); const actualProc = this.createProcedureModel('test name', 'test id'); this.procedureMap.add(actualProc); @@ -92,104 +119,131 @@ suite('Procedure Parameter Create Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterCreate, - { - procedure: actualProc, - parameter: actualProc.getParameter(0), - index: 0, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterCreate, + { + procedure: actualProc, + parameter: actualProc.getParameter(0), + index: 0, + }, + this.workspace.id, + ); }); test( - 'a parameter is not created if a parameter with a ' + + 'a parameter is not created if a parameter with a ' + 'matching ID and index already exists', - function() { - const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(modelProc, modelParam); - this.procedureMap.add(modelProc); - - this.eventSpy.resetHistory(); - event.run(/* forward= */ true); - this.clock.runAll(); - - const actualProc = this.procedureMap.get('test id'); - assert.equal( - actualProc, - modelProc, - 'Expected the procedure in the procedure map to not ' + - 'have changed'); - assert.equal( - actualProc.getParameter(0), - modelParam, - 'Expected the parameter to not have changed'); - }); + function () { + const {param: modelParam, proc: modelProc} = + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(modelProc, modelParam); + this.procedureMap.add(modelProc); + + this.eventSpy.resetHistory(); + event.run(/* forward= */ true); + this.clock.runAll(); + + const actualProc = this.procedureMap.get('test id'); + assert.equal( + actualProc, + modelProc, + 'Expected the procedure in the procedure map to not ' + + 'have changed', + ); + assert.equal( + actualProc.getParameter(0), + modelParam, + 'Expected the parameter to not have changed', + ); + }, + ); + + test('not creating a parameter model does not fire a create event', function () { + const {param: modelParam, proc: modelProc} = + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(modelProc, modelParam); + this.procedureMap.add(modelProc); - test( - 'not creating a parameter model does not fire a create event', - function() { - const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(modelProc, modelParam); - this.procedureMap.add(modelProc); - - this.eventSpy.resetHistory(); - event.run(/* forward= */ true); - this.clock.runAll(); - - testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureParameterCreate, - {}, - this.workspace.id); - }); + this.eventSpy.resetHistory(); + event.run(/* forward= */ true); + this.clock.runAll(); + + testHelpers.assertEventNotFired( + this.eventSpy, + ProcedureParameterCreate, + {}, + this.workspace.id, + ); + }); test( - 'deserializing the event into a different workspace creates ' + + 'deserializing the event into a different workspace creates ' + 'an identical parameter (including variable ID)', - function() { - const otherWorkspace = new Blockly.Workspace(); - const otherProcedureMap = otherWorkspace.getProcedureMap(); + function () { + const otherWorkspace = new Blockly.Workspace(); + const otherProcedureMap = otherWorkspace.getProcedureMap(); - const {param: modelParam, proc: modelProc} = + const {param: modelParam, proc: modelProc} = this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(modelProc, modelParam); - const actualProc = this.createProcedureModel( - 'test name', 'test id', otherWorkspace); - otherProcedureMap.add(actualProc); - - const otherEvent = Blockly.Events.fromJson( - event.toJson(), otherWorkspace); - otherEvent.run(/* forward= */ true); - this.clock.runAll(); - - const createdParam = actualProc.getParameter(0); - assert.isDefined(createdParam, 'Expected the parameter to exist'); - assert.equal( - createdParam.getName(), - modelParam.getName(), - 'Expected the parameter\'s name to match the model'); - assert.equal( - createdParam.getId(), - modelParam.getId(), - 'Expected the parameter\'s id to match the model'); - assert.equal( - createdParam.getVariableModel().getId(), - modelParam.getVariableModel().getId(), - 'Expected the parameter\'s variable\'s id to match the model'); - }); + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(modelProc, modelParam); + const actualProc = this.createProcedureModel( + 'test name', + 'test id', + otherWorkspace, + ); + otherProcedureMap.add(actualProc); + + const otherEvent = Blockly.Events.fromJson( + event.toJson(), + otherWorkspace, + ); + otherEvent.run(/* forward= */ true); + this.clock.runAll(); + + const createdParam = actualProc.getParameter(0); + assert.isDefined(createdParam, 'Expected the parameter to exist'); + assert.equal( + createdParam.getName(), + modelParam.getName(), + "Expected the parameter's name to match the model", + ); + assert.equal( + createdParam.getId(), + modelParam.getId(), + "Expected the parameter's id to match the model", + ); + assert.equal( + createdParam.getVariableModel().getId(), + modelParam.getVariableModel().getId(), + "Expected the parameter's variable's id to match the model", + ); + }, + ); }); - suite('backward', function() { - test('a parameter is removed if it exists', function() { - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + suite('backward', function () { + test('a parameter is removed if it exists', function () { + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(proc, param); this.procedureMap.add(proc); @@ -197,14 +251,18 @@ suite('Procedure Parameter Create Event', function() { this.clock.runAll(); assert.isUndefined( - proc.getParameter(0), - 'Expected the parameter to be deleted'); + proc.getParameter(0), + 'Expected the parameter to be deleted', + ); }); - test('removing a parameter fires a delete event', function() { - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + test('removing a parameter fires a delete event', function () { + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(proc, param); this.procedureMap.add(proc); @@ -213,36 +271,44 @@ suite('Procedure Parameter Create Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterDelete, - { - procedure: proc, - parameter: param, - index: 0, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterDelete, + { + procedure: proc, + parameter: param, + index: 0, + }, + this.workspace.id, + ); }); test( - 'running the event throws if a parameter with a ' + + 'running the event throws if a parameter with a ' + 'matching ID and index does not exist', - function() { - // TODO: Figure out what we want to do in this case. - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(proc, param); - - this.eventSpy.resetHistory(); - chai.assert.throws(() => { - event.run(/* forward= */ false); - }); + function () { + // TODO: Figure out what we want to do in this case. + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(proc, param); + + this.eventSpy.resetHistory(); + chai.assert.throws(() => { + event.run(/* forward= */ false); }); - - test('not removing a parameter does not fire a delete event', function() { - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + }, + ); + + test('not removing a parameter does not fire a delete event', function () { + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(proc, param); this.procedureMap.add(proc); proc.deleteParameter(0); @@ -252,24 +318,34 @@ suite('Procedure Parameter Create Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureParameterDelete, - {}, - this.workspace.id); + this.eventSpy, + ProcedureParameterDelete, + {}, + this.workspace.id, + ); }); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const param = new ObservableParameterModel( - this.workspace, 'test param name', 'test param id'); - const model = - new ObservableProcedureModel( - this.workspace, 'test name', 'test id'); + this.workspace, + 'test param name', + 'test param id', + ); + const model = new ObservableProcedureModel( + this.workspace, + 'test name', + 'test id', + ); this.procedureMap.add(model); const origEvent = new ProcedureParameterCreate( - this.workspace, model, param, 0); + this.workspace, + model, + param, + 0, + ); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_parameter_delete.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_parameter_delete.mocha.js index 33b686b3b0..36f59bd35b 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_parameter_delete.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_parameter_delete.mocha.js @@ -12,14 +12,15 @@ const eventTestHelpers = require('./event_test_helpers'); const {testHelpers} = require('@blockly/dev-tools'); const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ObservableParameterModel} = require('../src/observable_parameter_model'); -const {ProcedureParameterDelete} = - require('../src/events_procedure_parameter_delete'); -const {ProcedureParameterCreate} = - require('../src/events_procedure_parameter_create'); - - -suite('Procedure Parameter Delete Event', function() { - setup(function() { +const { + ProcedureParameterDelete, +} = require('../src/events_procedure_parameter_delete'); +const { + ProcedureParameterCreate, +} = require('../src/events_procedure_parameter_create'); + +suite('Procedure Parameter Delete Event', function () { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -28,39 +29,54 @@ suite('Procedure Parameter Delete Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.clock.runAll(); this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (name, id) => { - return new ObservableProcedureModel( - this.workspace, name, id); + return new ObservableProcedureModel(this.workspace, name, id); }; - this.createProcedureAndParameter = - (procName, procId, paramName, paramId) => { - const param = new ObservableParameterModel( - this.workspace, procName, paramId); - const proc = new ObservableProcedureModel( - this.workspace, paramName, procId) - .insertParameter(param, 0); - return {param, proc}; - }; + this.createProcedureAndParameter = ( + procName, + procId, + paramName, + paramId, + ) => { + const param = new ObservableParameterModel( + this.workspace, + procName, + paramId, + ); + const proc = new ObservableProcedureModel( + this.workspace, + paramName, + procId, + ).insertParameter(param, 0); + return {param, proc}; + }; this.createEventToState = (procedureModel, parameterModel) => { return new ProcedureParameterDelete( - this.workspace, procedureModel, parameterModel, 0); + this.workspace, + procedureModel, + parameterModel, + 0, + ); }; }); - suite('forward', function() { - test('a parameter is removed if it exists', function() { - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + suite('forward', function () { + test('a parameter is removed if it exists', function () { + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(proc, param); this.procedureMap.add(proc); @@ -68,14 +84,18 @@ suite('Procedure Parameter Delete Event', function() { this.clock.runAll(); assert.isUndefined( - proc.getParameter(0), - 'Expected the parameter to be deleted'); + proc.getParameter(0), + 'Expected the parameter to be deleted', + ); }); - test('removing a parameter fires a delete event', function() { - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + test('removing a parameter fires a delete event', function () { + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(proc, param); this.procedureMap.add(proc); @@ -84,36 +104,44 @@ suite('Procedure Parameter Delete Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterDelete, - { - procedure: proc, - parameter: param, - index: 0, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterDelete, + { + procedure: proc, + parameter: param, + index: 0, + }, + this.workspace.id, + ); }); test( - 'running the event throws if a parameter with a ' + + 'running the event throws if a parameter with a ' + 'matching ID and index does not exist', - function() { - // TODO: Figure out what we want to do in this case. - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(proc, param); - - this.eventSpy.resetHistory(); - chai.assert.throws(() => { - event.run(/* forward= */ true); - }); + function () { + // TODO: Figure out what we want to do in this case. + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(proc, param); + + this.eventSpy.resetHistory(); + chai.assert.throws(() => { + event.run(/* forward= */ true); }); - - test('not removing a parameter does not fire a delete event', function() { - const {param, proc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + }, + ); + + test('not removing a parameter does not fire a delete event', function () { + const {param, proc} = this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(proc, param); this.procedureMap.add(proc); proc.deleteParameter(0); @@ -123,18 +151,23 @@ suite('Procedure Parameter Delete Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureParameterDelete, - {}, - this.workspace.id); + this.eventSpy, + ProcedureParameterDelete, + {}, + this.workspace.id, + ); }); }); - suite('backward', function() { - test('a parameter is inserted if it does not exist', function() { + suite('backward', function () { + test('a parameter is inserted if it does not exist', function () { const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(modelProc, modelParam); const actualProc = this.createProcedureModel('test name', 'test id'); this.procedureMap.add(actualProc); @@ -145,19 +178,25 @@ suite('Procedure Parameter Delete Event', function() { const createdParam = actualProc.getParameter(0); assert.isDefined(createdParam, 'Expected the parameter to exist'); assert.equal( - createdParam.getName(), - modelParam.getName(), - 'Expected the parameter\'s name to match the model'); + createdParam.getName(), + modelParam.getName(), + "Expected the parameter's name to match the model", + ); assert.equal( - createdParam.getId(), - modelParam.getId(), - 'Expected the parameter\'s id to match the model'); + createdParam.getId(), + modelParam.getId(), + "Expected the parameter's id to match the model", + ); }); - test('inserting a parameter fires a create event', function() { + test('inserting a parameter fires a create event', function () { const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); const event = this.createEventToState(modelProc, modelParam); const actualProc = this.createProcedureModel('test name', 'test id'); this.procedureMap.add(actualProc); @@ -167,75 +206,94 @@ suite('Procedure Parameter Delete Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterCreate, - { - procedure: actualProc, - parameter: actualProc.getParameter(0), - index: 0, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterCreate, + { + procedure: actualProc, + parameter: actualProc.getParameter(0), + index: 0, + }, + this.workspace.id, + ); }); test( - 'a parameter is not created if a parameter with a ' + + 'a parameter is not created if a parameter with a ' + 'matching ID and index already exists', - function() { - const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(modelProc, modelParam); - this.procedureMap.add(modelProc); - - this.eventSpy.resetHistory(); - event.run(/* forward= */ false); - this.clock.runAll(); - - const actualProc = this.procedureMap.get('test id'); - assert.equal( - actualProc, - modelProc, - 'Expected the procedure in the procedure map to not ' + - 'have changed'); - assert.equal( - actualProc.getParameter(0), - modelParam, - 'Expected the parameter to not have changed'); - }); + function () { + const {param: modelParam, proc: modelProc} = + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(modelProc, modelParam); + this.procedureMap.add(modelProc); + + this.eventSpy.resetHistory(); + event.run(/* forward= */ false); + this.clock.runAll(); + + const actualProc = this.procedureMap.get('test id'); + assert.equal( + actualProc, + modelProc, + 'Expected the procedure in the procedure map to not ' + + 'have changed', + ); + assert.equal( + actualProc.getParameter(0), + modelParam, + 'Expected the parameter to not have changed', + ); + }, + ); + + test('not creating a parameter model does not fire a create event', function () { + const {param: modelParam, proc: modelProc} = + this.createProcedureAndParameter( + 'test name', + 'test id', + 'test param name', + 'test param id', + ); + const event = this.createEventToState(modelProc, modelParam); + this.procedureMap.add(modelProc); - test( - 'not creating a parameter model does not fire a create event', - function() { - const {param: modelParam, proc: modelProc} = - this.createProcedureAndParameter( - 'test name', 'test id', 'test param name', 'test param id'); - const event = this.createEventToState(modelProc, modelParam); - this.procedureMap.add(modelProc); - - this.eventSpy.resetHistory(); - event.run(/* forward= */ false); - this.clock.runAll(); - - testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureParameterCreate, - {}, - this.workspace.id); - }); + this.eventSpy.resetHistory(); + event.run(/* forward= */ false); + this.clock.runAll(); + + testHelpers.assertEventNotFired( + this.eventSpy, + ProcedureParameterCreate, + {}, + this.workspace.id, + ); + }); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const param = new ObservableParameterModel( - this.workspace, 'test param name', 'test param id'); - const model = - new ObservableProcedureModel( - this.workspace, 'test name', 'test id') - .insertParameter(param, 0); + this.workspace, + 'test param name', + 'test param id', + ); + const model = new ObservableProcedureModel( + this.workspace, + 'test name', + 'test id', + ).insertParameter(param, 0); this.procedureMap.add(model); const origEvent = new ProcedureParameterDelete( - this.workspace, model, param, 0); + this.workspace, + model, + param, + 0, + ); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_parameter_rename.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_parameter_rename.mocha.js index 1af684a7ee..6557efe905 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_parameter_rename.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_parameter_rename.mocha.js @@ -12,12 +12,12 @@ const eventTestHelpers = require('./event_test_helpers'); const {testHelpers} = require('@blockly/dev-tools'); const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ObservableParameterModel} = require('../src/observable_parameter_model'); -const {ProcedureParameterRename} = - require('../src/events_procedure_parameter_rename'); +const { + ProcedureParameterRename, +} = require('../src/events_procedure_parameter_rename'); - -suite('Procedure Parameter Rename Event', function() { - setup(function() { +suite('Procedure Parameter Rename Event', function () { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -26,61 +26,66 @@ suite('Procedure Parameter Rename Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { + suite('running', function () { const DEFAULT_NAME = 'default'; const NON_DEFAULT_NAME = 'non-default'; - setup(function() { + setup(function () { this.createProcedureAndParameter = (procId, paramId) => { const param = new ObservableParameterModel( - this.workspace, DEFAULT_NAME, paramId); + this.workspace, + DEFAULT_NAME, + paramId, + ); const proc = new ObservableProcedureModel( - this.workspace, 'test name', procId) - .insertParameter(param, 0); + this.workspace, + 'test name', + procId, + ).insertParameter(param, 0); return {param, proc}; }; this.createEventToState = (procedureModel, parameterModel) => { return new ProcedureParameterRename( - this.workspace, - procedureModel, - parameterModel, - parameterModel.getName() === DEFAULT_NAME ? - NON_DEFAULT_NAME : - DEFAULT_NAME); + this.workspace, + procedureModel, + parameterModel, + parameterModel.getName() === DEFAULT_NAME + ? NON_DEFAULT_NAME + : DEFAULT_NAME, + ); }; }); - suite('forward', function() { - test( - 'the parameter with the matching ID and index is renamed', - function() { - const {param: initialParam, proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - const {param: finalParam, proc: finalProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - finalParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(finalProc, finalParam); - this.procedureMap.add(initialProc); - - event.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - initialParam.getName(), - finalParam.getName(), - 'Expected the procedure parameter\'s name to be changed'); - }); - - test('renaming a parameter fires a rename event', function() { + suite('forward', function () { + test('the parameter with the matching ID and index is renamed', function () { const {param: initialParam, proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + this.createProcedureAndParameter('test procId', 'test paramId'); const {param: finalParam, proc: finalProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + this.createProcedureAndParameter('test procId', 'test paramId'); + finalParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(finalProc, finalParam); + this.procedureMap.add(initialProc); + + event.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + initialParam.getName(), + finalParam.getName(), + "Expected the procedure parameter's name to be changed", + ); + }); + + test('renaming a parameter fires a rename event', function () { + const {param: initialParam, proc: initialProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + const {param: finalParam, proc: finalProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); finalParam.setName(NON_DEFAULT_NAME); const event = this.createEventToState(finalProc, finalParam); this.procedureMap.add(initialProc); @@ -90,21 +95,24 @@ suite('Procedure Parameter Rename Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterRename, - { - procedure: initialProc, - parameter: initialParam, - oldName: DEFAULT_NAME, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterRename, + { + procedure: initialProc, + parameter: initialParam, + oldName: DEFAULT_NAME, + }, + this.workspace.id, + ); }); - test('noop renames do not fire rename events', function() { - const {proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + test('noop renames do not fire rename events', function () { + const {proc: initialProc} = this.createProcedureAndParameter( + 'test procId', + 'test paramId', + ); const {param: finalParam, proc: finalProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + this.createProcedureAndParameter('test procId', 'test paramId'); const event = this.createEventToState(finalProc, finalParam); this.procedureMap.add(initialProc); @@ -113,100 +121,101 @@ suite('Procedure Parameter Rename Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureParameterRename, - {}, - this.workspace.id); + this.eventSpy, + ProcedureParameterRename, + {}, + this.workspace.id, + ); }); - test( - 'attempting to rename a parameter that does not exist throws', - function() { - const {param: finalParam, proc: finalProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - finalParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(finalProc, finalParam); - this.clock.runAll(); - - assert.throws(() => { - event.run(/* forward= */ true); - }); - }); + test('attempting to rename a parameter that does not exist throws', function () { + const {param: finalParam, proc: finalProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + finalParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(finalProc, finalParam); + this.clock.runAll(); + + assert.throws(() => { + event.run(/* forward= */ true); + }); + }); test( - 'attempting to rename a procedure with a different old name ' + + 'attempting to rename a procedure with a different old name ' + 'does not work', - function() { - const otherNonDefaultName = 'other non-default name'; - const {param: finalParam, proc: finalProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - finalParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(finalProc, finalParam); - const {param: testParam, proc: testProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - testParam.setName(otherNonDefaultName); - this.procedureMap.add(testProc); - - event.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - testParam.getName(), - otherNonDefaultName, - 'Expected the parameter\'s name to be unchanged'); - }); + function () { + const otherNonDefaultName = 'other non-default name'; + const {param: finalParam, proc: finalProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + finalParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(finalProc, finalParam); + const {param: testParam, proc: testProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + testParam.setName(otherNonDefaultName); + this.procedureMap.add(testProc); - test( - 'deserializing the event and running it triggers the effect', - function() { - const {param: initialParam, proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - const {param: finalParam, proc: finalProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - finalParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(finalProc, finalParam); - this.procedureMap.add(initialProc); - - const newEvent = Blockly.Events.fromJson( - event.toJson(), this.workspace); - newEvent.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - initialParam.getName(), - finalParam.getName(), - 'Expected the procedure parameter\'s name to be changed'); - }); + event.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + testParam.getName(), + otherNonDefaultName, + "Expected the parameter's name to be unchanged", + ); + }, + ); + + test('deserializing the event and running it triggers the effect', function () { + const {param: initialParam, proc: initialProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + const {param: finalParam, proc: finalProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + finalParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(finalProc, finalParam); + this.procedureMap.add(initialProc); + + const newEvent = Blockly.Events.fromJson( + event.toJson(), + this.workspace, + ); + newEvent.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + initialParam.getName(), + finalParam.getName(), + "Expected the procedure parameter's name to be changed", + ); + }); }); - suite('backward', function() { - test( - 'the parameter with the matching ID and index is renamed', - function() { - const {param: initialParam, proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - const {param: undoableParam, proc: undoableProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - initialParam.setName(NON_DEFAULT_NAME); - undoableParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(undoableProc, undoableParam); - this.procedureMap.add(initialProc); - - this.eventSpy.resetHistory(); - event.run(/* forward= */ false); - this.clock.runAll(); - - assert.equal( - initialParam.getName(), - DEFAULT_NAME, - 'Expected the procedure parameter\'s name to be changed'); - }); - - test('renaming a parameter fires a rename event', function() { + suite('backward', function () { + test('the parameter with the matching ID and index is renamed', function () { const {param: initialParam, proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + this.createProcedureAndParameter('test procId', 'test paramId'); const {param: undoableParam, proc: undoableProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + this.createProcedureAndParameter('test procId', 'test paramId'); + initialParam.setName(NON_DEFAULT_NAME); + undoableParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(undoableProc, undoableParam); + this.procedureMap.add(initialProc); + + this.eventSpy.resetHistory(); + event.run(/* forward= */ false); + this.clock.runAll(); + + assert.equal( + initialParam.getName(), + DEFAULT_NAME, + "Expected the procedure parameter's name to be changed", + ); + }); + + test('renaming a parameter fires a rename event', function () { + const {param: initialParam, proc: initialProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + const {param: undoableParam, proc: undoableProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); initialParam.setName(NON_DEFAULT_NAME); undoableParam.setName(NON_DEFAULT_NAME); const event = this.createEventToState(undoableProc, undoableParam); @@ -218,21 +227,24 @@ suite('Procedure Parameter Rename Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureParameterRename, - { - procedure: initialProc, - parameter: initialParam, - oldName: NON_DEFAULT_NAME, - }, - this.workspace.id); + this.eventSpy, + ProcedureParameterRename, + { + procedure: initialProc, + parameter: initialParam, + oldName: NON_DEFAULT_NAME, + }, + this.workspace.id, + ); }); - test('noop renames do not fire rename events', function() { - const {proc: initialProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + test('noop renames do not fire rename events', function () { + const {proc: initialProc} = this.createProcedureAndParameter( + 'test procId', + 'test paramId', + ); const {param: undoableParam, proc: undoableProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); + this.createProcedureAndParameter('test procId', 'test paramId'); undoableParam.setName(NON_DEFAULT_NAME); const event = this.createEventToState(undoableProc, undoableParam); this.procedureMap.add(initialProc); @@ -241,64 +253,75 @@ suite('Procedure Parameter Rename Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureParameterRename, - {}, - this.workspace.id); + this.eventSpy, + ProcedureParameterRename, + {}, + this.workspace.id, + ); }); - test( - 'attempting to rename a parameter that does not exist throws', - function() { - const {param: initialParam} = - this.createProcedureAndParameter('test procId', 'test paramId'); - const {param: undoableParam, proc: undoableProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - initialParam.setName(NON_DEFAULT_NAME); - undoableParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(undoableProc, undoableParam); - - assert.throws(() => { - event.run(/* forward= */ false); - }); - }); + test('attempting to rename a parameter that does not exist throws', function () { + const {param: initialParam} = this.createProcedureAndParameter( + 'test procId', + 'test paramId', + ); + const {param: undoableParam, proc: undoableProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + initialParam.setName(NON_DEFAULT_NAME); + undoableParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(undoableProc, undoableParam); + + assert.throws(() => { + event.run(/* forward= */ false); + }); + }); test( - 'attempting to rename a procedure with a different old name ' + + 'attempting to rename a procedure with a different old name ' + 'does not work', - function() { - const otherNonDefaultName = 'other non-default name'; - const {param: undoableParam, proc: undoableProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - undoableParam.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(undoableProc, undoableParam); - const {param: testParam, proc: testProc} = - this.createProcedureAndParameter('test procId', 'test paramId'); - testParam.setName(otherNonDefaultName); - this.procedureMap.add(testProc); - - event.run(/* forward= */ false); - this.clock.runAll(); - - assert.equal( - testParam.getName(), - otherNonDefaultName, - 'Expected the parameter\'s name to be unchanged'); - }); + function () { + const otherNonDefaultName = 'other non-default name'; + const {param: undoableParam, proc: undoableProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + undoableParam.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(undoableProc, undoableParam); + const {param: testParam, proc: testProc} = + this.createProcedureAndParameter('test procId', 'test paramId'); + testParam.setName(otherNonDefaultName); + this.procedureMap.add(testProc); + + event.run(/* forward= */ false); + this.clock.runAll(); + + assert.equal( + testParam.getName(), + otherNonDefaultName, + "Expected the parameter's name to be unchanged", + ); + }, + ); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const param = new ObservableParameterModel( - this.workspace, 'test param name', 'test param id'); - const model = - new ObservableProcedureModel( - this.workspace, 'test name', 'test id') - .insertParameter(param, 0); + this.workspace, + 'test param name', + 'test param id', + ); + const model = new ObservableProcedureModel( + this.workspace, + 'test name', + 'test id', + ).insertParameter(param, 0); this.procedureMap.add(model); const origEvent = new ProcedureParameterRename( - this.workspace, model, param, 'old name'); + this.workspace, + model, + param, + 'old name', + ); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_procedure_rename.mocha.js b/plugins/block-shareable-procedures/test/event_procedure_rename.mocha.js index 4c9a8f0e00..1230223f05 100644 --- a/plugins/block-shareable-procedures/test/event_procedure_rename.mocha.js +++ b/plugins/block-shareable-procedures/test/event_procedure_rename.mocha.js @@ -13,12 +13,11 @@ const {testHelpers} = require('@blockly/dev-tools'); const {ObservableProcedureModel} = require('../src/observable_procedure_model'); const {ProcedureRename} = require('../src/events_procedure_rename'); - -suite('Procedure Rename Event', function() { +suite('Procedure Rename Event', function () { const DEFAULT_NAME = 'default'; const NON_DEFAULT_NAME = 'non-default'; - setup(function() { + setup(function () { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers(); this.workspace = new Blockly.Workspace(); @@ -27,29 +26,29 @@ suite('Procedure Rename Event', function() { this.workspace.addChangeListener(this.eventSpy); }); - teardown(function() { + teardown(function () { this.sandbox.restore(); }); - suite('running', function() { - setup(function() { + suite('running', function () { + setup(function () { this.createProcedureModel = (id) => { - return new ObservableProcedureModel( - this.workspace, DEFAULT_NAME, id); + return new ObservableProcedureModel(this.workspace, DEFAULT_NAME, id); }; this.createEventToState = (procedureModel) => { return new ProcedureRename( - this.workspace, - procedureModel, - procedureModel.getName() === DEFAULT_NAME ? - NON_DEFAULT_NAME : - DEFAULT_NAME); + this.workspace, + procedureModel, + procedureModel.getName() === DEFAULT_NAME + ? NON_DEFAULT_NAME + : DEFAULT_NAME, + ); }; }); - suite('forward', function() { - test('the procedure with the matching ID is renamed', function() { + suite('forward', function () { + test('the procedure with the matching ID is renamed', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); final.setName(NON_DEFAULT_NAME); @@ -60,12 +59,13 @@ suite('Procedure Rename Event', function() { this.clock.runAll(); assert.equal( - initial.getName(), - final.getName(), - 'Expected the procedure\'s name to be changed'); + initial.getName(), + final.getName(), + "Expected the procedure's name to be changed", + ); }); - test('renaming a procedure fires a rename event', function() { + test('renaming a procedure fires a rename event', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); final.setName(NON_DEFAULT_NAME); @@ -76,13 +76,14 @@ suite('Procedure Rename Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureRename, - {procedure: initial, oldName: DEFAULT_NAME}, - this.workspace.id); + this.eventSpy, + ProcedureRename, + {procedure: initial, oldName: DEFAULT_NAME}, + this.workspace.id, + ); }); - test('noop renames do not fire rename events', function() { + test('noop renames do not fire rename events', function () { const initial = this.createProcedureModel('test id'); const final = this.createProcedureModel('test id'); const event = this.createEventToState(final); @@ -92,68 +93,70 @@ suite('Procedure Rename Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureRename, - {}, - this.workspace.id); + this.eventSpy, + ProcedureRename, + {}, + this.workspace.id, + ); }); - test( - 'attempting to rename a procedure that does not exist throws', - function() { - const final = this.createProcedureModel('test id'); - final.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(final); + test('attempting to rename a procedure that does not exist throws', function () { + const final = this.createProcedureModel('test id'); + final.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(final); - assert.throws(() => { - event.run(/* forward= */ true); - }); - }); + assert.throws(() => { + event.run(/* forward= */ true); + }); + }); test( - 'attempting to rename a procedure with a different old name ' + + 'attempting to rename a procedure with a different old name ' + 'does not work', - function() { - const otherNonDefaultName = 'other non-default name'; - const final = this.createProcedureModel('test id') - .setName(NON_DEFAULT_NAME); - const event = this.createEventToState(final); - const testModel = this.createProcedureModel('test id') - .setName(otherNonDefaultName); - this.procedureMap.add(testModel); - - event.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - testModel.getName(), - otherNonDefaultName, - 'Expected the procedure\'s name to be unchanged'); - }); + function () { + const otherNonDefaultName = 'other non-default name'; + const final = + this.createProcedureModel('test id').setName(NON_DEFAULT_NAME); + const event = this.createEventToState(final); + const testModel = + this.createProcedureModel('test id').setName(otherNonDefaultName); + this.procedureMap.add(testModel); + + event.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + testModel.getName(), + otherNonDefaultName, + "Expected the procedure's name to be unchanged", + ); + }, + ); + + test('deserializing the event and running it triggers the effect', function () { + const initial = this.createProcedureModel('test id'); + const final = this.createProcedureModel('test id'); + final.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(final); + this.procedureMap.add(initial); - test( - 'deserializing the event and running it triggers the effect', - function() { - const initial = this.createProcedureModel('test id'); - const final = this.createProcedureModel('test id'); - final.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(final); - this.procedureMap.add(initial); - - const newEvent = Blockly.Events.fromJson( - event.toJson(), this.workspace); - newEvent.run(/* forward= */ true); - this.clock.runAll(); - - assert.equal( - initial.getName(), - final.getName(), - 'Expected the procedure\'s name to be changed'); - }); + const newEvent = Blockly.Events.fromJson( + event.toJson(), + this.workspace, + ); + newEvent.run(/* forward= */ true); + this.clock.runAll(); + + assert.equal( + initial.getName(), + final.getName(), + "Expected the procedure's name to be changed", + ); + }); }); - suite('backward', function() { - test('the procedure with the matching ID is renamed', function() { + suite('backward', function () { + test('the procedure with the matching ID is renamed', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); initial.setName(NON_DEFAULT_NAME); @@ -165,12 +168,13 @@ suite('Procedure Rename Event', function() { this.clock.runAll(); assert.equal( - initial.getName(), - DEFAULT_NAME, - 'Expected the procedure\'s name to be changed'); + initial.getName(), + DEFAULT_NAME, + "Expected the procedure's name to be changed", + ); }); - test('renaming a procedure fires a rename event', function() { + test('renaming a procedure fires a rename event', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); initial.setName(NON_DEFAULT_NAME); @@ -182,13 +186,14 @@ suite('Procedure Rename Event', function() { this.clock.runAll(); eventTestHelpers.assertEventFiredShallow( - this.eventSpy, - ProcedureRename, - {procedure: initial, oldName: NON_DEFAULT_NAME}, - this.workspace.id); + this.eventSpy, + ProcedureRename, + {procedure: initial, oldName: NON_DEFAULT_NAME}, + this.workspace.id, + ); }); - test('noop renames do not fire rename events', function() { + test('noop renames do not fire rename events', function () { const initial = this.createProcedureModel('test id'); const undoable = this.createProcedureModel('test id'); initial.setName(NON_DEFAULT_NAME); @@ -199,53 +204,60 @@ suite('Procedure Rename Event', function() { this.clock.runAll(); testHelpers.assertEventNotFired( - this.eventSpy, - ProcedureRename, - {}, - this.workspace.id); + this.eventSpy, + ProcedureRename, + {}, + this.workspace.id, + ); }); - test( - 'attempting to rename a procedure that does not exist throws', - function() { - const undoable = this.createProcedureModel('test id'); - undoable.setName(NON_DEFAULT_NAME); - const event = this.createEventToState(undoable); + test('attempting to rename a procedure that does not exist throws', function () { + const undoable = this.createProcedureModel('test id'); + undoable.setName(NON_DEFAULT_NAME); + const event = this.createEventToState(undoable); - assert.throws(() => { - event.run(/* forward= */ false); - }); - }); + assert.throws(() => { + event.run(/* forward= */ false); + }); + }); test( - 'attempting to rename a procedure with a different new name ' + + 'attempting to rename a procedure with a different new name ' + 'does not work', - function() { - const otherNonDefaultName = 'other non-default name'; - const undoable = this.createProcedureModel('test id'); - const event = this.createEventToState(undoable); - const testModel = this.createProcedureModel('test id') - .setName(otherNonDefaultName); - this.procedureMap.add(testModel); - - event.run(/* forward= */ false); - this.clock.runAll(); - - assert.equal( - testModel.getName(), - otherNonDefaultName, - 'Expected the procedure\'s name to be unchanged'); - }); + function () { + const otherNonDefaultName = 'other non-default name'; + const undoable = this.createProcedureModel('test id'); + const event = this.createEventToState(undoable); + const testModel = + this.createProcedureModel('test id').setName(otherNonDefaultName); + this.procedureMap.add(testModel); + + event.run(/* forward= */ false); + this.clock.runAll(); + + assert.equal( + testModel.getName(), + otherNonDefaultName, + "Expected the procedure's name to be unchanged", + ); + }, + ); }); }); - suite('serialization', function() { - test('events round-trip through JSON', function() { + suite('serialization', function () { + test('events round-trip through JSON', function () { const model = new ObservableProcedureModel( - this.workspace, 'test name', 'test id'); + this.workspace, + 'test name', + 'test id', + ); this.procedureMap.add(model); const origEvent = new ProcedureRename( - this.workspace, model, NON_DEFAULT_NAME); + this.workspace, + model, + NON_DEFAULT_NAME, + ); const json = origEvent.toJson(); const newEvent = Blockly.Events.fromJson(json, this.workspace); diff --git a/plugins/block-shareable-procedures/test/event_test_helpers.js b/plugins/block-shareable-procedures/test/event_test_helpers.js index 59dbf057f4..815cf8c11e 100644 --- a/plugins/block-shareable-procedures/test/event_test_helpers.js +++ b/plugins/block-shareable-procedures/test/event_test_helpers.js @@ -37,18 +37,21 @@ export function shallowMatch(expected) { * @param {?string=} expectedBlockId Expected block id of event fired. */ export function assertEventFiredShallow( - spy, - instanceType, - expectedProperties, - expectedWorkspaceId, - expectedBlockId) { + spy, + instanceType, + expectedProperties, + expectedWorkspaceId, + expectedBlockId, +) { const properties = { ...expectedProperties, workspaceId: expectedWorkspaceId, blockId: expectedBlockId, }; sinon.assert.calledWith( - spy, - sinon.match.instanceOf(instanceType) - .and(sinon.match(shallowMatch(properties)))); + spy, + sinon.match + .instanceOf(instanceType) + .and(sinon.match(shallowMatch(properties))), + ); } diff --git a/plugins/block-shareable-procedures/test/index.html b/plugins/block-shareable-procedures/test/index.html index de969229e2..64d2578c27 100644 --- a/plugins/block-shareable-procedures/test/index.html +++ b/plugins/block-shareable-procedures/test/index.html @@ -1,61 +1,61 @@ - + - - - - Blockly Shareable Procedures - - - - -
-
-
-
-

Saved State

- -

Workspace 1

- -

Workspace 2

- + + + Blockly Shareable Procedures + + + + +
+
+
+
+

Saved State

+ +

Workspace 1

+ +

Workspace 2

+ +
-
- - - + + diff --git a/plugins/block-shareable-procedures/test/index.js b/plugins/block-shareable-procedures/test/index.js index 6d628e4261..72c9dda859 100644 --- a/plugins/block-shareable-procedures/test/index.js +++ b/plugins/block-shareable-procedures/test/index.js @@ -9,7 +9,11 @@ import * as Blockly from 'blockly'; import {toolboxCategories} from '@blockly/dev-tools'; -import {blocks, unregisterProcedureBlocks, registerProcedureSerializer} from '../src/index'; +import { + blocks, + unregisterProcedureBlocks, + registerProcedureSerializer, +} from '../src/index'; import {ProcedureBase} from '../src/events_procedure_base'; /* eslint no-unused-vars: "off" */ @@ -22,7 +26,7 @@ registerProcedureSerializer(); let workspace1; let workspace2; -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { injectTwoWorkspaces(); }); @@ -43,12 +47,15 @@ function injectTwoWorkspaces() { workspace2.addChangeListener(createEventSharer(workspace1)); workspace1.addChangeListener( - createSerializationListener(workspace1, 'save1')); + createSerializationListener(workspace1, 'save1'), + ); workspace2.addChangeListener( - createSerializationListener(workspace2, 'save2')); + createSerializationListener(workspace2, 'save2'), + ); - document.getElementById('load') - .addEventListener('click', () => reloadWorkspaces()); + document + .getElementById('load') + .addEventListener('click', () => reloadWorkspaces()); } /** Injects one workspace with undo and redo enabled. */ @@ -62,10 +69,12 @@ function injectOneWorkspace() { workspace1 = Blockly.inject('blockly1', options); workspace1.addChangeListener( - createSerializationListener(workspace1, 'save1')); + createSerializationListener(workspace1, 'save1'), + ); - document.getElementById('load') - .addEventListener('click', () => loadWorkspace()); + document + .getElementById('load') + .addEventListener('click', () => loadWorkspace()); } /** @@ -76,8 +85,10 @@ function injectOneWorkspace() { */ function createEventSharer(otherWorkspace) { return (e) => { - if (!(e instanceof ProcedureBase) && - !(e instanceof Blockly.Events.VarBase)) { + if ( + !(e instanceof ProcedureBase) && + !(e instanceof Blockly.Events.VarBase) + ) { return; } let event; @@ -105,11 +116,11 @@ function createSerializationListener(workspace, textAreaId) { const textArea = document.getElementById(textAreaId); return (e) => { if (workspace.isDragging()) return; - textArea.value = - JSON.stringify( - Blockly.serialization.workspaces.save(workspace), - undefined, - 2); + textArea.value = JSON.stringify( + Blockly.serialization.workspaces.save(workspace), + undefined, + 2, + ); }; } diff --git a/plugins/block-shareable-procedures/test/procedure_blocks.mocha.js b/plugins/block-shareable-procedures/test/procedure_blocks.mocha.js index 83c6e4798b..e2c60173fe 100644 --- a/plugins/block-shareable-procedures/test/procedure_blocks.mocha.js +++ b/plugins/block-shareable-procedures/test/procedure_blocks.mocha.js @@ -1,4 +1,3 @@ - /** * @license * Copyright 2019 Google LLC @@ -25,12 +24,12 @@ const {unregisterProcedureBlocks} = require('../src/index'); const {ProcedureDelete} = require('../src/events_procedure_delete'); const {ProcedureCreate} = require('../src/events_procedure_create'); - -suite('Procedures', function() { - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
', - {pretendToBeVisual: true}); +suite('Procedures', function () { + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + {pretendToBeVisual: true}, + ); this.sandbox = sinon.createSandbox(); globalThis.clock = this.sandbox.useFakeTimers(); @@ -45,164 +44,177 @@ suite('Procedures', function() { this.workspace.createVariable('preCreatedVar', '', 'preCreatedVarId'); this.workspace.createVariable( - 'preCreatedTypedVar', 'type', 'preCreatedTypedVarId'); - - Blockly.defineBlocksWithJsonArray([{ - 'type': 'row_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'input_value', - 'name': 'INPUT', - }, - ], - 'output': null, - }]); - - this.getContextStub = this.sandbox.stub( - window.HTMLCanvasElement.prototype, 'getContext') - .callsFake(() => { - return { - measureText: function() { - return {'width': 0}; - }, - }; - }); + 'preCreatedTypedVar', + 'type', + 'preCreatedTypedVarId', + ); + + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'row_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT', + }, + ], + 'output': null, + }, + ]); + + this.getContextStub = this.sandbox + .stub(window.HTMLCanvasElement.prototype, 'getContext') + .callsFake(() => { + return { + measureText: function () { + return {'width': 0}; + }, + }; + }); this.findParentWsStub = this.sandbox - .stub(Blockly.Workspace.prototype, 'getRootWorkspace') - .callsFake(() => { - return this.workspace; - }); + .stub(Blockly.Workspace.prototype, 'getRootWorkspace') + .callsFake(() => { + return this.workspace; + }); }); - teardown(function() { + teardown(function () { globalThis.clock.runAll(); delete Blockly.Blocks['row_block']; this.sandbox.restore(); this.jsdomCleanup(); }); - suite('updating data models', function() { - test( - 'renaming a procedure def block updates the procedure model', - function() { - const defBlock = createProcDefBlock(this.workspace); + suite('updating data models', function () { + test('renaming a procedure def block updates the procedure model', function () { + const defBlock = createProcDefBlock(this.workspace); - defBlock.setFieldValue('new name', 'NAME'); + defBlock.setFieldValue('new name', 'NAME'); - assert.equal( - defBlock.getProcedureModel().getName(), - 'new name', - 'Expected the procedure model name to be updated'); - }); + assert.equal( + defBlock.getProcedureModel().getName(), + 'new name', + 'Expected the procedure model name to be updated', + ); + }); - test( - 'disabling a procedure def block updates the procedure model', - function() { - const defBlock = createProcDefBlock(this.workspace); + test('disabling a procedure def block updates the procedure model', function () { + const defBlock = createProcDefBlock(this.workspace); - defBlock.setEnabled(false); - globalThis.clock.runAll(); + defBlock.setEnabled(false); + globalThis.clock.runAll(); - assert.isFalse( - defBlock.getProcedureModel().getEnabled(), - 'Expected the procedure model to be disabled'); - }); + assert.isFalse( + defBlock.getProcedureModel().getEnabled(), + 'Expected the procedure model to be disabled', + ); + }); - test( - 'adding a parameter to a procedure def updates the procedure model', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param name', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - - defBlock.compose(containerBlock); - - assert.equal( - defBlock.getProcedureModel().getParameter(0).getName(), - 'param name', - 'Expected the procedure model to have a matching parameter'); - }); - - test('adding a parameter adds a variable to the variable map', function() { + test('adding a parameter to a procedure def updates the procedure model', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param name', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + + defBlock.compose(containerBlock); + + assert.equal( + defBlock.getProcedureModel().getParameter(0).getName(), + 'param name', + 'Expected the procedure model to have a matching parameter', + ); + }); + + test('adding a parameter adds a variable to the variable map', function () { // Create a stack of container, parameter. const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); paramBlock.setFieldValue('param name', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); defBlock.compose(containerBlock); assert.isTrue( - this.workspace.getVariableMap().getVariablesOfType('') - .some((variable) => variable.name === 'param name'), - 'Expected the variable map to have a matching variable'); + this.workspace + .getVariableMap() + .getVariablesOfType('') + .some((variable) => variable.name === 'param name'), + 'Expected the variable map to have a matching variable', + ); }); + test('moving a parameter in the procedure def updates the procedure model', function () { + // Create a stack of container, param1, param2. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock1 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock1.setFieldValue('param name1', 'NAME'); + const paramBlock2 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock2.setFieldValue('param name2', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock1.previousConnection); + paramBlock1.nextConnection.connect(paramBlock2.previousConnection); + defBlock.compose(containerBlock); + const id1 = defBlock.getProcedureModel().getParameter(0).getId(); + const id2 = defBlock.getProcedureModel().getParameter(1).getId(); + + // Reconfigure the stack to be container, param2, param1. + paramBlock2.previousConnection.disconnect(); + paramBlock1.previousConnection.disconnect(); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock2.previousConnection); + paramBlock2.nextConnection.connect(paramBlock1.previousConnection); + defBlock.compose(containerBlock); - test( - 'moving a parameter in the procedure def updates the procedure model', - function() { - // Create a stack of container, param1, param2. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock1 = - this.workspace.newBlock('procedures_mutatorarg'); - paramBlock1.setFieldValue('param name1', 'NAME'); - const paramBlock2 = - this.workspace.newBlock('procedures_mutatorarg'); - paramBlock2.setFieldValue('param name2', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock1.previousConnection); - paramBlock1.nextConnection.connect(paramBlock2.previousConnection); - defBlock.compose(containerBlock); - const id1 = defBlock.getProcedureModel().getParameter(0).getId(); - const id2 = defBlock.getProcedureModel().getParameter(1).getId(); - - // Reconfigure the stack to be container, param2, param1. - paramBlock2.previousConnection.disconnect(); - paramBlock1.previousConnection.disconnect(); - containerBlock.getInput('STACK').connection - .connect(paramBlock2.previousConnection); - paramBlock2.nextConnection.connect(paramBlock1.previousConnection); - defBlock.compose(containerBlock); - - assert.equal( - defBlock.getProcedureModel().getParameter(0).getName(), - 'param name2', - 'Expected the first parameter of the procedure to be param 2'); - assert.equal( - defBlock.getProcedureModel().getParameter(0).getId(), - id2, - 'Expected the first parameter of the procedure to be param 2'); - assert.equal( - defBlock.getProcedureModel().getParameter(1).getName(), - 'param name1', - 'Expected the second parameter of the procedure to be param 1'); - assert.equal( - defBlock.getProcedureModel().getParameter(1).getId(), - id1, - 'Expected the second parameter of the procedure to be param 1'); - }); - - test('decomposing and recomposing maintains parameter IDs', function() { + assert.equal( + defBlock.getProcedureModel().getParameter(0).getName(), + 'param name2', + 'Expected the first parameter of the procedure to be param 2', + ); + assert.equal( + defBlock.getProcedureModel().getParameter(0).getId(), + id2, + 'Expected the first parameter of the procedure to be param 2', + ); + assert.equal( + defBlock.getProcedureModel().getParameter(1).getName(), + 'param name1', + 'Expected the second parameter of the procedure to be param 1', + ); + assert.equal( + defBlock.getProcedureModel().getParameter(1).getId(), + id1, + 'Expected the second parameter of the procedure to be param 1', + ); + }); + + test('decomposing and recomposing maintains parameter IDs', function () { // Create a stack of container, param. const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); paramBlock.setFieldValue('param name', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); defBlock.compose(containerBlock); const paramBlockId = defBlock.getProcedureModel().getParameter(0).getId(); @@ -213,112 +225,128 @@ suite('Procedures', function() { defBlock.compose(container); assert.equal( - defBlock.getProcedureModel().getParameter(0).getId(), - paramBlockId, - 'Expected the parameter ID to be maintained'); + defBlock.getProcedureModel().getParameter(0).getId(), + paramBlockId, + 'Expected the parameter ID to be maintained', + ); }); - test( - 'deleting a parameter from a procedure def updates the procedure model', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param name', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - containerBlock.getInput('STACK').connection.disconnect(); - defBlock.compose(containerBlock); - - assert.isEmpty( - defBlock.getProcedureModel().getParameters(), - 'Expected the procedure model to have no parameters'); - }); + test('deleting a parameter from a procedure def updates the procedure model', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param name', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); - test( - 'renaming a procedure parameter updates the parameter model', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param name', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - paramBlock.setFieldValue('new param name', 'NAME'); - defBlock.compose(containerBlock); - - assert.equal( - defBlock.getProcedureModel().getParameter(0).getName(), - 'new param name', - 'Expected the procedure model to have a matching parameter'); - }); - - test('deleting a procedure deletes the procedure model', function() { + containerBlock.getInput('STACK').connection.disconnect(); + defBlock.compose(containerBlock); + + assert.isEmpty( + defBlock.getProcedureModel().getParameters(), + 'Expected the procedure model to have no parameters', + ); + }); + + test('renaming a procedure parameter updates the parameter model', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param name', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + paramBlock.setFieldValue('new param name', 'NAME'); + defBlock.compose(containerBlock); + + assert.equal( + defBlock.getProcedureModel().getParameter(0).getName(), + 'new param name', + 'Expected the procedure model to have a matching parameter', + ); + }); + + test('deleting a procedure deletes the procedure model', function () { const defBlock = createProcDefBlock(this.workspace); const model = defBlock.getProcedureModel(); defBlock.dispose(); assert.isUndefined( - this.workspace.getProcedureMap().get(model.getId()), - 'Expected the model to be removed from the procedure map'); + this.workspace.getProcedureMap().get(model.getId()), + 'Expected the model to be removed from the procedure map', + ); }); }); - suite('responding to data model updates', function() { - suite('def blocks', function() { - test('renaming the procedure data model updates blocks', function() { + suite('responding to data model updates', function () { + suite('def blocks', function () { + test('renaming the procedure data model updates blocks', function () { const defBlock = createProcDefBlock(this.workspace); const procModel = defBlock.getProcedureModel(); procModel.setName('new name'); assert.equal( - defBlock.getFieldValue('NAME'), - 'new name', - 'Expected the procedure block to be renamed'); + defBlock.getFieldValue('NAME'), + 'new name', + 'Expected the procedure block to be renamed', + ); }); - test('disabling a procedure data model disables blocks', function() { + test('disabling a procedure data model disables blocks', function () { const defBlock = createProcDefBlock(this.workspace); const procModel = defBlock.getProcedureModel(); procModel.setEnabled(false); assert.isFalse( - defBlock.isEnabled(), - 'Expected the procedure block to be disabled'); + defBlock.isEnabled(), + 'Expected the procedure block to be disabled', + ); }); - test('adding a parameter to a data model updates blocks', function() { + test('adding a parameter to a data model updates blocks', function () { const defBlock = createProcDefBlock(this.workspace); const procModel = defBlock.getProcedureModel(); procModel.insertParameter( - new ObservableParameterModel(this.workspace, 'param1', 'id'), 0); + new ObservableParameterModel(this.workspace, 'param1', 'id'), + 0, + ); assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('param1'), - 'Expected the params field to contain the name of the new param'); + defBlock.getFieldValue('PARAMS').includes('param1'), + 'Expected the params field to contain the name of the new param', + ); }); - test('moving a parameter in the data model updates blocks', function() { + test('moving a parameter in the data model updates blocks', function () { const defBlock = createProcDefBlock(this.workspace); const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - const param2 = - new ObservableParameterModel(this.workspace, 'param2', 'id2'); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + const param2 = new ObservableParameterModel( + this.workspace, + 'param2', + 'id2', + ); procModel.insertParameter(param1, 0); procModel.insertParameter(param2, 1); @@ -326,61 +354,72 @@ suite('Procedures', function() { procModel.insertParameter(param2, 0); assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('param2, param1'), - 'Expected the params field order to match the parameter order'); + defBlock.getFieldValue('PARAMS').includes('param2, param1'), + 'Expected the params field order to match the parameter order', + ); }); - test( - 'deleting a parameter from the data model updates blocks', - function() { - const defBlock = createProcDefBlock(this.workspace); - const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - const param2 = - new ObservableParameterModel(this.workspace, 'param2', 'id2'); - procModel.insertParameter(param1, 0); - procModel.insertParameter(param2, 1); - - procModel.deleteParameter(0); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('param2'), - 'Expected the params field order to contain one parameter'); - assert.isFalse( - defBlock.getFieldValue('PARAMS').includes('param1'), - 'Expected the params field to not contain the ' + - 'deleted parameter'); - }); - - test( - 'renaming a procedure parameter in the data model updates blocks', - function() { - const defBlock = createProcDefBlock(this.workspace); - const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - procModel.insertParameter(param1, 0); - - param1.setName('new name'); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('new name'), - 'Expected the params field to contain the new param name'); - }); + test('deleting a parameter from the data model updates blocks', function () { + const defBlock = createProcDefBlock(this.workspace); + const procModel = defBlock.getProcedureModel(); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + const param2 = new ObservableParameterModel( + this.workspace, + 'param2', + 'id2', + ); + procModel.insertParameter(param1, 0); + procModel.insertParameter(param2, 1); + + procModel.deleteParameter(0); + + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('param2'), + 'Expected the params field order to contain one parameter', + ); + assert.isFalse( + defBlock.getFieldValue('PARAMS').includes('param1'), + 'Expected the params field to not contain the ' + 'deleted parameter', + ); + }); + + test('renaming a procedure parameter in the data model updates blocks', function () { + const defBlock = createProcDefBlock(this.workspace); + const procModel = defBlock.getProcedureModel(); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + procModel.insertParameter(param1, 0); + + param1.setName('new name'); + + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('new name'), + 'Expected the params field to contain the new param name', + ); + }); }); - suite('caller blocks', function() { - test('renaming the procedure data model updates blocks', function() { + suite('caller blocks', function () { + test('renaming the procedure data model updates blocks', function () { const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); const procModel = defBlock.getProcedureModel(); @@ -388,12 +427,13 @@ suite('Procedures', function() { procModel.setName('new name'); assert.equal( - callBlock.getFieldValue('NAME'), - 'new name', - 'Expected the procedure block to be renamed'); + callBlock.getFieldValue('NAME'), + 'new name', + 'Expected the procedure block to be renamed', + ); }); - test('disabling a procedure data model disables blocks', function() { + test('disabling a procedure data model disables blocks', function () { const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); const procModel = defBlock.getProcedureModel(); @@ -401,862 +441,1003 @@ suite('Procedures', function() { procModel.setEnabled(false); assert.isFalse( - callBlock.isEnabled(), - 'Expected the procedure block to be disabled'); + callBlock.isEnabled(), + 'Expected the procedure block to be disabled', + ); }); - test('adding a parameter to a data model updates blocks', function() { + test('adding a parameter to a data model updates blocks', function () { const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); const procModel = defBlock.getProcedureModel(); procModel.insertParameter( - new ObservableParameterModel(this.workspace, 'param1', 'id'), 0); + new ObservableParameterModel(this.workspace, 'param1', 'id'), + 0, + ); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); + assert.equal( + callBlock.getFieldValue('ARGNAME0'), + 'param1', + 'Expected the params field to match the name of the new param', + ); + }); + test('moving a parameter in the data model updates blocks', function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const procModel = defBlock.getProcedureModel(); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + const param2 = new ObservableParameterModel( + this.workspace, + 'param2', + 'id2', + ); + procModel.insertParameter(param1, 0); + procModel.insertParameter(param2, 1); + + procModel.deleteParameter(1); + procModel.insertParameter(param2, 0); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the first param input to exist', + ); assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); + callBlock.getInput('ARG1'), + 'Expected the second param input to exist', + ); assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'param1', - 'Expected the params field to match the name of the new param'); + callBlock.getFieldValue('ARGNAME0'), + 'param2', + 'Expected the first params field to match the name of the param', + ); + assert.equal( + callBlock.getFieldValue('ARGNAME1'), + 'param1', + 'Expected the second params field to match the name of the param', + ); }); - test('moving a parameter in the data model updates blocks', function() { + test('moving a parameter in the data model moves input blocks', function () { const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - const param2 = - new ObservableParameterModel(this.workspace, 'param2', 'id2'); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + const param2 = new ObservableParameterModel( + this.workspace, + 'param2', + 'id2', + ); procModel.insertParameter(param1, 0); procModel.insertParameter(param2, 1); + const rowBlock1 = this.workspace.newBlock('row_block'); + const rowBlock2 = this.workspace.newBlock('row_block'); + callBlock + .getInput('ARG0') + .connection.connect(rowBlock1.outputConnection); + callBlock + .getInput('ARG1') + .connection.connect(rowBlock2.outputConnection); + globalThis.clock.runAll(); procModel.deleteParameter(1); procModel.insertParameter(param2, 0); assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the first param input to exist'); + callBlock.getInput('ARG0'), + 'Expected the first param input to exist', + ); + assert.equal( + callBlock.getInputTargetBlock('ARG0'), + rowBlock2, + 'Expected the second row block to be attached to the ' + + 'first input', + ); assert.isNotNull( - callBlock.getInput('ARG1'), - 'Expected the second param input to exist'); + callBlock.getInput('ARG1'), + 'Expected the second param input to exist', + ); assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'param2', - 'Expected the first params field to match the name of the param'); + callBlock.getInputTargetBlock('ARG1'), + rowBlock1, + 'Expected the first row block to be attached to the ' + + 'second input', + ); + }); + + test('deleting a parameter from the data model updates blocks', function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const procModel = defBlock.getProcedureModel(); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + const param2 = new ObservableParameterModel( + this.workspace, + 'param2', + 'id2', + ); + procModel.insertParameter(param1, 0); + procModel.insertParameter(param2, 1); + + procModel.deleteParameter(0); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the first param input to exist', + ); + assert.isNull( + callBlock.getInput('ARG1'), + 'Expected the second param input to not exist', + ); assert.equal( - callBlock.getFieldValue('ARGNAME1'), - 'param1', - 'Expected the second params field to match the name of the param'); + callBlock.getFieldValue('ARGNAME0'), + 'param2', + 'Expected the first params field to match the name of ' + 'the param', + ); }); - test( - 'moving a parameter in the data model moves input blocks', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - const param2 = - new ObservableParameterModel(this.workspace, 'param2', 'id2'); - procModel.insertParameter(param1, 0); - procModel.insertParameter(param2, 1); - const rowBlock1 = this.workspace.newBlock('row_block'); - const rowBlock2 = this.workspace.newBlock('row_block'); - callBlock.getInput('ARG0').connection - .connect(rowBlock1.outputConnection); - callBlock.getInput('ARG1').connection - .connect(rowBlock2.outputConnection); - globalThis.clock.runAll(); - - procModel.deleteParameter(1); - procModel.insertParameter(param2, 0); - - assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the first param input to exist'); - assert.equal( - callBlock.getInputTargetBlock('ARG0'), - rowBlock2, - 'Expected the second row block to be attached to the ' + - 'first input'); - assert.isNotNull( - callBlock.getInput('ARG1'), - 'Expected the second param input to exist'); - assert.equal( - callBlock.getInputTargetBlock('ARG1'), - rowBlock1, - 'Expected the first row block to be attached to the ' + - 'second input'); - }); - - test( - 'deleting a parameter from the data model updates blocks', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - const param2 = - new ObservableParameterModel(this.workspace, 'param2', 'id2'); - procModel.insertParameter(param1, 0); - procModel.insertParameter(param2, 1); - - procModel.deleteParameter(0); - - assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the first param input to exist'); - assert.isNull( - callBlock.getInput('ARG1'), - 'Expected the second param input to not exist'); - assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'param2', - 'Expected the first params field to match the name of ' + - 'the param'); - }); - - test( - 'renaming a procedure parameter in the data model updates blocks', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const procModel = defBlock.getProcedureModel(); - const param1 = - new ObservableParameterModel(this.workspace, 'param1', 'id1'); - procModel.insertParameter(param1, 0); - - param1.setName('new name'); - - assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); - assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'new name', - 'Expected the params field to match the new name of the param'); - }); + test('renaming a procedure parameter in the data model updates blocks', function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const procModel = defBlock.getProcedureModel(); + const param1 = new ObservableParameterModel( + this.workspace, + 'param1', + 'id1', + ); + procModel.insertParameter(param1, 0); + + param1.setName('new name'); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); + assert.equal( + callBlock.getFieldValue('ARGNAME0'), + 'new name', + 'Expected the params field to match the new name of the param', + ); + }); }); }); - suite('renaming procedures', function() { - test('callers are updated to have the new name', function() { + suite('renaming procedures', function () { + test('callers are updated to have the new name', function () { const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); defBlock.setFieldValue('new name', 'NAME'); assert.equal( - callBlock.getFieldValue('NAME'), - 'new name', - 'Expected the procedure block to be renamed'); + callBlock.getFieldValue('NAME'), + 'new name', + 'Expected the procedure block to be renamed', + ); }); test( - 'setting an illegal name results in both the ' + + 'setting an illegal name results in both the ' + 'procedure and the caller getting the legal name', - function() { - createProcDefBlock(this.workspace, undefined, undefined, 'procA'); - const defBlockB = - createProcDefBlock(this.workspace, undefined, undefined, 'procB'); - const callBlockB = - createProcCallBlock(this.workspace, undefined, 'procB'); - - defBlockB.setFieldValue('procA', 'NAME'); - - assert.notEqual( - defBlockB.getFieldValue('NAME'), - 'procA', - 'Expected the procedure def block to have a legal name'); - assert.notEqual( - callBlockB.getFieldValue('NAME'), - 'procA', - 'Expected the procedure call block to have a legal name'); - }); + function () { + createProcDefBlock(this.workspace, undefined, undefined, 'procA'); + const defBlockB = createProcDefBlock( + this.workspace, + undefined, + undefined, + 'procB', + ); + const callBlockB = createProcCallBlock( + this.workspace, + undefined, + 'procB', + ); + + defBlockB.setFieldValue('procA', 'NAME'); + + assert.notEqual( + defBlockB.getFieldValue('NAME'), + 'procA', + 'Expected the procedure def block to have a legal name', + ); + assert.notEqual( + callBlockB.getFieldValue('NAME'), + 'procA', + 'Expected the procedure call block to have a legal name', + ); + }, + ); }); - suite('adding procedure parameters', function() { - test( - 'adding a parameter to the procedure updates procedure defs', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('param1'), - 'Expected the params field to contain the name of the new param'); - }); + suite('adding procedure parameters', function () { + test('adding a parameter to the procedure updates procedure defs', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); - test( - 'adding a parameter to the procedure updates procedure callers', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); - assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'param1', - 'Expected the params field to match the name of the new param'); - }); + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('param1'), + 'Expected the params field to contain the name of the new param', + ); + }); + + test('adding a parameter to the procedure updates procedure callers', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); + assert.equal( + callBlock.getFieldValue('ARGNAME0'), + 'param1', + 'Expected the params field to match the name of the new param', + ); + }); }); - suite('deleting procedure parameters', function() { - test( - 'deleting a parameter from the procedure updates procedure defs', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - paramBlock.dispose(); - defBlock.compose(containerBlock); - - assert.isFalse( - defBlock.getFieldValue('PARAMS').includes('param1'), - 'Expected the params field to not contain the name of the ' + - 'new param'); - }); + suite('deleting procedure parameters', function () { + test('deleting a parameter from the procedure updates procedure defs', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); - test( - 'deleting a parameter from the procedure updates procedure callers', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - paramBlock.checkAndDelete(); - defBlock.compose(containerBlock); - - assert.isNull( - callBlock.getInput('ARG0'), - 'Expected the param input to not exist'); - }); + paramBlock.dispose(); + defBlock.compose(containerBlock); + + assert.isFalse( + defBlock.getFieldValue('PARAMS').includes('param1'), + 'Expected the params field to not contain the name of the ' + + 'new param', + ); + }); + + test('deleting a parameter from the procedure updates procedure callers', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + paramBlock.checkAndDelete(); + defBlock.compose(containerBlock); + + assert.isNull( + callBlock.getInput('ARG0'), + 'Expected the param input to not exist', + ); + }); }); - suite('renaming procedure parameters', function() { - test('defs are updated for parameter renames', function() { + suite('renaming procedure parameters', function () { + test('defs are updated for parameter renames', function () { // Create a stack of container, parameter. const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); defBlock.compose(containerBlock); paramBlock.setFieldValue('new name', 'NAME'); defBlock.compose(containerBlock); assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('new name'), - 'Expected the params field to contain the new name of the param'); + defBlock.getFieldValue('PARAMS').includes('new name'), + 'Expected the params field to contain the new name of the param', + ); + }); + + test('defs are updated for parameter renames when two params exist', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock1 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock1.setFieldValue('param1', 'NAME'); + const paramBlock2 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock2.setFieldValue('param2', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock1.previousConnection); + paramBlock1.nextConnection.connect(paramBlock2.previousConnection); + defBlock.compose(containerBlock); + + paramBlock1.setFieldValue('new name', 'NAME'); + defBlock.compose(containerBlock); + + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('new name'), + 'Expected the params field to contain the new name of the param', + ); }); - test('defs are updated for parameter renames when two params exist', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock1 = this.workspace - .newBlock('procedures_mutatorarg'); - paramBlock1.setFieldValue('param1', 'NAME'); - const paramBlock2 = this.workspace - .newBlock('procedures_mutatorarg'); - paramBlock2.setFieldValue('param2', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock1.previousConnection); - paramBlock1.nextConnection.connect(paramBlock2.previousConnection); - defBlock.compose(containerBlock); - - paramBlock1.setFieldValue('new name', 'NAME'); - defBlock.compose(containerBlock); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('new name'), - 'Expected the params field to contain the new name of the param'); - }); - - test('callers are updated for parameter renames', function() { + test('callers are updated for parameter renames', function () { // Create a stack of container, parameter. const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); defBlock.compose(containerBlock); paramBlock.setFieldValue('new name', 'NAME'); defBlock.compose(containerBlock); assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'new name', - 'Expected the params field to match the name of the new param'); + callBlock.getFieldValue('ARGNAME0'), + 'new name', + 'Expected the params field to match the name of the new param', + ); }); - test( - 'variables associated with procedure parameters are not renamed', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - paramBlock.setFieldValue('param2', 'NAME'); - defBlock.compose(containerBlock); - - assert.isNotNull( - this.workspace.getVariable('param1', ''), - 'Expected the old variable to continue to exist'); - }); + test('variables associated with procedure parameters are not renamed', function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + paramBlock.setFieldValue('param2', 'NAME'); + defBlock.compose(containerBlock); + + assert.isNotNull( + this.workspace.getVariable('param1', ''), + 'Expected the old variable to continue to exist', + ); + }); test( - 'renaming a variable associated with a parameter updates ' + + 'renaming a variable associated with a parameter updates ' + 'procedure defs', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - const variable = this.workspace.getVariable('param1', ''); - this.workspace.renameVariableById(variable.getId(), 'new name'); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('new name'), - 'Expected the params field to contain the new name of the param'); - }); + function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + const variable = this.workspace.getVariable('param1', ''); + this.workspace.renameVariableById(variable.getId(), 'new name'); + + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('new name'), + 'Expected the params field to contain the new name of the param', + ); + }, + ); // TODO(blockly/#): We can't open mutators in node (even with JSDOM) due to // failing instanceof checks. So we can't currently test this. test.skip( - 'renaming a variable associated with a parameter updates ' + + 'renaming a variable associated with a parameter updates ' + 'mutator parameters', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - const variable = this.workspace.getVariable('param1', ''); - this.workspace.renameVariableById(variable.getId(), 'new name'); - - assert.equal( - paramBlock.getFieldValue('NAME'), - 'new name', - 'Expected the params field to contain the new name of the param'); - }); + function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + const variable = this.workspace.getVariable('param1', ''); + this.workspace.renameVariableById(variable.getId(), 'new name'); + + assert.equal( + paramBlock.getFieldValue('NAME'), + 'new name', + 'Expected the params field to contain the new name of the param', + ); + }, + ); test( - 'renaming a variable associated with a parameter updates ' + + 'renaming a variable associated with a parameter updates ' + 'procedure callers', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - const variable = this.workspace.getVariable('param1', ''); - this.workspace.renameVariableById(variable.getId(), 'new name'); - - assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); - assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'new name', - 'Expected the params field to match the name of the new param'); - }); + function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + const variable = this.workspace.getVariable('param1', ''); + this.workspace.renameVariableById(variable.getId(), 'new name'); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); + assert.equal( + callBlock.getFieldValue('ARGNAME0'), + 'new name', + 'Expected the params field to match the name of the new param', + ); + }, + ); test( - 'coalescing a variable associated with a parameter updates ' + + 'coalescing a variable associated with a parameter updates ' + 'procedure defs', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - const variable = this.workspace.getVariable('param1', ''); - this.workspace.renameVariableById(variable.getId(), 'preCreatedVar'); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('preCreatedVar'), - 'Expected the params field to contain the new name of the param'); - }); + function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + const variable = this.workspace.getVariable('param1', ''); + this.workspace.renameVariableById(variable.getId(), 'preCreatedVar'); + + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('preCreatedVar'), + 'Expected the params field to contain the new name of the param', + ); + }, + ); // TODO(blockly/#): We can't open mutators in node (even with JSDOM) due to // failing instanceof checks. So we can't currently test this. test.skip( - 'coalescing a variable associated with a parameter updates ' + + 'coalescing a variable associated with a parameter updates ' + 'mutator parameters', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - const variable = this.workspace.getVariable('param1', ''); - this.workspace.renameVariableById(variable.getId(), 'preCreatedVar'); - - assert.equal( - paramBlock.getFieldValue('NAME'), - 'preCreatedVar', - 'Expected the params field to contain the new name of the param'); - }); + function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + const variable = this.workspace.getVariable('param1', ''); + this.workspace.renameVariableById(variable.getId(), 'preCreatedVar'); + + assert.equal( + paramBlock.getFieldValue('NAME'), + 'preCreatedVar', + 'Expected the params field to contain the new name of the param', + ); + }, + ); test( - 'coalescing a variable associated with a parameter updates ' + + 'coalescing a variable associated with a parameter updates ' + 'procedure callers', - function() { - // Create a stack of container, parameter. - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); - paramBlock.setFieldValue('param1', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock.previousConnection); - defBlock.compose(containerBlock); - - const variable = this.workspace.getVariable('param1', ''); - this.workspace.renameVariableById(variable.getId(), 'preCreatedVar'); - - assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); - assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'preCreatedVar', - 'Expected the params field to match the name of the new param'); - }); + function () { + // Create a stack of container, parameter. + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock.setFieldValue('param1', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock.previousConnection); + defBlock.compose(containerBlock); + + const variable = this.workspace.getVariable('param1', ''); + this.workspace.renameVariableById(variable.getId(), 'preCreatedVar'); + + assert.isNotNull( + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); + assert.equal( + callBlock.getFieldValue('ARGNAME0'), + 'preCreatedVar', + 'Expected the params field to match the name of the new param', + ); + }, + ); test.skip( - 'renaming a variable such that you get a parameter ' + + 'renaming a variable such that you get a parameter ' + 'conflict does... something!', - function() { + function () {}, + ); + }); + + suite('reordering procedure parameters', function () { + test('reordering procedure parameters updates procedure blocks', function () { + // Create a stack of container, parameter, parameter. + const defBlock = createProcDefBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock1 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock1.setFieldValue('param1', 'NAME'); + const paramBlock2 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock2.setFieldValue('param2', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock1.previousConnection); + paramBlock1.nextConnection.connect(paramBlock2.previousConnection); + defBlock.compose(containerBlock); + + // Reorder the parameters. + paramBlock2.previousConnection.disconnect(); + paramBlock1.previousConnection.disconnect(); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock2.previousConnection); + paramBlock2.nextConnection.connect(paramBlock1.previousConnection); + defBlock.compose(containerBlock); - }); - }); + assert.isNotNull( + defBlock.getField('PARAMS'), + 'Expected the params field to exist', + ); + assert.isTrue( + defBlock.getFieldValue('PARAMS').includes('param2, param1'), + 'Expected the params field order to match the parameter order', + ); + }); - suite('reordering procedure parameters', function() { - test( - 'reordering procedure parameters updates procedure blocks', - function() { - // Create a stack of container, parameter, parameter. - const defBlock = createProcDefBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock1 = this.workspace - .newBlock('procedures_mutatorarg'); - paramBlock1.setFieldValue('param1', 'NAME'); - const paramBlock2 = this.workspace - .newBlock('procedures_mutatorarg'); - paramBlock2.setFieldValue('param2', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock1.previousConnection); - paramBlock1.nextConnection.connect(paramBlock2.previousConnection); - defBlock.compose(containerBlock); - - // Reorder the parameters. - paramBlock2.previousConnection.disconnect(); - paramBlock1.previousConnection.disconnect(); - containerBlock.getInput('STACK').connection - .connect(paramBlock2.previousConnection); - paramBlock2.nextConnection.connect(paramBlock1.previousConnection); - defBlock.compose(containerBlock); - - assert.isNotNull( - defBlock.getField('PARAMS'), - 'Expected the params field to exist'); - assert.isTrue( - defBlock.getFieldValue('PARAMS').includes('param2, param1'), - 'Expected the params field order to match the parameter order'); - }); - - test('reordering procedure parameters updates caller blocks', function() { + test('reordering procedure parameters updates caller blocks', function () { // Create a stack of container, parameter, parameter. const defBlock = createProcDefBlock(this.workspace); const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); const paramBlock1 = this.workspace.newBlock('procedures_mutatorarg'); paramBlock1.setFieldValue('param1', 'NAME'); const paramBlock2 = this.workspace.newBlock('procedures_mutatorarg'); paramBlock2.setFieldValue('param2', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock1.previousConnection); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock1.previousConnection); paramBlock1.nextConnection.connect(paramBlock2.previousConnection); defBlock.compose(containerBlock); // Reorder the parameters. paramBlock2.previousConnection.disconnect(); paramBlock1.previousConnection.disconnect(); - containerBlock.getInput('STACK').connection - .connect(paramBlock2.previousConnection); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock2.previousConnection); paramBlock2.nextConnection.connect(paramBlock1.previousConnection); defBlock.compose(containerBlock); assert.isNotNull( - callBlock.getInput('ARG0'), - 'Expected the param input to exist'); + callBlock.getInput('ARG0'), + 'Expected the param input to exist', + ); assert.equal( - callBlock.getFieldValue('ARGNAME0'), - 'param2', - 'Expected the params field to match the name of the second param'); + callBlock.getFieldValue('ARGNAME0'), + 'param2', + 'Expected the params field to match the name of the second param', + ); assert.isNotNull( - callBlock.getInput('ARG1'), - 'Expected the param input to exist'); + callBlock.getInput('ARG1'), + 'Expected the param input to exist', + ); assert.equal( - callBlock.getFieldValue('ARGNAME1'), - 'param1', - 'Expected the params field to match the name of the first param'); + callBlock.getFieldValue('ARGNAME1'), + 'param1', + 'Expected the params field to match the name of the first param', + ); }); test( - 'reordering procedure parameters reorders the blocks ' + + 'reordering procedure parameters reorders the blocks ' + 'attached to caller inputs', - function() { - // Create a stack of container, parameter, parameter. - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - const containerBlock = this.workspace - .newBlock('procedures_mutatorcontainer'); - const paramBlock1 = this.workspace - .newBlock('procedures_mutatorarg'); - paramBlock1.setFieldValue('param1', 'NAME'); - const paramBlock2 = this.workspace - .newBlock('procedures_mutatorarg'); - paramBlock2.setFieldValue('param2', 'NAME'); - containerBlock.getInput('STACK').connection - .connect(paramBlock1.previousConnection); - paramBlock1.nextConnection.connect(paramBlock2.previousConnection); - defBlock.compose(containerBlock); - - // Add args to the parameter inputs on the caller. - const block1 = this.workspace.newBlock('text'); - const block2 = this.workspace.newBlock('text'); - callBlock.getInput('ARG0').connection - .connect(block1.outputConnection); - callBlock.getInput('ARG1').connection - .connect(block2.outputConnection); - globalThis.clock.runAll(); - - // Reorder the parameters. - paramBlock2.previousConnection.disconnect(); - paramBlock1.previousConnection.disconnect(); - defBlock.compose(containerBlock); - containerBlock.getInput('STACK').connection - .connect(paramBlock2.previousConnection); - paramBlock2.nextConnection.connect(paramBlock1.previousConnection); - defBlock.compose(containerBlock); - - assert.equal( - callBlock.getInputTargetBlock('ARG0'), - block2, - 'Expected the second block to be in the first slot'); - assert.equal( - callBlock.getInputTargetBlock('ARG1'), - block1, - 'Expected the first block to be in the second slot'); - }); + function () { + // Create a stack of container, parameter, parameter. + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + const containerBlock = this.workspace.newBlock( + 'procedures_mutatorcontainer', + ); + const paramBlock1 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock1.setFieldValue('param1', 'NAME'); + const paramBlock2 = this.workspace.newBlock('procedures_mutatorarg'); + paramBlock2.setFieldValue('param2', 'NAME'); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock1.previousConnection); + paramBlock1.nextConnection.connect(paramBlock2.previousConnection); + defBlock.compose(containerBlock); + + // Add args to the parameter inputs on the caller. + const block1 = this.workspace.newBlock('text'); + const block2 = this.workspace.newBlock('text'); + callBlock.getInput('ARG0').connection.connect(block1.outputConnection); + callBlock.getInput('ARG1').connection.connect(block2.outputConnection); + globalThis.clock.runAll(); + + // Reorder the parameters. + paramBlock2.previousConnection.disconnect(); + paramBlock1.previousConnection.disconnect(); + defBlock.compose(containerBlock); + containerBlock + .getInput('STACK') + .connection.connect(paramBlock2.previousConnection); + paramBlock2.nextConnection.connect(paramBlock1.previousConnection); + defBlock.compose(containerBlock); + + assert.equal( + callBlock.getInputTargetBlock('ARG0'), + block2, + 'Expected the second block to be in the first slot', + ); + assert.equal( + callBlock.getInputTargetBlock('ARG1'), + block1, + 'Expected the first block to be in the second slot', + ); + }, + ); }); - suite('enabling and disabling procedure blocks', function() { + suite('enabling and disabling procedure blocks', function () { test( - 'if a procedure definition is disabled, the procedure caller ' + + 'if a procedure definition is disabled, the procedure caller ' + 'is also disabled', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); + function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); - defBlock.setEnabled(false); - globalThis.clock.runAll(); + defBlock.setEnabled(false); + globalThis.clock.runAll(); - assert.isFalse( - callBlock.isEnabled(), - 'Expected the caller block to be disabled'); - }); + assert.isFalse( + callBlock.isEnabled(), + 'Expected the caller block to be disabled', + ); + }, + ); test( - 'if a procedure definition is enabled, the procedure caller ' + + 'if a procedure definition is enabled, the procedure caller ' + 'is also enabled', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - defBlock.setEnabled(false); - globalThis.clock.runAll(); + function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + defBlock.setEnabled(false); + globalThis.clock.runAll(); - defBlock.setEnabled(true); - globalThis.clock.runAll(); + defBlock.setEnabled(true); + globalThis.clock.runAll(); - assert.isTrue( - callBlock.isEnabled(), - 'Expected the caller block to be enabled'); - }); + assert.isTrue( + callBlock.isEnabled(), + 'Expected the caller block to be enabled', + ); + }, + ); test( - 'if a procedure caller block was already disabled before ' + + 'if a procedure caller block was already disabled before ' + 'its definition was disabled, it is not reenabled', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock = createProcCallBlock(this.workspace); - globalThis.clock.runAll(); - callBlock.setEnabled(false); - globalThis.clock.runAll(); - defBlock.setEnabled(false); - globalThis.clock.runAll(); - - defBlock.setEnabled(true); - globalThis.clock.runAll(); - - assert.isFalse( - callBlock.isEnabled(), - 'Expected the caller block to continue to be disabled'); - }); + function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock = createProcCallBlock(this.workspace); + globalThis.clock.runAll(); + callBlock.setEnabled(false); + globalThis.clock.runAll(); + defBlock.setEnabled(false); + globalThis.clock.runAll(); + + defBlock.setEnabled(true); + globalThis.clock.runAll(); + + assert.isFalse( + callBlock.isEnabled(), + 'Expected the caller block to continue to be disabled', + ); + }, + ); }); - suite('creating procedure blocks', function() { + suite('creating procedure blocks', function () { test( - 'when a procedure definition block is created, a create event for ' + + 'when a procedure definition block is created, a create event for ' + 'its data model is fired', - function() { - const defBlock = createProcDefBlock(this.workspace); - const procedure = defBlock.getProcedureModel(); - globalThis.clock.runAll(); - - assertEventFiredShallow( - this.eventSpy, - ProcedureCreate, - { - procedure: procedure, - }, - this.workspace.id); - }); + function () { + const defBlock = createProcDefBlock(this.workspace); + const procedure = defBlock.getProcedureModel(); + globalThis.clock.runAll(); + + assertEventFiredShallow( + this.eventSpy, + ProcedureCreate, + { + procedure: procedure, + }, + this.workspace.id, + ); + }, + ); }); - suite('deleting procedure blocks', function() { + suite('deleting procedure blocks', function () { test( - 'when the procedure definition block is deleted, all of its ' + + 'when the procedure definition block is deleted, all of its ' + 'associated callers are deleted as well', - function() { - const defBlock = createProcDefBlock(this.workspace); - const callBlock1 = createProcCallBlock(this.workspace); - const callBlock2 = createProcCallBlock(this.workspace); + function () { + const defBlock = createProcDefBlock(this.workspace); + const callBlock1 = createProcCallBlock(this.workspace); + const callBlock2 = createProcCallBlock(this.workspace); - defBlock.dispose(); - globalThis.clock.runAll(); + defBlock.dispose(); + globalThis.clock.runAll(); - assert.isTrue( - callBlock1.disposed, 'Expected the first caller to be disposed'); - assert.isTrue( - callBlock2.disposed, 'Expected the second caller to be disposed'); - }); + assert.isTrue( + callBlock1.disposed, + 'Expected the first caller to be disposed', + ); + assert.isTrue( + callBlock2.disposed, + 'Expected the second caller to be disposed', + ); + }, + ); test( - 'when a procedure definition block is deleted, a delete event for ' + + 'when a procedure definition block is deleted, a delete event for ' + 'its data model is fired', - function() { - const defBlock = createProcDefBlock(this.workspace); - const procedure = defBlock.getProcedureModel(); + function () { + const defBlock = createProcDefBlock(this.workspace); + const procedure = defBlock.getProcedureModel(); - defBlock.dispose(); - globalThis.clock.runAll(); + defBlock.dispose(); + globalThis.clock.runAll(); - assertEventFiredShallow( - this.eventSpy, - ProcedureDelete, - { - procedure: procedure, - }, - this.workspace.id); - }); + assertEventFiredShallow( + this.eventSpy, + ProcedureDelete, + { + procedure: procedure, + }, + this.workspace.id, + ); + }, + ); }); - suite('caller blocks creating new def blocks', function() { - setup(function() { + suite('caller blocks creating new def blocks', function () { + setup(function () { this.TEST_VAR_ID = 'test-id'; this.genUidStub = createGenUidStubWithReturns(this.TEST_VAR_ID); }); - teardown(function() { + teardown(function () { this.genUidStub.restore(); }); - suite('xml', function() { - test('callers that can find models do not create defs', function() { - this.workspace.getProcedureMap().add( - new ObservableProcedureModel(this.workspace, 'do something')); - Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom(` + suite('xml', function () { + test('callers that can find models do not create defs', function () { + this.workspace + .getProcedureMap() + .add(new ObservableProcedureModel(this.workspace, 'do something')); + Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(` - ` - ), this.workspace); + `), + this.workspace, + ); globalThis.clock.runAll(); assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected only the call block to exist'); + this.workspace.getTopBlocks().length, + 1, + 'Expected only the call block to exist', + ); }); - test('callers without defs create new defs', function() { - const callBlock = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom(` + test('callers without defs create new defs', function () { + const callBlock = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(` - ` - ), this.workspace); + `), + this.workspace, + ); globalThis.clock.runAll(); assertDefBlockStructure( - this.workspace.getBlocksByType('procedures_defreturn')[0], true); + this.workspace.getBlocksByType('procedures_defreturn')[0], + true, + ); assertCallBlockStructure(callBlock, [], [], 'do something'); }); - test('callers without mutations create unnamed defs', function() { - const callBlock = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom( - '' - ), this.workspace); + test('callers without mutations create unnamed defs', function () { + const callBlock = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom( + '', + ), + this.workspace, + ); globalThis.clock.runAll(); assertDefBlockStructure( - this.workspace.getBlocksByType('procedures_defreturn')[0], true); + this.workspace.getBlocksByType('procedures_defreturn')[0], + true, + ); assertCallBlockStructure(callBlock, [], [], 'unnamed'); }); - test('callers with missing args create new defs', function() { - const defBlock = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom(` + test('callers with missing args create new defs', function () { + const defBlock = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(` do something - `), this.workspace); - const callBlock = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom( + `), + this.workspace, + ); + const callBlock = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom( '' + - ' ' + - '' - ), this.workspace); + ' ' + + '', + ), + this.workspace, + ); globalThis.clock.runAll(); assertDefBlockStructure(defBlock, true, ['x'], ['arg']); assertCallBlockStructure(callBlock, [], [], 'do something2'); }); - test('callers with mismatched args create new defs', function() { - const defBlock = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom(` + test('callers with mismatched args create new defs', function () { + const defBlock = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(` do something - `), this.workspace); - const callBlock = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom(` + `), + this.workspace, + ); + const callBlock = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(` - `), this.workspace); + `), + this.workspace, + ); globalThis.clock.runAll(); assertDefBlockStructure(defBlock, true, ['x'], ['arg']); assertCallBlockStructure( - callBlock, ['y'], [this.TEST_VAR_ID], 'do something2'); + callBlock, + ['y'], + [this.TEST_VAR_ID], + 'do something2', + ); }); - test( - 'callers whose defs are deserialized later do not create defs', - function() { - Blockly.Xml.domToWorkspace(Blockly.utils.xml.textToDom(` + test('callers whose defs are deserialized later do not create defs', function () { + Blockly.Xml.domToWorkspace( + Blockly.utils.xml.textToDom(` @@ -1270,220 +1451,272 @@ suite('Procedures', function() { - `), this.workspace); - globalThis.clock.runAll(); - const defBlock = - this.workspace.getBlocksByType('procedures_defreturn')[0]; - const callBlock = - this.workspace.getBlocksByType('procedures_callreturn')[0]; - assertDefBlockStructure(defBlock, true, ['x'], ['arg']); - assertCallBlockStructure(callBlock, ['x'], ['arg'], 'do something'); - assert.equal( - defBlock.getProcedureModel(), - callBlock.getProcedureModel(), - 'Expected the blocks to have the same procedure model'); - }); + `), + this.workspace, + ); + globalThis.clock.runAll(); + const defBlock = this.workspace.getBlocksByType( + 'procedures_defreturn', + )[0]; + const callBlock = this.workspace.getBlocksByType( + 'procedures_callreturn', + )[0]; + assertDefBlockStructure(defBlock, true, ['x'], ['arg']); + assertCallBlockStructure(callBlock, ['x'], ['arg'], 'do something'); + assert.equal( + defBlock.getProcedureModel(), + callBlock.getProcedureModel(), + 'Expected the blocks to have the same procedure model', + ); + }); }); - suite('json', function() { - test('callers that can find models do not create defs', function() { - this.workspace.getProcedureMap().add( - new ObservableProcedureModel(this.workspace, 'do something')); - Blockly.serialization.blocks.append({ - 'type': 'procedures_callnoreturn', - 'extraState': { - 'name': 'do something', + suite('json', function () { + test('callers that can find models do not create defs', function () { + this.workspace + .getProcedureMap() + .add(new ObservableProcedureModel(this.workspace, 'do something')); + Blockly.serialization.blocks.append( + { + 'type': 'procedures_callnoreturn', + 'extraState': { + 'name': 'do something', + }, }, - }, this.workspace, {recordUndo: true}); + this.workspace, + {recordUndo: true}, + ); globalThis.clock.runAll(); assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected only the call block to exist'); + this.workspace.getTopBlocks().length, + 1, + 'Expected only the call block to exist', + ); }); - test('callers without defs create new defs', function() { - const callBlock = Blockly.serialization.blocks.append({ - 'type': 'procedures_callreturn', - 'extraState': { - 'name': 'do something', + test('callers without defs create new defs', function () { + const callBlock = Blockly.serialization.blocks.append( + { + 'type': 'procedures_callreturn', + 'extraState': { + 'name': 'do something', + }, }, - }, this.workspace, {recordUndo: true}); + this.workspace, + {recordUndo: true}, + ); globalThis.clock.runAll(); assertDefBlockStructure( - this.workspace.getBlocksByType('procedures_defreturn')[0], true); + this.workspace.getBlocksByType('procedures_defreturn')[0], + true, + ); assertCallBlockStructure(callBlock, [], [], 'do something'); }); - test('callers without extra state create unamed defs', function() { + test('callers without extra state create unamed defs', function () { // recordUndo must be true to trigger change listener. - const callBlock = Blockly.serialization.blocks.append({ - 'type': 'procedures_callreturn', - }, this.workspace, {recordUndo: true}); + const callBlock = Blockly.serialization.blocks.append( + { + 'type': 'procedures_callreturn', + }, + this.workspace, + {recordUndo: true}, + ); globalThis.clock.runAll(); assertDefBlockStructure( - this.workspace.getBlocksByType('procedures_defreturn')[0], true); + this.workspace.getBlocksByType('procedures_defreturn')[0], + true, + ); assertCallBlockStructure(callBlock, [], [], 'unnamed'); }); - test('callers with missing args create new defs', function() { - const defBlock = Blockly.serialization.blocks.append({ - 'type': 'procedures_defreturn', - 'fields': { - 'NAME': 'do something', - }, - 'extraState': { - 'params': [ - { - 'name': 'x', - 'id': 'arg', - }, - ], + test('callers with missing args create new defs', function () { + const defBlock = Blockly.serialization.blocks.append( + { + 'type': 'procedures_defreturn', + 'fields': { + 'NAME': 'do something', + }, + 'extraState': { + 'params': [ + { + 'name': 'x', + 'id': 'arg', + }, + ], + }, }, - }, this.workspace); - const callBlock = Blockly.serialization.blocks.append({ - 'type': 'procedures_callreturn', - 'extraState': { - 'name': 'do something', + this.workspace, + ); + const callBlock = Blockly.serialization.blocks.append( + { + 'type': 'procedures_callreturn', + 'extraState': { + 'name': 'do something', + }, }, - }, this.workspace, {recordUndo: true}); + this.workspace, + {recordUndo: true}, + ); globalThis.clock.runAll(); assertDefBlockStructure(defBlock, true, ['x'], ['arg']); assertCallBlockStructure(callBlock, [], [], 'do something2'); }); - test('callers with mismatched args create new defs', function() { - const defBlock = Blockly.serialization.blocks.append({ - 'type': 'procedures_defreturn', - 'fields': { - 'NAME': 'do something', - }, - 'extraState': { - 'params': [ - { - 'name': 'x', - 'id': 'arg', - }, - ], + test('callers with mismatched args create new defs', function () { + const defBlock = Blockly.serialization.blocks.append( + { + 'type': 'procedures_defreturn', + 'fields': { + 'NAME': 'do something', + }, + 'extraState': { + 'params': [ + { + 'name': 'x', + 'id': 'arg', + }, + ], + }, }, - }, this.workspace); - const callBlock = Blockly.serialization.blocks.append({ - 'type': 'procedures_callreturn', - 'extraState': { - 'name': 'do something', - 'params': ['y'], + this.workspace, + ); + const callBlock = Blockly.serialization.blocks.append( + { + 'type': 'procedures_callreturn', + 'extraState': { + 'name': 'do something', + 'params': ['y'], + }, }, - }, this.workspace, {recordUndo: true}); + this.workspace, + {recordUndo: true}, + ); globalThis.clock.runAll(); assertDefBlockStructure(defBlock, true, ['x'], ['arg']); assertCallBlockStructure( - callBlock, ['y'], [this.TEST_VAR_ID], 'do something2'); + callBlock, + ['y'], + [this.TEST_VAR_ID], + 'do something2', + ); }); - test( - 'callers whose defs are deserialized later do not create defs', - function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'procedures_callreturn', - 'extraState': { - 'params': ['x'], - }, + test('callers whose defs are deserialized later do not create defs', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ + { + 'type': 'procedures_callreturn', + 'extraState': { + 'params': ['x'], }, - { - 'type': 'procedures_defreturn', - 'fields': { - 'NAME': 'do something', - }, - 'extraState': { - 'params': [ - { - 'name': 'x', - 'id': 'arg', - }, - ], - }, + }, + { + 'type': 'procedures_defreturn', + 'fields': { + 'NAME': 'do something', }, - ], - }, - }, this.workspace, {recordUndo: true}); - globalThis.clock.runAll(); - const defBlock = - this.workspace.getBlocksByType('procedures_defreturn')[0]; - const callBlock = - this.workspace.getBlocksByType('procedures_callreturn')[0]; - assertDefBlockStructure(defBlock, true, ['x'], ['arg']); - assertCallBlockStructure(callBlock, ['x'], ['arg'], 'do something'); - assert.equal( - defBlock.getProcedureModel(), - callBlock.getProcedureModel(), - 'Expected the blocks to have the same procedure model'); - }); + 'extraState': { + 'params': [ + { + 'name': 'x', + 'id': 'arg', + }, + ], + }, + }, + ], + }, + }, + this.workspace, + {recordUndo: true}, + ); + globalThis.clock.runAll(); + const defBlock = this.workspace.getBlocksByType( + 'procedures_defreturn', + )[0]; + const callBlock = this.workspace.getBlocksByType( + 'procedures_callreturn', + )[0]; + assertDefBlockStructure(defBlock, true, ['x'], ['arg']); + assertCallBlockStructure(callBlock, ['x'], ['arg'], 'do something'); + assert.equal( + defBlock.getProcedureModel(), + callBlock.getProcedureModel(), + 'Expected the blocks to have the same procedure model', + ); + }); }); }); - suite('definition block context menu', function() { - test( - 'the context menu includes an option for creating the caller', - function() { - const def = Blockly.serialization.blocks.append({ - 'type': 'procedures_defnoreturn', - 'fields': { - 'NAME': 'test name', - }, - }, this.workspace); + suite('definition block context menu', function () { + test('the context menu includes an option for creating the caller', function () { + const def = Blockly.serialization.blocks.append( + { + 'type': 'procedures_defnoreturn', + 'fields': { + 'NAME': 'test name', + }, + }, + this.workspace, + ); - const options = []; - def.customContextMenu(options); + const options = []; + def.customContextMenu(options); - assert.isTrue( - options[0].text.includes('test name'), - 'Expected the context menu to have an option to create ' + - 'the caller'); - }); + assert.isTrue( + options[0].text.includes('test name'), + 'Expected the context menu to have an option to create ' + 'the caller', + ); + }); - test('the context menu includes an option for each parameter', function() { - const def = Blockly.serialization.blocks.append({ - 'type': 'procedures_defnoreturn', - 'fields': { - 'NAME': 'test name', - }, - 'extraState': { - 'params': [ - { - 'name': 'testParam1', - 'id': 'varId1', - 'paramId': 'paramId1', - }, - { - 'name': 'testParam2', - 'id': 'varId2', - 'paramId': 'paramId2', - }, - ], + test('the context menu includes an option for each parameter', function () { + const def = Blockly.serialization.blocks.append( + { + 'type': 'procedures_defnoreturn', + 'fields': { + 'NAME': 'test name', + }, + 'extraState': { + 'params': [ + { + 'name': 'testParam1', + 'id': 'varId1', + 'paramId': 'paramId1', + }, + { + 'name': 'testParam2', + 'id': 'varId2', + 'paramId': 'paramId2', + }, + ], + }, }, - }, this.workspace); + this.workspace, + ); const options = []; def.customContextMenu(options); assert.isTrue( - options[1].text.includes('testParam1'), - 'Expected the context menu to have an option to create the ' + - 'first param'); + options[1].text.includes('testParam1'), + 'Expected the context menu to have an option to create the ' + + 'first param', + ); assert.isTrue( - options[2].text.includes('testParam2'), - 'Expected the context menu to have an option to create the ' + - 'second param'); + options[2].text.includes('testParam2'), + 'Expected the context menu to have an option to create the ' + + 'second param', + ); }); }); - suite('deserializing data models', function() { - suite('return types', function() { - test('procedure defs without returns have null return types', function() { + suite('deserializing data models', function () { + suite('return types', function () { + test('procedure defs without returns have null return types', function () { const json = { 'blocks': { 'languageVersion': 0, @@ -1498,15 +1731,17 @@ suite('Procedures', function() { }, }; Blockly.serialization.workspaces.load(json, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.isNull( - procedureModel.getReturnTypes(), - 'Expected the return types to be null'); + procedureModel.getReturnTypes(), + 'Expected the return types to be null', + ); }); - test('procedure defs with returns have array return types', function() { + test('procedure defs with returns have array return types', function () { const json = { 'blocks': { 'languageVersion': 0, @@ -1521,17 +1756,19 @@ suite('Procedures', function() { }, }; Blockly.serialization.workspaces.load(json, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.isArray( - procedureModel.getReturnTypes(), - 'Expected the return types to be an array'); + procedureModel.getReturnTypes(), + 'Expected the return types to be an array', + ); }); }); - suite('json', function() { - test('procedure names get deserialized', function() { + suite('json', function () { + test('procedure names get deserialized', function () { const json = { 'blocks': { 'languageVersion': 0, @@ -1546,17 +1783,19 @@ suite('Procedures', function() { }, }; Blockly.serialization.workspaces.load(json, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.equal( - procedureModel.name, - 'test name', - 'Expected the name of the procedure model to equal the name ' + - 'being deserialized.'); + procedureModel.name, + 'test name', + 'Expected the name of the procedure model to equal the name ' + + 'being deserialized.', + ); }); - test('procedure parameter names get deserialized', function() { + test('procedure parameter names get deserialized', function () { const json = { 'blocks': { 'languageVersion': 0, @@ -1583,22 +1822,25 @@ suite('Procedures', function() { }, }; Blockly.serialization.workspaces.load(json, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.equal( - procedureModel.getParameter(0).getName(), - 'test name 1', - 'Expected the name of the first parameter to equal the name ' + - 'being deserialized.'); + procedureModel.getParameter(0).getName(), + 'test name 1', + 'Expected the name of the first parameter to equal the name ' + + 'being deserialized.', + ); assert.equal( - procedureModel.getParameter(1).getName(), - 'test name 2', - 'Expected the name of the second parameter to equal the name ' + - 'being deserialized.'); + procedureModel.getParameter(1).getName(), + 'test name 2', + 'Expected the name of the second parameter to equal the name ' + + 'being deserialized.', + ); }); - test('procedure variables get matching IDs', function() { + test('procedure variables get matching IDs', function () { const json = { 'blocks': { 'languageVersion': 0, @@ -1627,61 +1869,70 @@ suite('Procedures', function() { ], }; Blockly.serialization.workspaces.load(json, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.equal( - procedureModel.getParameter(0).getVariableModel().getId(), - 'test param id', - 'Expected the variable id to match the serialized param id'); + procedureModel.getParameter(0).getVariableModel().getId(), + 'test param id', + 'Expected the variable id to match the serialized param id', + ); }); }); - suite('xml', function() { - test('procedure names get deserialized', function() { + suite('xml', function () { + test('procedure names get deserialized', function () { const xml = Blockly.utils.xml.textToDom( - `` + + `` + ` test name` + - ``); + ``, + ); Blockly.Xml.domToBlock(xml, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.equal( - procedureModel.name, - 'test name', - 'Expected the name of the procedure model to equal the name ' + - 'being deserialized.'); + procedureModel.name, + 'test name', + 'Expected the name of the procedure model to equal the name ' + + 'being deserialized.', + ); }); - test('procedure parameter names get deserialized', function() { + test('procedure parameter names get deserialized', function () { const xml = Blockly.utils.xml.textToDom( - `` + + `` + ` ` + ` ` + ` ` + ` ` + ` test name` + - ``); + ``, + ); Blockly.Xml.domToBlock(xml, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.equal( - procedureModel.getParameter(0).getName(), - 'test name 1', - 'Expected the name of the first parameter to equal the name ' + - 'being deserialized.'); + procedureModel.getParameter(0).getName(), + 'test name 1', + 'Expected the name of the first parameter to equal the name ' + + 'being deserialized.', + ); assert.equal( - procedureModel.getParameter(1).getName(), - 'test name 2', - 'Expected the name of the second parameter to equal the name ' + - 'being deserialized.'); + procedureModel.getParameter(1).getName(), + 'test name 2', + 'Expected the name of the second parameter to equal the name ' + + 'being deserialized.', + ); }); - test('procedure variables get matching IDs', function() { + test('procedure variables get matching IDs', function () { const xml = Blockly.utils.xml.textToDom( - `` + + `` + ` ` + ` test param name` + ` ` + @@ -1691,72 +1942,83 @@ suite('Procedures', function() { ` ` + ` test name` + ` ` + - ``); + ``, + ); Blockly.Xml.domToWorkspace(xml, this.workspace); - const procedureModel = - this.workspace.getProcedureMap().getProcedures()[0]; + const procedureModel = this.workspace + .getProcedureMap() + .getProcedures()[0]; assert.equal( - procedureModel.getParameter(0).getVariableModel().getId(), - 'test param id', - 'Expected the variable id to match the serialized param id'); + procedureModel.getParameter(0).getVariableModel().getId(), + 'test param id', + 'Expected the variable id to match the serialized param id', + ); }); }); }); - suite('full workspace serialization test cases', function() { - test('definitions with parameters are properly rendered', function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'procedures_defnoreturn', - 'extraState': { - 'procedureId': 'procId', - 'params': [ - { - 'name': 'x', - 'id': 'varId', - 'paramId': 'paramId', - }, - ], - }, - 'fields': { - 'NAME': 'do something', - }, - }, - ], - }, - 'procedures': [ - { - 'id': 'procId', - 'name': 'do something', - 'returnTypes': null, - 'parameters': [ + suite('full workspace serialization test cases', function () { + test('definitions with parameters are properly rendered', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ { - 'id': 'paramId', - 'name': 'x', + 'type': 'procedures_defnoreturn', + 'extraState': { + 'procedureId': 'procId', + 'params': [ + { + 'name': 'x', + 'id': 'varId', + 'paramId': 'paramId', + }, + ], + }, + 'fields': { + 'NAME': 'do something', + }, }, ], }, - ], - 'variables': [ - { - 'name': 'x', - 'id': 'varId', - }, - ], - }, this.workspace); + 'procedures': [ + { + 'id': 'procId', + 'name': 'do something', + 'returnTypes': null, + 'parameters': [ + { + 'id': 'paramId', + 'name': 'x', + }, + ], + }, + ], + 'variables': [ + { + 'name': 'x', + 'id': 'varId', + }, + ], + }, + this.workspace, + ); assertDefBlockStructure( - this.workspace.getTopBlocks(false)[0], false, ['x'], ['varId']); + this.workspace.getTopBlocks(false)[0], + false, + ['x'], + ['varId'], + ); }); test( - 'multiple definitions pointing to the same model end up with ' + + 'multiple definitions pointing to the same model end up with ' + 'different models', - function() { - Blockly.serialization.workspaces.load({ + function () { + Blockly.serialization.workspaces.load( + { 'blocks': { 'languageVersion': 0, 'blocks': [ @@ -1788,73 +2050,101 @@ suite('Procedures', function() { 'returnTypes': null, }, ], - }, this.workspace); - const def1 = this.workspace.getTopBlocks(true)[0]; - const def2 = this.workspace.getTopBlocks(true)[1]; - chai.assert.equal( - def1.getProcedureModel().getName(), - 'do something', - 'Expected the first procedure definition to have the ' + - 'name in XML'); - chai.assert.equal( - def2.getProcedureModel().getName(), - 'do something2', - 'Expected the second procedure definition to be renamed'); - chai.assert.notEqual( - def1.getProcedureModel(), - def2.getProcedureModel(), - 'Expected the procedures to have different models'); - }); + }, + this.workspace, + ); + const def1 = this.workspace.getTopBlocks(true)[0]; + const def2 = this.workspace.getTopBlocks(true)[1]; + chai.assert.equal( + def1.getProcedureModel().getName(), + 'do something', + 'Expected the first procedure definition to have the ' + + 'name in XML', + ); + chai.assert.equal( + def2.getProcedureModel().getName(), + 'do something2', + 'Expected the second procedure definition to be renamed', + ); + chai.assert.notEqual( + def1.getProcedureModel(), + def2.getProcedureModel(), + 'Expected the procedures to have different models', + ); + }, + ); }); - suite('getDefinition', function() { - test('individual definitions are returned', function() { + suite('getDefinition', function () { + test('individual definitions are returned', function () { const defBlock = createProcDefBlock( - this.workspace, false, [], 'proc name'); + this.workspace, + false, + [], + 'proc name', + ); const def = Blockly.procedures.getDefinition('proc name', this.workspace); assert.equal(def, defBlock); }); - test('definitions of different procedures are not returned', function() { + test('definitions of different procedures are not returned', function () { const defBlock1 = createProcDefBlock( - this.workspace, false, [], 'proc name'); - createProcDefBlock( - this.workspace, false, [], 'other proc name'); + this.workspace, + false, + [], + 'proc name', + ); + createProcDefBlock(this.workspace, false, [], 'other proc name'); const def = Blockly.procedures.getDefinition('proc name', this.workspace); assert.equal(def, defBlock1); }); }); - suite('getCallers', function() { - test('individual callers are returned', function() { + suite('getCallers', function () { + test('individual callers are returned', function () { createProcDefBlock(this.workspace, false, [], 'proc name'); const callBlock = createProcCallBlock(this.workspace, false, 'proc name'); const callers = Blockly.procedures.getCallers( - 'proc name', this.workspace); + 'proc name', + this.workspace, + ); assert.equal(callers.length, 1); assert.equal(callers[0], callBlock); }); - test('multiple callers of the same procedure are returned', function() { + test('multiple callers of the same procedure are returned', function () { createProcDefBlock(this.workspace, false, [], 'proc name'); const callBlock1 = createProcCallBlock( - this.workspace, false, 'proc name'); + this.workspace, + false, + 'proc name', + ); const callBlock2 = createProcCallBlock( - this.workspace, false, 'proc name'); + this.workspace, + false, + 'proc name', + ); const callers = Blockly.procedures.getCallers( - 'proc name', this.workspace); + 'proc name', + this.workspace, + ); assert.equal(callers.length, 2); assert.includeMembers(callers, [callBlock1, callBlock2]); }); - test('callers of different procedures are not returned', function() { + test('callers of different procedures are not returned', function () { createProcDefBlock(this.workspace, false, [], 'proc name1'); const callBlock1 = createProcCallBlock( - this.workspace, false, 'proc name1'); + this.workspace, + false, + 'proc name1', + ); createProcDefBlock(this.workspace, false, [], 'proc name2'); createProcCallBlock(this.workspace, false, 'proc name2'); const callers = Blockly.procedures.getCallers( - 'proc name1', this.workspace); + 'proc name1', + this.workspace, + ); assert.equal(callers.length, 1); assert.equal(callers[0], callBlock1); }); @@ -1865,146 +2155,140 @@ suite('Procedures', function() { title: 'XML - Minimal definition', xml: '', expectedXml: - '\n' + - ' unnamed\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, false); - }, + '\n' + + ' unnamed\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, false); + }, }, { title: 'XML - Common definition', xml: - '' + - ' do something' + - '', + '' + + ' do something' + + '', expectedXml: - '\n' + - ' do something\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, false); - }, + '\n' + + ' do something\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, false); + }, }, { title: 'XML - With vars definition', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' do something\n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' do something\n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' do something\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure( - block, false, ['x', 'y'], ['arg1', 'arg2']); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' do something\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, false, ['x', 'y'], ['arg1', 'arg2']); + }, }, { title: 'XML - With pre-created vars definition', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' do something\n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' do something\n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' do something\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, false, - ['preCreatedVar'], ['preCreatedVarId']); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' do something\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure( + block, + false, + ['preCreatedVar'], + ['preCreatedVarId'], + ); + }, }, { title: 'XML - No statements definition', xml: - '\n' + - ' \n' + - ' do something\n' + - '', + '\n' + + ' \n' + + ' do something\n' + + '', expectedXml: - '\n' + - ' \n' + - ' do something\n' + - '', - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, true, [], [], false); - }, + '\n' + + ' \n' + + ' do something\n' + + '', + assertBlockStructure: (block) => { + assertDefBlockStructure(block, true, [], [], false); + }, }, { title: 'XML - Minimal caller', xml: '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'XML - Common caller', xml: - '\n' + - ' \n' + - '', + '\n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + '\n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'XML - With pre-created vars caller', xml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - '', + '\n' + + ' \n' + + ' \n' + + ' \n' + + '', expectedXml: - '\n' + - ' \n' + - ' \n' + - ' \n' + - '', - assertBlockStructure: - (block) => { - assertCallBlockStructure( - block, ['preCreatedVar'], ['preCreatedVarId']); - }, + '\n' + + ' \n' + + ' \n' + + ' \n' + + '', + assertBlockStructure: (block) => { + assertCallBlockStructure(block, ['preCreatedVar'], ['preCreatedVarId']); + }, }, ]; testHelpers.runSerializationTestSuite(xmlTestCases, globalThis.clock); @@ -2026,10 +2310,9 @@ suite('Procedures', function() { 'fullSerialization': true, }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, false); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, false); + }, }, { title: 'JSON - Common definition', @@ -2050,10 +2333,9 @@ suite('Procedures', function() { 'fullSerialization': true, }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, false); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, false); + }, }, { title: 'JSON - With vars definition', @@ -2098,11 +2380,9 @@ suite('Procedures', function() { ], }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure( - block, false, ['x', 'y'], ['arg1', 'arg2']); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, false, ['x', 'y'], ['arg1', 'arg2']); + }, }, { title: 'JSON - With pre-created vars definition', @@ -2138,11 +2418,14 @@ suite('Procedures', function() { ], }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, false, - ['preCreatedVar'], ['preCreatedVarId']); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure( + block, + false, + ['preCreatedVar'], + ['preCreatedVarId'], + ); + }, }, { title: 'JSON - No statements definition', @@ -2167,10 +2450,9 @@ suite('Procedures', function() { 'hasStatements': false, }, }, - assertBlockStructure: - (block) => { - assertDefBlockStructure(block, true, [], [], false); - }, + assertBlockStructure: (block) => { + assertDefBlockStructure(block, true, [], [], false); + }, }, { title: 'JSON - Minimal caller', @@ -2184,10 +2466,9 @@ suite('Procedures', function() { 'name': 'unnamed', }, }, - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'JSON - Common caller', @@ -2204,10 +2485,9 @@ suite('Procedures', function() { 'name': 'do something', }, }, - assertBlockStructure: - (block) => { - assertCallBlockStructure(block); - }, + assertBlockStructure: (block) => { + assertCallBlockStructure(block); + }, }, { title: 'JSON - With pre-created vars caller', @@ -2215,9 +2495,7 @@ suite('Procedures', function() { 'type': 'procedures_callnoreturn', 'extraState': { 'name': 'do something', - 'params': [ - 'preCreatedVar', - ], + 'params': ['preCreatedVar'], }, }, expectedJson: { @@ -2225,16 +2503,12 @@ suite('Procedures', function() { 'id': '1', 'extraState': { 'name': 'do something', - 'params': [ - 'preCreatedVar', - ], + 'params': ['preCreatedVar'], }, }, - assertBlockStructure: - (block) => { - assertCallBlockStructure( - block, ['preCreatedVar'], ['preCreatedVarId']); - }, + assertBlockStructure: (block) => { + assertCallBlockStructure(block, ['preCreatedVar'], ['preCreatedVarId']); + }, }, ]; testHelpers.runSerializationTestSuite(jsonTestCases, globalThis.clock); diff --git a/plugins/block-shareable-procedures/test/procedure_test_helpers.js b/plugins/block-shareable-procedures/test/procedure_test_helpers.js index 4a6040abde..b1a3329b84 100644 --- a/plugins/block-shareable-procedures/test/procedure_test_helpers.js +++ b/plugins/block-shareable-procedures/test/procedure_test_helpers.js @@ -1,4 +1,3 @@ - /** * @license * Copyright 2023 Google LLC @@ -11,7 +10,6 @@ const chai = require('chai'); const assert = chai.assert; const sinon = require('sinon'); - /** * Creates stub for Blockly.utils.idGenerator.genUid that returns the * provided id or ids. @@ -56,16 +54,22 @@ export function assertBlockVarModels(block, varIds) { */ export function assertCallBlockArgsStructure(callBlock, args) { // inputList also contains "TOPROW" - assert.equal(callBlock.inputList.length - 1, args.length, - 'call block has the expected number of args'); + assert.equal( + callBlock.inputList.length - 1, + args.length, + 'call block has the expected number of args', + ); for (let i = 0; i < args.length; i++) { const expectedName = args[i]; const callInput = callBlock.inputList[i + 1]; assert.equal(callInput.type, Blockly.ConnectionType.INPUT_VALUE); assert.equal(callInput.name, 'ARG' + i); - assert.equal(callInput.fieldRow[0].getValue(), expectedName, - 'Call block consts did not match expected.'); + assert.equal( + callInput.fieldRow[0].getValue(), + expectedName, + 'Call block consts did not match expected.', + ); } assert.sameOrderedMembers(callBlock.getVars(), args); } @@ -82,31 +86,46 @@ export function assertCallBlockArgsStructure(callBlock, args) { * statement input or not. */ export function assertDefBlockStructure( - defBlock, - hasReturn = false, - args = [], - varIds = [], - hasStatements = true) { + defBlock, + hasReturn = false, + args = [], + varIds = [], + hasStatements = true, +) { if (hasStatements) { - assert.isNotNull(defBlock.getInput('STACK'), - 'Def block should have STACK input'); + assert.isNotNull( + defBlock.getInput('STACK'), + 'Def block should have STACK input', + ); } else { - assert.isNull(defBlock.getInput('STACK'), - 'Def block should not have STACK input'); + assert.isNull( + defBlock.getInput('STACK'), + 'Def block should not have STACK input', + ); } if (hasReturn) { - assert.isNotNull(defBlock.getInput('RETURN'), - 'Def block should have RETURN input'); + assert.isNotNull( + defBlock.getInput('RETURN'), + 'Def block should have RETURN input', + ); } else { - assert.isNull(defBlock.getInput('RETURN'), - 'Def block should not have RETURN input'); + assert.isNull( + defBlock.getInput('RETURN'), + 'Def block should not have RETURN input', + ); } if (args.length) { - assert.include(defBlock.toString(), 'with', - 'Def block string should include "with"'); + assert.include( + defBlock.toString(), + 'with', + 'Def block string should include "with"', + ); } else { - assert.notInclude(defBlock.toString(), 'with', - 'Def block string should not include "with"'); + assert.notInclude( + defBlock.toString(), + 'with', + 'Def block string should not include "with"', + ); } assert.sameOrderedMembers(defBlock.getVars(), args); @@ -122,7 +141,11 @@ export function assertDefBlockStructure( * @param {string=} name The name we expect the caller to have. */ export function assertCallBlockStructure( - callBlock, args = [], varIds = [], name = undefined) { + callBlock, + args = [], + varIds = [], + name = undefined, +) { if (args.length) { assert.include(callBlock.toString(), 'with'); } else { @@ -146,16 +169,23 @@ export function assertCallBlockStructure( * @returns {Blockly.Block} The created block. */ export function createProcDefBlock( - workspace, hasReturn = false, args = [], name = 'proc name') { - return Blockly.serialization.blocks.append({ - 'type': hasReturn ? 'procedures_defreturn' : 'procedures_defnoreturn', - 'fields': { - 'NAME': name, - }, - 'extraState': { - 'params': args.map((a) => ({'name': a})), + workspace, + hasReturn = false, + args = [], + name = 'proc name', +) { + return Blockly.serialization.blocks.append( + { + 'type': hasReturn ? 'procedures_defreturn' : 'procedures_defnoreturn', + 'fields': { + 'NAME': name, + }, + 'extraState': { + 'params': args.map((a) => ({'name': a})), + }, }, - }, workspace); + workspace, + ); } /** @@ -168,11 +198,17 @@ export function createProcDefBlock( * @returns {Blockly.Block} The created block. */ export function createProcCallBlock( - workspace, hasReturn = false, name = 'proc name') { - return Blockly.serialization.blocks.append({ - 'type': hasReturn ? 'procedures_callreturn' : 'procedures_callnoreturn', - 'extraState': { - 'name': name, + workspace, + hasReturn = false, + name = 'proc name', +) { + return Blockly.serialization.blocks.append( + { + 'type': hasReturn ? 'procedures_callreturn' : 'procedures_callnoreturn', + 'extraState': { + 'name': name, + }, }, - }, workspace); + workspace, + ); } diff --git a/plugins/block-test/README.md b/plugins/block-test/README.md index 7b9c7da80d..d97290898e 100644 --- a/plugins/block-test/README.md +++ b/plugins/block-test/README.md @@ -5,11 +5,13 @@ A set of [Blockly](https://www.npmjs.com/package/blockly) test blocks. ## Installation ### Yarn + ``` yarn add @blockly/block-test ``` ### npm + ``` npm install @blockly/block-test --save ``` @@ -17,6 +19,7 @@ npm install @blockly/block-test --save ## Usage ### Import + ```js import * as Blockly from 'blockly'; import {toolboxTestBlocks, toolboxTestBlocksInit} from '@blockly/block-test'; @@ -32,4 +35,5 @@ toolboxTestBlocksInit(workspace); ``` ## License + Apache 2.0 diff --git a/plugins/block-test/package.json b/plugins/block-test/package.json index 2e3c252fd9..fb3f584fa4 100644 --- a/plugins/block-test/package.json +++ b/plugins/block-test/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start" }, @@ -49,9 +49,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/block-test/src/align.js b/plugins/block-test/src/align.js index 6efcb4b834..934de65557 100644 --- a/plugins/block-test/src/align.js +++ b/plugins/block-test/src/align.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_align_dummy_right', @@ -31,8 +30,8 @@ Blockly.defineBlocksWithJsonArray([ }, { 'type': 'test_align_all', - 'message0': 'text %1 long text left %2 text centre %3 much longer text ' + - 'right %4', + 'message0': + 'text %1 long text left %2 text centre %3 much longer text ' + 'right %4', 'args0': [ { 'type': 'input_dummy', @@ -54,8 +53,8 @@ Blockly.defineBlocksWithJsonArray([ }, { 'type': 'test_align_with_external_input', - 'message0': 'text right %1 long text centre %2 text left %3 much longer ' + - 'text %4', + 'message0': + 'text right %1 long text centre %2 text left %3 much longer ' + 'text %4', 'args0': [ { 'type': 'input_dummy', @@ -79,7 +78,6 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - /** * The Align category. */ diff --git a/plugins/block-test/src/basic.js b/plugins/block-test/src/basic.js index f77402e053..3ba2d75da4 100644 --- a/plugins/block-test/src/basic.js +++ b/plugins/block-test/src/basic.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_basic_empty', @@ -145,19 +144,18 @@ Blockly.defineBlocksWithJsonArray([ ]); Blockly.Blocks['test_basic_empty_with_mutator'] = { - init: function() { + init: function () { this.setMutator(new Blockly.icons.MutatorIcon(['math_number'], this)); }, - decompose: function(workspace) { + decompose: function (workspace) { const topBlock = workspace.newBlock('math_number'); topBlock.initSvg(); return topBlock; }, - compose: function() {}, + compose: function () {}, }; - /** * The Basic Category. */ diff --git a/plugins/block-test/src/connections/index.js b/plugins/block-test/src/connections/index.js index 1806e08f69..894b59b70d 100644 --- a/plugins/block-test/src/connections/index.js +++ b/plugins/block-test/src/connections/index.js @@ -13,8 +13,9 @@ import {category as rowCategory, onInit as initRow} from './row'; import {category as stackCategory, onInit as initStack} from './stack'; import { - category as statementCategory, onInit as initStatement} from './statement'; - + category as statementCategory, + onInit as initStatement, +} from './statement'; /** * The Connections category. @@ -23,11 +24,7 @@ export const category = { 'kind': 'CATEGORY', 'name': 'Connections', 'expanded': 'true', - 'contents': [ - rowCategory, - stackCategory, - statementCategory, - ], + 'contents': [rowCategory, stackCategory, statementCategory], }; /** diff --git a/plugins/block-test/src/connections/row.js b/plugins/block-test/src/connections/row.js index e9066854a2..67be4f6e9a 100644 --- a/plugins/block-test/src/connections/row.js +++ b/plugins/block-test/src/connections/row.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_connections_row_input', @@ -24,8 +23,7 @@ Blockly.defineBlocksWithJsonArray([ }, ], 'colour': '#aaaaaa', - 'tooltip': 'No Checks\n' + - 'Can connect to any output connection.', + 'tooltip': 'No Checks\n' + 'Can connect to any output connection.', }, { 'type': 'test_connections_row_blue', @@ -39,9 +37,10 @@ Blockly.defineBlocksWithJsonArray([ ], 'output': 'noneOut', 'colour': 230, - 'tooltip': 'Output: noneOut\n' + - 'Input: greenRel\n' + - 'Input connection can accept yellow blocks but not red blocks.', + 'tooltip': + 'Output: noneOut\n' + + 'Input: greenRel\n' + + 'Input connection can accept yellow blocks but not red blocks.', }, { 'type': 'test_connections_row_yellow', @@ -50,23 +49,18 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'input_value', 'name': 'NAME', - 'check': [ - 'orangeRel', - 'yellowRel', - ], + 'check': ['orangeRel', 'yellowRel'], }, ], - 'output': [ - 'yellowRel', - 'greenRel', - ], + 'output': ['yellowRel', 'greenRel'], 'colour': 60, - 'tooltip': 'Output: yellowRel, greenRel\n' + - 'Input: yellowRel, orangeRel\n' + - 'Output can connect to yellow blocks and blue blocks, but not red ' + - 'blocks.\n' + - 'Input can connect to yellow blocks and red blocks, but not blue ' + - 'blocks.', + 'tooltip': + 'Output: yellowRel, greenRel\n' + + 'Input: yellowRel, orangeRel\n' + + 'Output can connect to yellow blocks and blue blocks, but not red ' + + 'blocks.\n' + + 'Input can connect to yellow blocks and red blocks, but not blue ' + + 'blocks.', }, { 'type': 'test_connections_row_red', @@ -80,17 +74,17 @@ Blockly.defineBlocksWithJsonArray([ ], 'output': 'orangeRel', 'colour': 0, - 'tooltip': 'Output: orangeRel\n' + - 'Input: noneIn\n' + - 'Output can connect to yellow blocks, but not blue blocks.', + 'tooltip': + 'Output: orangeRel\n' + + 'Input: noneIn\n' + + 'Output can connect to yellow blocks, but not blue blocks.', }, { 'type': 'test_connections_row_output', 'message0': '', 'output': null, 'colour': '#aaaaaa', - 'tooltip': 'No Checks\n' + - 'Can connect to any input connection.', + 'tooltip': 'No Checks\n' + 'Can connect to any input connection.', }, { @@ -107,25 +101,20 @@ Blockly.defineBlocksWithJsonArray([ 'type': 'input_value', 'name': 'NAME2', 'align': 'RIGHT', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, ], - 'output': [ - 'yellowRel', - 'greenRel', - ], + 'output': ['yellowRel', 'greenRel'], 'colour': 60, - 'tooltip': 'Output: yellowRel, greenRel\n' + - 'Input Top: noneIn\n' + - 'Input Bottom: yellowRel, orangeRel\n' + - 'Output can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Top Input can connect to nothing, except grey blocks.\n' + - 'Bottom Input can connect to yellow blocks and red blocks, but not' + - ' blue blocks.', + 'tooltip': + 'Output: yellowRel, greenRel\n' + + 'Input Top: noneIn\n' + + 'Input Bottom: yellowRel, orangeRel\n' + + 'Output can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Top Input can connect to nothing, except grey blocks.\n' + + 'Bottom Input can connect to yellow blocks and red blocks, but not' + + ' blue blocks.', }, { 'type': 'test_connections_multivalue_2valid', @@ -135,78 +124,67 @@ Blockly.defineBlocksWithJsonArray([ 'type': 'input_value', 'name': 'NAME1', 'align': 'RIGHT', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, { 'type': 'input_value', 'name': 'NAME2', 'align': 'RIGHT', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, ], - 'output': [ - 'yellowRel', - 'greenRel', - ], + 'output': ['yellowRel', 'greenRel'], 'colour': 60, - 'tooltip': 'Output: yellowRel, greenRel\n' + - 'Input Top: yellowRel, orangeRel\n' + - 'Input Bottom: yellowRel, orangeRel\n' + - 'Output can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Top Input can connect to yellow blocks and red blocks, but not blue' + - ' blocks.\n' + - 'Bottom Input can connect to yellow blocks and red blocks, but not' + - ' blue blocks.', + 'tooltip': + 'Output: yellowRel, greenRel\n' + + 'Input Top: yellowRel, orangeRel\n' + + 'Input Bottom: yellowRel, orangeRel\n' + + 'Output can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Top Input can connect to yellow blocks and red blocks, but not blue' + + ' blocks.\n' + + 'Bottom Input can connect to yellow blocks and red blocks, but not' + + ' blue blocks.', }, ]); - /** * Handles "insert" button in the connection row test category. This will insert * a group of test blocks connected in a row. * @param {!Blockly.FlyoutButton} button The Flyout button. */ -const insertConnectionRows = function(button) { +const insertConnectionRows = function (button) { const workspace = button.getTargetWorkspace(); Blockly.Xml.domToWorkspace( - Blockly.utils.xml.textToDom( - /* eslint-disable max-len */ - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '' - /* eslint-enable max-len */ - ), - workspace); + Blockly.utils.xml.textToDom( + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', + ), + workspace, + ); }; - /** * The Row connections category. */ @@ -300,12 +278,13 @@ export const category = { ], }; - /** * Initialize this toolbox category. * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. */ export function onInit(workspace) { workspace.registerButtonCallback( - 'insertConnectionRows', insertConnectionRows); + 'insertConnectionRows', + insertConnectionRows, + ); } diff --git a/plugins/block-test/src/connections/stack.js b/plugins/block-test/src/connections/stack.js index 5d63c4f308..91ed457697 100644 --- a/plugins/block-test/src/connections/stack.js +++ b/plugins/block-test/src/connections/stack.js @@ -12,16 +12,13 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ - { 'type': 'test_connections_stack_next', 'message0': '', 'nextStatement': null, 'colour': '#aaaaaa', - 'tooltip': 'No Checks\n' + - 'Can connect to any previous connection.', + 'tooltip': 'No Checks\n' + 'Can connect to any previous connection.', }, { 'type': 'test_connections_stack_blue', @@ -29,28 +26,24 @@ Blockly.defineBlocksWithJsonArray([ 'previousStatement': 'nonePrev', 'nextStatement': 'greenRel', 'colour': 230, - 'tooltip': 'Prev: nonePrev\n' + - 'Next: greenRel\n' + - 'Next connection can accept yellow blocks but not red blocks.', + 'tooltip': + 'Prev: nonePrev\n' + + 'Next: greenRel\n' + + 'Next connection can accept yellow blocks but not red blocks.', }, { 'type': 'test_connections_stack_yellow', 'message0': '', - 'previousStatement': [ - 'greenRel', - 'yellowRel', - ], - 'nextStatement': [ - 'yellowRel', - 'orangeRel', - ], + 'previousStatement': ['greenRel', 'yellowRel'], + 'nextStatement': ['yellowRel', 'orangeRel'], 'colour': 60, - 'tooltip': 'Prev: yellowRel, greenRel\n' + - 'Next: yellowRel, orangeRel\n' + - 'Prev can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Next can connect to yellow blocks and red blocks, but not blue' + - ' blocks.', + 'tooltip': + 'Prev: yellowRel, greenRel\n' + + 'Next: yellowRel, orangeRel\n' + + 'Prev can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Next can connect to yellow blocks and red blocks, but not blue' + + ' blocks.', }, { 'type': 'test_connections_stack_red', @@ -58,57 +51,55 @@ Blockly.defineBlocksWithJsonArray([ 'previousStatement': 'orangeRel', 'nextStatement': 'noneNext', 'colour': 0, - 'tooltip': 'Prev: orangeRel\n' + - 'Next: noneNext\n' + - 'Prev can connect to yellow blocks, but not blue blocks.', + 'tooltip': + 'Prev: orangeRel\n' + + 'Next: noneNext\n' + + 'Prev can connect to yellow blocks, but not blue blocks.', }, { 'type': 'test_connections_stack_prev', 'message0': '', 'previousStatement': null, 'colour': '#aaaaaa', - 'tooltip': 'No Checks\n' + - 'Can connect to any input connection.', + 'tooltip': 'No Checks\n' + 'Can connect to any input connection.', }, ]); - /** * Handles "insert" button in the connection stack test category. This will * insert a group of test blocks connected in a stack. * @param {!Blockly.FlyoutButton} button The flyout button. */ -const insertConnectionStacks = function(button) { +const insertConnectionStacks = function (button) { const workspace = button.getTargetWorkspace(); Blockly.Xml.domToWorkspace( - Blockly.utils.xml.textToDom( - /* eslint-disable max-len */ - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - '' - /* eslint-enable max-len */ - ), - workspace); + Blockly.utils.xml.textToDom( + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', + ), + workspace, + ); }; /** @@ -187,12 +178,13 @@ export const category = { ], }; - /** * Initialize this toolbox category. * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. */ export function onInit(workspace) { workspace.registerButtonCallback( - 'insertConnectionStacks', insertConnectionStacks); + 'insertConnectionStacks', + insertConnectionStacks, + ); } diff --git a/plugins/block-test/src/connections/statement.js b/plugins/block-test/src/connections/statement.js index 20c381e6f9..7bf3a027e6 100644 --- a/plugins/block-test/src/connections/statement.js +++ b/plugins/block-test/src/connections/statement.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_connections_statement_blue', @@ -27,11 +26,12 @@ Blockly.defineBlocksWithJsonArray([ 'previousStatement': 'nonePrev', 'nextStatement': 'greenRel', 'colour': 230, - 'tooltip': 'Prev: nonePrev\n' + - 'Next: greenRel\n' + - 'Statement: greenRel\n' + - 'Next connection can accept yellow blocks but not red blocks.\n' + - 'Statement connection can accept yellow blocks but not red blocks.', + 'tooltip': + 'Prev: nonePrev\n' + + 'Next: greenRel\n' + + 'Statement: greenRel\n' + + 'Next connection can accept yellow blocks but not red blocks.\n' + + 'Statement connection can accept yellow blocks but not red blocks.', }, { 'type': 'test_connections_statement_yellow', @@ -40,30 +40,22 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'input_statement', 'name': 'NAME', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, ], - 'previousStatement': [ - 'greenRel', - 'yellowRel', - ], - 'nextStatement': [ - 'yellowRel', - 'orangeRel', - ], + 'previousStatement': ['greenRel', 'yellowRel'], + 'nextStatement': ['yellowRel', 'orangeRel'], 'colour': 60, - 'tooltip': 'Prev: yellowRel, greenRel\n' + - 'Next: yellowRel, orangeRel\n' + - 'Statement: orangeRel\n' + - 'Prev can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Next can connect to yellow blocks and red blocks, but not blue' + - ' blocks.\n' + - 'Statement connection can accept yellow blocks and red blocks but not' + - ' blue blocks.\n', + 'tooltip': + 'Prev: yellowRel, greenRel\n' + + 'Next: yellowRel, orangeRel\n' + + 'Statement: orangeRel\n' + + 'Prev can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Next can connect to yellow blocks and red blocks, but not blue' + + ' blocks.\n' + + 'Statement connection can accept yellow blocks and red blocks but not' + + ' blue blocks.\n', }, { 'type': 'test_connections_statement_red', @@ -78,11 +70,12 @@ Blockly.defineBlocksWithJsonArray([ 'previousStatement': 'orangeRel', 'nextStatement': 'noneNext', 'colour': 0, - 'tooltip': 'Prev: orangeRel\n' + - 'Next: noneNext\n' + - 'Statement: noneNext\n' + - 'Prev connection can accept yellow blocks but not blue blocks.\n' + - 'Statement connection accepts none.', + 'tooltip': + 'Prev: orangeRel\n' + + 'Next: noneNext\n' + + 'Statement: noneNext\n' + + 'Prev connection can accept yellow blocks but not blue blocks.\n' + + 'Statement connection accepts none.', }, { 'type': 'test_connections_statement_nonext', @@ -91,24 +84,19 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'input_statement', 'name': 'NAME', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, ], - 'previousStatement': [ - 'greenRel', - 'yellowRel', - ], + 'previousStatement': ['greenRel', 'yellowRel'], 'colour': 60, - 'tooltip': 'Prev: yellowRel, greenRel\n' + - 'Next: yellowRel, orangeRel\n' + - 'Statement: orangeRel\n' + - 'Prev can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Statement connection can accept yellow blocks and red blocks but not' + - ' blue blocks.\n', + 'tooltip': + 'Prev: yellowRel, greenRel\n' + + 'Next: yellowRel, orangeRel\n' + + 'Statement: orangeRel\n' + + 'Prev can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Statement connection can accept yellow blocks and red blocks but not' + + ' blue blocks.\n', }, { 'type': 'test_connections_multistatement_1valid', @@ -122,25 +110,20 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'input_statement', 'name': 'NAME', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, ], - 'previousStatement': [ - 'greenRel', - 'yellowRel', - ], + 'previousStatement': ['greenRel', 'yellowRel'], 'colour': 60, - 'tooltip': 'Prev: yellowRel, greenRel\n' + - 'Next: yellowRel, orangeRel\n' + - 'Statement: orangeRel\n' + - 'Prev can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Top Statement cannot connect to anything, except grey blocks.\n' + - 'Bottom Statement connection can accept yellow blocks and red blocks' + - ' but not blue blocks.\n', + 'tooltip': + 'Prev: yellowRel, greenRel\n' + + 'Next: yellowRel, orangeRel\n' + + 'Statement: orangeRel\n' + + 'Prev can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Top Statement cannot connect to anything, except grey blocks.\n' + + 'Bottom Statement connection can accept yellow blocks and red blocks' + + ' but not blue blocks.\n', }, { 'type': 'test_connections_multistatement_2valid', @@ -149,66 +132,58 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'input_statement', 'name': 'NAME', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, { 'type': 'input_statement', 'name': 'NAME', - 'check': [ - 'yellowRel', - 'orangeRel', - ], + 'check': ['yellowRel', 'orangeRel'], }, ], - 'previousStatement': [ - 'greenRel', - 'yellowRel', - ], + 'previousStatement': ['greenRel', 'yellowRel'], 'colour': 60, - 'tooltip': 'Prev: yellowRel, greenRel\n' + - 'Next: yellowRel, orangeRel\n' + - 'Statement: orangeRel\n' + - 'Prev can connect to yellow blocks and blue blocks, but not red' + - ' blocks.\n' + - 'Top Statement connection can accept yellow blocks and red blocks but' + - ' not blue blocks.\n' + - 'Bottom Statement connection can accept yellow blocks and red blocks' + - ' but not blue blocks.\n', + 'tooltip': + 'Prev: yellowRel, greenRel\n' + + 'Next: yellowRel, orangeRel\n' + + 'Statement: orangeRel\n' + + 'Prev can connect to yellow blocks and blue blocks, but not red' + + ' blocks.\n' + + 'Top Statement connection can accept yellow blocks and red blocks but' + + ' not blue blocks.\n' + + 'Bottom Statement connection can accept yellow blocks and red blocks' + + ' but not blue blocks.\n', }, ]); - /** * Handles "insert" button in the connection statement test category. This will * insert a group of test blocks connected as statements. * @param {!Blockly.FlyoutButton} button The flyout button. */ -const insertConnectionStatements = function(button) { +const insertConnectionStatements = function (button) { const workspace = button.getTargetWorkspace(); Blockly.Xml.domToWorkspace( - Blockly.utils.xml.textToDom( - '\n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ''), - workspace); + Blockly.utils.xml.textToDom( + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + '', + ), + workspace, + ); }; - /** * The Statement connections category. */ @@ -286,5 +261,7 @@ export const category = { */ export function onInit(workspace) { workspace.registerButtonCallback( - 'insertConnectionStatements', insertConnectionStatements); + 'insertConnectionStatements', + insertConnectionStatements, + ); } diff --git a/plugins/block-test/src/drag.js b/plugins/block-test/src/drag.js index b0bdabb069..394a50e81c 100644 --- a/plugins/block-test/src/drag.js +++ b/plugins/block-test/src/drag.js @@ -10,7 +10,6 @@ * @author samelh@google.com (Sam El-Husseini) */ - /** * The Drag category. */ diff --git a/plugins/block-test/src/fields/angles.js b/plugins/block-test/src/fields/angles.js index bb4d6575f2..bc6aa0490d 100644 --- a/plugins/block-test/src/fields/angles.js +++ b/plugins/block-test/src/fields/angles.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_angles_protractor', @@ -114,7 +113,6 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - /** * The Angle field category. */ diff --git a/plugins/block-test/src/fields/defaults.js b/plugins/block-test/src/fields/defaults.js index 6a7097b0b1..6356885198 100644 --- a/plugins/block-test/src/fields/defaults.js +++ b/plugins/block-test/src/fields/defaults.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_fields_angle', @@ -108,10 +107,21 @@ Blockly.defineBlocksWithJsonArray([ 'type': 'field_colour', 'name': 'COLOUR', 'colour': '#ff4040', - 'colourOptions': - ['#ff4040', '#ff8080', '#ffc0c0', '#4040ff', '#8080ff', '#c0c0ff'], + 'colourOptions': [ + '#ff4040', + '#ff8080', + '#ffc0c0', + '#4040ff', + '#8080ff', + '#c0c0ff', + ], 'colourTitles': [ - 'dark pink', 'pink', 'light pink', 'dark blue', 'blue', 'light blue', + 'dark pink', + 'pink', + 'light pink', + 'dark blue', + 'blue', + 'light blue', ], 'columns': 3, }, @@ -164,7 +174,6 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - /** * The Default fields category. */ @@ -279,11 +288,12 @@ export const category = { * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. */ export function onInit(workspace) { - const randomizeLabelText = function(button) { - const blocks = button.getTargetWorkspace().getBlocksByType( - 'test_fields_label_serializable'); + const randomizeLabelText = function (button) { + const blocks = button + .getTargetWorkspace() + .getBlocksByType('test_fields_label_serializable'); const possible = 'AB'; - for (let i = 0, block; block = blocks[i]; i++) { + for (let i = 0, block; (block = blocks[i]); i++) { let text = ''; for (let j = 0; j < 4; j++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); @@ -291,46 +301,62 @@ export function onInit(workspace) { block.setFieldValue(text, 'LABEL'); } }; - const setRandomStyle = function(button) { - const blocks = button.getTargetWorkspace().getFlyout().getWorkspace() - .getAllBlocks(false); - const styles = - Object.keys(workspace.getRenderer().getConstants().blockStyles); + const setRandomStyle = function (button) { + const blocks = button + .getTargetWorkspace() + .getFlyout() + .getWorkspace() + .getAllBlocks(false); + const styles = Object.keys( + workspace.getRenderer().getConstants().blockStyles, + ); styles.splice(styles.indexOf(blocks[0].getStyleName()), 1); const style = styles[Math.floor(Math.random() * styles.length)]; - for (let i = 0, block; block = blocks[i]; i++) { + for (let i = 0, block; (block = blocks[i]); i++) { block.setStyle(style); } }; - const toggleEnabled = function(button) { - const blocks = button.getTargetWorkspace().getFlyout().getWorkspace() - .getAllBlocks(false); - for (let i = 0, block; block = blocks[i]; i++) { + const toggleEnabled = function (button) { + const blocks = button + .getTargetWorkspace() + .getFlyout() + .getWorkspace() + .getAllBlocks(false); + for (let i = 0, block; (block = blocks[i]); i++) { block.setEnabled(!block.isEnabled()); } }; - const toggleShadow = function(button) { - const blocks = button.getTargetWorkspace().getFlyout().getWorkspace() - .getAllBlocks(false); - for (let i = 0, block; block = blocks[i]; i++) { + const toggleShadow = function (button) { + const blocks = button + .getTargetWorkspace() + .getFlyout() + .getWorkspace() + .getAllBlocks(false); + for (let i = 0, block; (block = blocks[i]); i++) { block.setShadow(!block.isShadow()); } }; - const toggleCollapsed = function(button) { - const blocks = button.getTargetWorkspace().getFlyout().getWorkspace() - .getAllBlocks(false); - for (let i = 0, block; block = blocks[i]; i++) { + const toggleCollapsed = function (button) { + const blocks = button + .getTargetWorkspace() + .getFlyout() + .getWorkspace() + .getAllBlocks(false); + for (let i = 0, block; (block = blocks[i]); i++) { block.setCollapsed(!block.isCollapsed()); } }; - const changeImage = function(button) { - const blocks = button.getTargetWorkspace().getFlyout().getWorkspace() - .getBlocksByType('test_fields_image'); + const changeImage = function (button) { + const blocks = button + .getTargetWorkspace() + .getFlyout() + .getWorkspace() + .getBlocksByType('test_fields_image'); const possible = 'abcdefghijklm'; const image = possible.charAt(Math.floor(Math.random() * possible.length)); const src = - 'https://blockly-demo.appspot.com/static/tests/media/' + image + '.png'; - for (let i = 0, block; block = blocks[i]; i++) { + 'https://blockly-demo.appspot.com/static/tests/media/' + image + '.png'; + for (let i = 0, block; (block = blocks[i]); i++) { const imageField = block.getField('IMAGE'); imageField.setValue(src); } diff --git a/plugins/block-test/src/fields/dropdowns.js b/plugins/block-test/src/fields/dropdowns.js index 84e9f2cef5..60fdca985b 100644 --- a/plugins/block-test/src/fields/dropdowns.js +++ b/plugins/block-test/src/fields/dropdowns.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_dropdowns_long', @@ -22,22 +21,38 @@ Blockly.defineBlocksWithJsonArray([ 'type': 'field_dropdown', 'name': 'FIELDNAME', 'options': [ - ['first item', 'ITEM1'], ['second item', 'ITEM2'], - ['third item', 'ITEM3'], ['fourth item', 'ITEM4'], - ['fifth item', 'ITEM5'], ['sixth item', 'ITEM6'], - ['seventh item', 'ITEM7'], ['eighth item', 'ITEM8'], - ['ninth item', 'ITEM9'], ['tenth item', 'ITEM10'], - ['eleventh item', 'ITEM11'], ['twelfth item', 'ITEM12'], - ['thirteenth item', 'ITEM13'], ['fourteenth item', 'ITEM14'], - ['fifteenth item', 'ITEM15'], ['sixteenth item', 'ITEM16'], - ['seventeenth item', 'ITEM17'], ['eighteenth item', 'ITEM18'], - ['nineteenth item', 'ITEM19'], ['twentieth item', 'ITEM20'], - ['twenty-first item', 'ITEM21'], ['twenty-second item', 'ITEM22'], - ['twenty-third item', 'ITEM23'], ['twenty-fourth item', 'ITEM24'], - ['twenty-fifth item', 'ITEM25'], ['twenty-sixth item', 'ITEM26'], - ['twenty-seventh item', 'ITEM27'], ['twenty-eighth item', 'ITEM28'], - ['twenty-ninth item', 'ITEM29'], ['thirtieth item', 'ITEM30'], - ['thirty-first item', 'ITEM31'], ['thirty-second item', 'ITEM32'], + ['first item', 'ITEM1'], + ['second item', 'ITEM2'], + ['third item', 'ITEM3'], + ['fourth item', 'ITEM4'], + ['fifth item', 'ITEM5'], + ['sixth item', 'ITEM6'], + ['seventh item', 'ITEM7'], + ['eighth item', 'ITEM8'], + ['ninth item', 'ITEM9'], + ['tenth item', 'ITEM10'], + ['eleventh item', 'ITEM11'], + ['twelfth item', 'ITEM12'], + ['thirteenth item', 'ITEM13'], + ['fourteenth item', 'ITEM14'], + ['fifteenth item', 'ITEM15'], + ['sixteenth item', 'ITEM16'], + ['seventeenth item', 'ITEM17'], + ['eighteenth item', 'ITEM18'], + ['nineteenth item', 'ITEM19'], + ['twentieth item', 'ITEM20'], + ['twenty-first item', 'ITEM21'], + ['twenty-second item', 'ITEM22'], + ['twenty-third item', 'ITEM23'], + ['twenty-fourth item', 'ITEM24'], + ['twenty-fifth item', 'ITEM25'], + ['twenty-sixth item', 'ITEM26'], + ['twenty-seventh item', 'ITEM27'], + ['twenty-eighth item', 'ITEM28'], + ['twenty-ninth item', 'ITEM29'], + ['thirtieth item', 'ITEM30'], + ['thirty-first item', 'ITEM31'], + ['thirty-second item', 'ITEM32'], ], }, ], @@ -54,7 +69,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/a.png', + 'https://blockly-demo.appspot.com/static/tests/media/a.png', 'width': 32, 'height': 32, 'alt': 'A', @@ -64,7 +79,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/b.png', + 'https://blockly-demo.appspot.com/static/tests/media/b.png', 'width': 32, 'height': 32, 'alt': 'B', @@ -74,7 +89,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/c.png', + 'https://blockly-demo.appspot.com/static/tests/media/c.png', 'width': 32, 'height': 32, 'alt': 'C', @@ -84,7 +99,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/d.png', + 'https://blockly-demo.appspot.com/static/tests/media/d.png', 'width': 32, 'height': 32, 'alt': 'D', @@ -94,7 +109,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/e.png', + 'https://blockly-demo.appspot.com/static/tests/media/e.png', 'width': 32, 'height': 32, 'alt': 'E', @@ -104,7 +119,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/f.png', + 'https://blockly-demo.appspot.com/static/tests/media/f.png', 'width': 32, 'height': 32, 'alt': 'F', @@ -114,7 +129,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/g.png', + 'https://blockly-demo.appspot.com/static/tests/media/g.png', 'width': 32, 'height': 32, 'alt': 'G', @@ -124,7 +139,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/h.png', + 'https://blockly-demo.appspot.com/static/tests/media/h.png', 'width': 32, 'height': 32, 'alt': 'H', @@ -134,7 +149,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/i.png', + 'https://blockly-demo.appspot.com/static/tests/media/i.png', 'width': 32, 'height': 32, 'alt': 'I', @@ -144,7 +159,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/j.png', + 'https://blockly-demo.appspot.com/static/tests/media/j.png', 'width': 32, 'height': 32, 'alt': 'J', @@ -154,7 +169,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/k.png', + 'https://blockly-demo.appspot.com/static/tests/media/k.png', 'width': 32, 'height': 32, 'alt': 'K', @@ -164,7 +179,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/l.png', + 'https://blockly-demo.appspot.com/static/tests/media/l.png', 'width': 32, 'height': 32, 'alt': 'L', @@ -174,7 +189,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/m.png', + 'https://blockly-demo.appspot.com/static/tests/media/m.png', 'width': 32, 'height': 32, 'alt': 'M', @@ -197,7 +212,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/a.png', + 'https://blockly-demo.appspot.com/static/tests/media/a.png', 'width': 32, 'height': 32, 'alt': 'A', @@ -207,7 +222,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/b.png', + 'https://blockly-demo.appspot.com/static/tests/media/b.png', 'width': 32, 'height': 32, 'alt': 'B', @@ -217,7 +232,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/c.png', + 'https://blockly-demo.appspot.com/static/tests/media/c.png', 'width': 32, 'height': 32, 'alt': 'C', @@ -227,7 +242,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/d.png', + 'https://blockly-demo.appspot.com/static/tests/media/d.png', 'width': 32, 'height': 32, 'alt': 'D', @@ -237,7 +252,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/e.png', + 'https://blockly-demo.appspot.com/static/tests/media/e.png', 'width': 32, 'height': 32, 'alt': 'E', @@ -247,7 +262,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/f.png', + 'https://blockly-demo.appspot.com/static/tests/media/f.png', 'width': 32, 'height': 32, 'alt': 'F', @@ -257,7 +272,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/g.png', + 'https://blockly-demo.appspot.com/static/tests/media/g.png', 'width': 32, 'height': 32, 'alt': 'G', @@ -267,7 +282,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/h.png', + 'https://blockly-demo.appspot.com/static/tests/media/h.png', 'width': 32, 'height': 32, 'alt': 'H', @@ -278,7 +293,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/i.png', + 'https://blockly-demo.appspot.com/static/tests/media/i.png', 'width': 32, 'height': 32, 'alt': 'I', @@ -288,7 +303,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/j.png', + 'https://blockly-demo.appspot.com/static/tests/media/j.png', 'width': 32, 'height': 32, 'alt': 'J', @@ -298,7 +313,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/k.png', + 'https://blockly-demo.appspot.com/static/tests/media/k.png', 'width': 32, 'height': 32, 'alt': 'K', @@ -308,7 +323,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/l.png', + 'https://blockly-demo.appspot.com/static/tests/media/l.png', 'width': 32, 'height': 32, 'alt': 'L', @@ -318,7 +333,7 @@ Blockly.defineBlocksWithJsonArray([ [ { 'src': - 'https://blockly-demo.appspot.com/static/tests/media/m.png', + 'https://blockly-demo.appspot.com/static/tests/media/m.png', 'width': 32, 'height': 32, 'alt': 'M', @@ -350,7 +365,6 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - /** * An array of options for the dynamic dropdown. * @type {!Array.} @@ -363,19 +377,23 @@ const dynamicDropdownOptions_ = []; * the user for an option to add. * @package */ -const addDynamicDropdownOption = function() { +const addDynamicDropdownOption = function () { Blockly.prompt( - 'Add an option?', 'option ' + dynamicDropdownOptions_.length, - function(text) { - if (text) { - // Do not remove this log! Helps you know if it was added correctly. - console.log('Adding option: ' + text); - // The option is an array containing human-readable text and a - // language-neutral id. - dynamicDropdownOptions_.push( - [text, 'OPTION' + dynamicDropdownOptions_.length]); - } - }); + 'Add an option?', + 'option ' + dynamicDropdownOptions_.length, + function (text) { + if (text) { + // Do not remove this log! Helps you know if it was added correctly. + console.log('Adding option: ' + text); + // The option is an array containing human-readable text and a + // language-neutral id. + dynamicDropdownOptions_.push([ + text, + 'OPTION' + dynamicDropdownOptions_.length, + ]); + } + }, + ); }; /** @@ -384,11 +402,12 @@ const addDynamicDropdownOption = function() { * same name. * @package */ -const removeDynamicDropdownOption = function() { - const defaultText = - dynamicDropdownOptions_[0] ? dynamicDropdownOptions_[0][0] : ''; - Blockly.prompt('Remove an option?', defaultText, function(text) { - for (let i = 0, option; option = dynamicDropdownOptions_[i]; i++) { +const removeDynamicDropdownOption = function () { + const defaultText = dynamicDropdownOptions_[0] + ? dynamicDropdownOptions_[0][0] + : ''; + Blockly.prompt('Remove an option?', defaultText, function (text) { + for (let i = 0, option; (option = dynamicDropdownOptions_[i]); i++) { // The option is an array containing human-readable text and a // language-neutral id, we'll compare against the human-readable text. if (option[0] == text) { @@ -401,14 +420,14 @@ const removeDynamicDropdownOption = function() { }; Blockly.Blocks['test_dropdowns_dynamic_random'] = { - init: function() { + init: function () { const dropdown = new Blockly.FieldDropdown(this.dynamicOptions); this.appendDummyInput() - .appendField('dynamic random') - .appendField(dropdown, 'OPTIONS'); + .appendField('dynamic random') + .appendField(dropdown, 'OPTIONS'); }, - dynamicOptions: function() { + dynamicOptions: function () { const random = Math.floor(Math.random() * 10) + 1; const options = []; for (let i = 0; i < random; i++) { @@ -419,22 +438,23 @@ Blockly.Blocks['test_dropdowns_dynamic_random'] = { }; Blockly.Blocks['test_dropdowns_dynamic_connect_dependant'] = { - init: function() { + init: function () { const dropdown = new Blockly.FieldDropdown(this.dynamicOptions); this.appendDummyInput() - .appendField('dynamic connect-dependant') - .appendField(dropdown, 'OPTIONS'); + .appendField('dynamic connect-dependant') + .appendField(dropdown, 'OPTIONS'); this.setNextStatement(true); this.setPreviousStatement(true); }, - dynamicOptions: function() { + dynamicOptions: function () { if (this.sourceBlock_ && this.sourceBlock_.getSurroundParent()) { const parent = this.sourceBlock_.getSurroundParent(); const options = [ ['connected', 'CONNECTED_KEY'], [`surroundParent: ${parent.type}`, `${parent.id}_type_key`], - [`surroundParent: ${parent.id}`, `${parent.id}_key`]]; + [`surroundParent: ${parent.id}`, `${parent.id}_key`], + ]; const top = this.sourceBlock_.getTopStackBlock(); if (top.id !== parent.id) { options.push([`topStack: ${top.type}`, `${top.id}_type_key`]); @@ -459,7 +479,7 @@ const DROPDOWN_MUTATOR = { * @returns {Element} XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { const container = Blockly.utils.xml.createElement('mutation'); return container; }, @@ -468,28 +488,29 @@ const DROPDOWN_MUTATOR = { * @param {!Element} _xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(_xmlElement) {}, + domToMutation: function (_xmlElement) {}, /** * Returns the state of the block as a JSON serializable object. * @returns {!Object} The state of the block as a JSON serializable object. */ - saveExtraState: function() { + saveExtraState: function () { return {}; }, /** * Applies the given state to the block. * @param {!Object} _state The state to apply. */ - loadExtraState: function(_state) { }, + loadExtraState: function (_state) {}, /** * Populate the mutator's dialog with this block's components. * @param {!Blockly.Workspace} workspace Mutator's workspace. * @returns {!Blockly.Block} Root block in mutator. * @this {Blockly.Block} */ - decompose: function(workspace) { - const containerBlock = - workspace.newBlock('test_dropdowns_in_mutator_block'); + decompose: function (workspace) { + const containerBlock = workspace.newBlock( + 'test_dropdowns_in_mutator_block', + ); containerBlock.initSvg(); return containerBlock; @@ -499,25 +520,28 @@ const DROPDOWN_MUTATOR = { * @param {!Blockly.Block} _containerBlock Root block in mutator. * @this {Blockly.Block} */ - compose: function(_containerBlock) {}, + compose: function (_containerBlock) {}, }; /** * Register custom mutator used by the test_dropdowns_in_mutator block. */ Blockly.Extensions.registerMutator( - 'test_dropdown_mutator', DROPDOWN_MUTATOR, null, - ['test_dropdowns_in_mutator_block']); - + 'test_dropdown_mutator', + DROPDOWN_MUTATOR, + null, + ['test_dropdowns_in_mutator_block'], +); Blockly.Blocks['test_dropdowns_dynamic'] = { - init: function() { + init: function () { const dropdown = new Blockly.FieldDropdown(this.dynamicOptions); - this.appendDummyInput().appendField('dynamic').appendField( - dropdown, 'OPTIONS'); + this.appendDummyInput() + .appendField('dynamic') + .appendField(dropdown, 'OPTIONS'); }, - dynamicOptions: function() { + dynamicOptions: function () { if (!dynamicDropdownOptions_.length) { return [['', 'OPTION0']]; } @@ -525,7 +549,6 @@ Blockly.Blocks['test_dropdowns_dynamic'] = { }, }; - /** * The Dropdown field category. */ @@ -584,7 +607,11 @@ export const category = { */ export function onInit(workspace) { workspace.registerButtonCallback( - 'addDynamicOption', addDynamicDropdownOption); + 'addDynamicOption', + addDynamicDropdownOption, + ); workspace.registerButtonCallback( - 'removeDynamicOption', removeDynamicDropdownOption); + 'removeDynamicOption', + removeDynamicDropdownOption, + ); } diff --git a/plugins/block-test/src/fields/emojis.js b/plugins/block-test/src/fields/emojis.js index b5ce2bbaa9..63ac751713 100644 --- a/plugins/block-test/src/fields/emojis.js +++ b/plugins/block-test/src/fields/emojis.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - /** * The Emoji category. */ @@ -37,12 +36,10 @@ export const category = { }, { 'kind': 'BLOCK', - /* eslint-disable max-len */ 'blockxml': ` Zalgo in text field:B̛̻̦̬̘̰͎̥̈̔͊͞ͅl̡͖̫̺̬̖̣̳̃̀́͑͑̕͟͠͝o̢̹͙̮̫͔͋̉̊̑̿̽̚c̸̹̹̜͙̹̠͋̒͑̊̇͝k̡͉̫͇̖̳͖̊͒́̆̄̎̂̔̕͜͞l̰̙̞̳̩̠͖̯̀̆̈́̿̈̓͗y̨̡̟͇̮͈̬̙̲̏̅̀͘͠ `, - /* eslint-enable max-len */ }, ], }; diff --git a/plugins/block-test/src/fields/images.js b/plugins/block-test/src/fields/images.js index a2c20b1815..933b6f7ed1 100644 --- a/plugins/block-test/src/fields/images.js +++ b/plugins/block-test/src/fields/images.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_images_datauri', @@ -21,9 +20,7 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'field_image', 'src': - /* eslint-disable max-len */ - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABHZJREFUaAXtmEuPDFEUx8cwJIx4jQjxSGYt4pWQiGSIz4A1O2FtLyx8B4+MxIKEtQkRsZBIEF/AAgki3gzjNfx/Xfc/rkpVd1dXdU13OMm/z73ndc+5r6rqgYHu01wNAfqa5kTZx+1I3PtNJ35Aqe4P6VrW+9mnEl6o/g/hu0Ab6koxg0nsjn+dVF6c+Yr8SZgUaGeRfR0ry6alzEFaGuYY/AryafFODjQ++EKOlfRq+nXSxzTeY2FHGHcocM/uIvXZWoA2ZJ1td0pGjKMoRY6d9Nr8ndemXdrMyayVYr1wQ9gn3BVIhNklNluKg06fNslTFDacG4q4LgwLxIIcO+nV+HtOY5HoF2FbgXG3y3ZKwPdsAb/KTeOZIxESOhRG2SB+SrgvfBDeC/cEZKwgdFjA5wydQHFMy2rh8WWxOYx4UJybiiTBR+Fzqu/nin2kHohj0a+dmEWfNYpwAefV3iSMCiMC5+GSYD0PSgjfWVkJDmoaJLRO8EocUXulMC68EW4KpuNqUAy2+EDpePRnjdj/JMhKUASH37N/S+0FgrePV+akZLWTl3+jRt4j7BbGhCUC9EAgcbbThdC+KL5aMA2Fxi5xbLkMoKXCmEBMYjMG5DGTXgW/XuqtiuVZNr8S4nM7cbBHBbYTehcxqDZJOTGv2DvJoKuC45lvaWiSbRea+cyHNN8i0UwHgyfilwUS+SYsFkiCmSYWD7tXwkOB5J8H7uRcCL48EPEDTMYqgYngneyl8FSAPHbSq+DXSWSFYmuwIhzg4WDgSYr93GY7kjQ++OaR7fP0M3IPNiNo0mBWCcxMm+izCtbBHRM5emR5FOvxi21ZibifF6Mh96BNjSIlgX9GfRJJkwen4CLbgrj2Tcds2Y9nt6VxQYOOkyo4TsO86IrkjRGvjNvmsQ8yCox1cTu2LdQuW4gT4wYyuZ21rbxKtsHHbcdynEK8TCEM7GS5jp3k8pAB16plQdRYCRLHxjp8JwVilSpG/h0TA08IXwUSAyTFNdwM2Nge32sCsTqmTp09c8zsM4H3KB6EJMcqW5+Oj946X88jklHMGoE3AuvVbJ/KbC1G4crkW4Ptsld4KzimZ1yiGSJJF0chy4Q7Av7xta5uMfKgxbz+WPMOxv9VrMhtwcmTJDqADKIAkgVeNWS8CbAi2M4akciEMCXwusFrB0WQPJy+z0qWDh98S58RxeiYvEXgnJUVIdIJcQqBQ8ib6fCNY+FTmMpsLZIlATiH1MQHFWT+Oun+JcvSOVZk3n5zsH3TTEuKgEjCf4k6pjnyZjqvhmMRrzCVWZF4MJLwwzGW086TW1eqAA/mWXO/b/n/Qnpt6f6vyL++Ir6hzCubj7q3lscz79tC/DVoXlkhVT0QWyXkV/TxYGhueSv/lvq6CuFM8CryQjgdsqJf2VmpfK+GJLOYi+FbvtIiGKwbK+JZNo+LQlb5+WCAbqyIY5rHhXSt3Y3BPOPmXUs+Dlzld7K30iMNwD8q3Ex85lquZv8QhzimdD/W9Xyb5H0z1Zbsb+OT/8HoqhrfAAAAAElFTkSuQmCC', - /* eslint-enable max-len */ + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABHZJREFUaAXtmEuPDFEUx8cwJIx4jQjxSGYt4pWQiGSIz4A1O2FtLyx8B4+MxIKEtQkRsZBIEF/AAgki3gzjNfx/Xfc/rkpVd1dXdU13OMm/z73ndc+5r6rqgYHu01wNAfqa5kTZx+1I3PtNJ35Aqe4P6VrW+9mnEl6o/g/hu0Ab6koxg0nsjn+dVF6c+Yr8SZgUaGeRfR0ry6alzEFaGuYY/AryafFODjQ++EKOlfRq+nXSxzTeY2FHGHcocM/uIvXZWoA2ZJ1td0pGjKMoRY6d9Nr8ndemXdrMyayVYr1wQ9gn3BVIhNklNluKg06fNslTFDacG4q4LgwLxIIcO+nV+HtOY5HoF2FbgXG3y3ZKwPdsAb/KTeOZIxESOhRG2SB+SrgvfBDeC/cEZKwgdFjA5wydQHFMy2rh8WWxOYx4UJybiiTBR+Fzqu/nin2kHohj0a+dmEWfNYpwAefV3iSMCiMC5+GSYD0PSgjfWVkJDmoaJLRO8EocUXulMC68EW4KpuNqUAy2+EDpePRnjdj/JMhKUASH37N/S+0FgrePV+akZLWTl3+jRt4j7BbGhCUC9EAgcbbThdC+KL5aMA2Fxi5xbLkMoKXCmEBMYjMG5DGTXgW/XuqtiuVZNr8S4nM7cbBHBbYTehcxqDZJOTGv2DvJoKuC45lvaWiSbRea+cyHNN8i0UwHgyfilwUS+SYsFkiCmSYWD7tXwkOB5J8H7uRcCL48EPEDTMYqgYngneyl8FSAPHbSq+DXSWSFYmuwIhzg4WDgSYr93GY7kjQ++OaR7fP0M3IPNiNo0mBWCcxMm+izCtbBHRM5emR5FOvxi21ZibifF6Mh96BNjSIlgX9GfRJJkwen4CLbgrj2Tcds2Y9nt6VxQYOOkyo4TsO86IrkjRGvjNvmsQ8yCox1cTu2LdQuW4gT4wYyuZ21rbxKtsHHbcdynEK8TCEM7GS5jp3k8pAB16plQdRYCRLHxjp8JwVilSpG/h0TA08IXwUSAyTFNdwM2Nge32sCsTqmTp09c8zsM4H3KB6EJMcqW5+Oj946X88jklHMGoE3AuvVbJ/KbC1G4crkW4Ptsld4KzimZ1yiGSJJF0chy4Q7Av7xta5uMfKgxbz+WPMOxv9VrMhtwcmTJDqADKIAkgVeNWS8CbAi2M4akciEMCXwusFrB0WQPJy+z0qWDh98S58RxeiYvEXgnJUVIdIJcQqBQ8ib6fCNY+FTmMpsLZIlATiH1MQHFWT+Oun+JcvSOVZk3n5zsH3TTEuKgEjCf4k6pjnyZjqvhmMRrzCVWZF4MJLwwzGW086TW1eqAA/mWXO/b/n/Qnpt6f6vyL++Ir6hzCubj7q3lscz79tC/DVoXlkhVT0QWyXkV/TxYGhueSv/lvq6CuFM8CryQjgdsqJf2VmpfK+GJLOYi+FbvtIiGKwbK+JZNo+LQlb5+WCAbqyIY5rHhXSt3Y3BPOPmXUs+Dlzld7K30iMNwD8q3Ex85lquZv8QhzimdD/W9Xyb5H0z1Zbsb+OT/8HoqhrfAAAAAElFTkSuQmCC', 'width': 50, 'height': 50, 'alt': '*', @@ -90,8 +87,9 @@ Blockly.defineBlocksWithJsonArray([ }, { 'type': 'test_images_many_icons', - 'message0': 'Lots of network icons: %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11' + - ' %12 %13 %14 %15 %16 %17 %18', + 'message0': + 'Lots of network icons: %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11' + + ' %12 %13 %14 %15 %16 %17 %18', 'args0': [ { 'type': 'input_dummy', @@ -216,24 +214,27 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - Blockly.Blocks['test_images_clickhandler'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('Image click handler') - .appendField( - new Blockly.FieldImage( - 'https://blockly-demo.appspot.com/static/tests/media/a.png', 32, - 32, 'image with click handler', this.onClick_), - 'IMAGE'); + .appendField('Image click handler') + .appendField( + new Blockly.FieldImage( + 'https://blockly-demo.appspot.com/static/tests/media/a.png', + 32, + 32, + 'image with click handler', + this.onClick_, + ), + 'IMAGE', + ); this.setStyle('text_blocks'); }, - onClick_: function() { + onClick_: function () { alert('Image clicked'); }, }; - /** * The Image field category. */ diff --git a/plugins/block-test/src/fields/index.js b/plugins/block-test/src/fields/index.js index 4063c4dba5..294a7102a2 100644 --- a/plugins/block-test/src/fields/index.js +++ b/plugins/block-test/src/fields/index.js @@ -17,7 +17,9 @@ import {category as fieldDropdowns, onInit as initDropdowns} from './dropdowns'; import {category as fieldImages, onInit as initImages} from './images'; import {category as fieldEmoji, onInit as initEmoji} from './emojis'; import { - category as fieldValidators, onInit as initValidators} from './validators'; + category as fieldValidators, + onInit as initValidators, +} from './validators'; /** * The fields category. @@ -37,7 +39,6 @@ export const category = { ], }; - /** * Initialize this toolbox category. * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. diff --git a/plugins/block-test/src/fields/numbers.js b/plugins/block-test/src/fields/numbers.js index b987ab5b91..09b0d15e07 100644 --- a/plugins/block-test/src/fields/numbers.js +++ b/plugins/block-test/src/fields/numbers.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_numbers_float', @@ -107,7 +106,6 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - /** * The Numbers field category. */ diff --git a/plugins/block-test/src/fields/validators.js b/plugins/block-test/src/fields/validators.js index 66359e5f53..2f4b7cc713 100644 --- a/plugins/block-test/src/fields/validators.js +++ b/plugins/block-test/src/fields/validators.js @@ -12,20 +12,21 @@ import * as Blockly from 'blockly/core'; - Blockly.Blocks['test_validators_dispose_block'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('dispose block') - .appendField( - new Blockly.FieldTextInput('default', this.validate), 'INPUT'); + .appendField('dispose block') + .appendField( + new Blockly.FieldTextInput('default', this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'Any changes to the text cause the block to be' + - ' disposed'); + 'Any changes to the text cause the block to be' + ' disposed', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue != 'default') { this.getSourceBlock().dispose(true); } @@ -33,54 +34,63 @@ Blockly.Blocks['test_validators_dispose_block'] = { }; Blockly.Blocks['test_validators_text_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('always null') - .appendField( - new Blockly.FieldTextInput('default', this.validate), 'INPUT'); + .appendField('always null') + .appendField( + new Blockly.FieldTextInput('default', this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'All input validates to null (invalid). The display' + + 'All input validates to null (invalid). The display' + ' text will remain the input text, but the value should be the' + - ' default text. The input should be red after the first keystroke.'); + ' default text. The input should be red after the first keystroke.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_text_A'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('remove \'a\'') - .appendField( - new Blockly.FieldTextInput('default', this.validate), 'INPUT'); + .appendField("remove 'a'") + .appendField( + new Blockly.FieldTextInput('default', this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'All \'a\' characters are removed from field value.' + - ' The display text will include invalid \'a\' characters while the' + - ' field is being edited, but the value will not.'); + "All 'a' characters are removed from field value." + + " The display text will include invalid 'a' characters while the" + + ' field is being edited, but the value will not.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return newValue.replace(/a/g, ''); }, }; Blockly.Blocks['test_validators_text_B'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('\'b\' -> null') - .appendField( - new Blockly.FieldTextInput('default', this.validate), 'INPUT'); + .appendField("'b' -> null") + .appendField( + new Blockly.FieldTextInput('default', this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'Upon detecting a \'b\' character the input will' + + "Upon detecting a 'b' character the input will" + ' validated to null (invalid). Upon removal it should revert to' + ' being valid. The display text will remain the input text, but if' + - ' the input text is invalid the value should be the default text.'); + ' the input text is invalid the value should be the default text.', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue.indexOf('b') !== -1) { return null; } @@ -89,57 +99,60 @@ Blockly.Blocks['test_validators_text_B'] = { }; Blockly.Blocks['test_validators_angle_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('always null') - .appendField(new Blockly.FieldAngle(90, this.validate), 'INPUT'); + .appendField('always null') + .appendField(new Blockly.FieldAngle(90, this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'All input validates to null (invalid). The field' + + 'All input validates to null (invalid). The field' + ' will display the input while the field is being edited (this' + ' includes the text and the graphic), but the value should be the' + ' default value. The input should be red after the first' + - ' keystroke.'); + ' keystroke.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_angle_mult30_force'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('force mult of 30') - .appendField(new Blockly.FieldAngle(90, this.validate), 'INPUT'); + .appendField('force mult of 30') + .appendField(new Blockly.FieldAngle(90, this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'The input value will be rounded to the nearest' + + 'The input value will be rounded to the nearest' + ' multiple of 30. The field will display the input while the field is' + ' being edited (this includes the text and the graphic), but the' + ' value will be the validated (rounded) value. Note: If you want to' + ' do rounding this is not the proper way, use the ROUND property of' + - ' the field angle instead.'); + ' the field angle instead.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return Math.round(newValue / 30) * 30; }, }; Blockly.Blocks['test_validators_angle_mult30_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('not mult of 30 -> null') - .appendField(new Blockly.FieldAngle(90, this.validate), 'INPUT'); + .appendField('not mult of 30 -> null') + .appendField(new Blockly.FieldAngle(90, this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'If the input value is not a multiple of 30, the' + + 'If the input value is not a multiple of 30, the' + ' input will validated to null (invalid). The field will display the' + ' input while the field is being edited (this includes the text and' + ' the graphic), but if the input value is invalid the value should be' + - ' the default value.'); + ' the default value.', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue % 30 != 0) { return null; } @@ -148,52 +161,55 @@ Blockly.Blocks['test_validators_angle_mult30_null'] = { }; Blockly.Blocks['test_validators_checkbox_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('always null') - .appendField(new Blockly.FieldCheckbox(true, this.validate), 'INPUT'); + .appendField('always null') + .appendField(new Blockly.FieldCheckbox(true, this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'The new input always validates to null (invalid).' + - ' This means that the field value should not change.'); + 'The new input always validates to null (invalid).' + + ' This means that the field value should not change.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_checkbox_match'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('force match') - .appendField(new Blockly.FieldCheckbox(true), 'MATCH') - .appendField(new Blockly.FieldCheckbox(true, this.validate), 'INPUT'); + .appendField('force match') + .appendField(new Blockly.FieldCheckbox(true), 'MATCH') + .appendField(new Blockly.FieldCheckbox(true, this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'The validator for this block only works on the end-most checkbox.' + + 'The validator for this block only works on the end-most checkbox.' + ' The validator will always return the value of the start-most' + - ' checkbox. Therefore they should always match.'); + ' checkbox. Therefore they should always match.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return this.sourceBlock_.getFieldValue('MATCH'); }, }; Blockly.Blocks['test_validators_checkbox_not_match_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('not match -> null') - .appendField(new Blockly.FieldCheckbox(true), 'MATCH') - .appendField(new Blockly.FieldCheckbox(true, this.validate), 'INPUT'); + .appendField('not match -> null') + .appendField(new Blockly.FieldCheckbox(true), 'MATCH') + .appendField(new Blockly.FieldCheckbox(true, this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'The validator for this block only works on the' + + 'The validator for this block only works on the' + ' end-most checkbox. If the new value does not match the value of the' + ' start-most checkbox, it will return null (invalid), which means the' + - ' field value should not change. Therefore they should always match.'); + ' field value should not change. Therefore they should always match.', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (this.sourceBlock_.getFieldValue('MATCH') != newValue) { return null; } @@ -202,68 +218,103 @@ Blockly.Blocks['test_validators_checkbox_not_match_null'] = { }; Blockly.Blocks['test_validators_colour_null'] = { - init: function() { + init: function () { const colourField = new Blockly.FieldColour('#ff0000', this.validate); colourField.setColours([ - '#ffffff', '#ffdcdc', '#ffb4b4', '#ff8c8c', '#ff6464', '#ff3c3c', - '#ff1414', '#00ffff', '#00dcdc', '#00b4b4', '#008c8c', '#006464', - '#003c3c', '#001414', + '#ffffff', + '#ffdcdc', + '#ffb4b4', + '#ff8c8c', + '#ff6464', + '#ff3c3c', + '#ff1414', + '#00ffff', + '#00dcdc', + '#00b4b4', + '#008c8c', + '#006464', + '#003c3c', + '#001414', ]); this.appendDummyInput() - .appendField('always null') - .appendField(colourField, 'INPUT'); + .appendField('always null') + .appendField(colourField, 'INPUT'); this.setColour(230); this.setCommentText( - 'All input validates to null (invalid). This means' + - ' the field value should not change.'); + 'All input validates to null (invalid). This means' + + ' the field value should not change.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_colour_force_red'] = { - init: function() { + init: function () { const colourField = new Blockly.FieldColour('#ff0000', this.validate); colourField.setColours([ - '#ffffff', '#ffdcdc', '#ffb4b4', '#ff8c8c', '#ff6464', '#ff3c3c', - '#ff1414', '#00ffff', '#00dcdc', '#00b4b4', '#008c8c', '#006464', - '#003c3c', '#001414', + '#ffffff', + '#ffdcdc', + '#ffb4b4', + '#ff8c8c', + '#ff6464', + '#ff3c3c', + '#ff1414', + '#00ffff', + '#00dcdc', + '#00b4b4', + '#008c8c', + '#006464', + '#003c3c', + '#001414', ]); this.appendDummyInput() - .appendField('force full red') - .appendField(colourField, 'INPUT'); + .appendField('force full red') + .appendField(colourField, 'INPUT'); this.setColour(230); this.setCommentText( - 'The input will have its red value replaced with' + - ' full red.'); + 'The input will have its red value replaced with' + ' full red.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return '#ff' + newValue.substr(3, 4); }, }; Blockly.Blocks['test_validators_colour_red_null'] = { - init: function() { + init: function () { const colourField = new Blockly.FieldColour('#ff0000', this.validate); colourField.setColours([ - '#ffffff', '#ffdcdc', '#ffb4b4', '#ff8c8c', '#ff6464', '#ff3c3c', - '#ff1414', '#00ffff', '#00dcdc', '#00b4b4', '#008c8c', '#006464', - '#003c3c', '#001414', + '#ffffff', + '#ffdcdc', + '#ffb4b4', + '#ff8c8c', + '#ff6464', + '#ff3c3c', + '#ff1414', + '#00ffff', + '#00dcdc', + '#00b4b4', + '#008c8c', + '#006464', + '#003c3c', + '#001414', ]); this.appendDummyInput() - .appendField('not red -> null') - .appendField(colourField, 'INPUT'); + .appendField('not red -> null') + .appendField(colourField, 'INPUT'); this.setColour(230); this.setCommentText( - 'If the input does not have full red, the input will validate to' + - ' null (invalid). Otherwise it will return the input value'); + 'If the input does not have full red, the input will validate to' + + ' null (invalid). Otherwise it will return the input value', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue.substr(1, 2) != 'ff') { return null; } @@ -272,67 +323,88 @@ Blockly.Blocks['test_validators_colour_red_null'] = { }; Blockly.Blocks['test_validators_dropdown_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('always null') - .appendField( - new Blockly.FieldDropdown( - [ - ['1a', '1A'], ['1b', '1B'], ['1c', '1C'], ['2a', '2A'], - ['2b', '2B'], ['2c', '2C'], - ], - this.validate), - 'INPUT'); + .appendField('always null') + .appendField( + new Blockly.FieldDropdown( + [ + ['1a', '1A'], + ['1b', '1B'], + ['1c', '1C'], + ['2a', '2A'], + ['2b', '2B'], + ['2c', '2C'], + ], + this.validate, + ), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'All input validates to null (invalid). This means' + - ' the field value should not change.'); + 'All input validates to null (invalid). This means' + + ' the field value should not change.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_dropdown_force_1s'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('force 1s') - .appendField( - new Blockly.FieldDropdown( - [ - ['1a', '1A'], ['1b', '1B'], ['1c', '1C'], ['2a', '2A'], - ['2b', '2B'], ['2c', '2C'], - ], - this.validate), - 'INPUT'); + .appendField('force 1s') + .appendField( + new Blockly.FieldDropdown( + [ + ['1a', '1A'], + ['1b', '1B'], + ['1c', '1C'], + ['2a', '2A'], + ['2b', '2B'], + ['2c', '2C'], + ], + this.validate, + ), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'The input\'s value will always change to start with 1.'); + "The input's value will always change to start with 1.", + ); }, - validate: function(newValue) { + validate: function (newValue) { return '1' + newValue.charAt(1); }, }; Blockly.Blocks['test_validators_dropdown_1s_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('not 1s -> null') - .appendField( - new Blockly.FieldDropdown( - [ - ['1a', '1A'], ['1b', '1B'], ['1c', '1C'], ['2a', '2A'], - ['2b', '2B'], ['2c', '2C'], - ], - this.validate), - 'INPUT'); + .appendField('not 1s -> null') + .appendField( + new Blockly.FieldDropdown( + [ + ['1a', '1A'], + ['1b', '1B'], + ['1c', '1C'], + ['2a', '2A'], + ['2b', '2B'], + ['2c', '2C'], + ], + this.validate, + ), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'If the input does not start with 1, the input will validate to' + - ' null (invalid). Otherwise it will return the input value.'); + 'If the input does not start with 1, the input will validate to' + + ' null (invalid). Otherwise it will return the input value.', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue.charAt(0) != '1') { return null; } @@ -341,61 +413,67 @@ Blockly.Blocks['test_validators_dropdown_1s_null'] = { }; Blockly.Blocks['test_validators_number_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('always null') - .appendField( - new Blockly.FieldNumber(123, null, null, null, this.validate), - 'INPUT'); + .appendField('always null') + .appendField( + new Blockly.FieldNumber(123, null, null, null, this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'All input validates to null (invalid). The field will display the' + + 'All input validates to null (invalid). The field will display the' + ' input while the field is being edited, but the value should be the' + ' default value. The input should be red after the first' + - ' keystroke.'); + ' keystroke.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_number_mult10_force'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('force mult of 10') - .appendField( - new Blockly.FieldNumber(123, null, null, null, this.validate), - 'INPUT'); + .appendField('force mult of 10') + .appendField( + new Blockly.FieldNumber(123, null, null, null, this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'The input value will be rounded to the nearest' + + 'The input value will be rounded to the nearest' + ' multiple of 10. The field will display the input while the field is' + ' being edited, but the value should be the validated (rounded)' + ' value. Note: If you want to do rounding this is not the proper' + ' way, use the precision option of the number field constructor' + - ' instead.'); + ' instead.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return Math.round(newValue / 10) * 10; }, }; Blockly.Blocks['test_validators_number_mult10_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('not mult of 10 -> null') - .appendField( - new Blockly.FieldNumber(123, null, null, null, this.validate), - 'INPUT'); + .appendField('not mult of 10 -> null') + .appendField( + new Blockly.FieldNumber(123, null, null, null, this.validate), + 'INPUT', + ); this.setColour(230); this.setCommentText( - 'If the input value is not a multiple of 10, the' + + 'If the input value is not a multiple of 10, the' + ' input will validate to null (invalid). The field will display the' + ' input while the field is being edited, but if the input value is' + - ' invalid the value should be the default value.'); + ' invalid the value should be the default value.', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue % 10 != 0) { return null; } @@ -404,45 +482,47 @@ Blockly.Blocks['test_validators_number_mult10_null'] = { }; Blockly.Blocks['test_validators_variable_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('always null') - .appendField(new Blockly.FieldVariable('1a', this.validate), 'INPUT'); + .appendField('always null') + .appendField(new Blockly.FieldVariable('1a', this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'All ids validate to null (invalid). This means' + - ' the variable should not change.'); + 'All ids validate to null (invalid). This means' + + ' the variable should not change.', + ); }, - validate: function(newValue) { + validate: function (newValue) { return null; }, }; Blockly.Blocks['test_validators_variable_force_1s'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('force 1s') - .appendField(new Blockly.FieldVariable('1a', this.validate), 'INPUT'); + .appendField('force 1s') + .appendField(new Blockly.FieldVariable('1a', this.validate), 'INPUT'); this.setColour(230); this.setCommentText('The id will always change to start with 1.'); }, - validate: function(newValue) { + validate: function (newValue) { return '1' + newValue.charAt(1); }, }; Blockly.Blocks['test_validators_variable_1s_null'] = { - init: function() { + init: function () { this.appendDummyInput() - .appendField('not 1s -> null') - .appendField(new Blockly.FieldVariable('1a', this.validate), 'INPUT'); + .appendField('not 1s -> null') + .appendField(new Blockly.FieldVariable('1a', this.validate), 'INPUT'); this.setColour(230); this.setCommentText( - 'If the id does not start with 1, the id will' + - ' validate to null (invalid). Otherwise it will return the id.'); + 'If the id does not start with 1, the id will' + + ' validate to null (invalid). Otherwise it will return the id.', + ); }, - validate: function(newValue) { + validate: function (newValue) { if (newValue.charAt(0) != '1') { return null; } @@ -450,7 +530,6 @@ Blockly.Blocks['test_validators_variable_1s_null'] = { }, }; - /** * The Validators field category. */ @@ -698,17 +777,17 @@ export const category = { * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. */ export function onInit(workspace) { - const addVariables = function(button) { + const addVariables = function (button) { workspace.createVariable('1b', '', '1B'); workspace.createVariable('1c', '', '1C'); workspace.createVariable('2a', '', '2A'); workspace.createVariable('2b', '', '2B'); workspace.createVariable('2c', '', '2C'); }; - const setInput = function(button) { - Blockly.prompt('Input text to set.', 'ab', function(input) { + const setInput = function (button) { + Blockly.prompt('Input text to set.', 'ab', function (input) { const blocks = button.getTargetWorkspace().getAllBlocks(false); - for (let i = 0, block; block = blocks[i]; i++) { + for (let i = 0, block; (block = blocks[i]); i++) { if (block.getField('INPUT')) { block.setFieldValue(input, 'INPUT'); } diff --git a/plugins/block-test/src/index.js b/plugins/block-test/src/index.js index d229348010..466917bda5 100644 --- a/plugins/block-test/src/index.js +++ b/plugins/block-test/src/index.js @@ -14,13 +14,18 @@ import * as Blockly from 'blockly/core'; import {category as alignCategory, onInit as initAlign} from './align'; import {category as basicCategory, onInit as initBasic} from './basic'; -import {category as connectionsCategory, onInit as initConnections} from './connections'; +import { + category as connectionsCategory, + onInit as initConnections, +} from './connections'; import {category as dragCategory, onInit as initDrag} from './drag'; import {category as fieldsCategory, onInit as initFields} from './fields'; import {category as mutatorsCategory, onInit as initMutators} from './mutators'; import {category as styleCategory, onInit as initStyle} from './style'; -import {category as serializationCategory, onInit as initSerialization} from './serialization/category'; - +import { + category as serializationCategory, + onInit as initSerialization, +} from './serialization/category'; /** * The Test blocks toolbox. @@ -52,15 +57,18 @@ export function toolboxTestBlocksInit(workspace) { initStyle(workspace); initSerialization(workspace); - const addAllBlocksToWorkspace = function(button) { + const addAllBlocksToWorkspace = function (button) { const workspace = button.getTargetWorkspace(); const blocks = workspace.getFlyout().getWorkspace().getTopBlocks(); - for (let i = 0, block; block = blocks[i]; i++) { - const state = Blockly.serialization.blocks.save( - block, {addCoordinates: true}); + for (let i = 0, block; (block = blocks[i]); i++) { + const state = Blockly.serialization.blocks.save(block, { + addCoordinates: true, + }); Blockly.serialization.blocks.append(state, workspace); } }; workspace.registerButtonCallback( - 'addAllBlocksToWorkspace', addAllBlocksToWorkspace); + 'addAllBlocksToWorkspace', + addAllBlocksToWorkspace, + ); } diff --git a/plugins/block-test/src/mutators.js b/plugins/block-test/src/mutators.js index fc14169b82..54217c2da5 100644 --- a/plugins/block-test/src/mutators.js +++ b/plugins/block-test/src/mutators.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_mutator_colorChange', @@ -40,7 +39,7 @@ const COLOR_CHANGE_MUTATOR = { * @returns {Element} XML storage element. * @this {Blockly.Block} */ - mutationToDom: function() { + mutationToDom: function () { const container = Blockly.utils.xml.createElement('mutation'); container.setAttribute('colour', this.getColour()); return container; @@ -50,7 +49,7 @@ const COLOR_CHANGE_MUTATOR = { * @param {!Element} xmlElement XML storage element. * @this {Blockly.Block} */ - domToMutation: function(xmlElement) { + domToMutation: function (xmlElement) { this.setColour(xmlElement.getAttribute('colour')); }, /** @@ -58,7 +57,7 @@ const COLOR_CHANGE_MUTATOR = { * @returns {{colour: string}} The state of this block. * @this {Blockly.Block} */ - saveExtraState: function() { + saveExtraState: function () { return {'colour': this.getColour()}; }, /** @@ -66,7 +65,7 @@ const COLOR_CHANGE_MUTATOR = { * @param {{color: string}} state The state to apply. * @this {Blockly.Block} */ - loadExtraState: function(state) { + loadExtraState: function (state) { this.setColour(state['colour']); }, /** @@ -75,10 +74,11 @@ const COLOR_CHANGE_MUTATOR = { * @returns {!Blockly.Block} Root block in mutator. * @this {Blockly.Block} */ - decompose: function(workspace) { + decompose: function (workspace) { const containerBlock = Blockly.serialization.blocks.append( - {'type': 'test_mutator_colorChange'}, - workspace); + {'type': 'test_mutator_colorChange'}, + workspace, + ); containerBlock.getField('COLOUR').setValue(this.getColour()); return containerBlock; }, @@ -87,12 +87,11 @@ const COLOR_CHANGE_MUTATOR = { * @param {!Blockly.Block} containerBlock Root block in mutator. * @this {Blockly.Block} */ - compose: function(containerBlock) { + compose: function (containerBlock) { this.setColour(containerBlock.getFieldValue('COLOUR')); }, }; - const n = 20; const blocksIds = []; for (let i = 0; i < n; i++) { @@ -124,10 +123,10 @@ Blockly.defineBlocksWithJsonArray([ /** Register custom mutator used by the test_mutators_many block. */ Blockly.Extensions.registerMutator( - 'test_many_blocks_mutator', - COLOR_CHANGE_MUTATOR, - null, - [...blocksIds] + 'test_many_blocks_mutator', + COLOR_CHANGE_MUTATOR, + null, + [...blocksIds], ); Blockly.defineBlocksWithJsonArray([ @@ -141,7 +140,11 @@ Blockly.defineBlocksWithJsonArray([ /** Register custom mutator used by the test_mutators_noflyout block. */ Blockly.Extensions.registerMutator( - 'test_noflyout_mutator', COLOR_CHANGE_MUTATOR, null, []); + 'test_noflyout_mutator', + COLOR_CHANGE_MUTATOR, + null, + [], +); Blockly.defineBlocksWithJsonArray([ { @@ -154,8 +157,11 @@ Blockly.defineBlocksWithJsonArray([ /** Register custom mutator used by the test_mutators_changeableFlyout block. */ Blockly.Extensions.registerMutator( - 'test_changeableFlyout_mutator', COLOR_CHANGE_MUTATOR, null, ['text']); - + 'test_changeableFlyout_mutator', + COLOR_CHANGE_MUTATOR, + null, + ['text'], +); /** * The Mutators category. diff --git a/plugins/block-test/src/serialization/blocks.js b/plugins/block-test/src/serialization/blocks.js index e2011bfeed..eebfeb20bb 100644 --- a/plugins/block-test/src/serialization/blocks.js +++ b/plugins/block-test/src/serialization/blocks.js @@ -65,39 +65,48 @@ Blockly.defineBlocksWithJsonArray([ }, ]); -Blockly.Blocks['test_extra_state_xml'] = - Object.assign({}, Blockly.Blocks['lists_create_with']); +Blockly.Blocks['test_extra_state_xml'] = Object.assign( + {}, + Blockly.Blocks['lists_create_with'], +); delete Blockly.Blocks['test_extra_state_xml'].saveExtraState; delete Blockly.Blocks['test_extra_state_xml'].loadExtraState; -Blockly.Blocks['test_extra_state_xml'].init = function() { +Blockly.Blocks['test_extra_state_xml'].init = function () { this.setColour(30); this.itemCount_ = 3; this.updateShape_(); this.setOutput(true, 'Array'); this.setMutator( - new Blockly.icons.MutatorIcon(['lists_create_with_item'], this)); + new Blockly.icons.MutatorIcon(['lists_create_with_item'], this), + ); }; -Blockly.Blocks['test_extra_state_jso'] = - Object.assign({}, Blockly.Blocks['lists_create_with']); +Blockly.Blocks['test_extra_state_jso'] = Object.assign( + {}, + Blockly.Blocks['lists_create_with'], +); delete Blockly.Blocks['test_extra_state_jso'].mutationToDom; delete Blockly.Blocks['test_extra_state_jso'].domToMutation; -Blockly.Blocks['test_extra_state_jso'].init = function() { +Blockly.Blocks['test_extra_state_jso'].init = function () { this.setColour(90); this.itemCount_ = 3; this.updateShape_(); this.setOutput(true, 'Array'); this.setMutator( - new Blockly.icons.MutatorIcon(['lists_create_with_item'], this)); + new Blockly.icons.MutatorIcon(['lists_create_with_item'], this), + ); }; -Blockly.Blocks['test_extra_state_both'] = - Object.assign({}, Blockly.Blocks['lists_create_with']); -Blockly.Blocks['test_extra_state_both'].init = function() { +Blockly.Blocks['test_extra_state_both'] = Object.assign( + {}, + Blockly.Blocks['lists_create_with'], +); +Blockly.Blocks['test_extra_state_both'].init = function () { this.setColour(150); this.itemCount_ = 3; this.updateShape_(); this.setOutput(true, 'Array'); this.setMutator( - new Blockly.icons.MutatorIcon(['lists_create_with_item'], this)); + new Blockly.icons.MutatorIcon(['lists_create_with_item'], this), + ); }; diff --git a/plugins/block-test/src/serialization/category.js b/plugins/block-test/src/serialization/category.js index 071c179985..d99faff6d9 100644 --- a/plugins/block-test/src/serialization/category.js +++ b/plugins/block-test/src/serialization/category.js @@ -52,9 +52,10 @@ export const category = { }, { 'kind': 'BLOCK', - 'blockxml': '' + - '' + - '', + 'blockxml': + '' + + '' + + '', }, { 'kind': 'BLOCK', @@ -124,13 +125,14 @@ export const category = { }, { 'kind': 'BLOCK', - 'blockxml': '' + - '' + - '' + - '' + - '' + - '' + - '', + 'blockxml': + '' + + '' + + '' + + '' + + '' + + '' + + '', }, { 'kind': 'BLOCK', @@ -168,19 +170,18 @@ export const category = { * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. */ export function onInit(workspace) { - const randomizeText = function(button) { + const randomizeText = function (button) { const targetWorkspace = button.getTargetWorkspace(); const blocks = [ ...targetWorkspace.getBlocksByType( - 'test_field_serialization_no_overrides'), - ...targetWorkspace.getBlocksByType( - 'test_field_serialization_xml'), - ...targetWorkspace.getBlocksByType( - 'test_field_serialization_jso'), - ...targetWorkspace.getBlocksByType( - 'test_field_serialization_both')]; + 'test_field_serialization_no_overrides', + ), + ...targetWorkspace.getBlocksByType('test_field_serialization_xml'), + ...targetWorkspace.getBlocksByType('test_field_serialization_jso'), + ...targetWorkspace.getBlocksByType('test_field_serialization_both'), + ]; const possible = 'ABCDEF'; - for (let i = 0, block; block = blocks[i]; i++) { + for (let i = 0, block; (block = blocks[i]); i++) { let text = ''; for (let j = 0; j < 4; j++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); @@ -190,4 +191,3 @@ export function onInit(workspace) { }; workspace.registerButtonCallback('randomizeText', randomizeText); } - diff --git a/plugins/block-test/src/serialization/fields.js b/plugins/block-test/src/serialization/fields.js index ed75409799..e67b5ce23c 100644 --- a/plugins/block-test/src/serialization/fields.js +++ b/plugins/block-test/src/serialization/fields.js @@ -8,7 +8,6 @@ import Blockly from 'blockly/core'; - /** * Field that does not override any serialization hooks. */ @@ -32,14 +31,13 @@ class NoOverridesField extends Blockly.FieldLabel { * @param {*} options Options for creating the field. * @returns {!NoOverridesField} The field that was created. */ -NoOverridesField.fromJson = function(options) { +NoOverridesField.fromJson = function (options) { const text = Blockly.utils.parsing.replaceMessageReferences(options['text']); return new this(text, undefined, options); }; Blockly.fieldRegistry.register('field_no_overrides', NoOverridesField); - /** * Field that overrides XML serialization hooks. */ @@ -81,14 +79,13 @@ class XmlField extends Blockly.FieldLabel { * @param {*} options Options for creating the field. * @returns {!XmlField} The field that was created. */ -XmlField.fromJson = function(options) { +XmlField.fromJson = function (options) { const text = Blockly.utils.parsing.replaceMessageReferences(options['text']); return new this(text, undefined, options); }; Blockly.fieldRegistry.register('field_xml', XmlField); - /** * Field that overrides JSO serialization hooks. */ @@ -130,14 +127,13 @@ class JsoField extends Blockly.FieldLabel { * @param {*} options Options for creating the field. * @returns {!JsoField} The field that was created. */ -JsoField.fromJson = function(options) { +JsoField.fromJson = function (options) { const text = Blockly.utils.parsing.replaceMessageReferences(options['text']); return new this(text, undefined, options); }; Blockly.fieldRegistry.register('field_jso', JsoField); - /** * Field that overrides XML and JSO serialization hooks. */ @@ -197,7 +193,7 @@ class BothField extends Blockly.FieldLabel { * @param {*} options Options for creating the field. * @returns {!BothField} The field that was created. */ -BothField.fromJson = function(options) { +BothField.fromJson = function (options) { const text = Blockly.utils.parsing.replaceMessageReferences(options['text']); return new this(text, undefined, options); }; diff --git a/plugins/block-test/src/style.js b/plugins/block-test/src/style.js index fcf42e095b..86465f2cc8 100644 --- a/plugins/block-test/src/style.js +++ b/plugins/block-test/src/style.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - Blockly.defineBlocksWithJsonArray([ { 'type': 'test_style_hat', @@ -134,7 +133,6 @@ Blockly.defineBlocksWithJsonArray([ }, ]); - /** * The Style category. */ diff --git a/plugins/block-test/test/index.html b/plugins/block-test/test/index.html index ee03fcb378..8d4238a202 100644 --- a/plugins/block-test/test/index.html +++ b/plugins/block-test/test/index.html @@ -1,29 +1,26 @@ - + + + + Blockly Test Blocks + + - - - Blockly Test Blocks - - - - -
- - - - \ No newline at end of file + +
+ + + diff --git a/plugins/block-test/test/index.js b/plugins/block-test/test/index.js index a6621fd7b9..f0f160a96a 100644 --- a/plugins/block-test/test/index.js +++ b/plugins/block-test/test/index.js @@ -9,12 +9,14 @@ */ import * as Blockly from 'blockly'; -import {toolboxTestBlocks as toolbox, - toolboxTestBlocksInit as onInit} from '../src/index'; +import { + toolboxTestBlocks as toolbox, + toolboxTestBlocksInit as onInit, +} from '../src/index'; // Do not use the advanced playground here because it will create a circular // dependency with the @blockly/dev-tools package. -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const workspace = Blockly.inject('root', { toolbox: toolbox, }); diff --git a/plugins/content-highlight/README.md b/plugins/content-highlight/README.md index 7c2af24af6..de181bbed6 100644 --- a/plugins/content-highlight/README.md +++ b/plugins/content-highlight/README.md @@ -8,11 +8,13 @@ content on the workspace. ## Installation ### Yarn + ``` yarn add @blockly/workspace-content-highlight ``` ### npm + ``` npm install @blockly/workspace-content-highlight --save ``` @@ -39,4 +41,5 @@ contentHighlight.init(); - `dispose`: Disposes of content highlight. ## License + Apache 2.0 diff --git a/plugins/content-highlight/package.json b/plugins/content-highlight/package.json index ca6bd84a0b..1dd32fefda 100644 --- a/plugins/content-highlight/package.json +++ b/plugins/content-highlight/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", @@ -55,9 +55,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/content-highlight/src/index.ts b/plugins/content-highlight/src/index.ts index 97823c0771..ff1a719996 100644 --- a/plugins/content-highlight/src/index.ts +++ b/plugins/content-highlight/src/index.ts @@ -89,35 +89,52 @@ export class ContentHighlight { /** @type {SVGElement} */ this.svgGroup = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.G, {'class': 'contentAreaHighlight'}, null); + Blockly.utils.Svg.G, + {'class': 'contentAreaHighlight'}, + null, + ); const rnd = String(Math.random()).substring(2); - const mask = - Blockly.utils.dom.createSvgElement(new Blockly.utils.Svg('mask'), { - 'id': 'contentAreaHighlightMask' + rnd, - }, this.svgGroup); - Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.RECT, { - 'x': 0, - 'y': 0, - 'width': '100%', - 'height': '100%', - 'fill': 'white', - }, mask); - this.rect = Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.RECT, { - 'x': 0, - 'y': 0, - 'rx': Blockly.Bubble.BORDER_WIDTH, - 'ry': Blockly.Bubble.BORDER_WIDTH, - 'fill': 'black', - }, mask); - this.background = - Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.RECT, { - 'x': 0, - 'y': 0, - 'width': '100%', - 'height': '100%', - 'mask': `url(#contentAreaHighlightMask${rnd})`, - }, this.svgGroup); + const mask = Blockly.utils.dom.createSvgElement( + new Blockly.utils.Svg('mask'), + { + 'id': 'contentAreaHighlightMask' + rnd, + }, + this.svgGroup, + ); + Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.RECT, + { + 'x': 0, + 'y': 0, + 'width': '100%', + 'height': '100%', + 'fill': 'white', + }, + mask, + ); + this.rect = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.RECT, + { + 'x': 0, + 'y': 0, + 'rx': Blockly.Bubble.BORDER_WIDTH, + 'ry': Blockly.Bubble.BORDER_WIDTH, + 'fill': 'black', + }, + mask, + ); + this.background = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.RECT, + { + 'x': 0, + 'y': 0, + 'width': '100%', + 'height': '100%', + 'mask': `url(#contentAreaHighlightMask${rnd})`, + }, + this.svgGroup, + ); this.applyColor(); const metricsManager = this.workspace.getMetricsManager(); @@ -196,13 +213,14 @@ export class ContentHighlight { private applyColor() { const theme = this.workspace.getTheme(); const bgColor = - theme.getComponentStyle('workspaceBackgroundColour') || '#ffffff'; + theme.getComponentStyle('workspaceBackgroundColour') || '#ffffff'; const colorDarkened = Blockly.utils.colour.blend('#000', bgColor, 0.1); const colorLightened = Blockly.utils.colour.blend('#fff', bgColor, 0.1); - const color = (bgColor === '#ffffff' || bgColor === '#fff') ? - colorDarkened : - colorLightened; + const color = + bgColor === '#ffffff' || bgColor === '#fff' + ? colorDarkened + : colorLightened; this.background.setAttribute('fill', color); } @@ -212,10 +230,12 @@ export class ContentHighlight { * coordinates. */ private resize(contentMetrics: Blockly.MetricsManager.ContainerRegion) { - const width = - contentMetrics.width ? contentMetrics.width + 2 * this.padding : 0; - const height = - contentMetrics.height ? contentMetrics.height + 2 * this.padding : 0; + const width = contentMetrics.width + ? contentMetrics.width + 2 * this.padding + : 0; + const height = contentMetrics.height + ? contentMetrics.height + 2 * this.padding + : 0; if (width !== this.width) { this.width = width; this.rect.setAttribute('width', `${width}`); @@ -232,23 +252,33 @@ export class ContentHighlight { * coordinates. * @param absoluteMetrics The absolute metrics for the workspace. */ - private position(contentMetrics: Blockly.MetricsManager.ContainerRegion, - absoluteMetrics: Blockly.MetricsManager.AbsoluteMetrics) { + private position( + contentMetrics: Blockly.MetricsManager.ContainerRegion, + absoluteMetrics: Blockly.MetricsManager.AbsoluteMetrics, + ) { // Compute top/left manually to avoid unnecessary extra computation. const viewTop = -this.workspace.scrollY; const viewLeft = -this.workspace.scrollX; const scale = this.workspace.scale; - const top = absoluteMetrics.top + contentMetrics.top * scale - viewTop - - this.padding * scale; - const left = absoluteMetrics.left + contentMetrics.left * scale - viewLeft - - this.padding * scale; + const top = + absoluteMetrics.top + + contentMetrics.top * scale - + viewTop - + this.padding * scale; + const left = + absoluteMetrics.left + + contentMetrics.left * scale - + viewLeft - + this.padding * scale; if (top !== this.top || left !== this.left || this.lastScale !== scale) { this.top = top; this.left = left; this.lastScale = scale; - this.rect.setAttribute('transform', - `translate(${left}, ${top}) scale(${scale})`); + this.rect.setAttribute( + 'transform', + `translate(${left}, ${top}) scale(${scale})`, + ); } } } diff --git a/plugins/content-highlight/test/index.html b/plugins/content-highlight/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/content-highlight/test/index.html +++ b/plugins/content-highlight/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/content-highlight/test/index.js b/plugins/content-highlight/test/index.js index 18c387cee3..fdf5b888e7 100644 --- a/plugins/content-highlight/test/index.js +++ b/plugins/content-highlight/test/index.js @@ -27,7 +27,7 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, grid: { @@ -40,6 +40,9 @@ document.addEventListener('DOMContentLoaded', function() { controls: true, }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/continuous-toolbox/README.md b/plugins/continuous-toolbox/README.md index b274a845a9..c1c8fd4e24 100644 --- a/plugins/continuous-toolbox/README.md +++ b/plugins/continuous-toolbox/README.md @@ -8,35 +8,43 @@ The continuous toolbox is shown here with the 'Zelos' theme, and the style can b ## Installation ### Yarn + ``` yarn add @blockly/continuous-toolbox ``` ### npm + ``` npm install @blockly/continuous-toolbox --save ``` ## Usage + Include the toolbox, flyout, and metrics manager classes from the plugin in the options struct used when injecting Blockly. This style of flyout works best with a toolbox definition that does not use collapsible categories. Note that this plugin uses APIs introduced in the `3.20200924.3` release of Blockly, so you will need to use at least this version or higher. ```js import * as Blockly from 'blockly'; -import {ContinuousToolbox, ContinuousFlyout, ContinuousMetrics} from '@blockly/continuous-toolbox'; +import { + ContinuousToolbox, + ContinuousFlyout, + ContinuousMetrics, +} from '@blockly/continuous-toolbox'; // Inject Blockly. const workspace = Blockly.inject('blocklyDiv', { plugins: { - 'toolbox': ContinuousToolbox, - 'flyoutsVerticalToolbox': ContinuousFlyout, - 'metricsManager': ContinuousMetrics, - }, + 'toolbox': ContinuousToolbox, + 'flyoutsVerticalToolbox': ContinuousFlyout, + 'metricsManager': ContinuousMetrics, + }, toolbox: toolboxCategories, // ... your other options here ... }); ``` ## License + Apache 2.0 diff --git a/plugins/continuous-toolbox/package.json b/plugins/continuous-toolbox/package.json index 45fb19de24..7e6ded04a6 100644 --- a/plugins/continuous-toolbox/package.json +++ b/plugins/continuous-toolbox/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", "audit:fix": "blockly-scripts auditFix", @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/continuous-toolbox/src/ContinuousCategory.js b/plugins/continuous-toolbox/src/ContinuousCategory.js index 82017b34d9..f0c29fe6f5 100644 --- a/plugins/continuous-toolbox/src/ContinuousCategory.js +++ b/plugins/continuous-toolbox/src/ContinuousCategory.js @@ -51,13 +51,17 @@ export class ContinuousCategory extends Blockly.ToolboxCategory { this.rowDiv_.style.backgroundColor = ''; Blockly.utils.dom.removeClass(this.rowDiv_, this.cssConfig_['selected']); } - Blockly.utils.aria.setState(/** @type {!Element} */ (this.htmlDiv_), - Blockly.utils.aria.State.SELECTED, isSelected); + Blockly.utils.aria.setState( + /** @type {!Element} */ (this.htmlDiv_), + Blockly.utils.aria.State.SELECTED, + isSelected, + ); } } Blockly.registry.register( - Blockly.registry.Type.TOOLBOX_ITEM, - Blockly.ToolboxCategory.registrationName, - ContinuousCategory, - true); + Blockly.registry.Type.TOOLBOX_ITEM, + Blockly.ToolboxCategory.registrationName, + ContinuousCategory, + true, +); diff --git a/plugins/continuous-toolbox/src/ContinuousFlyout.js b/plugins/continuous-toolbox/src/ContinuousFlyout.js index acf5740d7d..92ed25b1f5 100644 --- a/plugins/continuous-toolbox/src/ContinuousFlyout.js +++ b/plugins/continuous-toolbox/src/ContinuousFlyout.js @@ -49,7 +49,8 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { this.recyclingEnabled_ = true; this.workspace_.setMetricsManager( - new ContinuousFlyoutMetrics(this.workspace_, this)); + new ContinuousFlyoutMetrics(this.workspace_, this), + ); this.workspace_.addChangeListener((e) => { if (e.type === Blockly.Events.VIEWPORT_CHANGE) { @@ -79,8 +80,11 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { */ recordScrollPositions() { this.scrollPositions = []; - const categoryLabels = this.buttons_.filter((button) => button.isLabel() && - this.getParentToolbox_().getCategoryByName(button.getButtonText())); + const categoryLabels = this.buttons_.filter( + (button) => + button.isLabel() && + this.getParentToolbox_().getCategoryByName(button.getButtonText()), + ); for (const button of categoryLabels) { if (button.isLabel()) { this.scrollPositions.push({ @@ -139,8 +143,10 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { // Set the scroll target to either the scaled position or the lowest // possible scroll point, whichever is smaller. const metrics = this.workspace_.getMetrics(); - this.scrollTarget = Math.min(position * this.workspace_.scale, - metrics.scrollHeight - metrics.viewHeight); + this.scrollTarget = Math.min( + position * this.workspace_.scale, + metrics.scrollHeight - metrics.viewHeight, + ); this.stepScrollAnimation_(); } @@ -163,7 +169,8 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { return; } this.workspace_.scrollbar.setY( - currentScrollPos + diff * this.scrollAnimationFraction); + currentScrollPos + diff * this.scrollAnimationFraction, + ); requestAnimationFrame(this.stepScrollAnimation_.bind(this)); } @@ -180,7 +187,7 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { calculateBottomPadding(contentMetrics, viewMetrics) { if (this.scrollPositions.length > 0) { const lastCategory = - this.scrollPositions[this.scrollPositions.length - 1]; + this.scrollPositions[this.scrollPositions.length - 1]; const lastPosition = lastCategory.position.y * this.workspace_.scale; const lastCategoryHeight = contentMetrics.height - lastPosition; if (lastCategoryHeight < viewMetrics.height) { @@ -192,10 +199,12 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { /** @override */ getX() { - if (this.isVisible() && - this.targetWorkspace.toolboxPosition === this.toolboxPosition_ && - this.targetWorkspace.getToolbox() && - this.toolboxPosition_ !== Blockly.utils.toolbox.Position.LEFT) { + if ( + this.isVisible() && + this.targetWorkspace.toolboxPosition === this.toolboxPosition_ && + this.targetWorkspace.getToolbox() && + this.toolboxPosition_ !== Blockly.utils.toolbox.Position.LEFT + ) { // This makes it so blocks cannot go under the flyout in RTL mode. return this.targetWorkspace.getMetricsManager().getViewMetrics().width; } @@ -247,8 +256,9 @@ export class ContinuousFlyout extends Blockly.VerticalFlyout { } // Check children. if (input.connection) { - const targetBlock = /** @type {Blockly.BlockSvg} */ - (input.connection.targetBlock()); + const targetBlock = + /** @type {Blockly.BlockSvg} */ + (input.connection.targetBlock()); if (targetBlock && !this.blockIsRecyclable_(targetBlock)) { return false; } diff --git a/plugins/continuous-toolbox/src/ContinuousMetrics.js b/plugins/continuous-toolbox/src/ContinuousMetrics.js index 79317a4ced..97b9a72812 100644 --- a/plugins/continuous-toolbox/src/ContinuousMetrics.js +++ b/plugins/continuous-toolbox/src/ContinuousMetrics.js @@ -31,12 +31,16 @@ export class ContinuousMetrics extends Blockly.MetricsManager { if (this.workspace_.getToolbox()) { // Note: Not actually supported at this time due to ContinunousToolbox // only supporting a vertical flyout. But included for completeness. - if (toolboxPosition == Blockly.TOOLBOX_AT_TOP || - toolboxPosition == Blockly.TOOLBOX_AT_BOTTOM) { - svgMetrics.height -= (toolboxMetrics.height + flyoutMetrics.height); - } else if (toolboxPosition == Blockly.TOOLBOX_AT_LEFT || - toolboxPosition == Blockly.TOOLBOX_AT_RIGHT) { - svgMetrics.width -= (toolboxMetrics.width + flyoutMetrics.width); + if ( + toolboxPosition == Blockly.TOOLBOX_AT_TOP || + toolboxPosition == Blockly.TOOLBOX_AT_BOTTOM + ) { + svgMetrics.height -= toolboxMetrics.height + flyoutMetrics.height; + } else if ( + toolboxPosition == Blockly.TOOLBOX_AT_LEFT || + toolboxPosition == Blockly.TOOLBOX_AT_RIGHT + ) { + svgMetrics.width -= toolboxMetrics.width + flyoutMetrics.width; } } return { @@ -58,13 +62,17 @@ export class ContinuousMetrics extends Blockly.MetricsManager { const toolboxPosition = toolboxMetrics.position; let absoluteLeft = 0; - if (this.workspace_.getToolbox() && - toolboxPosition == Blockly.TOOLBOX_AT_LEFT) { + if ( + this.workspace_.getToolbox() && + toolboxPosition == Blockly.TOOLBOX_AT_LEFT + ) { absoluteLeft = toolboxMetrics.width + flyoutMetrics.width; } let absoluteTop = 0; - if (this.workspace_.getToolbox() && - toolboxPosition == Blockly.TOOLBOX_AT_TOP) { + if ( + this.workspace_.getToolbox() && + toolboxPosition == Blockly.TOOLBOX_AT_TOP + ) { absoluteTop = toolboxMetrics.height + flyoutMetrics.height; } return { @@ -74,5 +82,8 @@ export class ContinuousMetrics extends Blockly.MetricsManager { } } -Blockly.registry.register(Blockly.registry.Type.METRICS_MANAGER, - 'CustomMetricsManager', ContinuousMetrics); +Blockly.registry.register( + Blockly.registry.Type.METRICS_MANAGER, + 'CustomMetricsManager', + ContinuousMetrics, +); diff --git a/plugins/continuous-toolbox/src/ContinuousMetricsFlyout.js b/plugins/continuous-toolbox/src/ContinuousMetricsFlyout.js index e6c6f0b70e..90b84a872e 100644 --- a/plugins/continuous-toolbox/src/ContinuousMetricsFlyout.js +++ b/plugins/continuous-toolbox/src/ContinuousMetricsFlyout.js @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - import * as Blockly from 'blockly/core'; /** Adds additional padding to the bottom of the flyout if needed. */ @@ -19,19 +18,25 @@ export class ContinuousFlyoutMetrics extends Blockly.FlyoutMetricsManager { * @override */ getScrollMetrics( - getWorkspaceCoordinates = undefined, - cachedViewMetrics = undefined, - cachedContentMetrics = undefined) { + getWorkspaceCoordinates = undefined, + cachedViewMetrics = undefined, + cachedContentMetrics = undefined, + ) { const scrollMetrics = super.getScrollMetrics( - getWorkspaceCoordinates, cachedViewMetrics, cachedContentMetrics); - const contentMetrics = cachedContentMetrics || - this.getContentMetrics(getWorkspaceCoordinates); - const viewMetrics = cachedViewMetrics || - this.getViewMetrics(getWorkspaceCoordinates); + getWorkspaceCoordinates, + cachedViewMetrics, + cachedContentMetrics, + ); + const contentMetrics = + cachedContentMetrics || this.getContentMetrics(getWorkspaceCoordinates); + const viewMetrics = + cachedViewMetrics || this.getViewMetrics(getWorkspaceCoordinates); if (scrollMetrics) { - scrollMetrics.height += - this.flyout_.calculateBottomPadding(contentMetrics, viewMetrics); + scrollMetrics.height += this.flyout_.calculateBottomPadding( + contentMetrics, + viewMetrics, + ); } return scrollMetrics; } diff --git a/plugins/continuous-toolbox/src/ContinuousToolbox.js b/plugins/continuous-toolbox/src/ContinuousToolbox.js index f6fa65588b..634f9a2033 100644 --- a/plugins/continuous-toolbox/src/ContinuousToolbox.js +++ b/plugins/continuous-toolbox/src/ContinuousToolbox.js @@ -30,8 +30,10 @@ export class ContinuousToolbox extends Blockly.Toolbox { flyout.recordScrollPositions(); this.workspace_.addChangeListener((e) => { - if (e.type === Blockly.Events.BLOCK_CREATE || - e.type === Blockly.Events.BLOCK_DELETE) { + if ( + e.type === Blockly.Events.BLOCK_CREATE || + e.type === Blockly.Events.BLOCK_DELETE + ) { this.refreshSelection(); } }); @@ -83,8 +85,9 @@ export class ContinuousToolbox extends Blockly.Toolbox { /** @override */ updateFlyout_(_oldItem, newItem) { if (newItem) { - const target = this.getFlyout() - .getCategoryScrollPosition(newItem.name_).y; + const target = this.getFlyout().getCategoryScrollPosition( + newItem.name_, + ).y; this.getFlyout().scrollTo(target); } } @@ -92,7 +95,7 @@ export class ContinuousToolbox extends Blockly.Toolbox { /** @override */ shouldDeselectItem_(oldItem, newItem) { // Should not deselect if the same category is clicked again. - return (oldItem && oldItem !== newItem); + return oldItem && oldItem !== newItem; } /** @@ -104,8 +107,11 @@ export class ContinuousToolbox extends Blockly.Toolbox { */ getCategoryByName(name) { const category = this.contents_.find( - (item) => item instanceof Blockly.ToolboxCategory && - item.isSelectable() && name === item.getName()); + (item) => + item instanceof Blockly.ToolboxCategory && + item.isSelectable() && + name === item.getName(), + ); if (category) { return /** @type {!Blockly.ToolboxCategory} */ (category); } @@ -146,7 +152,6 @@ export class ContinuousToolbox extends Blockly.Toolbox { } } - Blockly.Css.register(` .categoryBubble { margin: 0 auto 0.125rem; diff --git a/plugins/continuous-toolbox/test/index.html b/plugins/continuous-toolbox/test/index.html index dcb04f7141..1747f4463d 100644 --- a/plugins/continuous-toolbox/test/index.html +++ b/plugins/continuous-toolbox/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Continuous Toolbox Plugin Test + + - - - Blockly Continuous Toolbox Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/continuous-toolbox/test/index.js b/plugins/continuous-toolbox/test/index.js index 5957090b31..3e4bb4ea40 100644 --- a/plugins/continuous-toolbox/test/index.js +++ b/plugins/continuous-toolbox/test/index.js @@ -10,8 +10,11 @@ import * as Blockly from 'blockly'; import {toolboxCategories, createPlayground} from '@blockly/dev-tools'; -import {ContinuousToolbox, ContinuousFlyout, ContinuousMetrics} from '../src/index'; - +import { + ContinuousToolbox, + ContinuousFlyout, + ContinuousMetrics, +} from '../src/index'; /** * Create a workspace. @@ -25,7 +28,7 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, plugins: { @@ -34,6 +37,9 @@ document.addEventListener('DOMContentLoaded', function() { 'metricsManager': ContinuousMetrics, }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/cross-tab-copy-paste/README.md b/plugins/cross-tab-copy-paste/README.md index 6839a95a28..c8eaef5ea2 100644 --- a/plugins/cross-tab-copy-paste/README.md +++ b/plugins/cross-tab-copy-paste/README.md @@ -5,11 +5,13 @@ A [Blockly](https://www.npmjs.com/package/blockly) plugin that adds context menu ## Installation ### Yarn + ``` yarn add @blockly/plugin-cross-tab-copy-paste ``` ### npm + ``` npm install @blockly/plugin-cross-tab-copy-paste --save ``` @@ -28,41 +30,51 @@ const workspace = Blockly.inject('blocklyDiv', { const options = { contextMenu: true, shortcut: true, -} +}; // Initialize plugin. const plugin = new CrossTabCopyPaste(); plugin.init(options, () => { - console.log('Use this error callback to handle TypeError while pasting'); - }); + console.log('Use this error callback to handle TypeError while pasting'); +}); // optional: Remove the duplication command from Blockly's context menu. Blockly.ContextMenuRegistry.registry.unregister('blockDuplicate'); // optional: You can change the position of the menu added to the context menu. Blockly.ContextMenuRegistry.registry.getItem('blockCopyToStorage').weight = 2; -Blockly.ContextMenuRegistry.registry.getItem('blockPasteFromStorage').weight = 3; +Blockly.ContextMenuRegistry.registry.getItem( + 'blockPasteFromStorage', +).weight = 3; ``` ## Options + - `contextMenu` `{boolean}`: Register copy, cut, and paste commands in the Blockly context menu. - `shortcut` `{boolean}`: Register cut (ctr + x), copy (ctr + c) and paste (ctr + v) in the keybord shortcut. ## Error Callback + - `typeErrorCallback` `{Function}`: is an extra parameter to the init method, one can pass a callback to the cross-tab-copy-paste plugin that is called when the plugin triggers a TypeError error when pasting. + ## Localization + You can change the displayed words. + ### English + ```js Blockly.Msg['CROSS_TAB_COPY'] = 'Copy'; Blockly.Msg['CROSS_TAB_PASTE'] = 'Paste'; ``` ### Japanese + ```js Blockly.Msg['CROSS_TAB_COPY'] = 'コピー'; Blockly.Msg['CROSS_TAB_PASTE'] = '貼り付け'; ``` ## License + Apache 2.0 diff --git a/plugins/cross-tab-copy-paste/package.json b/plugins/cross-tab-copy-paste/package.json index ce81ec22e9..f49e18fbe7 100644 --- a/plugins/cross-tab-copy-paste/package.json +++ b/plugins/cross-tab-copy-paste/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", @@ -51,9 +51,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/cross-tab-copy-paste/src/index.js b/plugins/cross-tab-copy-paste/src/index.js index 6a8f08b7cd..105172a2f3 100644 --- a/plugins/cross-tab-copy-paste/src/index.js +++ b/plugins/cross-tab-copy-paste/src/index.js @@ -6,7 +6,6 @@ import * as Blockly from 'blockly/core'; - /** * A Blockly plugin that adds context menu items and keyboard shortcuts * to allow users to copy and paste a block between tabs. @@ -22,14 +21,13 @@ export class CrossTabCopyPaste { * @param {Function=} typeErrorCallback * callback function to handle type errors */ - init({ - contextMenu = true, - shortcut = true, - } = { - contextMenu: true, - shortcut: true, - }, - typeErrorCallback) { + init( + {contextMenu = true, shortcut = true} = { + contextMenu: true, + shortcut: true, + }, + typeErrorCallback, + ) { if (contextMenu) { // Register the menus this.blockCopyToStorageContextMenu(); @@ -39,11 +37,14 @@ export class CrossTabCopyPaste { if (shortcut) { // Unregister the default KeyboardShortcuts Blockly.ShortcutRegistry.registry.unregister( - Blockly.ShortcutItems.names.COPY); + Blockly.ShortcutItems.names.COPY, + ); Blockly.ShortcutRegistry.registry.unregister( - Blockly.ShortcutItems.names.CUT); + Blockly.ShortcutItems.names.CUT, + ); Blockly.ShortcutRegistry.registry.unregister( - Blockly.ShortcutItems.names.PASTE); + Blockly.ShortcutItems.names.PASTE, + ); // Register the KeyboardShortcuts this.blockCopyToStorageShortcut(); this.blockCutToStorageShortcut(); @@ -57,25 +58,30 @@ export class CrossTabCopyPaste { blockCopyToStorageContextMenu() { /** @type {!Blockly.ContextMenuRegistry.RegistryItem} */ const copyToStorageOption = { - displayText: function() { + displayText: function () { if (Blockly.Msg['CROSS_TAB_COPY']) { return Blockly.Msg['CROSS_TAB_COPY']; } return 'Copy'; }, - preconditionFn: function( - /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) { + preconditionFn: function ( + /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope, + ) { if ( Blockly.getSelected().isDeletable() && - Blockly.getSelected().isMovable()) { + Blockly.getSelected().isMovable() + ) { return 'enabled'; } return 'disabled'; }, - callback: function( - /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) { + callback: function ( + /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope, + ) { localStorage.setItem( - 'blocklyStash', JSON.stringify(scope.block.toCopyData())); + 'blocklyStash', + JSON.stringify(scope.block.toCopyData()), + ); }, scopeType: Blockly.ContextMenuRegistry.ScopeType.BLOCK, id: 'blockCopyToStorage', @@ -92,23 +98,27 @@ export class CrossTabCopyPaste { blockPasteFromStorageContextMenu(typeErrorCallback) { /** @type {!Blockly.ContextMenuRegistry.RegistryItem} */ const pasteFromStorageOption = { - displayText: function() { + displayText: function () { if (Blockly.Msg['CROSS_TAB_PASTE']) { return Blockly.Msg['CROSS_TAB_PASTE']; } return 'Paste'; }, - preconditionFn: function( - /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) { + preconditionFn: function ( + /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope, + ) { const copyData = JSON.parse(localStorage.getItem('blocklyStash')); - if (copyData && - scope.workspace.isCapacityAvailable(copyData.typeCounts)) { + if ( + copyData && + scope.workspace.isCapacityAvailable(copyData.typeCounts) + ) { return 'enabled'; } return 'disabled'; }, - callback: function( - /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) { + callback: function ( + /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope, + ) { const copyData = JSON.parse(localStorage.getItem('blocklyStash')); try { Blockly.clipboard.paste(copyData, scope.workspace); @@ -135,15 +145,17 @@ export class CrossTabCopyPaste { /** @type {!Blockly.ShortcutRegistry.KeyboardShortcut} */ const copyShortcut = { name: 'copy', - preconditionFn: function(workspace) { - return !workspace.options.readOnly && + preconditionFn: function (workspace) { + return ( + !workspace.options.readOnly && !Blockly.Gesture.inProgress() && Blockly.getSelected() && Blockly.getSelected().isDeletable() && Blockly.getSelected().isMovable() && - !Blockly.getSelected().isInMutator; + !Blockly.getSelected().isInMutator + ); }, - callback: function(workspace, e) { + callback: function (workspace, e) { // Prevent the default copy behavior, // which may beep or otherwise indicate // an error due to the lack of a selection. @@ -152,23 +164,30 @@ export class CrossTabCopyPaste { if (!block || !Blockly.isCopyable(block)) return false; workspace.hideChaff(); localStorage.setItem( - 'blocklyStash', JSON.stringify(block.toCopyData())); + 'blocklyStash', + JSON.stringify(block.toCopyData()), + ); return true; }, }; Blockly.ShortcutRegistry.registry.register(copyShortcut); const ctrlC = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.C, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.C, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(ctrlC, copyShortcut.name); - const altC = - Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.C, [Blockly.utils.KeyCodes.ALT]); + const altC = Blockly.ShortcutRegistry.registry.createSerializedKey( + Blockly.utils.KeyCodes.C, + [Blockly.utils.KeyCodes.ALT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(altC, copyShortcut.name); const metaC = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.C, [Blockly.utils.KeyCodes.META]); + Blockly.utils.KeyCodes.C, + [Blockly.utils.KeyCodes.META], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(metaC, copyShortcut.name); } @@ -180,15 +199,17 @@ export class CrossTabCopyPaste { /** @type {!Blockly.ShortcutRegistry.KeyboardShortcut} */ const cutShortcut = { name: 'cut', - preconditionFn: function(workspace) { - return !workspace.options.readOnly && + preconditionFn: function (workspace) { + return ( + !workspace.options.readOnly && !Blockly.Gesture.inProgress() && Blockly.getSelected() && Blockly.getSelected().isDeletable() && Blockly.getSelected().isMovable() && - !Blockly.getSelected().workspace.isFlyout; + !Blockly.getSelected().workspace.isFlyout + ); }, - callback: function(workspace, e) { + callback: function (workspace, e) { // Prevent the default copy behavior, // which may beep or otherwise indicate // an error due to the lack of a selection. @@ -196,7 +217,9 @@ export class CrossTabCopyPaste { const block = /** @type {Blockly.BlockSvg} */ (Blockly.getSelected()); if (!block || !Blockly.isCopyable(block)) return false; localStorage.setItem( - 'blocklyStash', JSON.stringify(block.toCopyData())); + 'blocklyStash', + JSON.stringify(block.toCopyData()), + ); Blockly.Events.setGroup(true); block.dispose(true); Blockly.Events.setGroup(false); @@ -206,15 +229,21 @@ export class CrossTabCopyPaste { Blockly.ShortcutRegistry.registry.register(cutShortcut); const ctrlX = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.X, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.X, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(ctrlX, cutShortcut.name); const altX = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.X, [Blockly.utils.KeyCodes.ALT]); + Blockly.utils.KeyCodes.X, + [Blockly.utils.KeyCodes.ALT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(altX, cutShortcut.name); const metaX = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.X, [Blockly.utils.KeyCodes.META]); + Blockly.utils.KeyCodes.X, + [Blockly.utils.KeyCodes.META], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(metaX, cutShortcut.name); } @@ -227,7 +256,7 @@ export class CrossTabCopyPaste { /** @type {!Blockly.ShortcutRegistry.KeyboardShortcut} */ const pasteShortcut = { name: 'paste', - preconditionFn: function(workspace) { + preconditionFn: function (workspace) { if (workspace.options.readOnly || Blockly.Gesture.inProgress()) { return false; } @@ -237,7 +266,7 @@ export class CrossTabCopyPaste { } return true; }, - callback: function(workspace, e) { + callback: function (workspace, e) { // Prevent the default copy behavior, // which may beep or otherwise indicate // an error due to the lack of a selection. @@ -258,16 +287,21 @@ export class CrossTabCopyPaste { Blockly.ShortcutRegistry.registry.register(pasteShortcut); const ctrlV = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.V, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.V, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(ctrlV, pasteShortcut.name); - const altV = - Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.V, [Blockly.utils.KeyCodes.ALT]); + const altV = Blockly.ShortcutRegistry.registry.createSerializedKey( + Blockly.utils.KeyCodes.V, + [Blockly.utils.KeyCodes.ALT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(altV, pasteShortcut.name); const metaV = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.V, [Blockly.utils.KeyCodes.META]); + Blockly.utils.KeyCodes.V, + [Blockly.utils.KeyCodes.META], + ); Blockly.ShortcutRegistry.registry.addKeyMapping(metaV, pasteShortcut.name); } } diff --git a/plugins/cross-tab-copy-paste/test/index.html b/plugins/cross-tab-copy-paste/test/index.html index 084bb63f84..4eeec89c6a 100644 --- a/plugins/cross-tab-copy-paste/test/index.html +++ b/plugins/cross-tab-copy-paste/test/index.html @@ -1,23 +1,23 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -

This plugin can be tested by opening up multiple tabs of this page - and copy/pasting the block from one tab to another. You can only paste into - a workspace that also has this plugin enabled. -

-
- - - + +

+ This plugin can be tested by opening up multiple tabs of this page and + copy/pasting the block from one tab to another. You can only paste into a + workspace that also has this plugin enabled. +

+
+ + diff --git a/plugins/cross-tab-copy-paste/test/index.js b/plugins/cross-tab-copy-paste/test/index.js index ca7abeda1c..6d98e48d0a 100644 --- a/plugins/cross-tab-copy-paste/test/index.js +++ b/plugins/cross-tab-copy-paste/test/index.js @@ -23,12 +23,15 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); const copyPastePlugin = new CrossTabCopyPaste(); copyPastePlugin.init(); }); diff --git a/plugins/dev-create/README.md b/plugins/dev-create/README.md index 4cf146d3cd..55107d0511 100644 --- a/plugins/dev-create/README.md +++ b/plugins/dev-create/README.md @@ -21,13 +21,13 @@ npm start ### Available templates -``--type field``: A field template. +`--type field`: A field template. -``--type block``: A block template. +`--type block`: A block template. -``--type theme``: A theme template. +`--type theme`: A theme template. -``--type plugin``: A generic plugin template. (Default) +`--type plugin`: A generic plugin template. (Default) ### Options diff --git a/plugins/dev-create/bin/app.js b/plugins/dev-create/bin/app.js index 6b58b29b52..a6b621a0a2 100644 --- a/plugins/dev-create/bin/app.js +++ b/plugins/dev-create/bin/app.js @@ -4,7 +4,7 @@ const path = require('path'); const execSync = require('child_process').execSync; const {checkAndCreateDir} = require('./common'); -exports.createApp = function(name, options) { +exports.createApp = function (name, options) { const root = process.cwd(); const dir = options.dir ?? name; const appPath = path.join(root, dir); @@ -12,15 +12,21 @@ exports.createApp = function(name, options) { // Create the new directory for the app if needed. checkAndCreateDir(appPath); console.log( - `Creating a new Blockly application called ${name} in ${appPath}`); + `Creating a new Blockly application called ${name} in ${appPath}`, + ); // Copy over files from sample-app directory. - const sampleDir = options.typescript ? '../templates/sample-app-ts' : '../templates/sample-app'; - const excludes = - ['node_modules', 'dist', 'package-lock.json', 'package.json'] - .map((file) => { - return path.resolve(__dirname, sampleDir, file); - }); + const sampleDir = options.typescript + ? '../templates/sample-app-ts' + : '../templates/sample-app'; + const excludes = [ + 'node_modules', + 'dist', + 'package-lock.json', + 'package.json', + ].map((file) => { + return path.resolve(__dirname, sampleDir, file); + }); fs.copySync(path.resolve(__dirname, sampleDir), appPath, { filter(src) { return !excludes.includes(src); @@ -37,7 +43,9 @@ exports.createApp = function(name, options) { // Write the package.json to the new package. fs.writeFileSync( - path.join(appPath, 'package.json'), JSON.stringify(packageJson, null, 2)); + path.join(appPath, 'package.json'), + JSON.stringify(packageJson, null, 2), + ); // Run `npm install` to get things ready for user. if (!options.skipInstall) { diff --git a/plugins/dev-create/bin/common.js b/plugins/dev-create/bin/common.js index 65512330bc..1dac2bf07b 100644 --- a/plugins/dev-create/bin/common.js +++ b/plugins/dev-create/bin/common.js @@ -5,7 +5,7 @@ const fs = require('fs-extra'); * Throws if the directory exists and isn't the current directory. * @param {string} path Path at which to create directory. */ -exports.checkAndCreateDir = function(path) { +exports.checkAndCreateDir = function (path) { const root = process.cwd(); // If we're already in the desired directory, don't need to create it. if (path == root) { @@ -13,7 +13,8 @@ exports.checkAndCreateDir = function(path) { } if (fs.existsSync(path)) { console.error( - `Package directory ${path} already exists. Delete it and try again.`); + `Package directory ${path} already exists. Delete it and try again.`, + ); process.exit(1); } else { // Create the directory. diff --git a/plugins/dev-create/bin/create.js b/plugins/dev-create/bin/create.js index d84403a2a6..367f180bc4 100755 --- a/plugins/dev-create/bin/create.js +++ b/plugins/dev-create/bin/create.js @@ -22,38 +22,42 @@ const scriptName = scriptPackageJson.name; const program = new commander.Command(scriptName); -program.command('plugin', {isDefault: true}) - .description('Create a new plugin for Blockly.') - .version(scriptPackageJson.version) - .argument('', 'Name of your plugin.') - .option( - '-d, --dir ', - 'specify the directory name to use; defaults to name of plugin') - .option( - '-t, --type ', - `specify the type of the plugin. One of ${pluginTypes.join(', ')}`) - .option('--typescript', 'use typescript') - .option('--author ', 'author, eg: Blockly Team') - .option('--first-party', 'create a first-party plugin') - .option('--skip-install', 'skip running `npm install` after creation') - .action((name, options) => { - createPlugin(name, options); - }); - - -program.command('application') - .alias('app') - .description('Create a new application that uses Blockly.') - .version(scriptPackageJson.version) - .argument('', 'Name of your application. You can change this later.') - .option( - '-d, --dir ', - 'specify the directory name to use; defaults to name of application') - .option('--typescript', 'use typescript') - .option('--author ', 'author, eg: Blockly Team') - .option('--skip-install', 'skip running `npm install` after creation') - .action((name, options) => { - createApp(name, options); - }); +program + .command('plugin', {isDefault: true}) + .description('Create a new plugin for Blockly.') + .version(scriptPackageJson.version) + .argument('', 'Name of your plugin.') + .option( + '-d, --dir ', + 'specify the directory name to use; defaults to name of plugin', + ) + .option( + '-t, --type ', + `specify the type of the plugin. One of ${pluginTypes.join(', ')}`, + ) + .option('--typescript', 'use typescript') + .option('--author ', 'author, eg: Blockly Team') + .option('--first-party', 'create a first-party plugin') + .option('--skip-install', 'skip running `npm install` after creation') + .action((name, options) => { + createPlugin(name, options); + }); + +program + .command('application') + .alias('app') + .description('Create a new application that uses Blockly.') + .version(scriptPackageJson.version) + .argument('', 'Name of your application. You can change this later.') + .option( + '-d, --dir ', + 'specify the directory name to use; defaults to name of application', + ) + .option('--typescript', 'use typescript') + .option('--author ', 'author, eg: Blockly Team') + .option('--skip-install', 'skip running `npm install` after creation') + .action((name, options) => { + createApp(name, options); + }); program.parse(process.argv); diff --git a/plugins/dev-create/bin/plugin.js b/plugins/dev-create/bin/plugin.js index f4a837d80a..9b77f7726b 100644 --- a/plugins/dev-create/bin/plugin.js +++ b/plugins/dev-create/bin/plugin.js @@ -22,22 +22,22 @@ const pluginTypes = ['plugin', 'field', 'block', 'theme']; const root = process.cwd(); -exports.createPlugin = function(pluginName, options) { +exports.createPlugin = function (pluginName, options) { let gitRoot = ''; let gitURL = ''; try { gitRoot = execSync(`git rev-parse --show-toplevel`).toString().trim(); gitURL = execSync(`git config --get remote.origin.url`) - .toString() - .trim() - .replace(/\.git$/, ''); + .toString() + .trim() + .replace(/\.git$/, ''); } catch (err) { // NOP } const isGit = !!gitURL; - const isFirstParty = options.firstParty || - gitURL == 'https://github.com/google/blockly-samples'; + const isFirstParty = + options.firstParty || gitURL == 'https://github.com/google/blockly-samples'; /** * Gets the name of the plugin prefixed with the type. @@ -46,7 +46,7 @@ exports.createPlugin = function(pluginName, options) { * @param {string} type Plugin type. * @returns {string} Plugin name prefixed with type. */ - const getPrefixedName = function(name, type) { + const getPrefixedName = function (name, type) { // Don't add 'plugin' prefix for default type if (type == 'plugin') return name; // If the name is already prefixed, just return the name. @@ -76,12 +76,14 @@ exports.createPlugin = function(pluginName, options) { checkAndCreateDir(pluginPath); console.log( - `Creating a new Blockly ${chalk.green(pluginType)} with name ` + - `${chalk.green(pluginName)} in ${chalk.green(pluginPath)}.\n`); + `Creating a new Blockly ${chalk.green(pluginType)} with name ` + + `${chalk.green(pluginName)} in ${chalk.green(pluginPath)}.\n`, + ); const templatesDir = `../templates`; - const templateDir = - `${templatesDir}/${isTypescript ? 'typescript-' : ''}${pluginType}/`; + const templateDir = `${templatesDir}/${ + isTypescript ? 'typescript-' : '' + }${pluginType}/`; // Only use the @blockly scope for first party plugins. const pluginScope = isFirstParty ? '@blockly/' : 'blockly-'; @@ -89,8 +91,9 @@ exports.createPlugin = function(pluginName, options) { const gitPluginPath = path.join(path.relative(gitRoot, root), pluginDir); - const latestBlocklyVersion = - execSync('npm show blockly version').toString().trim(); + const latestBlocklyVersion = execSync('npm show blockly version') + .toString() + .trim(); const packageJson = { name: pluginPackageName, @@ -116,31 +119,34 @@ exports.createPlugin = function(pluginName, options) { pluginName, ].filter(Boolean), homepage: isGit ? `${gitURL}/tree/master/${gitPluginPath}#readme` : '', - bugs: isGit ? { - url: `${gitURL}/issues`, - } : {}, - repository: isGit ? { - 'type': 'git', - 'url': `${gitURL}.git`, - 'directory': gitPluginPath, - } : {}, + bugs: isGit + ? { + url: `${gitURL}/issues`, + } + : {}, + repository: isGit + ? { + 'type': 'git', + 'url': `${gitURL}.git`, + 'directory': gitPluginPath, + } + : {}, license: 'Apache-2.0', directories: { 'dist': 'dist', 'src': 'src', }, - files: [ - 'dist', - 'src', - ], + files: ['dist', 'src'], devDependencies: {}, peerDependencies: { 'blockly': `^${latestBlocklyVersion}`, }, - publishConfig: isFirstParty ? { - 'access': 'public', - 'registry': 'https://wombat-dressing-room.appspot.com', - } : {}, + publishConfig: isFirstParty + ? { + 'access': 'public', + 'registry': 'https://wombat-dressing-room.appspot.com', + } + : {}, eslintConfig: { 'extends': '@blockly/eslint-config', }, @@ -162,8 +168,10 @@ exports.createPlugin = function(pluginName, options) { // Write the README.md to the new package. let readme = fs.readFileSync( - path.resolve(__dirname, templateDir, 'README.md'), 'utf-8'); - readme = readme.replace(/@blockly\/plugin/gmi, `${pluginPackageName}`); + path.resolve(__dirname, templateDir, 'README.md'), + 'utf-8', + ); + readme = readme.replace(/@blockly\/plugin/gim, `${pluginPackageName}`); fs.writeFileSync(path.join(pluginPath, 'README.md'), readme, 'utf-8'); // Copy the rest of the template folder into the new package. @@ -172,13 +180,16 @@ exports.createPlugin = function(pluginName, options) { // Copy third party plugin files to the new package if third-party. if (!isFirstParty) { fs.copySync( - path.resolve(__dirname, templatesDir, 'third_party'), pluginPath); + path.resolve(__dirname, templatesDir, 'third_party'), + pluginPath, + ); } // Write the package.json to the new package. fs.writeFileSync( - path.join(pluginPath, 'package.json'), - JSON.stringify(packageJson, null, 2)); + path.join(pluginPath, 'package.json'), + JSON.stringify(packageJson, null, 2), + ); // Run npm install. if (!skipInstall) { @@ -187,7 +198,8 @@ exports.createPlugin = function(pluginName, options) { } console.log( - `Success! Created ${pluginType} '${pluginName}' at ${pluginPath}`); + `Success! Created ${pluginType} '${pluginName}' at ${pluginPath}`, + ); console.log(`\n ${chalk.blue(` npm start`)}`); console.log(` Starts the development server.\n`); console.log(` ${chalk.blue(` npm run build`)}`); diff --git a/plugins/dev-create/package.json b/plugins/dev-create/package.json index 60157f09b9..1f2d53df95 100644 --- a/plugins/dev-create/package.json +++ b/plugins/dev-create/package.json @@ -39,9 +39,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=14.0.0" }, diff --git a/plugins/dev-create/templates/block/README.md b/plugins/dev-create/templates/block/README.md index 13f18ff378..cddfaaab73 100644 --- a/plugins/dev-create/templates/block/README.md +++ b/plugins/dev-create/templates/block/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) block that ... ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -20,11 +23,12 @@ npm install @blockly/plugin --save ## Usage ### Import + ```js import * as Blockly from 'blockly'; import '@blockly/plugin'; - ``` ## License + Apache 2.0 diff --git a/plugins/dev-create/templates/block/template/test/block_test.mocha.js b/plugins/dev-create/templates/block/template/test/block_test.mocha.js index b5e21729ff..b2852b8c2f 100644 --- a/plugins/dev-create/templates/block/template/test/block_test.mocha.js +++ b/plugins/dev-create/templates/block/template/test/block_test.mocha.js @@ -17,33 +17,38 @@ require('../src/index'); const assert = chai.assert; -const {CodeGenerationTestSuite, runCodeGenerationTestSuites, - runSerializationTestSuite, SerializationTestCase} = testHelpers; +const { + CodeGenerationTestSuite, + runCodeGenerationTestSuites, + runSerializationTestSuite, + SerializationTestCase, +} = testHelpers; -suite('BlockTemplate', function() { +suite('BlockTemplate', function () { /** * Asserts that the block has the expected inputs and fields. * @param {!Blockly.Block} block The block to check. */ function assertBlockStructure(block) { - // TODO add relevant parameters and implement. + // TODO replace with meaningful assertions. + assert.exists(block); } - setup(function() { + setup(function () { this.workspace = new Blockly.Workspace(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - suite('Creation', function() { + suite('Creation', function () { // TODO Add basic test for creation of block using newBlock call. - // const block = this.workspace.newBlock('block_type'); - // assertBlockStructure(block); + const block = this.workspace.newBlock('block_type'); + assertBlockStructure(block); }); - suite('Code generation', function() { + suite('Code generation', function () { const trivialCreateBlock = (workspace) => { // TODO implement. // return workspace.newBlock('block_type'); @@ -57,52 +62,81 @@ suite('BlockTemplate', function() { // TODO Remove unsupported languages. // TODO Update expectedCode for all test cases. // TODO Add additional useful testCases. - {title: 'Dart', generator: dartGenerator, + { + title: 'Dart', + generator: dartGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'TODO', - createBlock: trivialCreateBlock}, - ]}, - {title: 'JavaScript', generator: javascriptGenerator, + { + title: 'Trivial', + expectedCode: 'TODO', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'JavaScript', + generator: javascriptGenerator, testCases: [ - - {title: 'Trivial', expectedCode: 'TODO', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Lua', generator: luaGenerator, + { + title: 'Trivial', + expectedCode: 'TODO', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Lua', + generator: luaGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'TODO', - createBlock: trivialCreateBlock}, - ]}, - {title: 'PHP', generator: phpGenerator, + { + title: 'Trivial', + expectedCode: 'TODO', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'PHP', + generator: phpGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'TODO', - createBlock: trivialCreateBlock}, - ]}, - {title: 'Python', generator: pythonGenerator, + { + title: 'Trivial', + expectedCode: 'TODO', + createBlock: trivialCreateBlock, + }, + ], + }, + { + title: 'Python', + generator: pythonGenerator, testCases: [ - {title: 'Trivial', expectedCode: 'TODO', - createBlock: trivialCreateBlock}, - ]}, + { + title: 'Trivial', + expectedCode: 'TODO', + createBlock: trivialCreateBlock, + }, + ], + }, ]; runCodeGenerationTestSuites(testSuites); }); - /** * Test cases for serialization tests. * @type {Array} */ const testCases = [ // TODO update xml and expectedXml. - {title: 'Empty XML', xml: '', + { + title: 'Empty XML', + xml: '', expectedXml: - '', - assertBlockStructure: - (block) => { - // TODO implement. - // assertBlockStructure(block); - }, + '', + assertBlockStructure: (block) => { + // TODO implement. + // assertBlockStructure(block); + }, }, // TODO add additional test cases. ]; diff --git a/plugins/dev-create/templates/block/template/test/index.html b/plugins/dev-create/templates/block/template/test/index.html index a4804fe7aa..1b2d485763 100644 --- a/plugins/dev-create/templates/block/template/test/index.html +++ b/plugins/dev-create/templates/block/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Block Test + + - - - Blockly Block Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/block/template/test/index.js b/plugins/dev-create/templates/block/template/test/index.js index 485662afb7..5b2286134b 100644 --- a/plugins/dev-create/templates/block/template/test/index.js +++ b/plugins/dev-create/templates/block/template/test/index.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly'; import {createPlayground} from '@blockly/dev-tools'; import '../src/index'; - // TODO: Edit list of blocks. const allBlocks = ['block_template']; @@ -27,7 +26,7 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: { 'kind': 'flyoutToolbox', @@ -39,6 +38,9 @@ document.addEventListener('DOMContentLoaded', function() { }), }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/field/README.md b/plugins/dev-create/templates/field/README.md index 188b91f56d..eb116453f3 100644 --- a/plugins/dev-create/templates/field/README.md +++ b/plugins/dev-create/templates/field/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) ... field. ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -24,6 +27,7 @@ npm install @blockly/plugin --save --> ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldTemplate} from '@blockly/plugin'; @@ -37,6 +41,7 @@ Blockly.Blocks["test_field_template"] = { ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/plugin'; diff --git a/plugins/dev-create/templates/field/template/test/field_test.mocha.js b/plugins/dev-create/templates/field/template/test/field_test.mocha.js index 043f38f24a..02cff48f80 100644 --- a/plugins/dev-create/templates/field/template/test/field_test.mocha.js +++ b/plugins/dev-create/templates/field/template/test/field_test.mocha.js @@ -8,11 +8,14 @@ const {testHelpers} = require('@blockly/dev-tools'); const {FieldTemplate} = require('../src/index'); const { - FieldCreationTestCase, FieldValueTestCase, runConstructorSuiteTests, - runFromJsonSuiteTests, runSetValueTests, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; -suite('FieldTemplate', function() { +suite('FieldTemplate', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -36,7 +39,7 @@ suite('FieldTemplate', function() { * Asserts that the field property values are set to default. * @param {FieldTemplate} field The field to check. */ - const assertFieldDefault = function(field) { + const assertFieldDefault = function (field) { // TODO Recommend use of assertFieldValue from testHelpers }; /** @@ -44,37 +47,51 @@ suite('FieldTemplate', function() { * @param {FieldTemplate} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { // TODO }; runConstructorSuiteTests( - FieldTemplate, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldTemplate, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); runFromJsonSuiteTests( - FieldTemplate, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldTemplate, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - suite('setValue', function() { - suite('Empty -> New Value', function() { - setup(function() { + suite('setValue', function () { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldTemplate(); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, defaultFieldValue); + validValueTestCases, + invalidValueTestCases, + defaultFieldValue, + ); }); - suite('Value -> New Value', function() { + suite('Value -> New Value', function () { const initialValue = 1; // TODO update with initial value for test. - setup(function() { + setup(function () { this.field = new FieldTemplate(initialValue); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, initialValue); + validValueTestCases, + invalidValueTestCases, + initialValue, + ); }); }); - suite('Validators', function() { + suite('Validators', function () { // TODO }); diff --git a/plugins/dev-create/templates/field/template/test/index.html b/plugins/dev-create/templates/field/template/test/index.html index ba00bba01c..10cd0a0c1d 100644 --- a/plugins/dev-create/templates/field/template/test/index.html +++ b/plugins/dev-create/templates/field/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Test + + - - - Blockly Field Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/field/template/test/index.js b/plugins/dev-create/templates/field/template/test/index.js index e85b8f830c..1ca6787531 100644 --- a/plugins/dev-create/templates/field/template/test/index.js +++ b/plugins/dev-create/templates/field/template/test/index.js @@ -31,10 +31,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/plugin/README.md b/plugins/dev-create/templates/plugin/README.md index e2ebf23dda..b40da88678 100644 --- a/plugins/dev-create/templates/plugin/README.md +++ b/plugins/dev-create/templates/plugin/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) plugin that ... ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -22,6 +25,7 @@ npm install @blockly/plugin --save + ```js import * as Blockly from 'blockly'; import {Plugin} from '@blockly/plugin'; @@ -43,4 +47,5 @@ plugin.init(); --> ## License + Apache 2.0 diff --git a/plugins/dev-create/templates/plugin/template/src/index.js b/plugins/dev-create/templates/plugin/template/src/index.js index 1ca4779eb8..c5ada33d12 100644 --- a/plugins/dev-create/templates/plugin/template/src/index.js +++ b/plugins/dev-create/templates/plugin/template/src/index.js @@ -31,5 +31,5 @@ export class Plugin { /** * Initialize. */ - init() { } + init() {} } diff --git a/plugins/dev-create/templates/plugin/template/test/index.html b/plugins/dev-create/templates/plugin/template/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/dev-create/templates/plugin/template/test/index.html +++ b/plugins/dev-create/templates/plugin/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/plugin/template/test/index.js b/plugins/dev-create/templates/plugin/template/test/index.js index c137888713..7286510122 100644 --- a/plugins/dev-create/templates/plugin/template/test/index.js +++ b/plugins/dev-create/templates/plugin/template/test/index.js @@ -28,10 +28,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/theme/README.md b/plugins/dev-create/templates/theme/README.md index 39bba62ff2..bf69f71963 100644 --- a/plugins/dev-create/templates/theme/README.md +++ b/plugins/dev-create/templates/theme/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) theme that ... ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -26,8 +29,8 @@ import Theme from '@blockly/plugin'; Blockly.inject('blocklyDiv', { theme: Theme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/dev-create/templates/theme/template/test/index.html b/plugins/dev-create/templates/theme/template/test/index.html index fcbe95c9e0..2730c18ef1 100644 --- a/plugins/dev-create/templates/theme/template/test/index.html +++ b/plugins/dev-create/templates/theme/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Theme Test + + - - - Blockly Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/theme/template/test/index.js b/plugins/dev-create/templates/theme/template/test/index.js index be708e3b7c..de643e2720 100644 --- a/plugins/dev-create/templates/theme/template/test/index.js +++ b/plugins/dev-create/templates/theme/template/test/index.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly'; import {toolboxCategories, createPlayground} from '@blockly/dev-tools'; import Theme from '../src/index'; - /** * Create a workspace. * @param {HTMLElement} blocklyDiv The blockly container div. @@ -24,11 +23,14 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, theme: Theme, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/typescript-block/README.md b/plugins/dev-create/templates/typescript-block/README.md index 13f18ff378..cddfaaab73 100644 --- a/plugins/dev-create/templates/typescript-block/README.md +++ b/plugins/dev-create/templates/typescript-block/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) block that ... ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -20,11 +23,12 @@ npm install @blockly/plugin --save ## Usage ### Import + ```js import * as Blockly from 'blockly'; import '@blockly/plugin'; - ``` ## License + Apache 2.0 diff --git a/plugins/dev-create/templates/typescript-block/template/test/index.html b/plugins/dev-create/templates/typescript-block/template/test/index.html index a4804fe7aa..1b2d485763 100644 --- a/plugins/dev-create/templates/typescript-block/template/test/index.html +++ b/plugins/dev-create/templates/typescript-block/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Block Test + + - - - Blockly Block Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/typescript-block/template/test/index.ts b/plugins/dev-create/templates/typescript-block/template/test/index.ts index 535e852a74..8940562e51 100644 --- a/plugins/dev-create/templates/typescript-block/template/test/index.ts +++ b/plugins/dev-create/templates/typescript-block/template/test/index.ts @@ -12,7 +12,6 @@ import * as Blockly from 'blockly'; import {createPlayground} from '@blockly/dev-tools'; import '../src/index'; - // TODO: Edit list of blocks. const allBlocks = ['block_template']; @@ -22,13 +21,15 @@ const allBlocks = ['block_template']; * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: { 'kind': 'flyoutToolbox', @@ -40,6 +41,9 @@ document.addEventListener('DOMContentLoaded', function() { }), }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/typescript-field/README.md b/plugins/dev-create/templates/typescript-field/README.md index 188b91f56d..eb116453f3 100644 --- a/plugins/dev-create/templates/typescript-field/README.md +++ b/plugins/dev-create/templates/typescript-field/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) ... field. ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -24,6 +27,7 @@ npm install @blockly/plugin --save --> ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldTemplate} from '@blockly/plugin'; @@ -37,6 +41,7 @@ Blockly.Blocks["test_field_template"] = { ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/plugin'; diff --git a/plugins/dev-create/templates/typescript-field/template/test/index.html b/plugins/dev-create/templates/typescript-field/template/test/index.html index ba00bba01c..10cd0a0c1d 100644 --- a/plugins/dev-create/templates/typescript-field/template/test/index.html +++ b/plugins/dev-create/templates/typescript-field/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Test + + - - - Blockly Field Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/typescript-field/template/test/index.ts b/plugins/dev-create/templates/typescript-field/template/test/index.ts index bf23227d0f..d6dba2bc20 100644 --- a/plugins/dev-create/templates/typescript-field/template/test/index.ts +++ b/plugins/dev-create/templates/typescript-field/template/test/index.ts @@ -26,16 +26,21 @@ const toolbox = generateFieldTestBlocks('field_template', [ * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/typescript-plugin/README.md b/plugins/dev-create/templates/typescript-plugin/README.md index e2ebf23dda..b40da88678 100644 --- a/plugins/dev-create/templates/typescript-plugin/README.md +++ b/plugins/dev-create/templates/typescript-plugin/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) plugin that ... ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -22,6 +25,7 @@ npm install @blockly/plugin --save + ```js import * as Blockly from 'blockly'; import {Plugin} from '@blockly/plugin'; @@ -43,4 +47,5 @@ plugin.init(); --> ## License + Apache 2.0 diff --git a/plugins/dev-create/templates/typescript-plugin/template/test/index.html b/plugins/dev-create/templates/typescript-plugin/template/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/dev-create/templates/typescript-plugin/template/test/index.html +++ b/plugins/dev-create/templates/typescript-plugin/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/typescript-plugin/template/test/index.ts b/plugins/dev-create/templates/typescript-plugin/template/test/index.ts index 63d364f947..8b395dfca5 100644 --- a/plugins/dev-create/templates/typescript-plugin/template/test/index.ts +++ b/plugins/dev-create/templates/typescript-plugin/template/test/index.ts @@ -18,8 +18,10 @@ import {Plugin} from '../src/index'; * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); // TODO: Initialize your plugin here. @@ -29,10 +31,13 @@ function createWorkspace(blocklyDiv: HTMLElement, return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-create/templates/typescript-theme/README.md b/plugins/dev-create/templates/typescript-theme/README.md index 39bba62ff2..bf69f71963 100644 --- a/plugins/dev-create/templates/typescript-theme/README.md +++ b/plugins/dev-create/templates/typescript-theme/README.md @@ -3,16 +3,19 @@ + A [Blockly](https://www.npmjs.com/package/blockly) theme that ... ## Installation ### Yarn + ``` yarn add @blockly/plugin ``` ### npm + ``` npm install @blockly/plugin --save ``` @@ -26,8 +29,8 @@ import Theme from '@blockly/plugin'; Blockly.inject('blocklyDiv', { theme: Theme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/dev-create/templates/typescript-theme/template/test/index.html b/plugins/dev-create/templates/typescript-theme/template/test/index.html index fcbe95c9e0..2730c18ef1 100644 --- a/plugins/dev-create/templates/typescript-theme/template/test/index.html +++ b/plugins/dev-create/templates/typescript-theme/template/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Theme Test + + - - - Blockly Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/dev-create/templates/typescript-theme/template/test/index.ts b/plugins/dev-create/templates/typescript-theme/template/test/index.ts index 88833fbe3e..038d2cacd6 100644 --- a/plugins/dev-create/templates/typescript-theme/template/test/index.ts +++ b/plugins/dev-create/templates/typescript-theme/template/test/index.ts @@ -12,24 +12,28 @@ import * as Blockly from 'blockly'; import {toolboxCategories, createPlayground} from '@blockly/dev-tools'; import Theme from '../src/index'; - /** * Create a workspace. * @param blocklyDiv The blockly container div. * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, theme: Theme, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/dev-scripts/README.md b/plugins/dev-scripts/README.md index 7b9ae99831..e1ee8bfad2 100644 --- a/plugins/dev-scripts/README.md +++ b/plugins/dev-scripts/README.md @@ -15,10 +15,6 @@ playground in the browser. The page will reload if you make edits. Builds the package into the `dist` directory. -### `blockly-scripts lint` - -Runs eslint on the `src` and `test` directories. - ### `blockly-scripts clean` Deletes the `dist` and `build` directories if they exist. diff --git a/plugins/dev-scripts/bin/blockly-scripts.js b/plugins/dev-scripts/bin/blockly-scripts.js index 6661d8a145..c5c6a914ee 100755 --- a/plugins/dev-scripts/bin/blockly-scripts.js +++ b/plugins/dev-scripts/bin/blockly-scripts.js @@ -25,9 +25,10 @@ const availableScripts = [ const script = args[0]; if (availableScripts.includes(script)) { - const result = spawnSync('node', - [].concat(require.resolve('../scripts/' + script)) - .concat(args.slice(1)), {stdio: 'inherit'} + const result = spawnSync( + 'node', + [].concat(require.resolve('../scripts/' + script)).concat(args.slice(1)), + {stdio: 'inherit'}, ); if (result.signal) { if (result.signal === 'SIGKILL') { diff --git a/plugins/dev-scripts/config/webpack.config.js b/plugins/dev-scripts/config/webpack.config.js index d1a8726910..83d27ad264 100644 --- a/plugins/dev-scripts/config/webpack.config.js +++ b/plugins/dev-scripts/config/webpack.config.js @@ -18,8 +18,6 @@ const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath); const packageJson = require(resolveApp('package.json')); -const ESLintPlugin = require('eslint-webpack-plugin'); - module.exports = (env) => { const mode = env.mode; const isDevelopment = mode === 'development'; @@ -30,29 +28,32 @@ module.exports = (env) => { let entry; let outputFile; let target = 'web'; - if (isProduction) { // Production. - ['js', 'ts'].filter((ext) => - fs.existsSync(resolveApp(`./src/index.${ext}`)) - ).forEach((ext) => { - entry = `./src/index.${ext}`; - }); + if (isProduction) { + // Production. + ['js', 'ts'] + .filter((ext) => fs.existsSync(resolveApp(`./src/index.${ext}`))) + .forEach((ext) => { + entry = `./src/index.${ext}`; + }); outputFile = 'index.js'; - } else if (isDevelopment) { // Development. - ['js', 'ts'].filter((ext) => - fs.existsSync(resolveApp(`./test/index.${ext}`)) - ).forEach((ext) => { - entry = `./test/index.${ext}`; - }); + } else if (isDevelopment) { + // Development. + ['js', 'ts'] + .filter((ext) => fs.existsSync(resolveApp(`./test/index.${ext}`))) + .forEach((ext) => { + entry = `./test/index.${ext}`; + }); outputFile = 'test_bundle.js'; - } else if (isTest) { // Test. + } else if (isTest) { + // Test. // Create an entry point for each .mocha.js file. fs.readdirSync('./test/') - .filter((file) => file.substr(-9) === '.mocha.js') - .forEach((file) => { - const entryName = file.replace(/\.mocha\.js/i, ''); - if (!entry) entry = {}; - entry[entryName] = `./test/${file}`; - }); + .filter((file) => file.substr(-9) === '.mocha.js') + .forEach((file) => { + const entryName = file.replace(/\.mocha\.js/i, ''); + if (!entry) entry = {}; + entry[entryName] = `./test/${file}`; + }); outputFile = '[name].mocha.js'; target = 'node'; } @@ -84,8 +85,9 @@ module.exports = (env) => { alias: { 'blockly': resolveApp(`node_modules/blockly${blocklyAliasSuffix}`), }, - extensions: ['.ts', '.js'] - .filter((ext) => isTypescript || !ext.includes('ts')), + extensions: ['.ts', '.js'].filter( + (ext) => isTypescript || !ext.includes('ts'), + ), fallback: { 'util': false, }, @@ -114,60 +116,50 @@ module.exports = (env) => { }), // canvas should only be required by jsdom if the 'canvas' package is // installed in package.json. Ignoring canvas require errors. - isTest && new webpack.IgnorePlugin({ - resourceRegExp: /canvas$/, - }), - // Run the linter. - !env.skipLint && new ESLintPlugin({ - cache: true, - cacheLocation: path.join('node_modules/.cache/eslint/'), - formatter: 'stylish', - emitWarning: isDevelopment, - eslintPath: require.resolve('eslint'), - resolvePluginsRelativeTo: __dirname, - useEslintrc: false, - baseConfig: { - extends: [require.resolve('@blockly/eslint-config')], - }, - }), + isTest && + new webpack.IgnorePlugin({ + resourceRegExp: /canvas$/, + }), ].filter(Boolean), - externals: isProduction ? { - 'blockly/core': { - root: 'Blockly', - commonjs: 'blockly/core', - commonjs2: 'blockly/core', - amd: 'blockly/core', - }, - 'blockly/javascript': { - root: 'Blockly.JavaScript', - commonjs: 'blockly/javascript', - commonjs2: 'blockly/javascript', - amd: 'blockly/javascript', - }, - 'blockly/python': { - root: 'Blockly.Python', - commonjs: 'blockly/python', - commonjs2: 'blockly/python', - amd: 'blockly/python', - }, - 'blockly/dart': { - root: 'Blockly.Dart', - commonjs: 'blockly/dart', - commonjs2: 'blockly/dart', - amd: 'blockly/dart', - }, - 'blockly/php': { - root: 'Blockly.PHP', - commonjs: 'blockly/php', - commonjs2: 'blockly/php', - amd: 'blockly/php', - }, - 'blockly/lua': { - root: 'Blockly.Lua', - commonjs: 'blockly/lua', - commonjs2: 'blockly/lua', - amd: 'blockly/lua', - }, - } : {}, + externals: isProduction + ? { + 'blockly/core': { + root: 'Blockly', + commonjs: 'blockly/core', + commonjs2: 'blockly/core', + amd: 'blockly/core', + }, + 'blockly/javascript': { + root: 'Blockly.JavaScript', + commonjs: 'blockly/javascript', + commonjs2: 'blockly/javascript', + amd: 'blockly/javascript', + }, + 'blockly/python': { + root: 'Blockly.Python', + commonjs: 'blockly/python', + commonjs2: 'blockly/python', + amd: 'blockly/python', + }, + 'blockly/dart': { + root: 'Blockly.Dart', + commonjs: 'blockly/dart', + commonjs2: 'blockly/dart', + amd: 'blockly/dart', + }, + 'blockly/php': { + root: 'Blockly.PHP', + commonjs: 'blockly/php', + commonjs2: 'blockly/php', + amd: 'blockly/php', + }, + 'blockly/lua': { + root: 'Blockly.Lua', + commonjs: 'blockly/lua', + commonjs2: 'blockly/lua', + amd: 'blockly/lua', + }, + } + : {}, }; }; diff --git a/plugins/dev-scripts/package-lock.json b/plugins/dev-scripts/package-lock.json index 9d92aa76db..da0755c062 100644 --- a/plugins/dev-scripts/package-lock.json +++ b/plugins/dev-scripts/package-lock.json @@ -177,6 +177,14 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.12.1", "license": "MIT", @@ -190,6 +198,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "license": "Apache-2.0", @@ -322,8 +350,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.4.1", - "license": "MIT", + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -599,8 +628,9 @@ } }, "node_modules/acorn": { - "version": "7.4.1", - "license": "MIT", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "bin": { "acorn": "bin/acorn" }, @@ -610,7 +640,8 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -740,11 +771,9 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/array-flatten": { "version": "2.1.2", @@ -883,6 +912,17 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/browser-stdout": { "version": "1.3.1", "license": "ISC" @@ -998,43 +1038,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/chokidar/node_modules/braces": { - "version": "3.0.2", - "license": "MIT", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/fill-range": { - "version": "7.0.1", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/is-number": { - "version": "7.0.0", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/chokidar/node_modules/to-regex-range": { - "version": "5.0.1", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "license": "MIT", @@ -1792,6 +1795,14 @@ "@babel/highlight": "^7.10.4" } }, + "node_modules/eslint/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/eslint/node_modules/globals": { "version": "13.12.1", "license": "MIT", @@ -1805,6 +1816,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/espree": { "version": "7.3.1", "license": "BSD-2-Clause", @@ -1817,6 +1848,17 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/espree/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/espree/node_modules/eslint-visitor-keys": { "version": "1.3.0", "license": "Apache-2.0", @@ -2028,54 +2070,6 @@ "node": ">=8.6.0" } }, - "node_modules/fast-glob/node_modules/braces": { - "version": "3.0.2", - "license": "MIT", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/fill-range": { - "version": "7.0.1", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/is-number": { - "version": "7.0.0", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/fast-glob/node_modules/micromatch": { - "version": "4.0.4", - "license": "MIT", - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/fast-glob/node_modules/to-regex-range": { - "version": "5.0.1", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "license": "MIT" @@ -2107,7 +2101,8 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dependencies": { "flat-cache": "^3.0.4" }, @@ -2115,6 +2110,17 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/finalhandler": { "version": "1.2.0", "license": "MIT", @@ -2373,13 +2379,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby/node_modules/ignore": { - "version": "5.2.0", - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, "node_modules/graceful-fs": { "version": "4.2.9", "license": "ISC" @@ -2565,54 +2564,6 @@ "@types/express": "^4.17.13" } }, - "node_modules/http-proxy-middleware/node_modules/braces": { - "version": "3.0.2", - "license": "MIT", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/http-proxy-middleware/node_modules/fill-range": { - "version": "7.0.1", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/http-proxy-middleware/node_modules/is-number": { - "version": "7.0.0", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/micromatch": { - "version": "4.0.4", - "license": "MIT", - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/http-proxy-middleware/node_modules/to-regex-range": { - "version": "5.0.1", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.1", "dev": true, @@ -2643,8 +2594,9 @@ } }, "node_modules/ignore": { - "version": "4.0.6", - "license": "MIT", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "engines": { "node": ">= 4" } @@ -2813,6 +2765,14 @@ "node": ">=0.10.0" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-path-cwd": { "version": "2.2.0", "license": "MIT", @@ -2941,11 +2901,11 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.1", - "license": "MIT", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -3159,6 +3119,18 @@ "node": ">= 0.6" } }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime": { "version": "1.6.0", "license": "MIT", @@ -3265,20 +3237,6 @@ "url": "https://opencollective.com/mochajs" } }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "license": "Python-2.0" - }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "license": "MIT" @@ -4535,16 +4493,6 @@ "node": ">=0.10.0" } }, - "node_modules/terser/node_modules/acorn": { - "version": "8.7.1", - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", "license": "MIT" @@ -4557,6 +4505,17 @@ "version": "1.1.0", "license": "MIT" }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "license": "MIT", @@ -4606,57 +4565,10 @@ "webpack": "^5.0.0" } }, - "node_modules/ts-loader/node_modules/braces": { - "version": "3.0.2", - "license": "MIT", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-loader/node_modules/fill-range": { - "version": "7.0.1", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-loader/node_modules/is-number": { - "version": "7.0.0", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/ts-loader/node_modules/micromatch": { - "version": "4.0.5", - "license": "MIT", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/ts-loader/node_modules/to-regex-range": { - "version": "5.0.1", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/type-check": { "version": "0.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -4666,7 +4578,8 @@ }, "node_modules/type-fest": { "version": "0.20.2", - "license": "(MIT OR CC0-1.0)", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "engines": { "node": ">=10" }, @@ -5082,16 +4995,6 @@ "node": ">=10.13.0" } }, - "node_modules/webpack/node_modules/acorn": { - "version": "8.8.2", - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/webpack/node_modules/acorn-import-assertions": { "version": "1.8.0", "license": "MIT", @@ -5376,11 +5279,33 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, "globals": { "version": "13.12.1", "requires": { "type-fest": "^0.20.2" } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } } } }, @@ -5478,7 +5403,9 @@ } }, "@types/eslint": { - "version": "8.4.1", + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", "requires": { "@types/estree": "*", "@types/json-schema": "*" @@ -5700,10 +5627,14 @@ } }, "acorn": { - "version": "7.4.1" + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==" }, "acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "requires": {} }, "agent-base": { @@ -5776,10 +5707,9 @@ } }, "argparse": { - "version": "1.0.10", - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "array-flatten": { "version": "2.1.2" @@ -5877,6 +5807,14 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1" }, @@ -5933,29 +5871,6 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0" - }, - "to-regex-range": { - "version": "5.0.1", - "requires": { - "is-number": "^7.0.0" - } - } } }, "chrome-trace-event": { @@ -6319,11 +6234,33 @@ "@babel/highlight": "^7.10.4" } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, "globals": { "version": "13.12.1", "requires": { "type-fest": "^0.20.2" } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } } } }, @@ -6437,6 +6374,11 @@ "eslint-visitor-keys": "^1.3.0" }, "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + }, "eslint-visitor-keys": { "version": "1.3.0" } @@ -6568,36 +6510,6 @@ "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0" - }, - "micromatch": { - "version": "4.0.4", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "to-regex-range": { - "version": "5.0.1", - "requires": { - "is-number": "^7.0.0" - } - } } }, "fast-json-stable-stringify": { @@ -6623,10 +6535,20 @@ }, "file-entry-cache": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "requires": { "flat-cache": "^3.0.4" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, "finalhandler": { "version": "1.2.0", "requires": { @@ -6782,11 +6704,6 @@ "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.2.0" - } } }, "graceful-fs": { @@ -6907,36 +6824,6 @@ "is-glob": "^4.0.1", "is-plain-obj": "^3.0.0", "micromatch": "^4.0.2" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0" - }, - "micromatch": { - "version": "4.0.4", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "to-regex-range": { - "version": "5.0.1", - "requires": { - "is-number": "^7.0.0" - } - } } }, "https-proxy-agent": { @@ -6957,7 +6844,9 @@ } }, "ignore": { - "version": "4.0.6" + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==" }, "import-fresh": { "version": "3.3.0", @@ -7043,6 +6932,11 @@ "is-extglob": "^2.1.1" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, "is-path-cwd": { "version": "2.2.0" }, @@ -7110,10 +7004,11 @@ "version": "4.0.0" }, "js-yaml": { - "version": "3.14.1", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "jsdom": { @@ -7246,6 +7141,15 @@ "methods": { "version": "1.1.2" }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mime": { "version": "1.6.0" }, @@ -7308,15 +7212,6 @@ "yargs-unparser": "2.0.0" }, "dependencies": { - "argparse": { - "version": "2.0.1" - }, - "js-yaml": { - "version": "4.1.0", - "requires": { - "argparse": "^2.0.1" - } - }, "ms": { "version": "2.1.3" }, @@ -8040,9 +7935,6 @@ "source-map-support": "~0.5.20" }, "dependencies": { - "acorn": { - "version": "8.7.1" - }, "commander": { "version": "2.20.3" } @@ -8069,6 +7961,14 @@ "thunky": { "version": "1.1.0" }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "toidentifier": { "version": "1.0.1" }, @@ -8096,46 +7996,20 @@ "enhanced-resolve": "^5.0.0", "micromatch": "^4.0.0", "semver": "^7.3.4" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0" - }, - "micromatch": { - "version": "4.0.5", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "to-regex-range": { - "version": "5.0.1", - "requires": { - "is-number": "^7.0.0" - } - } } }, "type-check": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "requires": { "prelude-ls": "^1.2.1" } }, "type-fest": { - "version": "0.20.2" + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "type-is": { "version": "1.6.18", @@ -8238,9 +8112,6 @@ "webpack-sources": "^3.2.3" }, "dependencies": { - "acorn": { - "version": "8.8.2" - }, "acorn-import-assertions": { "version": "1.8.0", "requires": {} diff --git a/plugins/dev-scripts/package.json b/plugins/dev-scripts/package.json index c3517c464b..3b2d76e053 100644 --- a/plugins/dev-scripts/package.json +++ b/plugins/dev-scripts/package.json @@ -51,9 +51,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" }, diff --git a/plugins/dev-scripts/scripts/build.js b/plugins/dev-scripts/scripts/build.js index 0b5dbdd445..4f3b0815f6 100644 --- a/plugins/dev-scripts/scripts/build.js +++ b/plugins/dev-scripts/scripts/build.js @@ -30,11 +30,8 @@ const packageJson = require(resolveApp('package.json')); console.log(`Running production build for ${packageJson.name}`); // Create the webpack configuration for based on the build environment. -const args = process.argv.slice(2); -const skipLint = args.includes('--skip-lint'); const config = webpackConfig({ mode: 'production', - skipLint: skipLint, }); if (!config.entry) { console.log(`${chalk.red(`Configuration error.`)} @@ -56,10 +53,8 @@ webpack(config, (err, stats) => { }; const messages = { - errors: statsData.errors - .map(formatWebpackMessage), - warnings: statsData.warnings - .map(formatWebpackMessage), + errors: statsData.errors.map(formatWebpackMessage), + warnings: statsData.warnings.map(formatWebpackMessage), }; if (!messages.errors.length && !messages.warnings.length) { diff --git a/plugins/dev-scripts/scripts/lint.js b/plugins/dev-scripts/scripts/lint.js index d7312884d8..2d581c49ce 100644 --- a/plugins/dev-scripts/scripts/lint.js +++ b/plugins/dev-scripts/scripts/lint.js @@ -18,7 +18,7 @@ const fs = require('fs'); const path = require('path'); const ESLint = require('eslint').ESLint; -// eslint-disable-next-line no-unused-vars + const LintResult = require('eslint').LintResult; const appDirectory = fs.realpathSync(process.cwd()); @@ -44,6 +44,10 @@ const linter = new ESLint({ cacheLocation: cacheLocation, }); +console.log( + 'blockly-scripts lint is deprecated! Run eslint directly using the CLI.', +); + /** * Lint this directory. * @param {string} dir The directory to lint. diff --git a/plugins/dev-scripts/scripts/predeploy.js b/plugins/dev-scripts/scripts/predeploy.js index b63a3cf311..922fbcf2eb 100644 --- a/plugins/dev-scripts/scripts/predeploy.js +++ b/plugins/dev-scripts/scripts/predeploy.js @@ -47,8 +47,10 @@ webpack(config, (err, stats) => { } return; } - console.log(stats.toString({ - chunks: false, // Makes the build much quieter - colors: true, // Shows colors in the console - })); + console.log( + stats.toString({ + chunks: false, // Makes the build much quieter + colors: true, // Shows colors in the console + }), + ); }); diff --git a/plugins/dev-scripts/scripts/start.js b/plugins/dev-scripts/scripts/start.js index 9b14d50cee..030a1fe0f3 100644 --- a/plugins/dev-scripts/scripts/start.js +++ b/plugins/dev-scripts/scripts/start.js @@ -37,13 +37,10 @@ const isTypescript = fs.existsSync(resolveApp('tsconfig.json')); console.log(`Running start for ${packageJson.name}`); -const args = process.argv.slice(2); -const skipLint = args.includes('--skip-lint'); // Create the webpack configuration for the development environment. // Build the test directory. const config = webpackConfig({ mode: 'development', - skipLint: skipLint, }); if (!config.entry) { console.log(`${chalk.red(`Configuration error.`)} @@ -63,8 +60,7 @@ try { const devSocket = { warnings: (warnings) => devServer.sockWrite(devServer.sockets, 'warnings', warnings), - errors: (errors) => - devServer.sockWrite(devServer.sockets, 'errors', errors), + errors: (errors) => devServer.sockWrite(devServer.sockets, 'errors', errors), }; compiler.hooks.invalid.tap('invalid', () => { @@ -89,12 +85,18 @@ if (isTypescript) { const messageColor = severity == 'warning' ? chalk.yellow : chalk.red; - const source = file && fs.existsSync(file) && - fs.readFileSync(file, 'utf-8'); - const frame = source ? codeFrame(source, - {start: {line: line, column: character}}, - {highlightCode: true, linesAbove: 2, linesBelow: 2}) - .split('\n').map((str) => ' ' + str).join(os.EOL) : ''; + const source = + file && fs.existsSync(file) && fs.readFileSync(file, 'utf-8'); + const frame = source + ? codeFrame( + source, + {start: {line: line, column: character}}, + {highlightCode: true, linesAbove: 2, linesBelow: 2}, + ) + .split('\n') + .map((str) => ' ' + str) + .join(os.EOL) + : ''; return [ os.EOL, @@ -108,11 +110,11 @@ if (isTypescript) { tsMessagesResolver({ errors: issues - .filter((msg) => msg.severity === 'error') - .map(formatTypecheckerMessage), + .filter((msg) => msg.severity === 'error') + .map(formatTypecheckerMessage), warnings: issues - .filter((msg) => msg.severity === 'warning') - .map(formatTypecheckerMessage), + .filter((msg) => msg.severity === 'warning') + .map(formatTypecheckerMessage), }); return issues; @@ -132,16 +134,17 @@ compiler.hooks.done.tap('done', async (stats) => { }; const messages = { - errors: statsData.errors - .map(formatWebpackMessage), - warnings: statsData.warnings - .map(formatWebpackMessage), + errors: statsData.errors.map(formatWebpackMessage), + warnings: statsData.warnings.map(formatWebpackMessage), }; if (isTypescript && statsData.errors.length === 0) { const delayedMsg = setTimeout(() => { - console.log(chalk.yellow( - 'Files successfully emitted, waiting for typecheck results...')); + console.log( + chalk.yellow( + 'Files successfully emitted, waiting for typecheck results...', + ), + ); }, 100); const tsMessages = await tsMessagesPromise; diff --git a/plugins/dev-scripts/scripts/test.js b/plugins/dev-scripts/scripts/test.js index 1ce67de0ed..8df4aa140d 100644 --- a/plugins/dev-scripts/scripts/test.js +++ b/plugins/dev-scripts/scripts/test.js @@ -27,16 +27,18 @@ const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath); const packageJson = require(resolveApp('package.json')); console.log(`Building tests for ${packageJson.name}`); -const args = process.argv.slice(2); -const skipLint = args.includes('--skip-lint'); const config = webpackConfig({ mode: 'test', - skipLint: skipLint, }); if (!config.entry) { - console.log(chalk.yellow(`Warning: No tests found`) + '\n' + - 'There were no ' + chalk.yellow('test/*.mocha.js') + ' files found ' + - 'in your package.\n'); + console.log( + chalk.yellow(`Warning: No tests found`) + + '\n' + + 'There were no ' + + chalk.yellow('test/*.mocha.js') + + ' files found ' + + 'in your package.\n', + ); process.exit(0); } @@ -58,10 +60,12 @@ webpack(config, (err, stats) => { } return; } - console.log(stats.toString({ - chunks: false, // Makes the build much quieter - colors: true, // Shows colors in the console - })); + console.log( + stats.toString({ + chunks: false, // Makes the build much quieter + colors: true, // Shows colors in the console + }), + ); // Run mocha. console.log(`Running tests for ${packageJson.name}`); @@ -71,12 +75,14 @@ webpack(config, (err, stats) => { // Run mocha for each built mocha .js file. const testOutputDir = 'build'; - fs.readdirSync(testOutputDir).filter((file) => { - // Only keep the .mocha.js files - return file.substr(-9) === '.mocha.js'; - }).forEach((file) => { - mocha.addFile(path.join(testOutputDir, file)); - }); + fs.readdirSync(testOutputDir) + .filter((file) => { + // Only keep the .mocha.js files + return file.substr(-9) === '.mocha.js'; + }) + .forEach((file) => { + mocha.addFile(path.join(testOutputDir, file)); + }); // Run the tests. mocha.run((failures) => { diff --git a/plugins/dev-tools/README.md b/plugins/dev-tools/README.md index 058e796007..b60fc46a72 100644 --- a/plugins/dev-tools/README.md +++ b/plugins/dev-tools/README.md @@ -11,7 +11,9 @@ npm install @blockly/dev-tools -D --save ## Usage ### Playground + The playground is a tremendously useful tool for debugging your Blockly project. As a preview, here is [one of the plugin playgrounds](https://google.github.io/blockly-samples/plugins/theme-modern/test/). The playground features are: + - All the default blocks - All the language generators (JavaScript, Python, PHP, Lua, and Dart) - Switch between different Blockly options (eg: rtl, renderer, readOnly, zoom and scroll) @@ -36,6 +38,7 @@ createPlayground(document.getElementById('blocklyDiv'), (blocklyDiv, options) => This package also exports pieces of the playground (addGUIControls, addCodeEditor) if you'd rather build your own playground. ### Toolboxes + Blockly built-in Simple and Category toolboxes. ```js @@ -43,7 +46,7 @@ import * as Blockly from 'blockly'; import {toolboxSimple, toolboxCategories} from '@blockly/dev-tools'; Blockly.inject('blocklyDiv', { - toolbox: toolboxCategories + toolbox: toolboxCategories, }); ``` @@ -56,6 +59,7 @@ The test toolbox is re-exported in this package, but can be imported as a stand- #### `populateRandom` The `populateRandom` function adds random blocks to a workspace. Blocks are selected from the full set of defined blocks. Pass in a worskpace and how many blocks should be created. + ```js import {populateRandom} from '@blockly/dev-tools'; // Add 10 random blocks to the workspace. @@ -65,6 +69,7 @@ populateRandom(workspace, 10); #### `spaghetti` The `spaghetti` function is a renderer stress test that populates the workspace with nested if-statements. Pass in a worskpace and how deep the nesting should be. + ```js import {spaghetti} from '@blockly/dev-tools'; spaghetti(workspace, 8); @@ -92,6 +97,7 @@ This package is also used in mocha tests, and exports a suite of useful test hel You can find the full list of helpers [here](https://github.com/google/blockly-samples/blob/master/plugins/dev-tools/src/test_helpers.mocha.js). ### Debug Renderer + The [debug renderer][dev-tools] is a renderer plugin that wraps your normal renderer, and visualizes the measurements the [render info][render-info] collects. This is extremely helpful for understanding what your renderer thinks @@ -186,13 +192,14 @@ DebugRenderer.config = { blockBounds: true, connectedBlockBounds: true, render: true, -} +}; ``` [render-info]: https://developers.google.com/blocklyguides/create-custom-blocks/appearance/renderers/concepts/info [dev-tools]: https://www.npmjs.com/package/@blockly/dev-tools ### Logger + A lightweight workspace console logger. ```js @@ -205,4 +212,5 @@ logger.disableLogger(workspace); The logger is included by default in the playground. ## License + Apache 2.0 diff --git a/plugins/dev-tools/package.json b/plugins/dev-tools/package.json index 5c77220188..4933071764 100644 --- a/plugins/dev-tools/package.json +++ b/plugins/dev-tools/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "start": "blockly-scripts start" }, "main": "dist/index.js", @@ -62,9 +62,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/dev-tools/src/block_test_helpers.mocha.js b/plugins/dev-tools/src/block_test_helpers.mocha.js index 2cad57eb2e..ab122a3bd4 100644 --- a/plugins/dev-tools/src/block_test_helpers.mocha.js +++ b/plugins/dev-tools/src/block_test_helpers.mocha.js @@ -9,12 +9,7 @@ import * as sinon from 'sinon'; import * as commonTestHelpers from './common_test_helpers.mocha'; import * as Blockly from 'blockly/core'; -const { - runTestCases, - runTestSuites, - TestCase, - TestSuite, -} = commonTestHelpers; +const {runTestCases, runTestSuites, TestCase, TestSuite} = commonTestHelpers; /** * Code generation test case configuration. @@ -115,7 +110,7 @@ export class SerializationTestCase { */ const createCodeGenerationTestFn_ = (generator) => { return (testCase) => { - return function() { + return function () { const block = testCase.createBlock(this.workspace); let code; let innerOrder; @@ -129,11 +124,13 @@ const createCodeGenerationTestFn_ = (generator) => { code = code[0]; } } - const assertFunc = (typeof testCase.expectedCode === 'string') ? - assert.equal : assert.match; + const assertFunc = + typeof testCase.expectedCode === 'string' ? assert.equal : assert.match; assertFunc(code, testCase.expectedCode); - if (!testCase.useWorkspaceToCode && - testCase.expectedInnerOrder !== undefined) { + if ( + !testCase.useWorkspaceToCode && + testCase.expectedInnerOrder !== undefined + ) { assert.equal(innerOrder, testCase.expectedInnerOrder); } }; @@ -169,14 +166,19 @@ export const runSerializationTestSuite = (testCases) => { * @returns {!Function} The test callback. */ const createSerializedDataToBlockTestCallback = (testCase) => { - return function() { + return function () { let block; if (testCase.json) { block = Blockly.serialization.blocks.append( - testCase.json, this.workspace, {recordUndo: true}); + testCase.json, + this.workspace, + {recordUndo: true}, + ); } else { - block = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom( - testCase.xml), this.workspace); + block = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(testCase.xml), + this.workspace, + ); } if (globalThis.clock) globalThis.clock.runAll(); testCase.assertBlockStructure(block); @@ -188,37 +190,41 @@ export const runSerializationTestSuite = (testCases) => { * @returns {!Function} The test callback. */ const createRoundTripTestCallback = (testCase) => { - return function() { + return function () { if (testCase.json) { const block = Blockly.serialization.blocks.append( - testCase.json, this.workspace, {recordUndo: true}); + testCase.json, + this.workspace, + {recordUndo: true}, + ); if (globalThis.clock) globalThis.clock.runAll(); const generatedJson = Blockly.serialization.blocks.save(block); const expectedJson = testCase.expectedJson || testCase.json; assert.deepEqual(generatedJson, expectedJson); } else { - const block = Blockly.Xml.domToBlock(Blockly.utils.xml.textToDom( - testCase.xml), this.workspace); + const block = Blockly.Xml.domToBlock( + Blockly.utils.xml.textToDom(testCase.xml), + this.workspace, + ); if (globalThis.clock) globalThis.clock.runAll(); - const generatedXml = - Blockly.Xml.domToPrettyText( - Blockly.Xml.blockToDom(block)); + const generatedXml = Blockly.Xml.domToPrettyText( + Blockly.Xml.blockToDom(block), + ); const expectedXml = testCase.expectedXml || testCase.xml; assert.equal(generatedXml, expectedXml); } }; }; - suite('Serialization', function() { - suite('append block', function() { + suite('Serialization', function () { + suite('append block', function () { runTestCases(testCases, createSerializedDataToBlockTestCallback); }); - suite('serialization round-trip', function() { - setup(function() { - sinon.stub(Blockly.utils.idGenerator.TEST_ONLY, 'genUid') - .returns('1'); + suite('serialization round-trip', function () { + setup(function () { + sinon.stub(Blockly.utils.idGenerator.TEST_ONLY, 'genUid').returns('1'); }); - teardown(function() { + teardown(function () { sinon.restore(); }); diff --git a/plugins/dev-tools/src/common_test_helpers.mocha.js b/plugins/dev-tools/src/common_test_helpers.mocha.js index b4e1f364c2..24672c5eb5 100644 --- a/plugins/dev-tools/src/common_test_helpers.mocha.js +++ b/plugins/dev-tools/src/common_test_helpers.mocha.js @@ -75,8 +75,8 @@ export class TestSuite { */ export function runTestCases(testCases, createTestCallback) { testCases.forEach((testCase) => { - let testCall = (testCase.skip ? test.skip : test); - testCall = (testCase.only ? test.only : testCall); + let testCall = testCase.skip ? test.skip : test; + testCall = testCase.only ? test.only : testCall; testCall(testCase.title, createTestCallback(testCase)); }); } @@ -92,9 +92,9 @@ export function runTestCases(testCases, createTestCallback) { */ export function runTestSuites(testSuites, createTestCaseCallback) { testSuites.forEach((testSuite) => { - let suiteCall = (testSuite.skip ? suite.skip : suite); - suiteCall = (testSuite.only ? suite.only : suiteCall); - suiteCall(testSuite.title, function() { + let suiteCall = testSuite.skip ? suite.skip : suite; + suiteCall = testSuite.only ? suite.only : suiteCall; + suiteCall(testSuite.title, function () { if (testSuite.testSuites && testSuite.testSuites.length) { runTestSuites(testSuite.testSuites, createTestCaseCallback); } @@ -115,7 +115,7 @@ export function captureWarnings(innerFunc) { const msgs = []; const nativeConsoleWarn = console.warn; try { - console.warn = function(msg) { + console.warn = function (msg) { msgs.push(msg); }; innerFunc(); diff --git a/plugins/dev-tools/src/debug.js b/plugins/dev-tools/src/debug.js index 45e40d6750..5adbb7aa55 100644 --- a/plugins/dev-tools/src/debug.js +++ b/plugins/dev-tools/src/debug.js @@ -7,7 +7,6 @@ import * as Blockly from 'blockly/core'; import {DebugDrawer} from './debugDrawer'; - /** * The name that the debug renderer is registered under. * @type {string} @@ -21,16 +20,26 @@ export const debugRendererName = 'debugRenderer'; */ export function registerDebugRendererFromName(name) { if (!Blockly.registry.hasItem(Blockly.registry.Type.RENDERER, name)) { - throw Error('No renderer with the name ' + name + ' is registered. ' + - 'Please register your renderer using Blockly.registry.register.'); + throw Error( + 'No renderer with the name ' + + name + + ' is registered. ' + + 'Please register your renderer using Blockly.registry.register.', + ); } const RendererClass = Blockly.registry.getClass( - Blockly.registry.Type.RENDERER, name); + Blockly.registry.Type.RENDERER, + name, + ); const DebugRenderer = createNewRenderer(RendererClass); - Blockly.registry.register(Blockly.registry.Type.RENDERER, - debugRendererName, DebugRenderer, true); + Blockly.registry.register( + Blockly.registry.Type.RENDERER, + debugRendererName, + DebugRenderer, + true, + ); } /** @@ -99,18 +108,19 @@ export function createNewRenderer(Renderer) { const workspaceListener = this.workspaceListeners[workspace.id]; if (!workspaceListener) { - this.workspaceListeners[workspace.id] = - workspace.addChangeListener((event) => { - const blockIds = event.ids; - if (event.type === Blockly.Events.DELETE) { - for (let i = 0; i < blockIds.length; i++) { - const blockId = blockIds[i]; - if (this.blockToDebugger[blockId]) { - delete this.blockToDebugger[blockId]; + this.workspaceListeners[workspace.id] = workspace.addChangeListener( + (event) => { + const blockIds = event.ids; + if (event.type === Blockly.Events.DELETE) { + for (let i = 0; i < blockIds.length; i++) { + const blockId = blockIds[i]; + if (this.blockToDebugger[blockId]) { + delete this.blockToDebugger[blockId]; + } } } - } - }); + }, + ); } } } diff --git a/plugins/dev-tools/src/debugDrawer.js b/plugins/dev-tools/src/debugDrawer.js index 5d0ceb9fa6..bebe48f823 100644 --- a/plugins/dev-tools/src/debugDrawer.js +++ b/plugins/dev-tools/src/debugDrawer.js @@ -75,7 +75,9 @@ export class DebugDrawer { cursorY -= height; } - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'rowSpacerRect blockRenderDebug', 'x': isRtl ? -(row.xPos + row.width) : row.xPos, @@ -87,7 +89,9 @@ export class DebugDrawer { 'fill-opacity': '0.5', 'stroke-width': '1px', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); } /** @@ -109,7 +113,9 @@ export class DebugDrawer { xPos = -(xPos + width); } const yPos = elem.centerline - elem.height / 2; - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'elemSpacerRect blockRenderDebug', 'x': xPos, @@ -121,7 +127,9 @@ export class DebugDrawer { 'fill-opacity': '0.5', 'stroke-width': '1px', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); } /** @@ -137,7 +145,9 @@ export class DebugDrawer { xPos = -(xPos + elem.width); } const yPos = elem.centerline - elem.height / 2; - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'rowRenderingRect blockRenderDebug', 'x': xPos, @@ -148,12 +158,18 @@ export class DebugDrawer { 'fill': 'none', 'stroke-width': '1px', }, - this.svgRoot_)); - - if (Blockly.blockRendering.Types.isField(elem) && - elem.field instanceof Blockly.FieldLabel) { + this.svgRoot_, + ), + ); + + if ( + Blockly.blockRendering.Types.isField(elem) && + elem.field instanceof Blockly.FieldLabel + ) { const baseline = this.constants_.FIELD_TEXT_BASELINE; - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'rowRenderingRect blockRenderDebug', 'x': xPos, @@ -164,13 +180,16 @@ export class DebugDrawer { 'fill': 'none', 'stroke-width': '0.5px', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); } } - - if (Blockly.blockRendering.Types.isInput(elem) && - DebugDrawer.config.connections) { + if ( + Blockly.blockRendering.Types.isInput(elem) && + DebugDrawer.config.connections + ) { this.drawConnection(elem.connectionModel); } } @@ -210,7 +229,9 @@ export class DebugDrawer { // TODO(blockly/7227): This method is still internal, so we're going to // have continual problems. We should consider making it public. const offset = conn.getOffsetInBlock(); - this.debugElements_.push(Blockly.utils.dom.createSvgElement('circle', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'circle', { 'class': 'blockRenderDebug', 'cx': offset.x, @@ -219,7 +240,9 @@ export class DebugDrawer { 'fill': fill, 'stroke': colour, }, - this.svgRoot_)); + this.svgRoot_, + ), + ); } /** @@ -233,7 +256,9 @@ export class DebugDrawer { if (!DebugDrawer.config.rows) { return; } - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'elemRenderingRect blockRenderDebug', 'x': isRtl ? -(row.xPos + row.width) : row.xPos, @@ -244,14 +269,18 @@ export class DebugDrawer { 'fill': 'none', 'stroke-width': '1px', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); if (Blockly.blockRendering.Types.isTopOrBottomRow(row)) { return; } if (DebugDrawer.config.connectedBlockBounds) { - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'connectedBlockWidth blockRenderDebug', 'x': isRtl ? -(row.xPos + row.widthWithConnectedBlocks) : row.xPos, @@ -263,7 +292,9 @@ export class DebugDrawer { 'stroke-width': '1px', 'stroke-dasharray': '3,3', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); } } @@ -283,8 +314,10 @@ export class DebugDrawer { } if (Blockly.blockRendering.Types.isSpacer(elem)) { this.drawSpacerElem( - /** @type {!Blockly.blockRendering.InRowSpacer} */ (elem), - row.height, isRtl); + /** @type {!Blockly.blockRendering.InRowSpacer} */ (elem), + row.height, + isRtl, + ); } else { this.drawRenderedElem(elem, isRtl); } @@ -305,7 +338,9 @@ export class DebugDrawer { // Bounding box without children. let xPos = info.RTL ? -info.width : 0; const yPos = 0; - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'blockBoundingBox blockRenderDebug', 'x': xPos, @@ -317,12 +352,16 @@ export class DebugDrawer { 'stroke-width': '1px', 'stroke-dasharray': '5,5', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); if (DebugDrawer.config.connectedBlockBounds) { // Bounding box with children. xPos = info.RTL ? -info.widthWithChildren : 0; - this.debugElements_.push(Blockly.utils.dom.createSvgElement('rect', + this.debugElements_.push( + Blockly.utils.dom.createSvgElement( + 'rect', { 'class': 'blockRenderDebug', 'x': xPos, @@ -334,7 +373,9 @@ export class DebugDrawer { 'stroke-width': '1px', 'stroke-dasharray': '3,3', }, - this.svgRoot_)); + this.svgRoot_, + ), + ); } } @@ -349,7 +390,7 @@ export class DebugDrawer { this.svgRoot_ = block.getSvgRoot(); this.randomColour_ = - '#' + Math.floor(Math.random() * 16777215).toString(16); + '#' + Math.floor(Math.random() * 16777215).toString(16); let cursorY = 0; for (let i = 0, row; (row = info.rows[i]); i++) { @@ -379,7 +420,6 @@ export class DebugDrawer { this.drawRender(block.pathObject.svgPath); } - /** * Show a debug filter to highlight that a block has been rendered. * @param {!SVGElement} svgPath The block's svg path. @@ -389,9 +429,11 @@ export class DebugDrawer { if (!DebugDrawer.config.render) { return; } - svgPath.setAttribute('filter', - 'url(#' + this.constants_.debugFilterId + ')'); - setTimeout(function() { + svgPath.setAttribute( + 'filter', + 'url(#' + this.constants_.debugFilterId + ')', + ); + setTimeout(function () { svgPath.setAttribute('filter', ''); }, 100); } diff --git a/plugins/dev-tools/src/event_test_helpers.mocha.js b/plugins/dev-tools/src/event_test_helpers.mocha.js index 1b364caf28..eb01f6bc5d 100644 --- a/plugins/dev-tools/src/event_test_helpers.mocha.js +++ b/plugins/dev-tools/src/event_test_helpers.mocha.js @@ -7,7 +7,6 @@ const Blockly = require('blockly/core'); const sinon = require('sinon'); - /** * Returns a matcher that asserts that the actual object has the same properties * and values (shallowly equated) as the expected object. @@ -39,20 +38,23 @@ function shallowMatch(expected) { * @param {?string=} expectedBlockId Expected block id of event fired. */ export function assertEventFiredShallow( - spy, - instanceType, - expectedProperties, - expectedWorkspaceId, - expectedBlockId) { + spy, + instanceType, + expectedProperties, + expectedWorkspaceId, + expectedBlockId, +) { const properties = { ...expectedProperties, workspaceId: expectedWorkspaceId, blockId: expectedBlockId, }; sinon.assert.match( - /** @type {sinon.SinonSpy} */ (spy).getCalls()[0].firstArg, - sinon.match.instanceOf(instanceType) - .and(sinon.match(shallowMatch(properties)))); + /** @type {sinon.SinonSpy} */ (spy).getCalls()[0].firstArg, + sinon.match + .instanceOf(instanceType) + .and(sinon.match(shallowMatch(properties))), + ); // TODO: Why does the above assert work but not this one??? // Also it does work when it's in the other pluging // sinon.assert.calledWith( @@ -72,18 +74,20 @@ export function assertEventFiredShallow( * @param {?string=} expectedBlockId Expected block id of event fired. */ export function assertEventNotFired( - spy, - instanceType, - expectedProperties, - expectedWorkspaceId, - expectedBlockId) { + spy, + instanceType, + expectedProperties, + expectedWorkspaceId, + expectedBlockId, +) { if (expectedWorkspaceId !== undefined) { expectedProperties.workspaceId = expectedWorkspaceId; } if (expectedBlockId !== undefined) { expectedProperties.blockId = expectedBlockId; } - const expectedEvent = - sinon.match.instanceOf(instanceType).and(sinon.match(expectedProperties)); + const expectedEvent = sinon.match + .instanceOf(instanceType) + .and(sinon.match(expectedProperties)); sinon.assert.neverCalledWith(spy, expectedEvent); } diff --git a/plugins/dev-tools/src/field_test_helpers.mocha.js b/plugins/dev-tools/src/field_test_helpers.mocha.js index 5219cdf36c..1eb54fab3a 100644 --- a/plugins/dev-tools/src/field_test_helpers.mocha.js +++ b/plugins/dev-tools/src/field_test_helpers.mocha.js @@ -65,8 +65,11 @@ export class FieldCreationTestCase { * @param {*} expectedValue The expected value. * @param {string=} expectedText The expected text. */ -export function assertFieldValue(field, expectedValue, - expectedText = undefined) { +export function assertFieldValue( + field, + expectedValue, + expectedText = undefined, +) { const actualValue = field.getValue(); const actualText = field.getText(); if (expectedText === undefined) { @@ -93,7 +96,7 @@ function runCreationTests_(testCases, assertion, creation) { * @returns {Function} The test callback. */ const createTestFn = (testCase) => { - return function() { + return function () { const field = creation.call(this, testCase); assertion(field, testCase); }; @@ -116,8 +119,8 @@ function runCreationTestsAssertThrows_(testCases, creation) { * @returns {!Function} The test callback. */ const createTestFn = (testCase) => { - return function() { - assert.throws(function() { + return function () { + assert.throws(function () { creation.call(this, testCase); }, testCase.errMsgMatcher); }; @@ -141,21 +144,28 @@ function runCreationTestsAssertThrows_(testCases, creation) { * @param {function(!FieldCreationTestCase=)=} customCreateWithJs Custom * creation function to use in tests. */ -export function runConstructorSuiteTests(TestedField, validValueTestCases, - invalidValueTestCases, validRunAssertField, assertFieldDefault, - customCreateWithJs) { - suite('Constructor', function() { +export function runConstructorSuiteTests( + TestedField, + validValueTestCases, + invalidValueTestCases, + validRunAssertField, + assertFieldDefault, + customCreateWithJs, +) { + suite('Constructor', function () { if (assertFieldDefault) { - test('Empty', function() { - const field = customCreateWithJs ? customCreateWithJs.call(this) : - new TestedField(); + test('Empty', function () { + const field = customCreateWithJs + ? customCreateWithJs.call(this) + : new TestedField(); assertFieldDefault(field); }); } else { - test('Empty', function() { - assert.throws(function() { - customCreateWithJs ? customCreateWithJs.call(this) : - new TestedField(); + test('Empty', function () { + assert.throws(function () { + customCreateWithJs + ? customCreateWithJs.call(this) + : new TestedField(); }); }); } @@ -165,13 +175,17 @@ export function runConstructorSuiteTests(TestedField, validValueTestCases, * @param {!FieldCreationTestCase} testCase The test case information. * @returns {!Blockly.Field} The instantiated field. */ - const createWithJs = function(testCase) { - return customCreateWithJs ? customCreateWithJs.call(this, testCase) : - new TestedField(...testCase.args); + const createWithJs = function (testCase) { + return customCreateWithJs + ? customCreateWithJs.call(this, testCase) + : new TestedField(...testCase.args); }; if (assertFieldDefault) { runCreationTests_( - invalidValueTestCases, assertFieldDefault, createWithJs); + invalidValueTestCases, + assertFieldDefault, + createWithJs, + ); } else { runCreationTestsAssertThrows_(invalidValueTestCases, createWithJs); } @@ -195,21 +209,28 @@ export function runConstructorSuiteTests(TestedField, validValueTestCases, * @param {function(!FieldCreationTestCase=)=} customCreateWithJson Custom * creation function to use in tests. */ -export function runFromJsonSuiteTests(TestedField, validValueTestCases, - invalidValueTestCases, validRunAssertField, assertFieldDefault, - customCreateWithJson) { - suite('fromJson', function() { +export function runFromJsonSuiteTests( + TestedField, + validValueTestCases, + invalidValueTestCases, + validRunAssertField, + assertFieldDefault, + customCreateWithJson, +) { + suite('fromJson', function () { if (assertFieldDefault) { - test('Empty', function() { - const field = customCreateWithJson ? customCreateWithJson.call(this) : - TestedField.fromJson({}); + test('Empty', function () { + const field = customCreateWithJson + ? customCreateWithJson.call(this) + : TestedField.fromJson({}); assertFieldDefault(field); }); } else { - test('Empty', function() { - assert.throws(function() { - customCreateWithJson ? customCreateWithJson.call(this) : - TestedField.fromJson({}); + test('Empty', function () { + assert.throws(function () { + customCreateWithJson + ? customCreateWithJson.call(this) + : TestedField.fromJson({}); }); }); } @@ -219,13 +240,17 @@ export function runFromJsonSuiteTests(TestedField, validValueTestCases, * @param {!FieldCreationTestCase} testCase The test case information. * @returns {!Blockly.Field} The instantiated field. */ - const createWithJson = function(testCase) { - return customCreateWithJson ? customCreateWithJson.call(this, testCase) : - TestedField.fromJson(testCase.json); + const createWithJson = function (testCase) { + return customCreateWithJson + ? customCreateWithJson.call(this, testCase) + : TestedField.fromJson(testCase.json); }; if (assertFieldDefault) { runCreationTests_( - invalidValueTestCases, assertFieldDefault, createWithJson); + invalidValueTestCases, + assertFieldDefault, + createWithJson, + ); } else { runCreationTestsAssertThrows_(invalidValueTestCases, createWithJson); } @@ -244,18 +269,25 @@ export function runFromJsonSuiteTests(TestedField, validValueTestCases, * @param {string=} invalidRunExpectedText Expected text for field after invalid * call to setValue. */ -export function runSetValueTests(validValueTestCases, invalidValueTestCases, - invalidRunExpectedValue, invalidRunExpectedText) { +export function runSetValueTests( + validValueTestCases, + invalidValueTestCases, + invalidRunExpectedValue, + invalidRunExpectedText, +) { /** * Creates test callback for invalid setValue test. * @param {!FieldValueTestCase} testCase The test case information. * @returns {!Function} The test callback. */ const createInvalidSetValueTestCallback = (testCase) => { - return function() { + return function () { this.field.setValue(testCase.value); assertFieldValue( - this.field, invalidRunExpectedValue, invalidRunExpectedText); + this.field, + invalidRunExpectedValue, + invalidRunExpectedText, + ); }; }; /** @@ -264,10 +296,13 @@ export function runSetValueTests(validValueTestCases, invalidValueTestCases, * @returns {!Function} The test callback. */ const createValidSetValueTestCallback = (testCase) => { - return function() { + return function () { this.field.setValue(testCase.value); assertFieldValue( - this.field, testCase.expectedValue, testCase.expectedText); + this.field, + testCase.expectedValue, + testCase.expectedText, + ); }; }; runTestCases(invalidValueTestCases, createInvalidSetValueTestCallback); diff --git a/plugins/dev-tools/src/generateFieldTestBlocks.js b/plugins/dev-tools/src/generateFieldTestBlocks.js index 6effd95de2..6c53c1e28b 100644 --- a/plugins/dev-tools/src/generateFieldTestBlocks.js +++ b/plugins/dev-tools/src/generateFieldTestBlocks.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - /** * Generates a number of field testing blocks for a specific field and returns * the toolbox xml string. @@ -40,72 +39,69 @@ export function generateFieldTestBlocks(fieldName, options) { // Define a single field block. const singleFieldBlock = `${++id}test_${fieldName}_single`; - blocks.push( + blocks.push({ + 'type': singleFieldBlock, + 'message0': '%1', + 'args0': [ { - 'type': singleFieldBlock, - 'message0': '%1', - 'args0': [ - { - 'type': fieldName, - 'name': 'FIELDNAME', - ...m.args, - 'alt': { - 'type': 'field_label', - 'text': `No ${fieldName}`, - }, - }, - ], - 'output': null, - 'style': 'math_blocks', - }); + 'type': fieldName, + 'name': 'FIELDNAME', + ...m.args, + 'alt': { + 'type': 'field_label', + 'text': `No ${fieldName}`, + }, + }, + ], + 'output': null, + 'style': 'math_blocks', + }); toolboxXml += ``; toolboxXml += ``; // Define a block and add the 'single field block' as a shadow. const parentBlock = `${++id}test_${fieldName}_parent`; - blocks.push( + blocks.push({ + 'type': `${parentBlock}`, + 'message0': 'parent %1', + 'args0': [ { - 'type': `${parentBlock}`, - 'message0': 'parent %1', - 'args0': [ - { - 'type': 'input_value', - 'name': 'INPUT', - }, - ], - 'previousStatement': null, - 'nextStatement': null, - 'style': 'loop_blocks', - }); + 'type': 'input_value', + 'name': 'INPUT', + }, + ], + 'previousStatement': null, + 'nextStatement': null, + 'style': 'loop_blocks', + }); toolboxXml += ` - + `; toolboxXml += ``; // Define a block with the field on it. const blockWithField = `${++id}test_${fieldName}_block`; - blocks.push( + blocks.push({ + 'type': blockWithField, + 'message0': 'block %1', + 'args0': [ { - 'type': blockWithField, - 'message0': 'block %1', - 'args0': [ - { - 'type': fieldName, - 'name': 'FIELDNAME', - ...m.args, - 'alt': { - 'type': 'field_label', - 'text': `No ${fieldName}`, - }, - }, - ], - 'output': null, - 'style': 'math_blocks', - }); + 'type': fieldName, + 'name': 'FIELDNAME', + ...m.args, + 'alt': { + 'type': 'field_label', + 'text': `No ${fieldName}`, + }, + }, + ], + 'output': null, + 'style': 'math_blocks', + }); toolboxXml += ``; toolboxXml += ``; diff --git a/plugins/dev-tools/src/index.d.ts b/plugins/dev-tools/src/index.d.ts index 6f0a0af564..ce9f2d57ba 100644 --- a/plugins/dev-tools/src/index.d.ts +++ b/plugins/dev-tools/src/index.d.ts @@ -1,4 +1,3 @@ - import * as Blockly from 'blockly/core'; import * as dat from 'dat.gui'; @@ -15,13 +14,22 @@ interface PlaygroundTab { } interface PlaygroundAPI { - addAction: (name: string, callback: (workspace: Blockly.Workspace) => void, - folder?: string) => dat.GUIController; - addCheckboxAction: (name: string, callback: - (workspace: Blockly.Workspace, value: boolean) => void, - folder?: string, defaultValue?: boolean) => dat.GUIController; - addGenerator: (label: string, generator: Blockly.Generator, - language?: string) => void; + addAction: ( + name: string, + callback: (workspace: Blockly.Workspace) => void, + folder?: string, + ) => dat.GUIController; + addCheckboxAction: ( + name: string, + callback: (workspace: Blockly.Workspace, value: boolean) => void, + folder?: string, + defaultValue?: boolean, + ) => dat.GUIController; + addGenerator: ( + label: string, + generator: Blockly.Generator, + language?: string, + ) => void; getCurrentTab: () => PlaygroundTab; getGUI: () => DevTools.GUI; getWorkspace: () => Blockly.WorkspaceSvg; @@ -29,7 +37,6 @@ interface PlaygroundAPI { } declare namespace DevTools { - /** * A basic visualizer for debugging custom renderers. */ @@ -41,38 +48,60 @@ declare namespace DevTools { * An extension of dat.GUI with additional functionality. */ export class GUI extends dat.GUI { - addAction(name: string, callback: (workspace: Blockly.Workspace) => void, - folder?: string): dat.GUIController; - addCheckboxAction: (name: string, callback: - (workspace: Blockly.Workspace, value: boolean) => void, - folder?: string, defaultValue?: boolean) => dat.GUIController; + addAction( + name: string, + callback: (workspace: Blockly.Workspace) => void, + folder?: string, + ): dat.GUIController; + addCheckboxAction: ( + name: string, + callback: (workspace: Blockly.Workspace, value: boolean) => void, + folder?: string, + defaultValue?: boolean, + ) => dat.GUIController; getWorkspace: () => Blockly.WorkspaceSvg; } /** * Create the Blockly playground. + * @param container + * @param createWorkspace + * @param defaultOptions + * @param vsEditorPath * @returns A promise to the playground API. */ - function createPlayground(container: HTMLElement, createWorkspace?: - (blocklyDiv: HTMLElement, options: Blockly.BlocklyOptions) => - Blockly.Workspace, defaultOptions?: Blockly.BlocklyOptions, - vsEditorPath?: string): Promise; + function createPlayground( + container: HTMLElement, + createWorkspace?: ( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, + ) => Blockly.Workspace, + defaultOptions?: Blockly.BlocklyOptions, + vsEditorPath?: string, + ): Promise; /** * Use dat.GUI to add controls to adjust configuration of a Blockly workspace. + * @param createWorkspace + * @param defaultOptions * @returns The dat.GUI instance. */ - function addGUIControls(createWorkspace: - (options: Blockly.BlocklyOptions) => Blockly.Workspace, - defaultOptions: Blockly.BlocklyOptions): GUI; + function addGUIControls( + createWorkspace: (options: Blockly.BlocklyOptions) => Blockly.Workspace, + defaultOptions: Blockly.BlocklyOptions, + ): GUI; /** * Generates a number of field testing blocks for a specific field and returns * the toolbox xml string. + * @param fieldName + * @param options * @returns The toolbox xml string. */ - export function generateFieldTestBlocks(fieldName: string, options?: - FieldGeneratorOptions|FieldGeneratorOptions[]): string; + export function generateFieldTestBlocks( + fieldName: string, + options?: FieldGeneratorOptions | FieldGeneratorOptions[], + ): string; /** * A toolbox xml with built-in blocks split into categories. diff --git a/plugins/dev-tools/src/logger.js b/plugins/dev-tools/src/logger.js index 0e0ae56ed1..98d3f57e90 100644 --- a/plugins/dev-tools/src/logger.js +++ b/plugins/dev-tools/src/logger.js @@ -9,7 +9,6 @@ * @author samelh@google.com (Sam El-Husseini) */ - /** * Enables console logging of workspace events. * @param {!Blockly.Workspace} workspace The Blockly workspace. diff --git a/plugins/dev-tools/src/playground/hash_state.js b/plugins/dev-tools/src/playground/hash_state.js index a7cfc28d68..fb1c82c79b 100644 --- a/plugins/dev-tools/src/playground/hash_state.js +++ b/plugins/dev-tools/src/playground/hash_state.js @@ -19,23 +19,27 @@ export class HashState { * @param {Object} state The state. */ static parse(hash, state) { - decodeURIComponent(hash) - .replace(/#?([^=&]+)=([^=&]+)/gm, function(_m0, key, value) { - let current = state; - let i; - while ((i = key.indexOf('.')) > -1) { - current[key.substr(0, i)] = current[key.substr(0, i)] || {}; - current = current[key.substr(0, i)]; - key = key.substr(i + 1); - } - // Parse the value. - if (value == 'true' || value == 'false') { // Boolean. - value = (value == 'true'); - } else if (!isNaN(value)) { // Number. - value = Number(value); - } - current[key] = value; - }); + decodeURIComponent(hash).replace( + /#?([^=&]+)=([^=&]+)/gm, + function (_m0, key, value) { + let current = state; + let i; + while ((i = key.indexOf('.')) > -1) { + current[key.substr(0, i)] = current[key.substr(0, i)] || {}; + current = current[key.substr(0, i)]; + key = key.substr(i + 1); + } + // Parse the value. + if (value == 'true' || value == 'false') { + // Boolean. + value = value == 'true'; + } else if (!isNaN(value)) { + // Number. + value = Number(value); + } + current[key] = value; + }, + ); } /** @@ -53,7 +57,7 @@ export class HashState { for (const p in cur) { if (Object.prototype.hasOwnProperty.call(cur, p)) { isEmpty = false; - flatten(cur[p], prop ? prop+'.'+p : p); + flatten(cur[p], prop ? prop + '.' + p : p); } } if (isEmpty && prop != '') { @@ -62,6 +66,8 @@ export class HashState { } }; flatten(state, ''); - return Object.keys(result).map((k) => `${k}=${result[k]}`).join('&'); + return Object.keys(result) + .map((k) => `${k}=${result[k]}`) + .join('&'); } } diff --git a/plugins/dev-tools/src/playground/index.js b/plugins/dev-tools/src/playground/index.js index 12a6f4d9a8..b3ceb7e82e 100644 --- a/plugins/dev-tools/src/playground/index.js +++ b/plugins/dev-tools/src/playground/index.js @@ -44,7 +44,6 @@ let CreateWorkspaceFn; */ let PlaygroundTab; - /** * @typedef {Blockly.utils.toolbox.ToolboxDefinition} BlocklyToolbox */ @@ -83,10 +82,14 @@ let PlaygroundAPI; * @returns {Promise} A promise to the playground API. */ export function createPlayground( - container, createWorkspace = Blockly.inject, defaultOptions = { - toolbox: toolboxCategories, - }, - config = {}, vsEditorPath) { + container, + createWorkspace = Blockly.inject, + defaultOptions = { + toolbox: toolboxCategories, + }, + config = {}, + vsEditorPath, +) { const { blocklyDiv, minimizeButton, @@ -109,247 +112,257 @@ export function createPlayground( }; // Load the code editor. - return addCodeEditor(monacoDiv, monacoOptions, vsEditorPath) - .then((editor) => { - let workspace; - - // Create a model for displaying errors. - const errorModel = window.monaco.editor.createModel(''); - const editorXmlContextKey = - editor.createContextKey('isEditorXml', true); - const editorJsonContextKey = - editor.createContextKey('isEditorJson', true); - - // Load / Save playground state. - // setting active tab as JSON - const playgroundState = new LocalStorageState(`playgroundState_${id}`, { - activeTab: 'JSON', - playgroundOpen: true, - autoGenerate: config && config.auto != undefined ? config.auto : true, - workspaceJson: '', - }); - playgroundState.load(); + return addCodeEditor(monacoDiv, monacoOptions, vsEditorPath).then( + (editor) => { + let workspace; + + // Create a model for displaying errors. + const errorModel = window.monaco.editor.createModel(''); + const editorXmlContextKey = editor.createContextKey('isEditorXml', true); + const editorJsonContextKey = editor.createContextKey( + 'isEditorJson', + true, + ); + + // Load / Save playground state. + // setting active tab as JSON + const playgroundState = new LocalStorageState(`playgroundState_${id}`, { + activeTab: 'JSON', + playgroundOpen: true, + autoGenerate: config && config.auto != undefined ? config.auto : true, + workspaceJson: '', + }); + playgroundState.load(); + + /** + * Register a generator and create a new code tab for it. + * @param {string} name The generator label. + * @param {string} language The monaco language to use. + * @param {function(Blockly.WorkspaceSvg):string} generator + * The Blockly generator. + * @param {boolean=} isReadOnly Whether the editor should be set to + * read-only mode. + * @returns {!PlaygroundTab} An object that represents the newly created + * tab. + */ + function registerGenerator(name, language, generator, isReadOnly) { + const tabElement = renderCodeTab(name); + tabElement.setAttribute('data-tab', name); + tabsDiv.appendChild(tabElement); + + // Create a monaco editor model for each tab. + const model = window.monaco.editor.createModel('', language); + const state = { + name, + model, + language, + viewState: undefined, + }; /** - * Register a generator and create a new code tab for it. - * @param {string} name The generator label. - * @param {string} language The monaco language to use. - * @param {function(Blockly.WorkspaceSvg):string} generator - * The Blockly generator. - * @param {boolean=} isReadOnly Whether the editor should be set to - * read-only mode. - * @returns {!PlaygroundTab} An object that represents the newly created - * tab. + * Call the generator, displaying an error message if it fails. */ - function registerGenerator(name, language, generator, isReadOnly) { - const tabElement = renderCodeTab(name); - tabElement.setAttribute('data-tab', name); - tabsDiv.appendChild(tabElement); - - // Create a monaco editor model for each tab. - const model = window.monaco.editor.createModel('', language); - const state = { - name, - model, - language, - viewState: undefined, - }; - - /** - * Call the generator, displaying an error message if it fails. - */ - function generate() { - let text; - let generateModel = model; - try { - text = generator(workspace); - } catch (e) { - console.error(e); - text = e.message; - generateModel = errorModel; - editor.updateOptions({ - wordWrap: true, - }); - } - generateModel.pushEditOperations( - [], [{range: generateModel.getFullModelRange(), text}], - () => null); - editor.setModel(generateModel); - editor.setSelection(new window.monaco.Range(0, 0, 0, 0)); + function generate() { + let text; + let generateModel = model; + try { + text = generator(workspace); + } catch (e) { + console.error(e); + text = e.message; + generateModel = errorModel; + editor.updateOptions({ + wordWrap: true, + }); } - - const tab = { - generate, - state, - tabElement, - }; - return tab; + generateModel.pushEditOperations( + [], + [{range: generateModel.getFullModelRange(), text}], + () => null, + ); + editor.setModel(generateModel); + editor.setSelection(new window.monaco.Range(0, 0, 0, 0)); } - /** - * Set the active tab. - * @param {!PlaygroundTab} tab The new tab. - */ - const setActiveTab = (tab) => { - currentTab = tab; - currentGenerate = tab.generate; - const isXml = tab.state.name == 'XML'; - const isJson = tab.state.name == 'JSON'; - editor.setModel(currentTab.state.model); - editor.updateOptions({ - readOnly: !isXml && !isJson, - wordWrap: false, - }); - - // Update tab UI. - Object.values(tabs).forEach( - (t) => t.tabElement.style.background = - (t.tabElement == tab.tabElement) ? '#1E1E1E' : '#2D2D2D'); - // Update editor state. - editorXmlContextKey.set(isXml); - editorJsonContextKey.set(isJson); - playgroundState.set('activeTab', tab.state.name); - playgroundState.save(); + const tab = { + generate, + state, + tabElement, }; + return tab; + } + + /** + * Set the active tab. + * @param {!PlaygroundTab} tab The new tab. + */ + const setActiveTab = (tab) => { + currentTab = tab; + currentGenerate = tab.generate; + const isXml = tab.state.name == 'XML'; + const isJson = tab.state.name == 'JSON'; + editor.setModel(currentTab.state.model); + editor.updateOptions({ + readOnly: !isXml && !isJson, + wordWrap: false, + }); - /** - * Call the current generate method if we are in 'auto' mode. In - * addition, persist the current workspace xml regardless of which tab - * we are in. - */ - const updateEditor = () => { - if (playgroundState.get('autoGenerate')) { - if (initialWorkspaceJson && isFirstLoad) { - isFirstLoad = false; - try { - Blockly.serialization.workspaces.load( - JSON.parse(initialWorkspaceJson), workspace); - } catch (e) { - console.warn('Failed to auto import.', e); - } - } - - if (currentGenerate) { - currentGenerate(); - } - - let code = ''; + // Update tab UI. + Object.values(tabs).forEach( + (t) => + (t.tabElement.style.background = + t.tabElement == tab.tabElement ? '#1E1E1E' : '#2D2D2D'), + ); + // Update editor state. + editorXmlContextKey.set(isXml); + editorJsonContextKey.set(isJson); + playgroundState.set('activeTab', tab.state.name); + playgroundState.save(); + }; + + /** + * Call the current generate method if we are in 'auto' mode. In + * addition, persist the current workspace xml regardless of which tab + * we are in. + */ + const updateEditor = () => { + if (playgroundState.get('autoGenerate')) { + if (initialWorkspaceJson && isFirstLoad) { + isFirstLoad = false; try { - code = JSON.stringify( - Blockly.serialization.workspaces.save(workspace), null, 2); + Blockly.serialization.workspaces.load( + JSON.parse(initialWorkspaceJson), + workspace, + ); } catch (e) { - console.warn('Failed to auto save.', e); + console.warn('Failed to auto import.', e); } - playgroundState.set('workspaceJson', code); - playgroundState.save(); } - }; - - // Register default tabs. - const tabs = { - 'JSON': registerGenerator( - 'JSON', - 'json', - (ws) => { - return JSON.stringify( - Blockly.serialization.workspaces.save(ws), null, 2); - } - ), - 'XML': registerGenerator( - 'XML', - 'xml', - (ws) => { - return Blockly.Xml.domToPrettyText( - Blockly.Xml.workspaceToDom(ws)); - } - ), - 'JavaScript': registerGenerator( - 'JavaScript', - 'javascript', - (ws) => - (javascriptGenerator || Blockly.JavaScript).workspaceToCode(ws), - true), - 'Python': registerGenerator( - 'Python', - 'python', - (ws) => (pythonGenerator || Blockly.Python).workspaceToCode(ws), - true), - 'Dart': registerGenerator( - 'Dart', - 'dart', - (ws) => (dartGenerator || Blockly.Dart).workspaceToCode(ws), - true), - 'Lua': registerGenerator( - 'Lua', - 'lua', - (ws) => (luaGenerator || Blockly.Lua).workspaceToCode(ws), - true), - 'PHP': registerGenerator( - 'PHP', - 'php', - (ws) => (phpGenerator || Blockly.PHP).workspaceToCode(ws), - true), - }; - // Handle tab click. - tabsDiv.addEventListener('click', (e) => { - const target = /** @type {HTMLElement} */ (e.target); - const tabName = target.getAttribute('data-tab'); - if (!tabName) { - // Not a tab. - return; + if (currentGenerate) { + currentGenerate(); } - const tab = tabs[tabName]; - // Save current tab state (eg: scroll position). - currentTab.state.viewState = editor.saveViewState(); - - setActiveTab(tab); - updateEditor(); + let code = ''; + try { + code = JSON.stringify( + Blockly.serialization.workspaces.save(workspace), + null, + 2, + ); + } catch (e) { + console.warn('Failed to auto save.', e); + } + playgroundState.set('workspaceJson', code); + playgroundState.save(); + } + }; + + // Register default tabs. + const tabs = { + 'JSON': registerGenerator('JSON', 'json', (ws) => { + return JSON.stringify( + Blockly.serialization.workspaces.save(ws), + null, + 2, + ); + }), + 'XML': registerGenerator('XML', 'xml', (ws) => { + return Blockly.Xml.domToPrettyText(Blockly.Xml.workspaceToDom(ws)); + }), + 'JavaScript': registerGenerator( + 'JavaScript', + 'javascript', + (ws) => + (javascriptGenerator || Blockly.JavaScript).workspaceToCode(ws), + true, + ), + 'Python': registerGenerator( + 'Python', + 'python', + (ws) => (pythonGenerator || Blockly.Python).workspaceToCode(ws), + true, + ), + 'Dart': registerGenerator( + 'Dart', + 'dart', + (ws) => (dartGenerator || Blockly.Dart).workspaceToCode(ws), + true, + ), + 'Lua': registerGenerator( + 'Lua', + 'lua', + (ws) => (luaGenerator || Blockly.Lua).workspaceToCode(ws), + true, + ), + 'PHP': registerGenerator( + 'PHP', + 'php', + (ws) => (phpGenerator || Blockly.PHP).workspaceToCode(ws), + true, + ), + }; + + // Handle tab click. + tabsDiv.addEventListener('click', (e) => { + const target = /** @type {HTMLElement} */ (e.target); + const tabName = target.getAttribute('data-tab'); + if (!tabName) { + // Not a tab. + return; + } + const tab = tabs[tabName]; - // Restore tab state (eg: scroll position). - editor.restoreViewState(currentTab.state.viewState); - editor.focus(); - }); + // Save current tab state (eg: scroll position). + currentTab.state.viewState = editor.saveViewState(); + setActiveTab(tab); + updateEditor(); - // Initialized saved JSON and bind change listener. - const initialWorkspaceJson = playgroundState.get('workspaceJson') || ''; - const jsonTab = tabs['JSON']; - const jsonModel = jsonTab.state.model; - let isFirstLoad = true; - jsonModel.setValue(initialWorkspaceJson); - jsonModel.onDidChangeContent(() => { - playgroundState.set('workspaceJson', jsonModel.getValue()); - playgroundState.save(); - }); + // Restore tab state (eg: scroll position). + editor.restoreViewState(currentTab.state.viewState); + editor.focus(); + }); - // Set the initial tab as active. - const activeTab = playgroundState.get('activeTab'); - let currentTab = tabs[activeTab]; - let currentGenerate; - if (currentTab) { - setActiveTab(currentTab); - } + // Initialized saved JSON and bind change listener. + const initialWorkspaceJson = playgroundState.get('workspaceJson') || ''; + const jsonTab = tabs['JSON']; + const jsonModel = jsonTab.state.model; + let isFirstLoad = true; + jsonModel.setValue(initialWorkspaceJson); + jsonModel.onDidChangeContent(() => { + playgroundState.set('workspaceJson', jsonModel.getValue()); + playgroundState.save(); + }); - // Load the GUI controls. - const gui = addGUIControls((options) => { + // Set the initial tab as active. + const activeTab = playgroundState.get('activeTab'); + let currentTab = tabs[activeTab]; + let currentGenerate; + if (currentTab) { + setActiveTab(currentTab); + } + + // Load the GUI controls. + const gui = addGUIControls( + (options) => { workspace = createWorkspace(blocklyDiv, options); // Initialize the test toolbox. toolboxTestBlocksInit( - /** @type {!Blockly.WorkspaceSvg} */ (workspace)); + /** @type {!Blockly.WorkspaceSvg} */ (workspace), + ); // Add download screenshot option. const prevConfigureContextMenu = workspace.configureContextMenu; workspace.configureContextMenu = (menuOptions, e) => { prevConfigureContextMenu && - prevConfigureContextMenu.call(null, menuOptions, e); + prevConfigureContextMenu.call(null, menuOptions, e); const screenshotOption = { text: 'Download Screenshot', enabled: workspace.getTopBlocks().length, - callback: function() { + callback: function () { downloadWorkspaceScreenshot(workspace); }, }; @@ -363,132 +376,139 @@ export function createPlayground( } }); return workspace; - }, defaultOptions, { + }, + defaultOptions, + { disableResize: true, toolboxes: config.toolboxes || { 'categories': toolboxCategories, 'simple': toolboxSimple, 'test blocks': toolboxTestBlocks, }, - }); - - // Move the GUI Element to the gui container. - const guiElement = gui.domElement; - guiElement.removeChild(guiElement.firstChild); - guiElement.style.position = 'relative'; - guiElement.style.minWidth = '100%'; - guiContainer.appendChild(guiElement); - - // Click handler to toggle the playground. - const togglePlayground = (e) => { - const shouldOpen = playgroundDiv.style.display === 'none'; - if (shouldOpen) { - playgroundDiv.style.display = 'flex'; - minimizeButton.textContent = 'Collapse'; - } else { - playgroundDiv.style.display = 'none'; - minimizeButton.textContent = 'Expand'; - } - playgroundState.set('playgroundOpen', shouldOpen); - playgroundState.save(); - Blockly.svgResize(workspace); - }; - minimizeButton.addEventListener('click', togglePlayground); - - // Start minimized if the playground was previously closed. - if (playgroundState.get('playgroundOpen') === false) { - togglePlayground(); + }, + ); + + // Move the GUI Element to the gui container. + const guiElement = gui.domElement; + guiElement.removeChild(guiElement.firstChild); + guiElement.style.position = 'relative'; + guiElement.style.minWidth = '100%'; + guiContainer.appendChild(guiElement); + + // Click handler to toggle the playground. + const togglePlayground = (e) => { + const shouldOpen = playgroundDiv.style.display === 'none'; + if (shouldOpen) { + playgroundDiv.style.display = 'flex'; + minimizeButton.textContent = 'Collapse'; + } else { + playgroundDiv.style.display = 'none'; + minimizeButton.textContent = 'Expand'; } - - // Playground API. - - /** - * Get the current GUI controls. - * @returns {!dat.GUI} The GUI controls. - */ - const getGUI = function() { - return gui; - }; - - /** - * Get the current workspace. - * @returns {!Blockly.WorkspaceSvg} The Blockly workspace. - */ - const getWorkspace = function() { - return workspace; - }; - - /** - * Get the current tab. - * @returns {!PlaygroundTab} The current tab. - */ - const getCurrentTab = function() { - return currentTab; - }; - - /** - * Add a generator tab. - * @param {string} label The label of the generator tab. - * @param {Blockly.Generator} generator The Blockly generator. - * @param {string=} language Optional editor language, defaults to - * 'javascript'. - */ - const addGenerator = function(label, generator, language) { - if (!label || !generator) { - throw Error('usage: addGenerator(label, generator, language?);'); - } - tabs[label] = registerGenerator( - label, language || 'javascript', - (ws) => generator.workspaceToCode(ws), true); - if (activeTab === label) { - // Set the new generator as the current tab if it is currently - // active. This occurs when a dynamically added generator is active - // and the page is reloaded. - setActiveTab(tabs[label]); - } - }; - - /** - * Removes a generator tab. - * @param {string} label The label of the generator tab to remove. - */ - const removeGenerator = function(label) { - if (!label) { - throw Error('usage: removeGenerator(label);'); - } - if (!(label in tabs)) { - throw Error('removeGenerator called on invalid label: ' + label); - } - const tab = tabs[label]; - tabsDiv.removeChild(tab.tabElement); - delete tabs[label]; - const tabsKeys = Object.keys(tabs); - if (activeTab === label && tabsKeys.length) { - // Set the active tab to another tab if the active tab corresponded - // to a removed generator. - setActiveTab(tabs[tabsKeys[0]]); - } - }; - - const playground = { - state: playgroundState, - addAction: (/** @type {?} */ (gui)).addAction, - addCheckboxAction: (/** @type {?} */ (gui)).addCheckboxAction, - addGenerator, - getCurrentTab, - getGUI, - getWorkspace, - removeGenerator, - }; - - // Add tab buttons. - registerTabButtons(editor, playground, tabButtons, updateEditor); - - // Register editor commands. - registerEditorCommands(editor, playground); - - return playground; - }); + playgroundState.set('playgroundOpen', shouldOpen); + playgroundState.save(); + Blockly.svgResize(workspace); + }; + minimizeButton.addEventListener('click', togglePlayground); + + // Start minimized if the playground was previously closed. + if (playgroundState.get('playgroundOpen') === false) { + togglePlayground(); + } + + // Playground API. + + /** + * Get the current GUI controls. + * @returns {!dat.GUI} The GUI controls. + */ + const getGUI = function () { + return gui; + }; + + /** + * Get the current workspace. + * @returns {!Blockly.WorkspaceSvg} The Blockly workspace. + */ + const getWorkspace = function () { + return workspace; + }; + + /** + * Get the current tab. + * @returns {!PlaygroundTab} The current tab. + */ + const getCurrentTab = function () { + return currentTab; + }; + + /** + * Add a generator tab. + * @param {string} label The label of the generator tab. + * @param {Blockly.Generator} generator The Blockly generator. + * @param {string=} language Optional editor language, defaults to + * 'javascript'. + */ + const addGenerator = function (label, generator, language) { + if (!label || !generator) { + throw Error('usage: addGenerator(label, generator, language?);'); + } + tabs[label] = registerGenerator( + label, + language || 'javascript', + (ws) => generator.workspaceToCode(ws), + true, + ); + if (activeTab === label) { + // Set the new generator as the current tab if it is currently + // active. This occurs when a dynamically added generator is active + // and the page is reloaded. + setActiveTab(tabs[label]); + } + }; + + /** + * Removes a generator tab. + * @param {string} label The label of the generator tab to remove. + */ + const removeGenerator = function (label) { + if (!label) { + throw Error('usage: removeGenerator(label);'); + } + if (!(label in tabs)) { + throw Error('removeGenerator called on invalid label: ' + label); + } + const tab = tabs[label]; + tabsDiv.removeChild(tab.tabElement); + delete tabs[label]; + const tabsKeys = Object.keys(tabs); + if (activeTab === label && tabsKeys.length) { + // Set the active tab to another tab if the active tab corresponded + // to a removed generator. + setActiveTab(tabs[tabsKeys[0]]); + } + }; + + const playground = { + state: playgroundState, + addAction: /** @type {?} */ (gui).addAction, + addCheckboxAction: /** @type {?} */ (gui).addCheckboxAction, + addGenerator, + getCurrentTab, + getGUI, + getWorkspace, + removeGenerator, + }; + + // Add tab buttons. + registerTabButtons(editor, playground, tabButtons, updateEditor); + + // Register editor commands. + registerEditorCommands(editor, playground); + + return playground; + }, + ); } /** @@ -499,10 +519,12 @@ export function createPlayground( * @param {function():void} updateEditor Update Editor method. */ function registerTabButtons(editor, playground, tabButtons, updateEditor) { - const [autoGenerateCheckbox, autoGenerateLabel] = - renderCheckbox('autoGenerate', 'Auto'); + const [autoGenerateCheckbox, autoGenerateLabel] = renderCheckbox( + 'autoGenerate', + 'Auto', + ); /** @type {HTMLInputElement} */ (autoGenerateCheckbox).checked = - playground.state.get('autoGenerate'); + playground.state.get('autoGenerate'); autoGenerateCheckbox.addEventListener('change', (e) => { const inputTarget = /** @type {HTMLInputElement} */ (e.target); playground.state.set('autoGenerate', !!inputTarget.checked); @@ -550,9 +572,7 @@ function registerEditorCommands(editor, playground) { editor.addAction({ id: 'import-xml', label: 'Import from XML', - keybindings: [ - window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.Enter, - ], + keybindings: [window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.Enter], precondition: 'isEditorXml', contextMenuGroupId: 'playground', contextMenuOrder: 0, @@ -562,9 +582,7 @@ function registerEditorCommands(editor, playground) { editor.addAction({ id: 'export-xml', label: 'Export to XML', - keybindings: [ - window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.KEY_S, - ], + keybindings: [window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.KEY_S], precondition: 'isEditorXml', contextMenuGroupId: 'playground', contextMenuOrder: 1, @@ -579,9 +597,12 @@ function registerEditorCommands(editor, playground) { contextMenuOrder: 2, run: () => { const model = editor.getModel(); - const text = model.getValue().replace(/ (x|y|id)="[^"]*"/gmi, ''); + const text = model.getValue().replace(/ (x|y|id)="[^"]*"/gim, ''); model.pushEditOperations( - [], [{range: model.getFullModelRange(), text}], () => null); + [], + [{range: model.getFullModelRange(), text}], + () => null, + ); editor.setSelection(new window.monaco.Range(0, 0, 0, 0)); }, }); @@ -589,9 +610,7 @@ function registerEditorCommands(editor, playground) { editor.addAction({ id: 'import-json', label: 'Import from JSON', - keybindings: [ - window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.Enter, - ], + keybindings: [window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.Enter], precondition: 'isEditorJson', contextMenuGroupId: 'playground', contextMenuOrder: 0, @@ -601,9 +620,7 @@ function registerEditorCommands(editor, playground) { editor.addAction({ id: 'generate', label: 'Generate', - keybindings: [ - window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.KEY_S, - ], + keybindings: [window.monaco.KeyMod.CtrlCmd | window.monaco.KeyCode.KEY_S], precondition: '!isEditorXml', contextMenuGroupId: 'playground', contextMenuOrder: 1, diff --git a/plugins/dev-tools/src/playground/monaco.js b/plugins/dev-tools/src/playground/monaco.js index 880d493a2b..a3315e3488 100644 --- a/plugins/dev-tools/src/playground/monaco.js +++ b/plugins/dev-tools/src/playground/monaco.js @@ -1,4 +1,3 @@ - // Declare external types to make eslint happy. /* global monaco */ diff --git a/plugins/dev-tools/src/playground/options.js b/plugins/dev-tools/src/playground/options.js index 170a376baa..17e27b0e9e 100644 --- a/plugins/dev-tools/src/playground/options.js +++ b/plugins/dev-tools/src/playground/options.js @@ -29,7 +29,6 @@ import highContrastTheme from '@blockly/theme-highcontrast'; const assign = require('lodash.assign'); const merge = require('lodash.merge'); - /** * @typedef {Blockly.utils.toolbox.ToolboxDefinition} BlocklyToolbox */ @@ -61,20 +60,23 @@ export function addGUIControls(genWorkspace, defaultOptions, config = {}) { config.toolboxes || { 'categories': toolboxCategories, 'simple': toolboxSimple, - }); + } + ); const defaultToolboxName = initDefaultToolbox(defaultOptions, toolboxes); guiState.toolboxName = guiState.toolboxName || defaultToolboxName; guiState.options.toolbox = toolboxes[guiState.toolboxName]; // Initialize themes. const themes = getThemes(defaultOptions); - const defaultThemeName = defaultOptions.theme ? - /** @type {!Blockly.Theme} */ (defaultOptions.theme).name : 'classic'; + const defaultThemeName = defaultOptions.theme + ? /** @type {!Blockly.Theme} */ (defaultOptions.theme).name + : 'classic'; guiState.themeName = guiState.themeName || defaultThemeName; guiState.options.theme = themes[guiState.themeName]; - const defaultRendererName = defaultOptions.renderer ? - defaultOptions.renderer : 'geras'; + const defaultRendererName = defaultOptions.renderer + ? defaultOptions.renderer + : 'geras'; guiState.renderer = guiState.renderer || defaultRendererName; guiState.debugEnabled = guiState.debugEnabled || false; @@ -123,8 +125,9 @@ export function addGUIControls(genWorkspace, defaultOptions, config = {}) { onResize(); } - const container = - /** @type {!HTMLElement} */ (workspace.getInjectionDiv().parentNode); + const container = /** @type {!HTMLElement} */ ( + workspace.getInjectionDiv().parentNode + ); container.style.position = 'relative'; container.appendChild(guiElement); @@ -178,37 +181,60 @@ export function addGUIControls(genWorkspace, defaultOptions, config = {}) { }; gui.add( - { - 'Reset': reset, - }, - 'Reset'); + { + 'Reset': reset, + }, + 'Reset', + ); // Options folder. const optionsFolder = gui.addFolder('Options'); setTooltip( - optionsFolder, 'Options that affect the appearance of the workspace.'); - openFolderIfOptionSelected( - optionsFolder, guiState, guiState.options, - ['rtl', 'renderer', 'toolboxPosition', 'horizontalLayout']); + optionsFolder, + 'Options that affect the appearance of the workspace.', + ); + openFolderIfOptionSelected(optionsFolder, guiState, guiState.options, [ + 'rtl', + 'renderer', + 'toolboxPosition', + 'horizontalLayout', + ]); setTooltip( - optionsFolder.add(options, 'RTL') - .name('rtl') - .onChange((value) => onChange('rtl', value)), - 'If true, mirror the editor (for Arabic or Hebrew locales).'); + optionsFolder + .add(options, 'RTL') + .name('rtl') + .onChange((value) => onChange('rtl', value)), + 'If true, mirror the editor (for Arabic or Hebrew locales).', + ); // Renderer. populateRendererOption(optionsFolder, guiState, onChange); // Theme. populateThemeOption( - optionsFolder, guiState, themes, defaultThemeName, onChange); + optionsFolder, + guiState, + themes, + defaultThemeName, + onChange, + ); // Toolbox. populateToolboxOption( - optionsFolder, guiState, toolboxes, defaultToolboxName, onChange); + optionsFolder, + guiState, + toolboxes, + defaultToolboxName, + onChange, + ); populateToolboxSidesOption( - optionsFolder, options, saveOptions, guiState, onChangeInternal); + optionsFolder, + options, + saveOptions, + guiState, + onChangeInternal, + ); // Basic options. const basicFolder = optionsFolder.addFolder('Basic'); @@ -296,28 +322,33 @@ export function addGUIControls(genWorkspace, defaultOptions, config = {}) { * @param {string=} tooltip Optional tooltip to set. * @returns {dat.GUIController} The GUI controller. */ - const addCheckboxAction = - (name, callback, folderName, defaultValue, tooltip) => { - actions[name] = !!defaultValue; - let folder = actionsFolder; - if (folderName) { - if (actionSubFolders[folderName]) { - folder = actionSubFolders[folderName]; - } else { - folder = actionsFolder.addFolder(folderName); - folder.open(); - actionSubFolders[folderName] = folder; - } - } - const controller = folder.add(actions, name); - tooltip && setTooltip(controller, tooltip); - name && controller.name(name); - controller.listen().onFinishChange((value) => { - callback(workspace, value); - }); + const addCheckboxAction = ( + name, + callback, + folderName, + defaultValue, + tooltip, + ) => { + actions[name] = !!defaultValue; + let folder = actionsFolder; + if (folderName) { + if (actionSubFolders[folderName]) { + folder = actionSubFolders[folderName]; + } else { + folder = actionsFolder.addFolder(folderName); + folder.open(); + actionSubFolders[folderName] = folder; + } + } + const controller = folder.add(actions, name); + tooltip && setTooltip(controller, tooltip); + name && controller.name(name); + controller.listen().onFinishChange((value) => { + callback(workspace, value); + }); - return controller; - }; + return controller; + }; const devGui = /** @type {?} */ (gui); devGui.addCheckboxAction = addCheckboxAction; @@ -371,8 +402,8 @@ function saveGUIState(guiState, defaultToolboxName, defaultThemeName) { function loadGUIState() { const defaultState = {options: {}, debug: {}, debugEnabled: false}; const guiStateKey = `guiState_${id}`; - const guiState = JSON.parse(localStorage.getItem(guiStateKey)) || - defaultState; + const guiState = + JSON.parse(localStorage.getItem(guiStateKey)) || defaultState; if (window.location.hash) { HashState.parse(window.location.hash, guiState.options); } @@ -434,8 +465,9 @@ function openFolderIfOptionSelected(folder, guiState, mainObj, options) { */ function initDefaultToolbox(defaultOptions, toolboxes) { const defaultToolbox = defaultOptions.toolbox; - const isDefaultInToolboxes = - Object.keys(toolboxes).filter((k) => toolboxes[k] == defaultToolbox); + const isDefaultInToolboxes = Object.keys(toolboxes).filter( + (k) => toolboxes[k] == defaultToolbox, + ); if (defaultToolbox && !isDefaultInToolboxes.length) { // Default toolbox not in the toolbox list. Add a "default" option. toolboxes['default'] = defaultToolbox; @@ -458,36 +490,53 @@ function initDefaultToolbox(defaultOptions, toolboxes) { */ function populateBasicOptions(basicFolder, options, guiState, onChange) { setTooltip( - basicFolder.add(options, 'readOnly') - .onChange((value) => onChange('readOnly', value)), - 'If true, prevent the user from editing. Suppresses the toolbox and' + - ' trashcan.'); + basicFolder + .add(options, 'readOnly') + .onChange((value) => onChange('readOnly', value)), + 'If true, prevent the user from editing. Suppresses the toolbox and' + + ' trashcan.', + ); setTooltip( - basicFolder.add(options, 'hasTrashcan') - .name('trashCan') - .onChange((value) => onChange('trashcan', value)), - 'Displays or hides the trashcan.'); + basicFolder + .add(options, 'hasTrashcan') + .name('trashCan') + .onChange((value) => onChange('trashcan', value)), + 'Displays or hides the trashcan.', + ); setTooltip( - basicFolder.add(options, 'hasSounds') - .name('sounds') - .onChange((value) => onChange('sounds', value)), - `If false, don't play sounds (e.g. click and delete).`); + basicFolder + .add(options, 'hasSounds') + .name('sounds') + .onChange((value) => onChange('sounds', value)), + `If false, don't play sounds (e.g. click and delete).`, + ); setTooltip( - basicFolder.add(options, 'disable') - .onChange((value) => onChange('disable', value)), - 'Allows blocks to be disabled. '); + basicFolder + .add(options, 'disable') + .onChange((value) => onChange('disable', value)), + 'Allows blocks to be disabled. ', + ); setTooltip( - basicFolder.add(options, 'collapse') - .onChange((value) => onChange('collapse', value)), - 'Allows blocks to be collapsed or expanded.'); + basicFolder + .add(options, 'collapse') + .onChange((value) => onChange('collapse', value)), + 'Allows blocks to be collapsed or expanded.', + ); setTooltip( - basicFolder.add(options, 'comments') - .onChange((value) => onChange('comments', value)), - 'Allows blocks to have comments.'); - - openFolderIfOptionSelected( - basicFolder, guiState, guiState.options, - ['readOnly', 'trashcan', 'sounds', 'disable', 'collapse', 'comments']); + basicFolder + .add(options, 'comments') + .onChange((value) => onChange('comments', value)), + 'Allows blocks to have comments.', + ); + + openFolderIfOptionSelected(basicFolder, guiState, guiState.options, [ + 'readOnly', + 'trashcan', + 'sounds', + 'disable', + 'collapse', + 'comments', + ]); } /** @@ -500,19 +549,20 @@ function populateRendererOption(folder, guiState, onChange) { // Get the list of renderers. Previous versions of Blockly used the // rendererMap_, whereas newer versions that use the global registry get their // list of renderers from somewhere else. - const renderers = Blockly.blockRendering.rendererMap_ || - (Blockly.registry && Blockly.registry.getAllItems('renderer')); - const publicRenderers = Object.keys(renderers) - .filter((name) => name !== debugRendererName.toLowerCase()); + const renderers = + Blockly.blockRendering.rendererMap_ || + (Blockly.registry && Blockly.registry.getAllItems('renderer')); + const publicRenderers = Object.keys(renderers).filter( + (name) => name !== debugRendererName.toLowerCase(), + ); setTooltip( - folder.add(guiState, 'renderer', publicRenderers) - .onChange((value) => { - guiState.renderer = value; - registerDebugRendererFromName(value); - onChange('renderer', - guiState.debugEnabled ? debugRendererName : value); - }), - 'The renderer used by Blockly.'); + folder.add(guiState, 'renderer', publicRenderers).onChange((value) => { + guiState.renderer = value; + registerDebugRendererFromName(value); + onChange('renderer', guiState.debugEnabled ? debugRendererName : value); + }), + 'The renderer used by Blockly.', + ); } /** @@ -525,16 +575,23 @@ function populateRendererOption(folder, guiState, onChange) { * @param {function(string, *):void} onChange On Change method. */ function populateToolboxOption( - folder, guiState, toolboxes, defaultToolboxName, onChange) { + folder, + guiState, + toolboxes, + defaultToolboxName, + onChange, +) { setTooltip( - folder.add(guiState, 'toolboxName') - .options(Object.keys(toolboxes)) - .name('toolbox') - .onChange((value) => { - guiState.toolboxName = value; - onChange('toolbox', toolboxes[value]); - }), - 'The toolbox used by Blockly.'); + folder + .add(guiState, 'toolboxName') + .options(Object.keys(toolboxes)) + .name('toolbox') + .onChange((value) => { + guiState.toolboxName = value; + onChange('toolbox', toolboxes[value]); + }), + 'The toolbox used by Blockly.', + ); if (guiState.toolboxName !== defaultToolboxName) { openFolderIfOptionSelected(folder, guiState, guiState.options, ['toolbox']); } @@ -549,24 +606,30 @@ function populateToolboxOption( * @param {function():void} onChangeInternal Internal on change method. */ function populateToolboxSidesOption( - folder, options, saveOptions, guiState, onChangeInternal) { + folder, + options, + saveOptions, + guiState, + onChangeInternal, +) { const toolboxSides = {top: 0, bottom: 1, left: 2, right: 3}; setTooltip( - folder.add(options, 'toolboxPosition', toolboxSides) - .name('toolboxPosition') - .onChange((value) => { - const side = Object.keys(toolboxSides) - .find((key) => toolboxSides[key] == value); - saveOptions['horizontalLayout'] = side == 'top' || side == 'bottom'; - saveOptions['toolboxPosition'] = - side == 'top' || side == 'left' ? 'start' : 'end'; - guiState.options['toolboxPosition'] = - saveOptions['toolboxPosition']; - guiState.options['horizontalLayout'] = - saveOptions['horizontalLayout']; - onChangeInternal(); - }), - 'The toolbox position.'); + folder + .add(options, 'toolboxPosition', toolboxSides) + .name('toolboxPosition') + .onChange((value) => { + const side = Object.keys(toolboxSides).find( + (key) => toolboxSides[key] == value, + ); + saveOptions['horizontalLayout'] = side == 'top' || side == 'bottom'; + saveOptions['toolboxPosition'] = + side == 'top' || side == 'left' ? 'start' : 'end'; + guiState.options['toolboxPosition'] = saveOptions['toolboxPosition']; + guiState.options['horizontalLayout'] = saveOptions['horizontalLayout']; + onChangeInternal(); + }), + 'The toolbox position.', + ); } /** @@ -589,8 +652,8 @@ function getThemes(defaultOptions) { 'highcontrast': highContrastTheme, }; if (defaultOptions.theme) { - themes[(/** @type {!Blockly.Theme} */ (defaultOptions.theme)).name] = - defaultOptions.theme; + themes[/** @type {!Blockly.Theme} */ (defaultOptions.theme).name] = + defaultOptions.theme; } } return themes; @@ -606,16 +669,23 @@ function getThemes(defaultOptions) { * @param {function(string, *):void} onChange On Change method. */ function populateThemeOption( - folder, guiState, themes, defaultThemeName, onChange) { + folder, + guiState, + themes, + defaultThemeName, + onChange, +) { setTooltip( - folder.add(guiState, 'themeName') - .options(Object.keys(themes)) - .name('theme') - .onChange((value) => { - guiState.themeName = value; - onChange('theme', themes[value]); - }), - 'The theme used by Blockly.'); + folder + .add(guiState, 'themeName') + .options(Object.keys(themes)) + .name('theme') + .onChange((value) => { + guiState.themeName = value; + onChange('theme', themes[value]); + }), + 'The theme used by Blockly.', + ); if (guiState.themeName !== defaultThemeName) { openFolderIfOptionSelected(folder, guiState, guiState.options, ['theme']); } @@ -630,26 +700,32 @@ function populateThemeOption( */ function populateMoveOptions(moveFolder, options, saveOptions, onChange) { setTooltip( - moveFolder.add(options.moveOptions, 'scrollbars') - .onChange((value) => onChange('move', { - ...saveOptions.move, - scrollbars: value, - })), - 'True if the workspace has scrollbars.'); + moveFolder.add(options.moveOptions, 'scrollbars').onChange((value) => + onChange('move', { + ...saveOptions.move, + scrollbars: value, + }), + ), + 'True if the workspace has scrollbars.', + ); setTooltip( - moveFolder.add(options.moveOptions, 'wheel') - .onChange((value) => onChange('move', { - ...saveOptions.move, - wheel: value, - })), - 'True if the workspace can be scrolled with the mouse wheel.'); + moveFolder.add(options.moveOptions, 'wheel').onChange((value) => + onChange('move', { + ...saveOptions.move, + wheel: value, + }), + ), + 'True if the workspace can be scrolled with the mouse wheel.', + ); setTooltip( - moveFolder.add(options.moveOptions, 'drag') - .onChange((value) => onChange('move', { - ...saveOptions.move, - drag: value, - })), - 'True if the workspace can be dragged with the mouse.'); + moveFolder.add(options.moveOptions, 'drag').onChange((value) => + onChange('move', { + ...saveOptions.move, + drag: value, + }), + ), + 'True if the workspace can be dragged with the mouse.', + ); } /** @@ -661,44 +737,60 @@ function populateMoveOptions(moveFolder, options, saveOptions, onChange) { */ function populateZoomOptions(zoomFolder, options, saveOptions, onChange) { setTooltip( - zoomFolder.add(options.zoomOptions, 'controls') - .onChange((value) => onChange('zoom', { - ...saveOptions.zoom, - controls: value, - })), - 'Set to true to show zoom-centre, zoom-in, and zoom-out buttons.'); + zoomFolder.add(options.zoomOptions, 'controls').onChange((value) => + onChange('zoom', { + ...saveOptions.zoom, + controls: value, + }), + ), + 'Set to true to show zoom-centre, zoom-in, and zoom-out buttons.', + ); setTooltip( - zoomFolder.add(options.zoomOptions, 'wheel') - .onChange((value) => onChange('zoom', { - ...saveOptions.zoom, - wheel: value, - })), - 'Set to true to allow the mouse wheel to zoom.'); + zoomFolder.add(options.zoomOptions, 'wheel').onChange((value) => + onChange('zoom', { + ...saveOptions.zoom, + wheel: value, + }), + ), + 'Set to true to allow the mouse wheel to zoom.', + ); setTooltip( - zoomFolder.add(options.zoomOptions, 'startScale', 0.1, 4) - .onChange((value) => onChange('zoom', { - ...saveOptions.zoom, - startScale: value, - })), - 'Initial magnification factor. For applications with multiple levels,' + + zoomFolder + .add(options.zoomOptions, 'startScale', 0.1, 4) + .onChange((value) => + onChange('zoom', { + ...saveOptions.zoom, + startScale: value, + }), + ), + 'Initial magnification factor. For applications with multiple levels,' + ' startScale is often set to a higher value on the first level, then' + - ' incrementally decreased as subsequent levels become more complex.'); + ' incrementally decreased as subsequent levels become more complex.', + ); setTooltip( - zoomFolder.add(options.zoomOptions, 'maxScale', 1, 20) - .onChange((value) => onChange('zoom', { - ...saveOptions.zoom, - maxScale: value, - })) - .step(1), - 'Maximum multiplication factor for how far one can zoom in.'); + zoomFolder + .add(options.zoomOptions, 'maxScale', 1, 20) + .onChange((value) => + onChange('zoom', { + ...saveOptions.zoom, + maxScale: value, + }), + ) + .step(1), + 'Maximum multiplication factor for how far one can zoom in.', + ); setTooltip( - zoomFolder.add(options.zoomOptions, 'minScale', 0.1, 1) - .onChange((value) => onChange('zoom', { - ...saveOptions.zoom, - minScale: value, - })) - .step(0.05), - 'Minimum multiplication factor for how far one can zoom out.'); + zoomFolder + .add(options.zoomOptions, 'minScale', 0.1, 1) + .onChange((value) => + onChange('zoom', { + ...saveOptions.zoom, + minScale: value, + }), + ) + .step(0.05), + 'Minimum multiplication factor for how far one can zoom out.', + ); } /** @@ -710,37 +802,45 @@ function populateZoomOptions(zoomFolder, options, saveOptions, onChange) { */ function populateGridOptions(gridFolder, options, saveOptions, onChange) { setTooltip( - gridFolder.add(options.gridOptions, 'spacing', 0, 50) - .onChange((value) => onChange('grid', { - ...saveOptions.grid, - spacing: value, - })), - `The distance between the grid's points.`); + gridFolder.add(options.gridOptions, 'spacing', 0, 50).onChange((value) => + onChange('grid', { + ...saveOptions.grid, + spacing: value, + }), + ), + `The distance between the grid's points.`, + ); setTooltip( - gridFolder.add(options.gridOptions, 'length', 0, 30) - .onChange((value) => onChange('grid', { - ...saveOptions.grid, - length: value, - })), - 'The shape of the grid points. A length of 0 results in an invisible' + + gridFolder.add(options.gridOptions, 'length', 0, 30).onChange((value) => + onChange('grid', { + ...saveOptions.grid, + length: value, + }), + ), + 'The shape of the grid points. A length of 0 results in an invisible' + ' grid (but still one that may be snapped to), a length of 1 (the' + ' default value) results in dots, a longer length results in crosses, ' + - 'and a length equal or greater than the spacing results in graph paper.'); + 'and a length equal or greater than the spacing results in graph paper.', + ); setTooltip( - gridFolder.addColor(options.gridOptions, 'colour') - .onChange((value) => onChange('grid', { - ...saveOptions.grid, - colour: value, - })), - 'The colour of the grid points.'); + gridFolder.addColor(options.gridOptions, 'colour').onChange((value) => + onChange('grid', { + ...saveOptions.grid, + colour: value, + }), + ), + 'The colour of the grid points.', + ); setTooltip( - gridFolder.add(options.gridOptions, 'snap') - .onChange((value) => onChange('grid', { - ...saveOptions.grid, - snap: value, - })), - 'Whether blocks should snap to the nearest grid point when placed on' + - ' the workspace.'); + gridFolder.add(options.gridOptions, 'snap').onChange((value) => + onChange('grid', { + ...saveOptions.grid, + snap: value, + }), + ), + 'Whether blocks should snap to the nearest grid point when placed on' + + ' the workspace.', + ); } /** @@ -784,7 +884,11 @@ function initDebugRenderer(guiState, reset) { * @param {function(string, *):void} onChange On Change method. */ function populateDebugFolder( - debugController, debugOptionsFolder, guiState, onChange) { + debugController, + debugOptionsFolder, + guiState, + onChange, +) { updateDebugFolder(debugOptionsFolder, guiState.debugEnabled); debugController.onChange((value) => { @@ -818,7 +922,10 @@ function updateDebugFolder(folder, isEnabled) { * @param {function():void} onChangeInternal Internal on change method. */ function populateDebugOptionsFolder( - debugOptionsFolder, guiState, onChangeInternal) { + debugOptionsFolder, + guiState, + onChangeInternal, +) { const debugState = guiState.debug; Object.keys(DebugDrawer.config).map((key) => { debugOptionsFolder.add(debugState, key, 0, 50).onChange((value) => { @@ -836,98 +943,166 @@ function populateDebugOptionsFolder( */ function addActions(gui, workspace) { // Visibility actions. - gui.addAction('Show', (workspace) => { - workspace.setVisible(true); - }, 'Visibility', 'Show the workspace.'); - gui.addAction('Hide', (workspace) => { - workspace.setVisible(false); - }, 'Visibility', 'Hide the workspace.'); + gui.addAction( + 'Show', + (workspace) => { + workspace.setVisible(true); + }, + 'Visibility', + 'Show the workspace.', + ); + gui.addAction( + 'Hide', + (workspace) => { + workspace.setVisible(false); + }, + 'Visibility', + 'Hide the workspace.', + ); // Block actions. - gui.addAction('Clear', (workspace) => { - workspace.clear(); - }, 'Blocks', 'Clear all the blocks from the workspace.'); - gui.addAction('Format', (workspace) => { - workspace.cleanUp(); - }, 'Blocks', 'Format the blocks on the workspace.'); + gui.addAction( + 'Clear', + (workspace) => { + workspace.clear(); + }, + 'Blocks', + 'Clear all the blocks from the workspace.', + ); + gui.addAction( + 'Format', + (workspace) => { + workspace.cleanUp(); + }, + 'Blocks', + 'Format the blocks on the workspace.', + ); // Undo/Redo actions. - gui.addAction('Undo', (workspace) => { - workspace.undo(); - }, 'Undo/Redo', 'Undo last action.'); - gui.addAction('Redo', (workspace) => { - workspace.undo(true); - }, 'Undo/Redo', 'Redo last action.'); - gui.addAction('Clear Undo Stack', (workspace) => { - workspace.clearUndo(); - }, 'Undo/Redo', 'Clear the undo stack.'); + gui.addAction( + 'Undo', + (workspace) => { + workspace.undo(); + }, + 'Undo/Redo', + 'Undo last action.', + ); + gui.addAction( + 'Redo', + (workspace) => { + workspace.undo(true); + }, + 'Undo/Redo', + 'Redo last action.', + ); + gui.addAction( + 'Clear Undo Stack', + (workspace) => { + workspace.clearUndo(); + }, + 'Undo/Redo', + 'Clear the undo stack.', + ); // Scale actions. - gui.addAction('Zoom reset', (workspace) => { - workspace.setScale(workspace.options.zoomOptions.startScale); - workspace.scrollCenter(); - }, 'Scale', 'Reset zoom.'); - gui.addAction('Zoom center', (workspace) => { - workspace.scrollCenter(); - }, 'Scale', 'Center the workspace.'); - gui.addAction('Zoom to Fit', (workspace) => { - workspace.zoomToFit(); - }, 'Scale', 'Zoom the blocks to fit in the workspace if possible.'); + gui.addAction( + 'Zoom reset', + (workspace) => { + workspace.setScale(workspace.options.zoomOptions.startScale); + workspace.scrollCenter(); + }, + 'Scale', + 'Reset zoom.', + ); + gui.addAction( + 'Zoom center', + (workspace) => { + workspace.scrollCenter(); + }, + 'Scale', + 'Center the workspace.', + ); + gui.addAction( + 'Zoom to Fit', + (workspace) => { + workspace.zoomToFit(); + }, + 'Scale', + 'Zoom the blocks to fit in the workspace if possible.', + ); // Stress Test. gui.addAction( - 'Random Blocks', - (workspace) => { - populateRandom(workspace, 100); - }, - 'Stress Test', - 'Populate the workspace with a random set of blocks, for testing.'); + 'Random Blocks', + (workspace) => { + populateRandom(workspace, 100); + }, + 'Stress Test', + 'Populate the workspace with a random set of blocks, for testing.', + ); gui.addAction( - 'Spaghetti!', - (workspace) => { - spaghetti(workspace, 8); - }, - 'Stress Test', - 'Populate the workspace with nested if-statement blocks, for testing.'); + 'Spaghetti!', + (workspace) => { + spaghetti(workspace, 8); + }, + 'Stress Test', + 'Populate the workspace with nested if-statement blocks, for testing.', + ); // Logging. - gui.addCheckboxAction('Log Events', function(workspace, value) { - if (value) { - enableLogger(workspace); - } else { - disableLogger(workspace); - } - }, 'Logging', false, 'Toggle console logging of workspace events.'); - gui.addCheckboxAction('Log Flyout Events', function(workspace, value) { - if (value) { - if (workspace.getFlyout()) { - enableLogger(workspace.getFlyout().getWorkspace()); + gui.addCheckboxAction( + 'Log Events', + function (workspace, value) { + if (value) { + enableLogger(workspace); + } else { + disableLogger(workspace); } - } else { - if (workspace.getFlyout()) { - disableLogger(workspace.getFlyout().getWorkspace()); + }, + 'Logging', + false, + 'Toggle console logging of workspace events.', + ); + gui.addCheckboxAction( + 'Log Flyout Events', + function (workspace, value) { + if (value) { + if (workspace.getFlyout()) { + enableLogger(workspace.getFlyout().getWorkspace()); + } + } else { + if (workspace.getFlyout()) { + disableLogger(workspace.getFlyout().getWorkspace()); + } } - } - }, 'Logging', false, 'Toggle console logging of flyout events.'); + }, + 'Logging', + false, + 'Toggle console logging of flyout events.', + ); // Accessibility actions. gui.addCheckboxAction( - 'Keyboard Nav', - (_workspace, value) => { - if (value) { - Blockly.navigation.enableKeyboardAccessibility(); - } else { - Blockly.navigation.disableKeyboardAccessibility(); - } - }, - 'Accessibility', workspace.keyboardAccessibilityMode, - 'Toggle keyboard accessibility mode'); + 'Keyboard Nav', + (_workspace, value) => { + if (value) { + Blockly.navigation.enableKeyboardAccessibility(); + } else { + Blockly.navigation.disableKeyboardAccessibility(); + } + }, + 'Accessibility', + workspace.keyboardAccessibilityMode, + 'Toggle keyboard accessibility mode', + ); gui.addCheckboxAction( - 'Navigate All', - (_workspace, value) => { - Blockly.ASTNode.NAVIGATE_ALL_FIELDS = value; - }, - 'Accessibility', Blockly.ASTNode.NAVIGATE_ALL_FIELDS, - 'Toggle navigating to all fields. False to only navigate to clickable' + - ' fields.'); + 'Navigate All', + (_workspace, value) => { + Blockly.ASTNode.NAVIGATE_ALL_FIELDS = value; + }, + 'Accessibility', + Blockly.ASTNode.NAVIGATE_ALL_FIELDS, + 'Toggle navigating to all fields. False to only navigate to clickable' + + ' fields.', + ); } diff --git a/plugins/dev-tools/src/playground/state.js b/plugins/dev-tools/src/playground/state.js index 60fbf6b72d..f003c5f4f9 100644 --- a/plugins/dev-tools/src/playground/state.js +++ b/plugins/dev-tools/src/playground/state.js @@ -43,7 +43,7 @@ export class LocalStorageState { */ load() { this.state_ = - JSON.parse(localStorage.getItem(this.key_)) || this.defaultState_; + JSON.parse(localStorage.getItem(this.key_)) || this.defaultState_; } /** diff --git a/plugins/dev-tools/src/playground/ui.js b/plugins/dev-tools/src/playground/ui.js index 4b1ee933e1..9e24f665f1 100644 --- a/plugins/dev-tools/src/playground/ui.js +++ b/plugins/dev-tools/src/playground/ui.js @@ -9,7 +9,6 @@ * @author samelh@google.com (Sam El-Husseini) */ - /** * Render the playground layout. * @param {HTMLElement} container The container to render the playground in. @@ -57,7 +56,6 @@ export function renderPlayground(container) { minimizeButton.textContent = 'Collapse'; container.appendChild(minimizeButton); - const playgroundDiv = document.createElement('div'); playgroundDiv.style.flex = '1 1 1'; playgroundDiv.style.maxWidth = '40vw'; diff --git a/plugins/dev-tools/src/populateRandom.js b/plugins/dev-tools/src/populateRandom.js index ab2e9a3dc7..b98c6a8b35 100644 --- a/plugins/dev-tools/src/populateRandom.js +++ b/plugins/dev-tools/src/populateRandom.js @@ -18,8 +18,10 @@ import Blockly from 'blockly/core'; export function populateRandom(workspace, count) { const names = []; for (const blockName in Blockly.Blocks) { - if (Object.prototype.hasOwnProperty.call(Blockly.Blocks, blockName) && - Object.prototype.hasOwnProperty.call(Blockly.Blocks[blockName], 'init')) { + if ( + Object.prototype.hasOwnProperty.call(Blockly.Blocks, blockName) && + Object.prototype.hasOwnProperty.call(Blockly.Blocks[blockName], 'init') + ) { names.push(blockName); } } @@ -28,9 +30,16 @@ export function populateRandom(workspace, count) { const name = names[Math.floor(Math.random() * names.length)]; const block = workspace.newBlock(name); block.initSvg(); - block.getSvgRoot().setAttribute('transform', 'translate(' + - Math.round(Math.random() * 450 + 40) + ', ' + - Math.round(Math.random() * 600 + 40) + ')'); + block + .getSvgRoot() + .setAttribute( + 'transform', + 'translate(' + + Math.round(Math.random() * 450 + 40) + + ', ' + + Math.round(Math.random() * 600 + 40) + + ')', + ); block.render(); } } diff --git a/plugins/dev-tools/src/screenshot.js b/plugins/dev-tools/src/screenshot.js index 7e278fe5d1..c752c1914d 100644 --- a/plugins/dev-tools/src/screenshot.js +++ b/plugins/dev-tools/src/screenshot.js @@ -25,9 +25,18 @@ function svgToPng_(data, width, height, callback) { const pixelDensity = 10; canvas.width = width * pixelDensity; canvas.height = height * pixelDensity; - img.onload = function() { + img.onload = function () { context.drawImage( - img, 0, 0, width, height, 0, 0, canvas.width, canvas.height); + img, + 0, + 0, + width, + height, + 0, + 0, + canvas.width, + canvas.height, + ); try { const dataUri = canvas.toDataURL('image/png'); callback(dataUri); @@ -65,28 +74,35 @@ function workspaceToSvg_(workspace, callback, customCss) { const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); svg.appendChild(clone); - svg.setAttribute('viewBox', - x + ' ' + y + ' ' + width + ' ' + height); + svg.setAttribute('viewBox', x + ' ' + y + ' ' + width + ' ' + height); - svg.setAttribute('class', 'blocklySvg ' + - (workspace.options.renderer || 'geras') + '-renderer ' + - (workspace.getTheme ? workspace.getTheme().name + '-theme' : '')); + svg.setAttribute( + 'class', + 'blocklySvg ' + + (workspace.options.renderer || 'geras') + + '-renderer ' + + (workspace.getTheme ? workspace.getTheme().name + '-theme' : ''), + ); svg.setAttribute('width', width); svg.setAttribute('height', height); svg.setAttribute('style', 'background-color: transparent'); - const css = [].slice.call(document.head.querySelectorAll('style')) - .filter(function(el) { - return /\.blocklySvg/.test(el.innerText) || - (el.id.indexOf('blockly-') === 0); - }).map(function(el) { - return el.innerText; - }).join('\n'); + const css = [].slice + .call(document.head.querySelectorAll('style')) + .filter(function (el) { + return ( + /\.blocklySvg/.test(el.innerText) || el.id.indexOf('blockly-') === 0 + ); + }) + .map(function (el) { + return el.innerText; + }) + .join('\n'); const style = document.createElement('style'); style.innerHTML = css + '\n' + customCss; svg.insertBefore(style, svg.firstChild); - let svgAsXML = (new XMLSerializer).serializeToString(svg); + let svgAsXML = new XMLSerializer().serializeToString(svg); svgAsXML = svgAsXML.replace(/ /g, ' '); const data = 'data:image/svg+xml,' + encodeURIComponent(svgAsXML); @@ -98,7 +114,7 @@ function workspaceToSvg_(workspace, callback, customCss) { * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. */ export function downloadWorkspaceScreenshot(workspace) { - workspaceToSvg_(workspace, function(datauri) { + workspaceToSvg_(workspace, function (datauri) { const a = document.createElement('a'); a.download = 'screenshot.png'; a.target = '_self'; diff --git a/plugins/dev-tools/src/spaghetti.js b/plugins/dev-tools/src/spaghetti.js index a37cb27529..216a821c31 100644 --- a/plugins/dev-tools/src/spaghetti.js +++ b/plugins/dev-tools/src/spaghetti.js @@ -40,7 +40,8 @@ const spaghettiXml = [ ' ', ' ', ' ', - '
'].join('\n'); + '
', +].join('\n'); /** * Populate the workspace with nested if-statement blocks, for testing. @@ -50,11 +51,13 @@ const spaghettiXml = [ export function spaghetti(workspace, depth) { let xml = spaghettiXml; for (let i = 0; i < depth; i++) { - xml = xml.replace(/(<(statement|next)( name="DO0")?>)<\//g, - '$1' + spaghettiXml + ')<\//g, + '$1' + spaghettiXml + '' + xml + - ''; + xml = + '' + xml + ''; const dom = Blockly.utils.xml.textToDom(xml); console.time('Spaghetti domToWorkspace'); Blockly.Xml.domToWorkspace(dom, workspace); diff --git a/plugins/dev-tools/src/test_helpers.mocha.js b/plugins/dev-tools/src/test_helpers.mocha.js index 3f2b24ecd9..c5ff8ca464 100644 --- a/plugins/dev-tools/src/test_helpers.mocha.js +++ b/plugins/dev-tools/src/test_helpers.mocha.js @@ -9,13 +9,8 @@ import * as blockTestHelpers from './block_test_helpers.mocha'; import * as fieldTestHelpers from './field_test_helpers.mocha'; import * as eventTestHelpers from './event_test_helpers.mocha'; -const { - TestCase, - TestSuite, - runTestCases, - runTestSuites, - captureWarnings, -} = commonHelpers; +const {TestCase, TestSuite, runTestCases, runTestSuites, captureWarnings} = + commonHelpers; const { CodeGenerationTestCase, @@ -34,10 +29,7 @@ const { runSetValueTests, } = fieldTestHelpers; -const { - assertEventFiredShallow, - assertEventNotFired, -} = eventTestHelpers; +const {assertEventFiredShallow, assertEventNotFired} = eventTestHelpers; export { assertEventFiredShallow, diff --git a/plugins/dev-tools/src/toolboxCategories.js b/plugins/dev-tools/src/toolboxCategories.js index 0a46fb3cf9..4dd889ca73 100644 --- a/plugins/dev-tools/src/toolboxCategories.js +++ b/plugins/dev-tools/src/toolboxCategories.js @@ -857,7 +857,6 @@ export default { 'name': 'Variables', 'custom': 'VARIABLE', 'categorystyle': 'variable_category', - }, { 'kind': 'category', diff --git a/plugins/dev-tools/test/index.html b/plugins/dev-tools/test/index.html index ae605fb218..91177218a0 100644 --- a/plugins/dev-tools/test/index.html +++ b/plugins/dev-tools/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Dev-Tools Playground + + - - - Blockly Dev-Tools Playground - - - - -
- - - + +
+ + diff --git a/plugins/dev-tools/test/index.js b/plugins/dev-tools/test/index.js index 15c408174d..1443d3d4e0 100644 --- a/plugins/dev-tools/test/index.js +++ b/plugins/dev-tools/test/index.js @@ -23,10 +23,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/disable-top-blocks/README.md b/plugins/disable-top-blocks/README.md index 9dbb0b0f65..481b2fce59 100644 --- a/plugins/disable-top-blocks/README.md +++ b/plugins/disable-top-blocks/README.md @@ -8,11 +8,13 @@ must set up yourself). ## Installation ### Yarn + ``` yarn add @blockly/disable-top-blocks ``` ### npm + ``` npm install @blockly/disable-top-blocks --save ``` @@ -37,11 +39,11 @@ disableTopBlocksPlugin.init(); ## API -* `init` initializes the plugin and modifies the behavior of the 'disable' - context menu item. -* `dispose` restores the original behavior of the context menu. This is never - required to be called, but can be if you want to programmatically disable - the effects of the plugin. +- `init` initializes the plugin and modifies the behavior of the 'disable' + context menu item. +- `dispose` restores the original behavior of the context menu. This is never + required to be called, but can be if you want to programmatically disable + the effects of the plugin. ## License diff --git a/plugins/disable-top-blocks/package.json b/plugins/disable-top-blocks/package.json index d0036bf3d0..709f29a6b3 100644 --- a/plugins/disable-top-blocks/package.json +++ b/plugins/disable-top-blocks/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "start": "blockly-scripts start", "predeploy": "npm run build && blockly-scripts predeploy" }, @@ -49,9 +49,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/disable-top-blocks/src/index.js b/plugins/disable-top-blocks/src/index.js index a565c9b129..457c191868 100644 --- a/plugins/disable-top-blocks/src/index.js +++ b/plugins/disable-top-blocks/src/index.js @@ -24,20 +24,24 @@ export class DisableTopBlocks { */ init() { const disableMenuItem = - Blockly.ContextMenuRegistry.registry.getItem('blockDisable'); + Blockly.ContextMenuRegistry.registry.getItem('blockDisable'); this.oldPreconditionFn = disableMenuItem.preconditionFn; - disableMenuItem.preconditionFn = - function(/** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) { - const block = scope.block; - if (!block.isInFlyout && block.workspace.options.disable && - block.isEditable()) { - if (block.getInheritedDisabled() || isOrphan(block)) { - return 'disabled'; - } - return 'enabled'; - } - return 'hidden'; - }; + disableMenuItem.preconditionFn = function ( + /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope, + ) { + const block = scope.block; + if ( + !block.isInFlyout && + block.workspace.options.disable && + block.isEditable() + ) { + if (block.getInheritedDisabled() || isOrphan(block)) { + return 'disabled'; + } + return 'enabled'; + } + return 'hidden'; + }; } /** @@ -47,7 +51,7 @@ export class DisableTopBlocks { */ dispose() { const disableMenuItem = - Blockly.ContextMenuRegistry.registry.getItem('blockDisable'); + Blockly.ContextMenuRegistry.registry.getItem('blockDisable'); disableMenuItem.preconditionFn = this.oldPreconditionFn; } } @@ -67,6 +71,5 @@ function isOrphan(block) { if (parent && isOrphan(parent)) { return true; } - return !parent && - !!(block.outputConnection || block.previousConnection); + return !parent && !!(block.outputConnection || block.previousConnection); } diff --git a/plugins/disable-top-blocks/test/index.html b/plugins/disable-top-blocks/test/index.html index 72d87a0da7..70aaa31226 100644 --- a/plugins/disable-top-blocks/test/index.html +++ b/plugins/disable-top-blocks/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly DisableTopBlocks Plugin Test + + - - - Blockly DisableTopBlocks Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/disable-top-blocks/test/index.js b/plugins/disable-top-blocks/test/index.js index aa3ea28532..553569f106 100644 --- a/plugins/disable-top-blocks/test/index.js +++ b/plugins/disable-top-blocks/test/index.js @@ -32,10 +32,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/eslint-config/index.js b/plugins/eslint-config/index.js index 801853fd13..d068a935a1 100644 --- a/plugins/eslint-config/index.js +++ b/plugins/eslint-config/index.js @@ -137,32 +137,35 @@ module.exports = { 'no-undef': 'off', // Add TypeScript specific rules (and turn off ESLint equivalents) - '@typescript-eslint/array-type': ['error', + '@typescript-eslint/array-type': [ + 'error', { 'default': 'array-simple', }, ], '@typescript-eslint/ban-ts-comment': 'error', - '@typescript-eslint/ban-types': ['error', + '@typescript-eslint/ban-types': [ + 'error', { 'types': { 'Object': { - 'message': 'Use {} or \'object\' instead.', + 'message': "Use {} or 'object' instead.", }, 'String': { - 'message': 'Use \'string\' instead.', + 'message': "Use 'string' instead.", }, 'Number': { - 'message': 'Use \'number\' instead.', + 'message': "Use 'number' instead.", }, 'Boolean': { - 'message': 'Use \'boolean\' instead.', + 'message': "Use 'boolean' instead.", }, }, }, ], 'camelcase': 'off', - '@typescript-eslint/naming-convention': ['error', + '@typescript-eslint/naming-convention': [ + 'error', { 'selector': 'default', 'format': ['camelCase', 'PascalCase'], @@ -182,7 +185,8 @@ module.exports = { }, ], '@typescript-eslint/consistent-type-assertions': 'error', - '@typescript-eslint/member-delimiter-style': ['error', + '@typescript-eslint/member-delimiter-style': [ + 'error', { 'multiline': { 'delimiter': 'semi', @@ -215,8 +219,10 @@ module.exports = { '@typescript-eslint/type-annotation-spacing': 'error', '@typescript-eslint/consistent-type-definitions': 'error', - '@typescript-eslint/explicit-member-accessibility': ['error', - {'accessibility': 'no-public'}], + '@typescript-eslint/explicit-member-accessibility': [ + 'error', + {'accessibility': 'no-public'}, + ], '@typescript-eslint/no-require-imports': 'error', '@typescript-eslint/semi': ['error', 'always'], }, diff --git a/plugins/field-angle/README.md b/plugins/field-angle/README.md index d6459bec35..38225077ec 100644 --- a/plugins/field-angle/README.md +++ b/plugins/field-angle/README.md @@ -5,82 +5,89 @@ A [Blockly](https://www.npmjs.com/package/blockly) angle field. ## Installation ### Yarn + ``` yarn add @blockly/field-angle ``` ### npm + ``` npm install @blockly/field-angle --save ``` ## Usage + This field accepts up to 9 parameters, in addition to the 4 accepted by the [number field][number-field]: - * "value" to specify the default value of the angle field. Defaults to 0. - * "mode" to specify the basic setup of the angle field. Either Mode.COMPASS - or Mode.PROTRACTOR. COMPASS specifies "clockwise" should be "true", and the - "offset" should be "90". PROTRACTOR specifies that "clockwise" should be - "false" and the "offset" should be 0. These settings can be overridden by - the following options. Defaults to PROTRACTOR. - * "clockwise" to specify whether the value of the angle field should increase - in the clockwise direction (if true) or in the counter-clockwise direction - (if false). Defaults to false. - * "offset" to specify where the minimum/maximum displayed value of the angle - field should be. The offset is in degree units that consider the circle to - be 360 degrees. A 0 offset (or multiple of 360) specifies the right side of - the circle as the minimum/maximum value. More positive values rotate - clockwise and more negative values rotate counter clockwise (regardless of - the "clockwise" setting). Defaults to 0. - * "displayMin" to specify the minimum displayed value of the angle field. The - minimum displayed value may not actually be a selectable value. For example, - you may have a full 0-360 degree circle ("displayMin" of 0), but only be - able to select angle values from 90-270. Defaults to 0. - * "displayMax" to specify the maximum displayed value of the angle field. The - maximum displayed value may not actually be a selectable value. For example, - you may have a full 0-360 degree circle ("displayMax" of 360), but only be - able to select angle values from 90-270. Defaults to 360. - * "minorTick" to specify the distance between small tick marks on the angle - picker. The minorTick is in units from your displayMin-displayMax. The ticks - start at your "min" rounded up to a multiple of your "minorTick". The - ticks end at you "max" rounded down to a multiple of your "minorTick". - Defaults to 15. - * "majorTick" to specify the distance between big tick marks on the angle - picker. The majorTick is in units from your displayMin-displayMax. The ticks - start at your "min" rounded up to a multiple of your "majorTick". The - ticks end at you "max" rounded down to a multiple of your "majorTick". - Defaults to 45. - * "symbol" to specify the unit symbol to append to your number. Defaults to °. + +- "value" to specify the default value of the angle field. Defaults to 0. +- "mode" to specify the basic setup of the angle field. Either Mode.COMPASS + or Mode.PROTRACTOR. COMPASS specifies "clockwise" should be "true", and the + "offset" should be "90". PROTRACTOR specifies that "clockwise" should be + "false" and the "offset" should be 0. These settings can be overridden by + the following options. Defaults to PROTRACTOR. +- "clockwise" to specify whether the value of the angle field should increase + in the clockwise direction (if true) or in the counter-clockwise direction + (if false). Defaults to false. +- "offset" to specify where the minimum/maximum displayed value of the angle + field should be. The offset is in degree units that consider the circle to + be 360 degrees. A 0 offset (or multiple of 360) specifies the right side of + the circle as the minimum/maximum value. More positive values rotate + clockwise and more negative values rotate counter clockwise (regardless of + the "clockwise" setting). Defaults to 0. +- "displayMin" to specify the minimum displayed value of the angle field. The + minimum displayed value may not actually be a selectable value. For example, + you may have a full 0-360 degree circle ("displayMin" of 0), but only be + able to select angle values from 90-270. Defaults to 0. +- "displayMax" to specify the maximum displayed value of the angle field. The + maximum displayed value may not actually be a selectable value. For example, + you may have a full 0-360 degree circle ("displayMax" of 360), but only be + able to select angle values from 90-270. Defaults to 360. +- "minorTick" to specify the distance between small tick marks on the angle + picker. The minorTick is in units from your displayMin-displayMax. The ticks + start at your "min" rounded up to a multiple of your "minorTick". The + ticks end at you "max" rounded down to a multiple of your "minorTick". + Defaults to 15. +- "majorTick" to specify the distance between big tick marks on the angle + picker. The majorTick is in units from your displayMin-displayMax. The ticks + start at your "min" rounded up to a multiple of your "majorTick". The + ticks end at you "max" rounded down to a multiple of your "majorTick". + Defaults to 45. +- "symbol" to specify the unit symbol to append to your number. Defaults to °. ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldAngle} from '@blockly/field-angle'; -Blockly.Blocks["test_field_angle"] = { +Blockly.Blocks['test_field_angle'] = { init: function () { this.appendDummyInput() - .appendField("angle: ") - .appendField(new FieldAngle(90), "FIELDNAME"); - } + .appendField('angle: ') + .appendField(new FieldAngle(90), 'FIELDNAME'); + }, }; ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/field-angle'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_field_angle", - "message0": "angle: %1", - "args0": [ - { - "type": "field_angle", - "name": "FIELDNAME", - "value": 50 - } - ] - }]); + { + 'type': 'test_field_angle', + 'message0': 'angle: %1', + 'args0': [ + { + 'type': 'field_angle', + 'name': 'FIELDNAME', + 'value': 50, + }, + ], + }, +]); ``` ## License diff --git a/plugins/field-angle/package-lock.json b/plugins/field-angle/package-lock.json index 53d7ee4b15..7c9c87ed46 100644 --- a/plugins/field-angle/package-lock.json +++ b/plugins/field-angle/package-lock.json @@ -9,7 +9,6 @@ "version": "3.0.6", "license": "Apache-2.0", "devDependencies": { - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.2.0", "sinon": "^9.0.1", @@ -22,213 +21,6 @@ "blockly": "^10.0.0" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -273,136 +65,12 @@ "node": ">= 10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -415,78 +83,6 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -496,29 +92,12 @@ "node": "*" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "node_modules/blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -528,39 +107,6 @@ "jsdom": "22.1.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -579,23 +125,6 @@ "node": ">=4" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -605,26 +134,6 @@ "node": "*" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -637,28 +146,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -720,13 +207,6 @@ "node": ">=6" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -736,67 +216,22 @@ "node": ">=0.4.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "dependencies": { - "path-type": "^4.0.0" + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { "node": ">=0.12" @@ -805,372 +240,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -1185,20 +254,6 @@ "node": ">= 6" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -1208,59 +263,6 @@ "node": "*" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1321,100 +323,6 @@ "node": ">=0.10.0" } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -1427,34 +335,6 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -1497,60 +377,18 @@ } } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -1560,40 +398,6 @@ "get-func-name": "^2.0.0" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1615,32 +419,12 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -1660,77 +444,16 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, "node_modules/path-to-regexp": { @@ -1742,15 +465,6 @@ "isarray": "0.0.1" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -1760,38 +474,6 @@ "node": "*" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -1813,120 +495,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1945,44 +525,6 @@ "node": ">=v12.22.7" } }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -2010,81 +552,6 @@ "node": ">=0.3.1" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2103,66 +570,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -2190,40 +597,6 @@ "node": ">=14" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -2233,19 +606,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -2268,16 +628,6 @@ "node": ">= 4.0.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -2288,13 +638,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -2350,249 +693,44 @@ "node": ">=14" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true - }, - "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "engines": { + "node": ">=10.0.0" }, - "dependencies": { - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true + "utf-8-validate": { + "optional": true } } }, - "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "engines": { + "node": ">=12" } }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, + } + }, + "dependencies": { "@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -2634,80 +772,12 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" - } - }, - "@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "eslint-visitor-keys": "^3.3.0" - } - }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2717,85 +787,18 @@ "debug": "4" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -2805,33 +808,6 @@ "jsdom": "22.1.0" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, "chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -2847,40 +823,12 @@ "type-detect": "^4.0.5" } }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2890,420 +838,70 @@ "delayed-stream": "~1.0.0" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "requires": { - "rrweb-cssom": "^0.6.0" - } - }, - "data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "dev": true, - "requires": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true + "rrweb-cssom": "^0.6.0" + } }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, "requires": { - "reusify": "^1.0.4" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" } }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "peer": true, "requires": { - "flat-cache": "^3.0.4" + "ms": "2.1.2" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "type-detect": "^4.0.0" } }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, - "peer": true, "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "webidl-conversions": "^7.0.0" } }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true }, "form-data": { "version": "4.0.0", @@ -3316,64 +914,12 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3419,76 +965,6 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -3501,31 +977,6 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -3557,57 +1008,18 @@ "xml-name-validator": "^4.0.0" } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -3617,31 +1029,6 @@ "get-func-name": "^2.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3657,29 +1044,12 @@ "mime-db": "1.52.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -3699,41 +1069,6 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, "parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -3743,20 +1078,6 @@ "entities": "^4.4.0" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, "path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -3766,38 +1087,12 @@ "isarray": "0.0.1" } }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -3816,70 +1111,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, "rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3895,32 +1138,6 @@ "xmlchars": "^2.2.0" } }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, "sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -3943,60 +1160,6 @@ } } }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4012,58 +1175,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -4085,44 +1196,12 @@ "punycode": "^2.3.0" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, "typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -4135,16 +1214,6 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -4155,13 +1224,6 @@ "requires-port": "^1.0.0" } }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -4202,30 +1264,6 @@ "webidl-conversions": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -4244,12 +1282,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } } diff --git a/plugins/field-angle/package.json b/plugins/field-angle/package.json index ce44f90536..c004adfd3a 100644 --- a/plugins/field-angle/package.json +++ b/plugins/field-angle/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", @@ -42,7 +42,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.2.0", "sinon": "^9.0.1", @@ -55,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-angle/src/field_angle.ts b/plugins/field-angle/src/field_angle.ts index a12d2da143..36385d286c 100644 --- a/plugins/field-angle/src/field_angle.ts +++ b/plugins/field-angle/src/field_angle.ts @@ -10,7 +10,6 @@ import * as Blockly from 'blockly/core'; - /** * Class for an editable angle field. */ @@ -80,14 +79,13 @@ export class FieldAngle extends Blockly.FieldNumber { private boundEvents: Blockly.browserEvents.Data[] = []; /** Dynamic red line pointing at the value's angle. */ - private line: SVGLineElement|null = null; + private line: SVGLineElement | null = null; /** Dynamic pink area extending from 0 to the value's angle. */ - private gauge: SVGPathElement|null = null; + private gauge: SVGPathElement | null = null; /** The degree symbol for this field. */ - // eslint-disable-next-line @typescript-eslint/naming-convention - protected symbolElement: SVGTSpanElement|null = null; + protected symbolElement: SVGTSpanElement | null = null; /** * @param value The initial value of the field. Should cast to a number. @@ -102,8 +100,11 @@ export class FieldAngle extends Blockly.FieldNumber { * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/angle#creation} * for a list of properties this parameter supports. */ - constructor(value?: string|number|typeof Blockly.Field.SKIP_SETUP, - validator?: FieldAngleValidator, config?: FieldAngleConfig) { + constructor( + value?: string | number | typeof Blockly.Field.SKIP_SETUP, + validator?: FieldAngleValidator, + config?: FieldAngleConfig, + ) { super(Blockly.Field.SKIP_SETUP); if (value === Blockly.Field.SKIP_SETUP) return; @@ -178,8 +179,10 @@ export class FieldAngle extends Blockly.FieldNumber { if (this.symbol) { // Add the degree symbol to the left of the number, // even in RTL (https://github.com/google/blockly/issues/2380). - this.symbolElement = - Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.TSPAN, {}); + this.symbolElement = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.TSPAN, + {}, + ); this.symbolElement.appendChild(document.createTextNode(this.symbol)); this.getTextElement().appendChild(this.symbolElement); } @@ -203,8 +206,10 @@ export class FieldAngle extends Blockly.FieldNumber { // eslint-disable-next-line @typescript-eslint/naming-convention protected override showEditor_(e?: Event) { // Mobile browsers have issues with in-line textareas (focus & keyboards). - const noFocus = Blockly.utils.userAgent.MOBILE || - Blockly.utils.userAgent.ANDROID || Blockly.utils.userAgent.IPAD; + const noFocus = + Blockly.utils.userAgent.MOBILE || + Blockly.utils.userAgent.ANDROID || + Blockly.utils.userAgent.IPAD; super.showEditor_(e, noFocus); const editor = this.dropdownCreate(); @@ -213,12 +218,15 @@ export class FieldAngle extends Blockly.FieldNumber { const sourceBlock = this.getSourceBlock(); if (sourceBlock instanceof Blockly.BlockSvg) { Blockly.DropDownDiv.setColour( - sourceBlock.style.colourPrimary, - sourceBlock.style.colourTertiary); + sourceBlock.style.colourPrimary, + sourceBlock.style.colourTertiary, + ); } Blockly.DropDownDiv.showPositionedByField( - this, this.dropdownDispose.bind(this)); + this, + this.dropdownDispose.bind(this), + ); this.updateGraph(); } @@ -241,28 +249,39 @@ export class FieldAngle extends Blockly.FieldNumber { }); svg.style.touchAction = 'none'; const circle = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.CIRCLE, { - 'cx': FieldAngle.HALF, - 'cy': FieldAngle.HALF, - 'r': FieldAngle.RADIUS, - 'class': 'blocklyAngleCircle', - }, svg); - this.gauge = - Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.PATH, { - 'class': 'blocklyAngleGauge', - }, svg); + Blockly.utils.Svg.CIRCLE, + { + 'cx': FieldAngle.HALF, + 'cy': FieldAngle.HALF, + 'r': FieldAngle.RADIUS, + 'class': 'blocklyAngleCircle', + }, + svg, + ); + this.gauge = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.PATH, + { + 'class': 'blocklyAngleGauge', + }, + svg, + ); this.line = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.LINE, { - 'x1': FieldAngle.HALF, - 'y1': FieldAngle.HALF, - 'class': 'blocklyAngleLine', - }, svg); + Blockly.utils.Svg.LINE, + { + 'x1': FieldAngle.HALF, + 'y1': FieldAngle.HALF, + 'class': 'blocklyAngleLine', + }, + svg, + ); // Draw markers around the edge. const minValueDegrees = Blockly.utils.math.toDegrees( - this.fieldAngleToRadians(this.min_)); + this.fieldAngleToRadians(this.min_), + ); const maxValueDegrees = Blockly.utils.math.toDegrees( - this.fieldAngleToRadians(this.max_)); + this.fieldAngleToRadians(this.max_), + ); /** * Draw a set of ticks on the gauge. @@ -291,24 +310,33 @@ export class FieldAngle extends Blockly.FieldNumber { } for (let angle = min; angle <= max; angle += tickAngle) { Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.LINE, { - 'x1': FieldAngle.HALF + FieldAngle.RADIUS, - 'y1': FieldAngle.HALF, - 'x2': FieldAngle.HALF + FieldAngle.RADIUS - length, - 'y2': FieldAngle.HALF, - 'class': 'blocklyAngleMarks', - 'transform': 'rotate(' + -angle + ',' + FieldAngle.HALF + ',' + - FieldAngle.HALF + ')', - }, svg); + Blockly.utils.Svg.LINE, + { + 'x1': FieldAngle.HALF + FieldAngle.RADIUS, + 'y1': FieldAngle.HALF, + 'x2': FieldAngle.HALF + FieldAngle.RADIUS - length, + 'y2': FieldAngle.HALF, + 'class': 'blocklyAngleMarks', + 'transform': + 'rotate(' + + -angle + + ',' + + FieldAngle.HALF + + ',' + + FieldAngle.HALF + + ')', + }, + svg, + ); } }; const displayRange = this.displayMax - this.displayMin; - const minorTickAngle = 360 / displayRange * this.minorTick; + const minorTickAngle = (360 / displayRange) * this.minorTick; if (minorTickAngle) { drawTicks(minorTickAngle, 5); } - const majorTickAngle = 360 / displayRange * this.majorTick; + const majorTickAngle = (360 / displayRange) * this.majorTick; if (majorTickAngle) { drawTicks(majorTickAngle, 10); } @@ -317,16 +345,29 @@ export class FieldAngle extends Blockly.FieldNumber { // mousemove even if it's not in the middle of a drag. In future we may // change this behaviour. this.boundEvents.push( - Blockly.browserEvents.conditionalBind(svg, 'click', this, this.hide)); + Blockly.browserEvents.conditionalBind(svg, 'click', this, this.hide), + ); // On touch devices, the picker's value is only updated with a drag. Add // a click handler on the drag surface to update the value if the surface // is clicked. this.boundEvents.push( - Blockly.browserEvents.conditionalBind( - circle, 'pointerdown', this, this.onMouseMove_, true)); + Blockly.browserEvents.conditionalBind( + circle, + 'pointerdown', + this, + this.onMouseMove_, + true, + ), + ); this.boundEvents.push( - Blockly.browserEvents.conditionalBind( - circle, 'pointermove', this, this.onMouseMove_, true)); + Blockly.browserEvents.conditionalBind( + circle, + 'pointermove', + this, + this.onMouseMove_, + true, + ), + ); return svg; } @@ -447,13 +488,9 @@ export class FieldAngle extends Blockly.FieldNumber { this.value_ !== oldValue ) { Blockly.Events.fire( - new (Blockly.Events.get( - Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE))( - this.sourceBlock_, - this.name || null, - oldValue, - this.value_ - ) + new (Blockly.Events.get( + Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE, + ))(this.sourceBlock_, this.name || null, oldValue, this.value_), ); } } @@ -482,13 +519,13 @@ export class FieldAngle extends Blockly.FieldNumber { y2 -= Math.sin(angle) * FieldAngle.RADIUS; // Don't ask how the flag calculations work. They just do. const clockwiseFlag = Number(this.clockwise); - let largeFlag = - Math.abs(Math.floor((angle - angle1) / Math.PI) % 2); + let largeFlag = Math.abs(Math.floor((angle - angle1) / Math.PI) % 2); if (clockwiseFlag) { largeFlag = 1 - largeFlag; } - path += ` l ${x1},${y1} A ${FieldAngle.RADIUS},${FieldAngle.RADIUS} 0 ` + - `${largeFlag} ${clockwiseFlag} ${x2},${y2} z`; + path += + ` l ${x1},${y1} A ${FieldAngle.RADIUS},${FieldAngle.RADIUS} 0 ` + + `${largeFlag} ${clockwiseFlag} ${x2},${y2} z`; } this.gauge.setAttribute('d', path); this.line.setAttribute('x2', `${x2}`); @@ -505,8 +542,10 @@ export class FieldAngle extends Blockly.FieldNumber { super.onHtmlInputKeyDown_(e); const block = this.getSourceBlock(); if (!block) { - throw new Error('The field has not yet been attached to its input. ' + - 'Call appendField to attach it.'); + throw new Error( + 'The field has not yet been attached to its input. ' + + 'Call appendField to attach it.', + ); } let multiplier = 0; @@ -543,7 +582,7 @@ export class FieldAngle extends Blockly.FieldNumber { * @returns A valid angle, or null if invalid. */ // eslint-disable-next-line @typescript-eslint/naming-convention - protected override doClassValidation_(newValue?: unknown): number|null { + protected override doClassValidation_(newValue?: unknown): number | null { // The obvious approach would be to call super.doClassValidation_ to handle // min/max limitations. However angle pickers out of range need to clamp // to the closest min/max point, which may involve a wrap to the opposite @@ -572,12 +611,12 @@ export class FieldAngle extends Blockly.FieldNumber { if (value < this.min_) { const undershoot = this.min_ - value; const overshoot = displayRange - undershoot - valueRange; - value = (undershoot < overshoot) ? this.min_ : this.max_; + value = undershoot < overshoot ? this.min_ : this.max_; } if (value > this.max_) { const overshoot = value - this.max_; const undershoot = displayRange - overshoot - valueRange; - value = (undershoot < overshoot) ? this.min_ : this.max_; + value = undershoot < overshoot ? this.min_ : this.max_; } return value; } @@ -624,7 +663,6 @@ Blockly.fieldRegistry.register('field_angle', FieldAngle); FieldAngle.prototype.DEFAULT_VALUE = 0; - /** * CSS for angle field. */ diff --git a/plugins/field-angle/test/field_angle_test.mocha.js b/plugins/field-angle/test/field_angle_test.mocha.js index 130b3e7762..92cbf7e8a3 100644 --- a/plugins/field-angle/test/field_angle_test.mocha.js +++ b/plugins/field-angle/test/field_angle_test.mocha.js @@ -9,11 +9,15 @@ const {FieldAngle} = require('../src/index'); const {assert} = require('chai'); const { - assertFieldValue, FieldCreationTestCase, FieldValueTestCase, - runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, + assertFieldValue, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; -suite('FieldAngle', function() { +suite('FieldAngle', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -40,7 +44,7 @@ suite('FieldAngle', function() { {title: '> 360°', value: 360 + 16, expectedValue: 15}, {title: '< 0°', value: -16, expectedValue: 360 - 15}, ]; - const addArgsAndJson = function(testCase) { + const addArgsAndJson = function (testCase) { testCase.args = [testCase.value]; testCase.json = {'value': testCase.value}; }; @@ -56,7 +60,7 @@ suite('FieldAngle', function() { * Asserts that the field property values are set to default. * @param {FieldAngle} field The field to check. */ - const assertFieldDefault = function(field) { + const assertFieldDefault = function (field) { assertFieldValue(field, defaultFieldValue); }; /** @@ -64,18 +68,27 @@ suite('FieldAngle', function() { * @param {FieldAngle} field The field to check. * @param {!FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertFieldValue(field, testCase.expectedValue); }; runConstructorSuiteTests( - FieldAngle, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldAngle, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - runFromJsonSuiteTests(FieldAngle, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + runFromJsonSuiteTests( + FieldAngle, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - suite('setValue', function() { + suite('setValue', function () { /** * Create a mock block that may be used as the source block for a field. * @returns {!Object} Mock block. @@ -94,25 +107,27 @@ suite('FieldAngle', function() { }; } - suite('Empty -> New Value', function() { - setup(function() { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldAngle(); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, defaultFieldValue); - test('With source block', function() { + validValueTestCases, + invalidValueTestCases, + defaultFieldValue, + ); + test('With source block', function () { this.field.setSourceBlock(createBlockMock()); this.field.setValue(12.5); assertFieldValue(this.field, 15); }); }); - suite('Value -> New Value', function() { - setup(function() { + suite('Value -> New Value', function () { + setup(function () { this.field = new FieldAngle(12.5); }); - runSetValueTests( - validValueTestCases, invalidValueTestCases, 15); - test('With source block', function() { + runSetValueTests(validValueTestCases, invalidValueTestCases, 15); + test('With source block', function () { this.field.setSourceBlock(createBlockMock()); this.field.setValue(-15); assertFieldValue(this.field, 360 - 15); @@ -120,49 +135,60 @@ suite('FieldAngle', function() { }); }); - suite('Validators', function() { - setup(function() { + suite('Validators', function () { + setup(function () { this.field = new FieldAngle(15); }); const testSuites = [ - {title: 'Null Validator', - validator: - function() { - return null; - }, - value: 30, expectedValue: 15}, - {title: 'Force multiple of 90 Validator', - validator: - function(newValue) { - return Math.round(newValue / 90) * 90; - }, - value: 60, expectedValue: 90}, - {title: 'Returns Undefined Validator', validator: function() {}, - value: 30, expectedValue: 30}, + { + title: 'Null Validator', + validator: function () { + return null; + }, + value: 30, + expectedValue: 15, + }, + { + title: 'Force multiple of 90 Validator', + validator: function (newValue) { + return Math.round(newValue / 90) * 90; + }, + value: 60, + expectedValue: 90, + }, + { + title: 'Returns Undefined Validator', + validator: function () {}, + value: 30, + expectedValue: 30, + }, ]; - testSuites.forEach(function(suiteInfo) { - suite(suiteInfo.title, function() { - setup(function() { + testSuites.forEach(function (suiteInfo) { + suite(suiteInfo.title, function () { + setup(function () { this.field.setValidator(suiteInfo.validator); }); - test('New Value', function() { + test('New Value', function () { this.field.setValue(suiteInfo.value); assertFieldValue( - this.field, suiteInfo.expectedValue, suiteInfo.expectedText); + this.field, + suiteInfo.expectedValue, + suiteInfo.expectedText, + ); }); }); }); }); - suite('Customizations', function() { - suite('Clockwise', function() { - test('JS Configuration', function() { + suite('Customizations', function () { + suite('Clockwise', function () { + test('JS Configuration', function () { const field = new FieldAngle(0, null, { clockwise: true, }); assert.isTrue(field.clockwise); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldAngle.fromJson({ value: 0, clockwise: true, @@ -171,14 +197,14 @@ suite('FieldAngle', function() { }); }); - suite('Offset', function() { - test('JS Configuration', function() { + suite('Offset', function () { + test('JS Configuration', function () { const field = new FieldAngle(0, null, { offset: 90, }); assert.equal(field.offset, 90); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldAngle.fromJson({ value: 0, offset: 90, @@ -187,8 +213,8 @@ suite('FieldAngle', function() { }); }); - suite('Min/Max', function() { - test('JS Configuration', function() { + suite('Min/Max', function () { + test('JS Configuration', function () { const field = new FieldAngle(0, null, { min: -180, max: 180, @@ -196,7 +222,7 @@ suite('FieldAngle', function() { assert.equal(field.getMin(), -180); assert.equal(field.getMax(), 180); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldAngle.fromJson({ value: 0, min: -180, @@ -207,14 +233,14 @@ suite('FieldAngle', function() { }); }); - suite('Precision', function() { - test('JS Configuration', function() { + suite('Precision', function () { + test('JS Configuration', function () { const field = new FieldAngle(0, null, { precision: 30, }); assert.equal(field.getPrecision(), 30); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldAngle.fromJson({ value: 0, precision: 30, @@ -223,16 +249,16 @@ suite('FieldAngle', function() { }); }); - suite('Mode', function() { - suite('Compass', function() { - test('JS Configuration', function() { + suite('Mode', function () { + suite('Compass', function () { + test('JS Configuration', function () { const field = new FieldAngle(0, null, { mode: 'compass', }); assert.equal(field.offset, 90); assert.isTrue(field.clockwise); }); - test('JS Configuration', function() { + test('JS Configuration', function () { const field = FieldAngle.fromJson({ value: 0, mode: 'compass', @@ -241,15 +267,15 @@ suite('FieldAngle', function() { assert.isTrue(field.clockwise); }); }); - suite('Protractor', function() { - test('JS Configuration', function() { + suite('Protractor', function () { + test('JS Configuration', function () { const field = new FieldAngle(0, null, { mode: 'protractor', }); assert.equal(field.offset, 0); assert.isFalse(field.clockwise); }); - test('JS Configuration', function() { + test('JS Configuration', function () { const field = FieldAngle.fromJson({ value: 0, mode: 'protractor', @@ -261,20 +287,22 @@ suite('FieldAngle', function() { }); }); - suite('Serialization', function() { - setup(function() { + suite('Serialization', function () { + setup(function () { this.workspace = new Blockly.Workspace(); - Blockly.defineBlocksWithJsonArray([{ - 'type': 'row_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'input_value', - 'name': 'INPUT', - }, - ], - 'output': null, - }]); + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'row_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT', + }, + ], + 'output': null, + }, + ]); this.assertValue = (value) => { const block = this.workspace.newBlock('row_block'); @@ -285,11 +313,11 @@ suite('FieldAngle', function() { }; }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Simple', function() { + test('Simple', function () { this.assertValue(90); }); }); diff --git a/plugins/field-angle/test/index.html b/plugins/field-angle/test/index.html index b137f0eb64..c6879bd868 100644 --- a/plugins/field-angle/test/index.html +++ b/plugins/field-angle/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Angle Playground + + - - - Blockly Field Angle Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-angle/test/index.ts b/plugins/field-angle/test/index.ts index 1a571a3fd7..b80e31d0fd 100644 --- a/plugins/field-angle/test/index.ts +++ b/plugins/field-angle/test/index.ts @@ -71,13 +71,15 @@ const toolbox = generateFieldTestBlocks('field_angle', [ * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-bitmap/README.md b/plugins/field-bitmap/README.md index e6268973e9..a8406ee2fb 100644 --- a/plugins/field-bitmap/README.md +++ b/plugins/field-bitmap/README.md @@ -7,11 +7,13 @@ Note: this field does not support serialization to XML. ## Installation ### Yarn + ``` yarn add @blockly/field-bitmap ``` ### npm + ``` npm install @blockly/field-bitmap --save ``` @@ -19,14 +21,16 @@ npm install @blockly/field-bitmap --save ## Usage This field accepts up to 3 parameters: + - `"value"` to specify an initial value. Must be a 2D rectangular array of 1s and 0s. -If not provided, the default is an empty grid of the specified size. + If not provided, the default is an empty grid of the specified size. - `"width"` to specify an initial width, if there is no initial value. -If not provided, the default is a width of 5. + If not provided, the default is a width of 5. - `"height"` to specify an initial height, if there is no initial value. -If not provided, the default is a height of 5. + If not provided, the default is a height of 5. ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldBitmap} from 'blockly-field-bitmap'; @@ -42,48 +46,52 @@ Blockly.Blocks["test_field_bitmap"] = { ### JSON Example with default value: + ```js import * as Blockly from 'blockly'; import '@blockly/field-bitmap'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_field_bitmap", - "message0": "bitmap: %1", - "args0": [ - { - "type": "field_bitmap", - "name": "FIELDNAME", - "value": [ - [0, 0, 0, 0, 0, 0, 0], - [0, 1, 1, 0, 1, 1, 0], - [0, 0, 0, 0, 0, 0, 0], - [0, 1, 1, 1, 1, 1, 0], - [0, 1, 0, 0, 0, 1, 0], - [0, 0, 1, 1, 1, 0, 0], - [0, 0, 0, 0, 0, 0, 0], - ], - } - ] - }]); + { + 'type': 'test_field_bitmap', + 'message0': 'bitmap: %1', + 'args0': [ + { + 'type': 'field_bitmap', + 'name': 'FIELDNAME', + 'value': [ + [0, 0, 0, 0, 0, 0, 0], + [0, 1, 1, 0, 1, 1, 0], + [0, 0, 0, 0, 0, 0, 0], + [0, 1, 1, 1, 1, 1, 0], + [0, 1, 0, 0, 0, 1, 0], + [0, 0, 1, 1, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0], + ], + }, + ], + }, +]); ``` Example with width and height: + ```js import * as Blockly from 'blockly'; import '@blockly/field-bitmap'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_field_bitmap", - "message0": "bitmap: %1", - "args0": [ - { - "type": "field_bitmap", - "name": "FIELDNAME", - "width": 8, - "height": 8 - } - ] - }]); + { + 'type': 'test_field_bitmap', + 'message0': 'bitmap: %1', + 'args0': [ + { + 'type': 'field_bitmap', + 'name': 'FIELDNAME', + 'width': 8, + 'height': 8, + }, + ], + }, +]); ``` ## License diff --git a/plugins/field-bitmap/package.json b/plugins/field-bitmap/package.json index 0d015aa15a..eb4692f080 100644 --- a/plugins/field-bitmap/package.json +++ b/plugins/field-bitmap/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -53,9 +53,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/field-bitmap/src/field-bitmap.js b/plugins/field-bitmap/src/field-bitmap.js index 39cd77996b..2829f17cce 100644 --- a/plugins/field-bitmap/src/field-bitmap.js +++ b/plugins/field-bitmap/src/field-bitmap.js @@ -9,17 +9,14 @@ * @author gregoryc@outlook.com (Greg Cannon) */ - import Blockly from 'blockly/core'; - export const DEFAULT_HEIGHT = 5; export const DEFAULT_WIDTH = 5; const PIXEL_SIZE = 15; const FILLED_PIXEL_COLOR = '#363d80'; const EMPTY_PIXEL_COLOR = '#fff'; - /** * Field for inputting a small bitmap image. * Includes a grid of clickable pixels that's exported as a bitmap. @@ -172,8 +169,8 @@ export class FieldBitmap extends Blockly.Field { const editor = this.dropdownCreate_(); Blockly.DropDownDiv.getContentDiv().appendChild(editor); Blockly.DropDownDiv.showPositionedByField( - this, - this.dropdownDispose_.bind(this) + this, + this.dropdownDispose_.bind(this), ); } @@ -194,14 +191,14 @@ export class FieldBitmap extends Blockly.Field { const pixel = this.getValue()[r][c]; if (this.blockDisplayPixels_) { - this.blockDisplayPixels_[r][c].style.fill = pixel ? - FILLED_PIXEL_COLOR : - EMPTY_PIXEL_COLOR; + this.blockDisplayPixels_[r][c].style.fill = pixel + ? FILLED_PIXEL_COLOR + : EMPTY_PIXEL_COLOR; } if (this.editorPixels_) { - this.editorPixels_[r][c].style.background = pixel ? - FILLED_PIXEL_COLOR : - EMPTY_PIXEL_COLOR; + this.editorPixels_[r][c].style.background = pixel + ? FILLED_PIXEL_COLOR + : EMPTY_PIXEL_COLOR; } }); } @@ -224,8 +221,11 @@ export class FieldBitmap extends Blockly.Field { getScaledBBox() { const boundingBox = this.fieldGroup_.getBoundingClientRect(); return new Blockly.utils.Rect( - boundingBox.top, boundingBox.bottom, boundingBox.left, - boundingBox.right); + boundingBox.top, + boundingBox.bottom, + boundingBox.left, + boundingBox.right, + ); } /** @@ -235,12 +235,12 @@ export class FieldBitmap extends Blockly.Field { */ dropdownCreate_() { const dropdownEditor = this.createElementWithClassname_( - 'div', - 'dropdownEditor' + 'div', + 'dropdownEditor', ); const pixelContainer = this.createElementWithClassname_( - 'div', - 'pixelContainer' + 'div', + 'pixelContainer', ); dropdownEditor.appendChild(pixelContainer); @@ -291,9 +291,9 @@ export class FieldBitmap extends Blockly.Field { // pixel ? FILLED_PIXEL_COLOR : EMPTY_PIXEL_COLOR; // } if (this.editorPixels_) { - this.editorPixels_[r][c].style.background = pixel ? - FILLED_PIXEL_COLOR : - EMPTY_PIXEL_COLOR; + this.editorPixels_[r][c].style.background = pixel + ? FILLED_PIXEL_COLOR + : EMPTY_PIXEL_COLOR; } }); } @@ -314,16 +314,16 @@ export class FieldBitmap extends Blockly.Field { const row = []; for (let c = 0; c < this.imgWidth_; c++) { const square = Blockly.utils.dom.createSvgElement( - 'rect', - { - x: c * PIXEL_SIZE, - y: r * PIXEL_SIZE, - width: PIXEL_SIZE, - height: PIXEL_SIZE, - fill: EMPTY_PIXEL_COLOR, - fill_opacity: 1, - }, - this.fieldGroup_ + 'rect', + { + x: c * PIXEL_SIZE, + y: r * PIXEL_SIZE, + width: PIXEL_SIZE, + height: PIXEL_SIZE, + fill: EMPTY_PIXEL_COLOR, + fill_opacity: 1, + }, + this.fieldGroup_, ); row.push(square); } @@ -370,17 +370,19 @@ export class FieldBitmap extends Blockly.Field { * @private */ dropdownDispose_() { - if (this.getSourceBlock() && - this.initialValue_ !== null && - this.initialValue_ !== this.getValue()) { + if ( + this.getSourceBlock() && + this.initialValue_ !== null && + this.initialValue_ !== this.getValue() + ) { Blockly.Events.fire( - new (Blockly.Events.get(Blockly.Events.BLOCK_CHANGE))( - this.sourceBlock_, - 'field', - this.name || null, - this.initialValue_, - this.getValue() - ) + new (Blockly.Events.get(Blockly.Events.BLOCK_CHANGE))( + this.sourceBlock_, + 'field', + this.name || null, + this.initialValue_, + this.getValue(), + ), ); } @@ -393,7 +395,6 @@ export class FieldBitmap extends Blockly.Field { this.initialValue_ = null; } - /** * Constructs an array of zeros with the specified width and height. * @returns {!Array>}The new value. @@ -461,13 +462,9 @@ export class FieldBitmap extends Blockly.Field { if (this.getSourceBlock()) { Blockly.Events.fire( - new (Blockly.Events.get( - Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE))( - this.sourceBlock_, - this.name || null, - this.getValue(), - newVal - ) + new (Blockly.Events.get( + Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE, + ))(this.sourceBlock_, this.name || null, this.getValue(), newVal), ); } @@ -486,13 +483,9 @@ export class FieldBitmap extends Blockly.Field { if (this.getSourceBlock()) { Blockly.Events.fire( - new (Blockly.Events.get( - Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE))( - this.sourceBlock_, - this.name || null, - this.getValue(), - newVal - ) + new (Blockly.Events.get( + Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE, + ))(this.sourceBlock_, this.name || null, this.getValue(), newVal), ); } @@ -512,13 +505,9 @@ export class FieldBitmap extends Blockly.Field { if (this.getSourceBlock()) { Blockly.Events.fire( - new (Blockly.Events.get( - Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE))( - this.sourceBlock_, - this.name || null, - this.getValue(), - newGrid - ) + new (Blockly.Events.get( + Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE, + ))(this.sourceBlock_, this.name || null, this.getValue(), newGrid), ); } @@ -558,8 +547,7 @@ export class FieldBitmap extends Blockly.Field { */ bindEvent_(element, eventName, callback) { this.boundEvents_.push( - Blockly.browserEvents. - conditionalBind(element, eventName, this, callback) + Blockly.browserEvents.conditionalBind(element, eventName, this, callback), ); } } diff --git a/plugins/field-bitmap/test/field_test.mocha.js b/plugins/field-bitmap/test/field_test.mocha.js index 08398b2b29..d809bb21b2 100644 --- a/plugins/field-bitmap/test/field_test.mocha.js +++ b/plugins/field-bitmap/test/field_test.mocha.js @@ -32,7 +32,7 @@ const { runFromJsonSuiteTests, } = testHelpers; -suite('FieldBitmap', function() { +suite('FieldBitmap', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -46,15 +46,27 @@ suite('FieldBitmap', function() { {title: 'Not a 2D array', value: [0, 1, 0, 1]}, { title: 'Not a rectangle', - value: [[1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1]], + value: [ + [1, 1, 1], + [1, 1, 1, 1, 1, 1], + [1, 1, 1], + ], }, { title: 'Contains non-binary number', - value: [[1, 99, 1], [1, 1, 1], [1, 1, 1]], + value: [ + [1, 99, 1], + [1, 1, 1], + [1, 1, 1], + ], }, { title: 'Contains bad value', - value: [[1, 'b', 1], [1, 1, 1], [1, 1, 1]], + value: [ + [1, 'b', 1], + [1, 1, 1], + [1, 1, 1], + ], }, ]); @@ -63,15 +75,39 @@ suite('FieldBitmap', function() { * @type {Array} */ const validValueTestCases = processTestCases([ - {title: '3x3 solid', value: [[1, 1, 1], [1, 1, 1], [1, 1, 1]]}, + { + title: '3x3 solid', + value: [ + [1, 1, 1], + [1, 1, 1], + [1, 1, 1], + ], + }, { title: '4x4 solid', - value: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], + value: [ + [1, 1, 1, 1], + [1, 1, 1, 1], + [1, 1, 1, 1], + [1, 1, 1, 1], + ], + }, + { + title: '3x3 checkerboard', + value: [ + [1, 0, 1], + [0, 1, 0], + [1, 0, 1], + ], }, - {title: '3x3 checkerboard', value: [[1, 0, 1], [0, 1, 0], [1, 0, 1]]}, { title: '4x4 empty', - value: [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], + value: [ + [0, 0, 0, 0], + [0, 0, 0, 0], + [0, 0, 0, 0], + [0, 0, 0, 0], + ], }, ]); @@ -80,14 +116,17 @@ suite('FieldBitmap', function() { * @type {*} */ const defaultFieldValue = [ - [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], ]; /** * Asserts that the field property values are set to default. * @param {FieldBitmap} field The field to check. */ - const assertFieldDefault = function(field) { + const assertFieldDefault = function (field) { assert.deepEqual(field.getValue(), defaultFieldValue); }; /** @@ -95,7 +134,7 @@ suite('FieldBitmap', function() { * @param {FieldBitmap} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { const expectedValue = testCase.value; assert.deepEqual(field.getValue(), expectedValue); assert.equal(field.getImageHeight(), expectedValue.length); @@ -109,13 +148,16 @@ suite('FieldBitmap', function() { * @param {*} invalidValueTestCases test cases for invalid field values */ function runSetValueTests(validValueTestCases, invalidValueTestCases) { - const createFieldForTestCase = (testCase) => FieldBitmap.fromJson(`{ - width: ${Array.isArray(testCase.value) ? - testCase.value.length : - DEFAULT_WIDTH}, - height:${testCase.value && Array.isArray(testCase.value[0]) ? - testCase.value[0].length : - DEFAULT_HEIGHT}, + const createFieldForTestCase = (testCase) => + FieldBitmap.fromJson(`{ + width: ${ + Array.isArray(testCase.value) ? testCase.value.length : DEFAULT_WIDTH + }, + height:${ + testCase.value && Array.isArray(testCase.value[0]) + ? testCase.value[0].length + : DEFAULT_HEIGHT + }, }`); /** @@ -124,7 +166,7 @@ suite('FieldBitmap', function() { * @returns {!Function} The test callback. */ const createInvalidSetValueTestCallback = (testCase) => { - return function() { + return function () { const field = createFieldForTestCase(testCase); field.setValue(testCase.value); assertFieldDefault(field); @@ -136,7 +178,7 @@ suite('FieldBitmap', function() { * @returns {!Function} The test callback. */ const createValidSetValueTestCallback = (testCase) => { - return function() { + return function () { const field = createFieldForTestCase(testCase); field.setValue(testCase.value); validTestCaseAssertField(field, testCase); @@ -144,20 +186,30 @@ suite('FieldBitmap', function() { }; testHelpers.runTestCases( - invalidValueTestCases, createInvalidSetValueTestCallback); + invalidValueTestCases, + createInvalidSetValueTestCallback, + ); testHelpers.runTestCases( - validValueTestCases, createValidSetValueTestCallback); + validValueTestCases, + createValidSetValueTestCallback, + ); } - runConstructorSuiteTests( - FieldBitmap, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldBitmap, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); runFromJsonSuiteTests( - FieldBitmap, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldBitmap, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - runSetValueTests( - validValueTestCases, invalidValueTestCases); + runSetValueTests(validValueTestCases, invalidValueTestCases); }); diff --git a/plugins/field-bitmap/test/index.html b/plugins/field-bitmap/test/index.html index ba00bba01c..10cd0a0c1d 100644 --- a/plugins/field-bitmap/test/index.html +++ b/plugins/field-bitmap/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Test + + - - - Blockly Field Test - - - - -
- - - + +
+ + diff --git a/plugins/field-bitmap/test/index.js b/plugins/field-bitmap/test/index.js index 77ed99aa74..3d7a8ae58c 100644 --- a/plugins/field-bitmap/test/index.js +++ b/plugins/field-bitmap/test/index.js @@ -49,10 +49,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox, }; createPlayground( - document.getElementById('root'), createWorkspace, defaultOptions); + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/field-colour-hsv-sliders/README.md b/plugins/field-colour-hsv-sliders/README.md index a9d55c27b8..7703bbc92c 100644 --- a/plugins/field-colour-hsv-sliders/README.md +++ b/plugins/field-colour-hsv-sliders/README.md @@ -7,16 +7,19 @@ A [Blockly](https://www.npmjs.com/package/blockly) colour field using HSV slider ## Installation ### Yarn + ``` yarn add @blockly/field-colour-hsv-sliders ``` ### npm + ``` npm install @blockly/field-colour-hsv-sliders --save ``` ## Usage + This plugin adds a field type `FieldColourHsvSliders` that is registered to the name `'field_colour_hsv_sliders'`. This field is an extension of the `Blockly.FieldColour` field and outputs values in the same hexadecimal string format `'#rrggbb'` even though the UI represents the colour in the HSV colour space. See the [Blockly.FieldColour documentation](https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/colour#creation) on what parameters and configurations this field supports, although unlike `Blockly.FieldColour`, this field does not use colour swatches and thus ignores options related to the swatches such as `'colourOptions'`. The UI also provides an eye dropper button that can be used to take a colour from anywhere on the screen [on supported platforms](https://caniuse.com/?search=eyedropper). Chrome, Edge, and Opera support the eye dropper feature, except [on Chromebooks](https://bugs.chromium.org/p/chromium/issues/detail?id=1348921) and on mobile devices. There is also [a known bug in Chrome on some versions of Linux](https://bugs.chromium.org/p/chromium/issues/detail?id=1227633) where the eye dropper may be visible but does not work correctly. @@ -38,19 +41,21 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'field_colour_hsv_sliders', 'name': 'COLOUR', - 'colour': '#ff0000' - } + 'colour': '#ff0000', + }, ], 'output': 'Colour', - 'style': 'colour_blocks' - } + 'style': 'colour_blocks', + }, ]); -javascriptGenerator.forBlock['colour_hsv_sliders'] = - function(block, generator) { - const code = generator.quote_(block.getFieldValue('COLOUR')); - return [code, Order.ATOMIC]; - }; +javascriptGenerator.forBlock['colour_hsv_sliders'] = function ( + block, + generator, +) { + const code = generator.quote_(block.getFieldValue('COLOUR')); + return [code, Order.ATOMIC]; +}; ``` ### JavaScript @@ -67,13 +72,15 @@ Blockly.Blocks['colour_hsv_sliders'] = { .appendField(new FieldColourHsvSliders('#ff0000'), 'COLOUR'); this.setOutput(true, 'Colour'); this.setStyle('colour_blocks'); - } + }, +}; +javascriptGenerator.forBlock['colour_hsv_sliders'] = function ( + block, + generator, +) { + const code = generator.quote_(block.getFieldValue('COLOUR')); + return [code, Order.ATOMIC]; }; -javascriptGenerator.forBlock['colour_hsv_sliders'] = - function(block, generator) { - const code = generator.quote_(block.getFieldValue('COLOUR')); - return [code, Order.ATOMIC]; - }; ``` ## License diff --git a/plugins/field-colour-hsv-sliders/package.json b/plugins/field-colour-hsv-sliders/package.json index 735355dba3..796d06f281 100644 --- a/plugins/field-colour-hsv-sliders/package.json +++ b/plugins/field-colour-hsv-sliders/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -55,9 +55,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-colour-hsv-sliders/src/field_colour_hsv_sliders.ts b/plugins/field-colour-hsv-sliders/src/field_colour_hsv_sliders.ts index 09840e2253..9921944dcc 100644 --- a/plugins/field-colour-hsv-sliders/src/field_colour_hsv_sliders.ts +++ b/plugins/field-colour-hsv-sliders/src/field_colour_hsv_sliders.ts @@ -65,10 +65,12 @@ class RgbColour { * @returns A hexadecimal representation of this colour. */ toHex(): string { - return '#' + - RgbColour.componentToHex(this.r) + - RgbColour.componentToHex(this.g) + - RgbColour.componentToHex(this.b); + return ( + '#' + + RgbColour.componentToHex(this.r) + + RgbColour.componentToHex(this.g) + + RgbColour.componentToHex(this.b) + ); } /** @@ -92,12 +94,12 @@ class RgbColour { */ loadFromHsv(hsv: HsvColour): RgbColour { const hue: number = (hsv.h - Math.floor(hsv.h)) * 6; - this.r = hsv.v * (1 - hsv.s * Math.max(0, Math.min(1, - 2 - Math.abs(hue - 3)))); - this.g = hsv.v * (1 - hsv.s * Math.max(0, Math.min(1, - Math.abs(hue - 2) - 1))); - this.b = hsv.v * (1 - hsv.s * Math.max(0, Math.min(1, - Math.abs(hue - 4) - 1))); + this.r = + hsv.v * (1 - hsv.s * Math.max(0, Math.min(1, 2 - Math.abs(hue - 3)))); + this.g = + hsv.v * (1 - hsv.s * Math.max(0, Math.min(1, Math.abs(hue - 2) - 1))); + this.b = + hsv.v * (1 - hsv.s * Math.max(0, Math.min(1, Math.abs(hue - 4) - 1))); return this; } } @@ -145,16 +147,16 @@ class HsvColour { return this; } - const delta: number = (max - min); + const delta: number = max - min; this.s = delta / max; let hue: number; if (rgb.r === max) { hue = (rgb.g - rgb.b) / delta; } else if (rgb.g === max) { - hue = 2 + ((rgb.b - rgb.r) / delta); + hue = 2 + (rgb.b - rgb.r) / delta; } else { - hue = 4 + ((rgb.r - rgb.g) / delta); + hue = 4 + (rgb.r - rgb.g) / delta; } hue /= 6; this.h = hue - Math.floor(hue); @@ -242,7 +244,9 @@ export class FieldColourHsvSliders extends FieldColour { Blockly.DropDownDiv.getContentDiv().appendChild(this.dropdownContainer); Blockly.DropDownDiv.showPositionedByField( - this, this.dropdownDisposeSliders.bind(this)); + this, + this.dropdownDisposeSliders.bind(this), + ); // Focus so we can start receiving keyboard events. this.hueSlider.focus({preventScroll: true}); @@ -256,7 +260,9 @@ export class FieldColourHsvSliders extends FieldColour { * @returns The readout, so that it can be updated. */ private static createLabelInContainer( - name: string, container: HTMLElement): HTMLSpanElement { + name: string, + container: HTMLElement, + ): HTMLSpanElement { const label: HTMLDivElement = document.createElement('div'); const labelText: HTMLSpanElement = document.createElement('span'); const readout: HTMLSpanElement = document.createElement('span'); @@ -276,7 +282,10 @@ export class FieldColourHsvSliders extends FieldColour { * @returns The slider. */ private static createSliderInContainer( - max: number, step: number, container: HTMLElement): HTMLInputElement { + max: number, + step: number, + container: HTMLElement, + ): HTMLInputElement { const slider: HTMLInputElement = document.createElement('input'); slider.classList.add('fieldColourSlider'); slider.type = 'range'; @@ -293,27 +302,57 @@ export class FieldColourHsvSliders extends FieldColour { container.classList.add('fieldColourSliderContainer'); this.hueReadout = FieldColourHsvSliders.createLabelInContainer( - 'Hue', container); + 'Hue', + container, + ); this.hueSlider = FieldColourHsvSliders.createSliderInContainer( - FieldColourHsvSliders.HUE_SLIDER_MAX, 2, container); + FieldColourHsvSliders.HUE_SLIDER_MAX, + 2, + container, + ); this.saturationReadout = FieldColourHsvSliders.createLabelInContainer( - 'Saturation', container); + 'Saturation', + container, + ); this.saturationSlider = FieldColourHsvSliders.createSliderInContainer( - FieldColourHsvSliders.SATURATION_SLIDER_MAX, 1, container); + FieldColourHsvSliders.SATURATION_SLIDER_MAX, + 1, + container, + ); this.brightnessReadout = FieldColourHsvSliders.createLabelInContainer( - 'Brightness', container); + 'Brightness', + container, + ); this.brightnessSlider = FieldColourHsvSliders.createSliderInContainer( - FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX, 1, container); + FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX, + 1, + container, + ); this.hsvBoundEvents.push( - Blockly.browserEvents.conditionalBind( - this.hueSlider, 'input', this, this.onSliderChange)); + Blockly.browserEvents.conditionalBind( + this.hueSlider, + 'input', + this, + this.onSliderChange, + ), + ); this.hsvBoundEvents.push( - Blockly.browserEvents.conditionalBind( - this.saturationSlider, 'input', this, this.onSliderChange)); + Blockly.browserEvents.conditionalBind( + this.saturationSlider, + 'input', + this, + this.onSliderChange, + ), + ); this.hsvBoundEvents.push( - Blockly.browserEvents.conditionalBind( - this.brightnessSlider, 'input', this, this.onSliderChange)); + Blockly.browserEvents.conditionalBind( + this.brightnessSlider, + 'input', + this, + this.onSliderChange, + ), + ); if (window.EyeDropper) { // If the browser supports the eyedropper API, create a button for it. @@ -322,8 +361,13 @@ export class FieldColourHsvSliders extends FieldColour { container.appendChild(document.createElement('hr')); container.appendChild(button); this.hsvBoundEvents.push( - Blockly.browserEvents.conditionalBind( - button, 'click', this, this.onEyedropperEvent)); + Blockly.browserEvents.conditionalBind( + button, + 'click', + this, + this.onEyedropperEvent, + ), + ); } this.dropdownContainer = container; @@ -356,12 +400,16 @@ export class FieldColourHsvSliders extends FieldColour { * @returns A hexadecimal representation of the colour in the format "#rrggbb" */ private static hsvToHex( - hue: number, saturation: number, brightness: number): string { + hue: number, + saturation: number, + brightness: number, + ): string { FieldColourHsvSliders.helperHsv.h = hue; FieldColourHsvSliders.helperHsv.s = saturation; FieldColourHsvSliders.helperHsv.v = brightness; - return FieldColourHsvSliders.helperRgb.loadFromHsv( - FieldColourHsvSliders.helperHsv).toHex(); + return FieldColourHsvSliders.helperRgb + .loadFromHsv(FieldColourHsvSliders.helperHsv) + .toHex(); } /** @@ -372,14 +420,15 @@ export class FieldColourHsvSliders extends FieldColour { if (!this.hueSlider || !this.saturationSlider || !this.brightnessSlider) { throw new Error('The HSV sliders are missing.'); } - const hue: number = parseFloat(this.hueSlider.value) / - FieldColourHsvSliders.HUE_SLIDER_MAX; - const saturation: number = parseFloat(this.saturationSlider.value) / - FieldColourHsvSliders.SATURATION_SLIDER_MAX; - const brightness: number = parseFloat(this.brightnessSlider.value) / - FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX; - this.setValue(FieldColourHsvSliders.hsvToHex( - hue, saturation, brightness)); + const hue: number = + parseFloat(this.hueSlider.value) / FieldColourHsvSliders.HUE_SLIDER_MAX; + const saturation: number = + parseFloat(this.saturationSlider.value) / + FieldColourHsvSliders.SATURATION_SLIDER_MAX; + const brightness: number = + parseFloat(this.brightnessSlider.value) / + FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX; + this.setValue(FieldColourHsvSliders.hsvToHex(hue, saturation, brightness)); this.renderSliders(); } @@ -402,54 +451,70 @@ export class FieldColourHsvSliders extends FieldColour { * on the slider values. */ private renderSliders(): void { - if (!this.hueSlider || !this.hueReadout || - !this.saturationSlider || !this.saturationReadout || - !this.brightnessSlider || !this.brightnessReadout) { + if ( + !this.hueSlider || + !this.hueReadout || + !this.saturationSlider || + !this.saturationReadout || + !this.brightnessSlider || + !this.brightnessReadout + ) { throw new Error('The HSV sliders are missing.'); } this.hueReadout.textContent = this.hueSlider.value; this.saturationReadout.textContent = this.saturationSlider.value; this.brightnessReadout.textContent = this.brightnessSlider.value; - const h: number = parseFloat(this.hueSlider.value) / - FieldColourHsvSliders.HUE_SLIDER_MAX; - const s: number = parseFloat(this.saturationSlider.value) / - FieldColourHsvSliders.SATURATION_SLIDER_MAX; - const v: number = parseFloat(this.brightnessSlider.value) / - FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX; + const h: number = + parseFloat(this.hueSlider.value) / FieldColourHsvSliders.HUE_SLIDER_MAX; + const s: number = + parseFloat(this.saturationSlider.value) / + FieldColourHsvSliders.SATURATION_SLIDER_MAX; + const v: number = + parseFloat(this.brightnessSlider.value) / + FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX; // The hue slider needs intermediate gradient control points to include all // colours of the rainbow. let hueGradient = 'linear-gradient(to right, '; - hueGradient += FieldColourHsvSliders.hsvToHex(0/6, s, v) + - ` ${FieldColourHsvSliders.THUMB_RADIUS}px, `; - hueGradient += FieldColourHsvSliders.hsvToHex(1/6, s, v) + ', '; - hueGradient += FieldColourHsvSliders.hsvToHex(2/6, s, v) + ', '; - hueGradient += FieldColourHsvSliders.hsvToHex(3/6, s, v) + ', '; - hueGradient += FieldColourHsvSliders.hsvToHex(4/6, s, v) + ', '; - hueGradient += FieldColourHsvSliders.hsvToHex(5/6, s, v) + ', '; - hueGradient += FieldColourHsvSliders.hsvToHex(6/6, s, v) + - ` calc(100% - ${FieldColourHsvSliders.THUMB_RADIUS}px))`; - this.hueSlider.style.setProperty( - '--slider-track-background', hueGradient); + hueGradient += + FieldColourHsvSliders.hsvToHex(0 / 6, s, v) + + ` ${FieldColourHsvSliders.THUMB_RADIUS}px, `; + hueGradient += FieldColourHsvSliders.hsvToHex(1 / 6, s, v) + ', '; + hueGradient += FieldColourHsvSliders.hsvToHex(2 / 6, s, v) + ', '; + hueGradient += FieldColourHsvSliders.hsvToHex(3 / 6, s, v) + ', '; + hueGradient += FieldColourHsvSliders.hsvToHex(4 / 6, s, v) + ', '; + hueGradient += FieldColourHsvSliders.hsvToHex(5 / 6, s, v) + ', '; + hueGradient += + FieldColourHsvSliders.hsvToHex(6 / 6, s, v) + + ` calc(100% - ${FieldColourHsvSliders.THUMB_RADIUS}px))`; + this.hueSlider.style.setProperty('--slider-track-background', hueGradient); // The saturation slider only needs gradient control points at each end. let saturationGradient = 'linear-gradient(to right, '; - saturationGradient += FieldColourHsvSliders.hsvToHex(h, 0, v) + - ` ${FieldColourHsvSliders.THUMB_RADIUS}px, `; - saturationGradient += FieldColourHsvSliders.hsvToHex(h, 1, v) + - ` calc(100% - ${FieldColourHsvSliders.THUMB_RADIUS}px))`; + saturationGradient += + FieldColourHsvSliders.hsvToHex(h, 0, v) + + ` ${FieldColourHsvSliders.THUMB_RADIUS}px, `; + saturationGradient += + FieldColourHsvSliders.hsvToHex(h, 1, v) + + ` calc(100% - ${FieldColourHsvSliders.THUMB_RADIUS}px))`; this.saturationSlider.style.setProperty( - '--slider-track-background', saturationGradient); + '--slider-track-background', + saturationGradient, + ); // The brightness slider only needs gradient control points at each end. let brightnessGradient = 'linear-gradient(to right, '; - brightnessGradient += FieldColourHsvSliders.hsvToHex(h, s, 0) + - ` ${FieldColourHsvSliders.THUMB_RADIUS}px, `; - brightnessGradient += FieldColourHsvSliders.hsvToHex(h, s, 1) + - ` calc(100% - ${FieldColourHsvSliders.THUMB_RADIUS}px))`; + brightnessGradient += + FieldColourHsvSliders.hsvToHex(h, s, 0) + + ` ${FieldColourHsvSliders.THUMB_RADIUS}px, `; + brightnessGradient += + FieldColourHsvSliders.hsvToHex(h, s, 1) + + ` calc(100% - ${FieldColourHsvSliders.THUMB_RADIUS}px))`; this.brightnessSlider.style.setProperty( - '--slider-track-background', brightnessGradient); + '--slider-track-background', + brightnessGradient, + ); } /** Updates slider values based on the current value of the field. */ @@ -459,21 +524,25 @@ export class FieldColourHsvSliders extends FieldColour { } const hsv: HsvColour = FieldColourHsvSliders.helperHsv.loadFromRgb( - FieldColourHsvSliders.helperRgb.loadFromHex(this.getValue() ?? '')); + FieldColourHsvSliders.helperRgb.loadFromHex(this.getValue() ?? ''), + ); - this.hueSlider.value = - String(hsv.h * FieldColourHsvSliders.HUE_SLIDER_MAX); - this.saturationSlider.value = - String(hsv.s * FieldColourHsvSliders.SATURATION_SLIDER_MAX); - this.brightnessSlider.value = - String(hsv.v * FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX); + this.hueSlider.value = String(hsv.h * FieldColourHsvSliders.HUE_SLIDER_MAX); + this.saturationSlider.value = String( + hsv.s * FieldColourHsvSliders.SATURATION_SLIDER_MAX, + ); + this.brightnessSlider.value = String( + hsv.v * FieldColourHsvSliders.BRIGHTNESS_SLIDER_MAX, + ); this.renderSliders(); } } Blockly.fieldRegistry.register( - 'field_colour_hsv_sliders', FieldColourHsvSliders); + 'field_colour_hsv_sliders', + FieldColourHsvSliders, +); // CSS for colour slider fields. Blockly.Css.register(` diff --git a/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test.mocha.js b/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test.mocha.js index dc44197385..5fc5258da5 100644 --- a/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test.mocha.js +++ b/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test.mocha.js @@ -4,17 +4,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -const {assertColourHsvSlidersField, assertColourHsvSlidersFieldDefault} = - require('./field_colour_hsv_sliders_test_helpers.mocha'); +const { + assertColourHsvSlidersField, + assertColourHsvSlidersFieldDefault, +} = require('./field_colour_hsv_sliders_test_helpers.mocha'); const {testHelpers} = require('@blockly/dev-tools'); const {FieldColourHsvSliders} = require('../src/index'); const { - FieldCreationTestCase, FieldValueTestCase, runConstructorSuiteTests, - runFromJsonSuiteTests, runSetValueTests, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; -suite('FieldColourHsvSliders', function() { +suite('FieldColourHsvSliders', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -38,18 +43,38 @@ suite('FieldColourHsvSliders', function() { * @type {Array} */ const validValueTestCases = [ - {title: 'Red', value: '#ff0000', expectedValue: '#ff0000', - expectedText: '#f00'}, - {title: 'Black', value: '#000000', expectedValue: '#000000', - expectedText: '#000'}, - {title: 'White', value: '#ffffff', expectedValue: '#ffffff', - expectedText: '#fff'}, - {title: 'Gray', value: '#7f7f7f', expectedValue: '#7f7f7f', - expectedText: '#7f7f7f'}, - {title: 'Shortened String', value: 'bad', expectedValue: '#bbaadd', - expectedText: '#bad'}, + { + title: 'Red', + value: '#ff0000', + expectedValue: '#ff0000', + expectedText: '#f00', + }, + { + title: 'Black', + value: '#000000', + expectedValue: '#000000', + expectedText: '#000', + }, + { + title: 'White', + value: '#ffffff', + expectedValue: '#ffffff', + expectedText: '#fff', + }, + { + title: 'Gray', + value: '#7f7f7f', + expectedValue: '#7f7f7f', + expectedText: '#7f7f7f', + }, + { + title: 'Shortened String', + value: 'bad', + expectedValue: '#bbaadd', + expectedText: '#bad', + }, ]; - const addArgsAndJson = function(testCase) { + const addArgsAndJson = function (testCase) { testCase.args = [testCase.value]; testCase.json = {'colour': testCase.value}; }; @@ -61,33 +86,52 @@ suite('FieldColourHsvSliders', function() { * @param {FieldColourHsvSliders} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertColourHsvSlidersField( - field, testCase.expectedValue, testCase.expectedText); + field, + testCase.expectedValue, + testCase.expectedText, + ); }; runConstructorSuiteTests( - FieldColourHsvSliders, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertColourHsvSlidersFieldDefault); + FieldColourHsvSliders, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertColourHsvSlidersFieldDefault, + ); - runFromJsonSuiteTests(FieldColourHsvSliders, validValueTestCases, - invalidValueTestCases, validTestCaseAssertField, - assertColourHsvSlidersFieldDefault); + runFromJsonSuiteTests( + FieldColourHsvSliders, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertColourHsvSlidersFieldDefault, + ); - suite('setValue', function() { - suite('Empty -> New Value', function() { - setup(function() { + suite('setValue', function () { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldColourHsvSliders(); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, '#ffffff', '#fff'); + validValueTestCases, + invalidValueTestCases, + '#ffffff', + '#fff', + ); }); - suite('Value -> New Value', function() { - setup(function() { + suite('Value -> New Value', function () { + setup(function () { this.field = new FieldColourHsvSliders(1); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, '#ffffff', '#fff'); + validValueTestCases, + invalidValueTestCases, + '#ffffff', + '#fff', + ); }); }); }); diff --git a/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test_helpers.mocha.js b/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test_helpers.mocha.js index 2b94afa9cd..74e5f80df1 100644 --- a/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test_helpers.mocha.js +++ b/plugins/field-colour-hsv-sliders/test/field_colour_hsv_sliders_test_helpers.mocha.js @@ -15,7 +15,10 @@ const {FieldColourHsvSliders} = require('../src/index'); * @param {string} expectedText The expected text. */ function assertColourHsvSlidersField( - colourHsvSlidersField, expectedValue, expectedText) { + colourHsvSlidersField, + expectedValue, + expectedText, +) { assertFieldValue(colourHsvSlidersField, expectedValue, expectedText); } diff --git a/plugins/field-colour-hsv-sliders/test/index.html b/plugins/field-colour-hsv-sliders/test/index.html index c3fe335344..e80b2952ae 100644 --- a/plugins/field-colour-hsv-sliders/test/index.html +++ b/plugins/field-colour-hsv-sliders/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Colour HSV Sliders Playground + + - - - Blockly Field Colour HSV Sliders Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-colour-hsv-sliders/test/index.ts b/plugins/field-colour-hsv-sliders/test/index.ts index 8ff0565d4f..c29160c02c 100644 --- a/plugins/field-colour-hsv-sliders/test/index.ts +++ b/plugins/field-colour-hsv-sliders/test/index.ts @@ -28,13 +28,14 @@ const toolbox = generateFieldTestBlocks('field_colour_hsv_sliders', [ * @returns The created workspace. */ function createWorkspace( - blocklyDiv: HTMLElement, options: Blockly.BlocklyOptions): - Blockly.WorkspaceSvg { + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-colour/README.md b/plugins/field-colour/README.md index c31ebcdbc2..fc19ee9cd5 100644 --- a/plugins/field-colour/README.md +++ b/plugins/field-colour/README.md @@ -5,11 +5,13 @@ A [Blockly](https://www.npmjs.com/package/blockly) colour field. ## Installation ### Yarn + ``` yarn add @blockly/field-colour ``` ### npm + ``` npm install @blockly/field-colour --save ``` @@ -17,52 +19,56 @@ npm install @blockly/field-colour --save ## Usage This field accepts up to 4 parameters: - * "colour" to specify the default colour. Defaults to the first value in the - "colourOptions" array. Should be a "#rrggbb" string. - * "colourOptions" to specify the colour options in the dropdown. Defaults to - a set of 70 colors, including grays, reds, oranges, yellows, olives, greens, - turquoises, blues, purples, and violets. Should be "#rrggbb" strings. - * "colourTitles" to specify the tooltips for the colour options. Defaults to - the "#rrggbb" values of the provided colour options. - * "columns" to specify the number of columns the colour dropdown should have. - Defaults to 7. + +- "colour" to specify the default colour. Defaults to the first value in the + "colourOptions" array. Should be a "#rrggbb" string. +- "colourOptions" to specify the colour options in the dropdown. Defaults to + a set of 70 colors, including grays, reds, oranges, yellows, olives, greens, + turquoises, blues, purples, and violets. Should be "#rrggbb" strings. +- "colourTitles" to specify the tooltips for the colour options. Defaults to + the "#rrggbb" values of the provided colour options. +- "columns" to specify the number of columns the colour dropdown should have. + Defaults to 7. ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldColour} from '@blockly/field-colour'; -Blockly.Blocks["test_field_colour"] = { +Blockly.Blocks['test_field_colour'] = { init: function () { this.appendDummyInput() - .appendField("colour: ") - .appendField(new FieldColour("#ffcccc"), "FIELDNAME"); - } + .appendField('colour: ') + .appendField(new FieldColour('#ffcccc'), 'FIELDNAME'); + }, }; ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/field-colour'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_field_colour", - "message0": "colour: %1", - "args0": [ - { - "type": "field_colour", - "name": "FIELDNAME", - "colour": "#ffcccc" - } - ] - }]); + { + 'type': 'test_field_colour', + 'message0': 'colour: %1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'FIELDNAME', + 'colour': '#ffcccc', + }, + ], + }, +]); ``` ### API Reference -* `setColours`: Sets the colour options, and optionally the titles for the +- `setColours`: Sets the colour options, and optionally the titles for the options. The colourss should be an array of #rrggbb strings. -* `setColumns`: Sets the number of columns the dropdown should have. +- `setColumns`: Sets the number of columns the dropdown should have. ## License diff --git a/plugins/field-colour/package-lock.json b/plugins/field-colour/package-lock.json index 8d9cf6187a..9bd259cdc7 100644 --- a/plugins/field-colour/package-lock.json +++ b/plugins/field-colour/package-lock.json @@ -9,7 +9,6 @@ "version": "3.0.6", "license": "Apache-2.0", "devDependencies": { - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.2.0", "sinon": "^9.0.1", @@ -22,213 +21,6 @@ "blockly": "^10.0.0" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -273,136 +65,12 @@ "node": ">= 10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -415,78 +83,6 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -496,29 +92,12 @@ "node": "*" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "node_modules/blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -528,39 +107,6 @@ "jsdom": "22.1.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -579,23 +125,6 @@ "node": ">=4" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -605,26 +134,6 @@ "node": "*" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -637,28 +146,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -720,13 +207,6 @@ "node": ">=6" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -736,67 +216,22 @@ "node": ">=0.4.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "dependencies": { - "path-type": "^4.0.0" + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { "node": ">=0.12" @@ -805,372 +240,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -1185,20 +254,6 @@ "node": ">= 6" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -1208,59 +263,6 @@ "node": "*" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1321,100 +323,6 @@ "node": ">=0.10.0" } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -1427,34 +335,6 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -1497,60 +377,18 @@ } } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -1560,40 +398,6 @@ "get-func-name": "^2.0.0" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1615,32 +419,12 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -1660,77 +444,16 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, "node_modules/path-to-regexp": { @@ -1742,15 +465,6 @@ "isarray": "0.0.1" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -1760,38 +474,6 @@ "node": "*" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -1813,120 +495,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1945,44 +525,6 @@ "node": ">=v12.22.7" } }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -2010,81 +552,6 @@ "node": ">=0.3.1" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2103,66 +570,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -2190,40 +597,6 @@ "node": ">=14" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -2233,19 +606,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -2268,16 +628,6 @@ "node": ">= 4.0.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -2288,13 +638,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -2350,249 +693,44 @@ "node": ">=14" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true - }, - "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "engines": { + "node": ">=10.0.0" }, - "dependencies": { - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true + "utf-8-validate": { + "optional": true } } }, - "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "engines": { + "node": ">=12" } }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, + } + }, + "dependencies": { "@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -2634,80 +772,12 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" - } - }, - "@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "eslint-visitor-keys": "^3.3.0" - } - }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2717,85 +787,18 @@ "debug": "4" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -2805,33 +808,6 @@ "jsdom": "22.1.0" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, "chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -2847,40 +823,12 @@ "type-detect": "^4.0.5" } }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2890,420 +838,70 @@ "delayed-stream": "~1.0.0" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "requires": { - "rrweb-cssom": "^0.6.0" - } - }, - "data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "dev": true, - "requires": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true + "rrweb-cssom": "^0.6.0" + } }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, "requires": { - "reusify": "^1.0.4" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" } }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "peer": true, "requires": { - "flat-cache": "^3.0.4" + "ms": "2.1.2" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "type-detect": "^4.0.0" } }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, - "peer": true, "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "webidl-conversions": "^7.0.0" } }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true }, "form-data": { "version": "4.0.0", @@ -3316,64 +914,12 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3419,76 +965,6 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -3501,31 +977,6 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -3557,57 +1008,18 @@ "xml-name-validator": "^4.0.0" } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -3617,31 +1029,6 @@ "get-func-name": "^2.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3657,29 +1044,12 @@ "mime-db": "1.52.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -3699,41 +1069,6 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, "parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -3743,20 +1078,6 @@ "entities": "^4.4.0" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, "path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -3766,38 +1087,12 @@ "isarray": "0.0.1" } }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -3816,70 +1111,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, "rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3895,32 +1138,6 @@ "xmlchars": "^2.2.0" } }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, "sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -3943,60 +1160,6 @@ } } }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4012,58 +1175,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -4085,44 +1196,12 @@ "punycode": "^2.3.0" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, "typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -4135,16 +1214,6 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -4155,13 +1224,6 @@ "requires-port": "^1.0.0" } }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -4202,30 +1264,6 @@ "webidl-conversions": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -4244,12 +1282,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } } diff --git a/plugins/field-colour/package.json b/plugins/field-colour/package.json index b97234c156..29234b9bee 100644 --- a/plugins/field-colour/package.json +++ b/plugins/field-colour/package.json @@ -6,14 +6,14 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", "test": "blockly-scripts test" }, "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.ts", "unpkg": "./dist/index.js", "author": "Blockly Team", "keywords": [ @@ -42,7 +42,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.2.0", "sinon": "^9.0.1", @@ -55,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-colour/src/field_colour.ts b/plugins/field-colour/src/field_colour.ts index ebac830d44..c1d9251b52 100644 --- a/plugins/field-colour/src/field_colour.ts +++ b/plugins/field-colour/src/field_colour.ts @@ -10,16 +10,15 @@ import * as Blockly from 'blockly/core'; - /** * Class for a colour input field. */ export class FieldColour extends Blockly.Field { /** The field's colour picker element. */ - private picker: HTMLElement|null = null; + private picker: HTMLElement | null = null; /** Index of the currently highlighted element. */ - private highlightedIndex: number|null = null; + private highlightedIndex: number | null = null; /** * Array holding info needed to unbind events. @@ -51,25 +50,85 @@ export class FieldColour extends Blockly.Field { */ private colours: string[] = [ // grays - '#ffffff', '#cccccc', '#c0c0c0', '#999999', '#666666', '#333333', '#000000', + '#ffffff', + '#cccccc', + '#c0c0c0', + '#999999', + '#666666', + '#333333', + '#000000', // reds - '#ffcccc', '#ff6666', '#ff0000', '#cc0000', '#990000', '#660000', '#330000', + '#ffcccc', + '#ff6666', + '#ff0000', + '#cc0000', + '#990000', + '#660000', + '#330000', // oranges - '#ffcc99', '#ff9966', '#ff9900', '#ff6600', '#cc6600', '#993300', '#663300', + '#ffcc99', + '#ff9966', + '#ff9900', + '#ff6600', + '#cc6600', + '#993300', + '#663300', // yellows - '#ffff99', '#ffff66', '#ffcc66', '#ffcc33', '#cc9933', '#996633', '#663333', + '#ffff99', + '#ffff66', + '#ffcc66', + '#ffcc33', + '#cc9933', + '#996633', + '#663333', // olives - '#ffffcc', '#ffff33', '#ffff00', '#ffcc00', '#999900', '#666600', '#333300', + '#ffffcc', + '#ffff33', + '#ffff00', + '#ffcc00', + '#999900', + '#666600', + '#333300', // greens - '#99ff99', '#66ff99', '#33ff33', '#33cc00', '#009900', '#006600', '#003300', + '#99ff99', + '#66ff99', + '#33ff33', + '#33cc00', + '#009900', + '#006600', + '#003300', // turquoises - '#99ffff', '#33ffff', '#66cccc', '#00cccc', '#339999', '#336666', '#003333', + '#99ffff', + '#33ffff', + '#66cccc', + '#00cccc', + '#339999', + '#336666', + '#003333', // blues - '#ccffff', '#66ffff', '#33ccff', '#3366ff', '#3333ff', '#000099', '#000066', + '#ccffff', + '#66ffff', + '#33ccff', + '#3366ff', + '#3333ff', + '#000099', + '#000066', // purples - '#ccccff', '#9999ff', '#6666cc', '#6633ff', '#6600cc', '#333399', '#330099', + '#ccccff', + '#9999ff', + '#6666cc', + '#6633ff', + '#6600cc', + '#333399', + '#330099', // violets - '#ffccff', '#ff99ff', '#cc66cc', '#cc33cc', '#993399', '#663366', '#330033', + '#ffccff', + '#ff99ff', + '#cc66cc', + '#cc33cc', + '#993399', + '#663366', + '#330033', ]; /** @@ -98,8 +157,10 @@ export class FieldColour extends Blockly.Field { * for a list of properties this parameter supports. */ constructor( - value?: string|typeof Blockly.Field.SKIP_SETUP, - validator?: FieldColourValidator, config?: FieldColourConfig) { + value?: string | typeof Blockly.Field.SKIP_SETUP, + validator?: FieldColourValidator, + config?: FieldColourConfig, + ) { super(Blockly.Field.SKIP_SETUP); if (value === Blockly.Field.SKIP_SETUP) return; @@ -135,8 +196,9 @@ export class FieldColour extends Blockly.Field { // This can't happen, but TypeScript thinks it can and lint forbids `!.`. if (!constants) throw Error('Constants not found'); this.size_ = new Blockly.utils.Size( - constants.FIELD_COLOUR_DEFAULT_WIDTH, - constants.FIELD_COLOUR_DEFAULT_HEIGHT); + constants.FIELD_COLOUR_DEFAULT_WIDTH, + constants.FIELD_COLOUR_DEFAULT_HEIGHT, + ); if (!constants.FIELD_COLOUR_FULL_BLOCK) { this.createBorderRect_(); this.getBorderRect().style['fillOpacity'] = '1'; @@ -160,7 +222,9 @@ export class FieldColour extends Blockly.Field { } } else if (this.sourceBlock_ instanceof Blockly.BlockSvg) { this.sourceBlock_.pathObject.svgPath.setAttribute( - 'fill', this.getValue() as string); + 'fill', + this.getValue() as string, + ); this.sourceBlock_.pathObject.svgPath.setAttribute('stroke', '#fff'); } } @@ -172,7 +236,7 @@ export class FieldColour extends Blockly.Field { * @returns A valid colour, or null if invalid. */ // eslint-disable-next-line @typescript-eslint/naming-convention - protected override doClassValidation_(newValue?: unknown): string|null { + protected override doClassValidation_(newValue?: unknown): string | null { if (typeof newValue !== 'string') { return null; } @@ -190,8 +254,11 @@ export class FieldColour extends Blockly.Field { this.value_ = newValue; if (this.borderRect_) { this.borderRect_.style.fill = newValue; - } else if (this.sourceBlock_ && this.sourceBlock_.rendered && - this.sourceBlock_ instanceof Blockly.BlockSvg) { + } else if ( + this.sourceBlock_ && + this.sourceBlock_.rendered && + this.sourceBlock_ instanceof Blockly.BlockSvg + ) { this.sourceBlock_.pathObject.svgPath.setAttribute('fill', newValue); this.sourceBlock_.pathObject.svgPath.setAttribute('stroke', '#fff'); } @@ -248,8 +315,10 @@ export class FieldColour extends Blockly.Field { if (!this.picker) throw Error('Picker not found'); Blockly.DropDownDiv.getContentDiv().appendChild(this.picker); - Blockly.DropDownDiv.showPositionedByField(this, - this.dropdownDispose.bind(this)); + Blockly.DropDownDiv.showPositionedByField( + this, + this.dropdownDispose.bind(this), + ); // Focus so we can start receiving keyboard events. this.picker.focus({preventScroll: true}); @@ -277,7 +346,7 @@ export class FieldColour extends Blockly.Field { */ private onKeyDown(e: KeyboardEvent) { let handled = true; - let highlighted: HTMLElement|null; + let highlighted: HTMLElement | null; switch (e.key) { case 'ArrowUp': this.moveHighlightBy(0, -1); @@ -363,8 +432,9 @@ export class FieldColour extends Blockly.Field { } // Move the highlight to the new coordinates. - const cell = - (this.picker as HTMLElement).childNodes[y].childNodes[x] as Element; + const cell = (this.picker as HTMLElement).childNodes[y].childNodes[ + x + ] as Element; const index = y * columns + x; this.setHighlightedCell(cell, index); } @@ -404,7 +474,7 @@ export class FieldColour extends Blockly.Field { * * @returns Highlighted item (null if none). */ - private getHighlighted(): HTMLElement|null { + private getHighlighted(): HTMLElement | null { if (!this.highlightedIndex) { return null; } @@ -438,8 +508,11 @@ export class FieldColour extends Blockly.Field { // Update accessibility roles. const cellId = cell.getAttribute('id'); if (cellId && this.picker) { - Blockly.utils.aria.setState(this.picker, - Blockly.utils.aria.State.ACTIVEDESCENDANT, cellId); + Blockly.utils.aria.setState( + this.picker, + Blockly.utils.aria.State.ACTIVEDESCENDANT, + cellId, + ); } } @@ -455,18 +528,24 @@ export class FieldColour extends Blockly.Field { table.dir = 'ltr'; Blockly.utils.aria.setRole(table, Blockly.utils.aria.Role.GRID); Blockly.utils.aria.setState(table, Blockly.utils.aria.State.EXPANDED, true); - Blockly.utils.aria.setState(table, Blockly.utils.aria.State.ROWCOUNT, - Math.floor(colours.length / columns)); - Blockly.utils.aria.setState(table, - Blockly.utils.aria.State.COLCOUNT, columns); - let row: Element|null = null; + Blockly.utils.aria.setState( + table, + Blockly.utils.aria.State.ROWCOUNT, + Math.floor(colours.length / columns), + ); + Blockly.utils.aria.setState( + table, + Blockly.utils.aria.State.COLCOUNT, + columns, + ); + let row: Element | null = null; for (let i = 0; i < colours.length; i++) { if (i % columns === 0) { row = document.createElement('tr'); Blockly.utils.aria.setRole(row, Blockly.utils.aria.Role.ROW); table.appendChild(row); } - const cell = (document.createElement('td')); + const cell = document.createElement('td'); (row as Element).appendChild(cell); // This becomes the value, if clicked. cell.setAttribute('data-colour', colours[i]); @@ -474,10 +553,16 @@ export class FieldColour extends Blockly.Field { cell.id = Blockly.utils.idGenerator.getNextUniqueId(); cell.setAttribute('data-index', `${i}`); Blockly.utils.aria.setRole(cell, Blockly.utils.aria.Role.GRIDCELL); - Blockly.utils.aria.setState(cell, Blockly.utils.aria.State.LABEL, - colours[i]); - Blockly.utils.aria.setState(cell, Blockly.utils.aria.State.SELECTED, - colours[i] === selectedColour); + Blockly.utils.aria.setState( + cell, + Blockly.utils.aria.State.LABEL, + colours[i], + ); + Blockly.utils.aria.setState( + cell, + Blockly.utils.aria.State.SELECTED, + colours[i] === selectedColour, + ); cell.style.backgroundColor = colours[i]; if (colours[i] === selectedColour) { cell.className = 'blocklyColourSelected'; @@ -486,16 +571,51 @@ export class FieldColour extends Blockly.Field { } // Configure event handler on the table to listen for any event in a cell. - this.boundEvents.push(Blockly.browserEvents.conditionalBind( - table, 'pointerdown', this, this.onClick, true)); - this.boundEvents.push(Blockly.browserEvents.conditionalBind( - table, 'pointermove', this, this.onMouseMove, true)); - this.boundEvents.push(Blockly.browserEvents.conditionalBind( - table, 'pointerenter', this, this.onMouseEnter, true)); - this.boundEvents.push(Blockly.browserEvents.conditionalBind( - table, 'pointerleave', this, this.onMouseLeave, true)); - this.boundEvents.push(Blockly.browserEvents.conditionalBind( - table, 'keydown', this, this.onKeyDown, false)); + this.boundEvents.push( + Blockly.browserEvents.conditionalBind( + table, + 'pointerdown', + this, + this.onClick, + true, + ), + ); + this.boundEvents.push( + Blockly.browserEvents.conditionalBind( + table, + 'pointermove', + this, + this.onMouseMove, + true, + ), + ); + this.boundEvents.push( + Blockly.browserEvents.conditionalBind( + table, + 'pointerenter', + this, + this.onMouseEnter, + true, + ), + ); + this.boundEvents.push( + Blockly.browserEvents.conditionalBind( + table, + 'pointerleave', + this, + this.onMouseLeave, + true, + ), + ); + this.boundEvents.push( + Blockly.browserEvents.conditionalBind( + table, + 'keydown', + this, + this.onKeyDown, + false, + ), + ); this.picker = table; } @@ -535,7 +655,6 @@ Blockly.fieldRegistry.unregister('field_colour'); Blockly.fieldRegistry.register('field_colour', FieldColour); - /** * CSS for colour picker. */ diff --git a/plugins/field-colour/test/field_colour_test.mocha.js b/plugins/field-colour/test/field_colour_test.mocha.js index 304a18ad7d..47c27bb1f7 100644 --- a/plugins/field-colour/test/field_colour_test.mocha.js +++ b/plugins/field-colour/test/field_colour_test.mocha.js @@ -9,11 +9,15 @@ const {FieldColour} = require('../src/index'); const {assert} = require('chai'); const { - assertFieldValue, FieldCreationTestCase, FieldValueTestCase, - runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, + assertFieldValue, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; -suite('FieldColour', function() { +suite('FieldColour', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -33,28 +37,68 @@ suite('FieldColour', function() { * @type {Array} */ const validValueTestCases = [ - {title: '#AAAAAA', value: '#AAAAAA', expectedValue: '#aaaaaa', - expectedText: '#aaa'}, - {title: '#aaaaaa', value: '#aaaaaa', expectedValue: '#aaaaaa', - expectedText: '#aaa'}, - {title: '#AAAA00', value: '#AAAA00', expectedValue: '#aaaa00', - expectedText: '#aa0'}, - {title: '#aaaA00', value: '#aaaA00', expectedValue: '#aaaa00', - expectedText: '#aa0'}, - {title: '#BCBCBC', value: '#BCBCBC', expectedValue: '#bcbcbc', - expectedText: '#bcbcbc'}, - {title: '#bcbcbc', value: '#bcbcbc', expectedValue: '#bcbcbc', - expectedText: '#bcbcbc'}, - {title: '#AA0', value: '#AA0', expectedValue: '#aaaa00', - expectedText: '#aa0'}, - {title: '#aa0', value: '#aa0', expectedValue: '#aaaa00', - expectedText: '#aa0'}, - {title: 'rgb(170, 170, 0)', value: 'rgb(170, 170, 0)', - expectedValue: '#aaaa00', expectedText: '#aa0'}, - {title: 'red', value: 'red', expectedValue: '#ff0000', - expectedText: '#f00'}, + { + title: '#AAAAAA', + value: '#AAAAAA', + expectedValue: '#aaaaaa', + expectedText: '#aaa', + }, + { + title: '#aaaaaa', + value: '#aaaaaa', + expectedValue: '#aaaaaa', + expectedText: '#aaa', + }, + { + title: '#AAAA00', + value: '#AAAA00', + expectedValue: '#aaaa00', + expectedText: '#aa0', + }, + { + title: '#aaaA00', + value: '#aaaA00', + expectedValue: '#aaaa00', + expectedText: '#aa0', + }, + { + title: '#BCBCBC', + value: '#BCBCBC', + expectedValue: '#bcbcbc', + expectedText: '#bcbcbc', + }, + { + title: '#bcbcbc', + value: '#bcbcbc', + expectedValue: '#bcbcbc', + expectedText: '#bcbcbc', + }, + { + title: '#AA0', + value: '#AA0', + expectedValue: '#aaaa00', + expectedText: '#aa0', + }, + { + title: '#aa0', + value: '#aa0', + expectedValue: '#aaaa00', + expectedText: '#aa0', + }, + { + title: 'rgb(170, 170, 0)', + value: 'rgb(170, 170, 0)', + expectedValue: '#aaaa00', + expectedText: '#aa0', + }, + { + title: 'red', + value: 'red', + expectedValue: '#ff0000', + expectedText: '#f00', + }, ]; - const addArgsAndJson = function(testCase) { + const addArgsAndJson = function (testCase) { testCase.args = [testCase.value]; testCase.json = {'colour': testCase.value}; }; @@ -71,20 +115,19 @@ suite('FieldColour', function() { * The expected default text for the field being tested. * @type {*} */ - const defaultTextValue = ( - function() { - let expectedText = defaultFieldValue; - const m = defaultFieldValue.match(/^#(.)\1(.)\2(.)\3$/); - if (m) { - expectedText = '#' + m[1] + m[2] + m[3]; - } - return expectedText; - })(); + const defaultTextValue = (function () { + let expectedText = defaultFieldValue; + const m = defaultFieldValue.match(/^#(.)\1(.)\2(.)\3$/); + if (m) { + expectedText = '#' + m[1] + m[2] + m[3]; + } + return expectedText; + })(); /** * Asserts that the field property values are set to default. * @param {!FieldColour} field The field to check. */ - const assertFieldDefault = function(field) { + const assertFieldDefault = function (field) { assertFieldValue(field, defaultFieldValue, defaultTextValue); }; @@ -93,19 +136,27 @@ suite('FieldColour', function() { * @param {FieldColour} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertFieldValue(field, testCase.expectedValue, testCase.expectedText); }; runConstructorSuiteTests( - FieldColour, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldColour, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); runFromJsonSuiteTests( - FieldColour, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldColour, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - suite('setValue', function() { + suite('setValue', function () { /** * Create a mock block that may be used as the source block for a field. * @returns {!Object} Mock block. @@ -124,26 +175,33 @@ suite('FieldColour', function() { }; } - suite('Empty -> New Value', function() { - setup(function() { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldColour(); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, defaultFieldValue, - defaultTextValue); - test('With source block', function() { + validValueTestCases, + invalidValueTestCases, + defaultFieldValue, + defaultTextValue, + ); + test('With source block', function () { this.field.setSourceBlock(createBlockMock()); this.field.setValue('#bcbcbc'); assertFieldValue(this.field, '#bcbcbc', '#bcbcbc'); }); }); - suite('Value -> New Value', function() { - setup(function() { + suite('Value -> New Value', function () { + setup(function () { this.field = new FieldColour('#aaaaaa'); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, '#aaaaaa', '#aaa'); - test('With source block', function() { + validValueTestCases, + invalidValueTestCases, + '#aaaaaa', + '#aaa', + ); + test('With source block', function () { this.field.setSourceBlock(createBlockMock()); this.field.setValue('#bcbcbc'); assertFieldValue(this.field, '#bcbcbc', '#bcbcbc'); @@ -151,42 +209,56 @@ suite('FieldColour', function() { }); }); - suite('Validators', function() { - setup(function() { + suite('Validators', function () { + setup(function () { this.field = new FieldColour('#aaaaaa'); }); const testSuites = [ - {title: 'Null Validator', - validator: - function() { - return null; - }, - value: '#000000', expectedValue: '#aaaaaa', expectedText: '#aaa'}, - {title: 'Force Full Red Validator', - validator: - function(newValue) { - return '#ff' + newValue.substr(3, 4); - }, - value: '#000000', expectedValue: '#ff0000', expectedText: '#f00'}, - {title: 'Returns Undefined Validator', validator: function() {}, - value: '#000000', expectedValue: '#000000', expectedText: '#000'}, + { + title: 'Null Validator', + validator: function () { + return null; + }, + value: '#000000', + expectedValue: '#aaaaaa', + expectedText: '#aaa', + }, + { + title: 'Force Full Red Validator', + validator: function (newValue) { + return '#ff' + newValue.substr(3, 4); + }, + value: '#000000', + expectedValue: '#ff0000', + expectedText: '#f00', + }, + { + title: 'Returns Undefined Validator', + validator: function () {}, + value: '#000000', + expectedValue: '#000000', + expectedText: '#000', + }, ]; - testSuites.forEach(function(suiteInfo) { - suite(suiteInfo.title, function() { - setup(function() { + testSuites.forEach(function (suiteInfo) { + suite(suiteInfo.title, function () { + setup(function () { this.field.setValidator(suiteInfo.validator); }); - test('New Value', function() { + test('New Value', function () { this.field.setValue(suiteInfo.value); assertFieldValue( - this.field, suiteInfo.expectedValue, suiteInfo.expectedText); + this.field, + suiteInfo.expectedValue, + suiteInfo.expectedText, + ); }); }); }); }); - suite('Customizations', function() { - suite('Colours and Titles', function() { + suite('Customizations', function () { + suite('Colours and Titles', function () { /** * Verify that the list of colours and titles are as expected. * @param {!FieldColour} field Field to test. @@ -199,14 +271,14 @@ suite('FieldColour', function() { assert.equal(String(actualColours), String(expectedColours)); assert.equal(String(actualTitles), String(expectedTitles)); } - test('JS Constructor', function() { + test('JS Constructor', function () { const field = new FieldColour('#aaaaaa', null, { colourOptions: ['#aaaaaa'], colourTitles: ['grey'], }); assertColoursAndTitles(field, ['#aaaaaa'], ['grey']); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldColour.fromJson({ colour: '#aaaaaa', colourOptions: ['#aaaaaa'], @@ -214,24 +286,23 @@ suite('FieldColour', function() { }); assertColoursAndTitles(field, ['#aaaaaa'], ['grey']); }); - test('setColours', function() { + test('setColours', function () { const field = new FieldColour(); field.setColours(['#aaaaaa'], ['grey']); assertColoursAndTitles(field, ['#aaaaaa'], ['grey']); }); - test('Titles Undefined', function() { + test('Titles Undefined', function () { const field = new FieldColour(); field.setColours(['#aaaaaa']); assertColoursAndTitles(field, ['#aaaaaa'], []); }); - test('Some Titles Undefined', function() { + test('Some Titles Undefined', function () { const field = new FieldColour(); field.setColours(['#aaaaaa', '#ff0000'], ['grey']); - assertColoursAndTitles(field, - ['#aaaaaa', '#ff0000'], ['grey']); + assertColoursAndTitles(field, ['#aaaaaa', '#ff0000'], ['grey']); }); // This is kinda derpy behaviour, but I wanted to document it. - test('Overwriting Colours While Leaving Titles', function() { + test('Overwriting Colours While Leaving Titles', function () { const field = new FieldColour(); field.setColours(['#aaaaaa'], ['grey']); field.setColours(['#ff0000']); @@ -239,7 +310,7 @@ suite('FieldColour', function() { }); }); - suite('Columns', function() { + suite('Columns', function () { /** * Verify that the number of columns is as expected. * @param {!FieldColour} field Field to test. @@ -249,18 +320,18 @@ suite('FieldColour', function() { const actualColumns = field.columns || FieldColour.COLUMNS; assert.equal(actualColumns, expectedColumns); } - test('JS Constructor', function() { + test('JS Constructor', function () { const field = new FieldColour('#ffffff', null, {columns: 3}); assertColumns(field, 3); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldColour.fromJson({ 'colour': '#ffffff', 'columns': 3, }); assertColumns(field, 3); }); - test('setColumns', function() { + test('setColumns', function () { const field = new FieldColour(); field.setColumns(3); assertColumns(field, 3); @@ -268,20 +339,22 @@ suite('FieldColour', function() { }); }); - suite('Serialization', function() { - setup(function() { + suite('Serialization', function () { + setup(function () { this.workspace = new Blockly.Workspace(); - Blockly.defineBlocksWithJsonArray([{ - 'type': 'row_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'input_value', - 'name': 'INPUT', - }, - ], - 'output': null, - }]); + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'row_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT', + }, + ], + 'output': null, + }, + ]); this.assertValue = (value) => { const block = this.workspace.newBlock('row_block'); @@ -292,15 +365,15 @@ suite('FieldColour', function() { }; }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Three char', function() { + test('Three char', function () { this.assertValue('#001122'); }); - test('Six char', function() { + test('Six char', function () { this.assertValue('#012345'); }); }); diff --git a/plugins/field-colour/test/index.html b/plugins/field-colour/test/index.html index b8cc44518f..60fa9f5b29 100644 --- a/plugins/field-colour/test/index.html +++ b/plugins/field-colour/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Colour Playground + + - - - Blockly Field Colour Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-colour/test/index.ts b/plugins/field-colour/test/index.ts index 969cea5a61..25b6d43ad6 100644 --- a/plugins/field-colour/test/index.ts +++ b/plugins/field-colour/test/index.ts @@ -15,17 +15,28 @@ import '../src/index'; const toolbox = generateFieldTestBlocks('field_colour', [ { label: 'Standard', - args: { - }, + args: {}, }, { label: 'Custom', args: { colour: '#ff4040', - colourOptions: - ['#ff4040', '#ff8080', '#ffc0c0', '#4040ff', '#8080ff', '#c0c0ff'], - colourTitles: - ['dark pink', 'pink', 'light pink', 'dark blue', 'blue', 'light blue'], + colourOptions: [ + '#ff4040', + '#ff8080', + '#ffc0c0', + '#4040ff', + '#8080ff', + '#c0c0ff', + ], + colourTitles: [ + 'dark pink', + 'pink', + 'light pink', + 'dark blue', + 'blue', + 'light blue', + ], columns: 3, }, }, @@ -37,13 +48,15 @@ const toolbox = generateFieldTestBlocks('field_colour', [ * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-date/README.md b/plugins/field-date/README.md index d534601e03..a7b28a22cf 100644 --- a/plugins/field-date/README.md +++ b/plugins/field-date/README.md @@ -5,11 +5,13 @@ A [Blockly](https://www.npmjs.com/package/blockly) plugin that uses a browser de ## Installation ### Yarn + ``` yarn add @blockly/field-date ``` ### npm + ``` npm install @blockly/field-date --save ``` @@ -22,12 +24,12 @@ npm install @blockly/field-date --save import * as Blockly from 'blockly'; import {FieldDate} from '@blockly/field-date'; -Blockly.Blocks["test_fields_date"] = { +Blockly.Blocks['test_fields_date'] = { init: function () { this.appendDummyInput() - .appendField("date: ") - .appendField(new FieldDate("2020-02-20"), "FIELDNAME"); - } + .appendField('date: ') + .appendField(new FieldDate('2020-02-20'), 'FIELDNAME'); + }, }; ``` @@ -38,18 +40,20 @@ import * as Blockly from 'blockly'; import '@blockly/field-date'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_fields_date", - "message0": "date: %1", - "args0": [ - { - "type": "field_date", - "name": "FIELDNAME", - "date": "2020-02-20" - } - ] - }]); + { + 'type': 'test_fields_date', + 'message0': 'date: %1', + 'args0': [ + { + 'type': 'field_date', + 'name': 'FIELDNAME', + 'date': '2020-02-20', + }, + ], + }, +]); ``` ## License + Apache 2.0 diff --git a/plugins/field-date/package.json b/plugins/field-date/package.json index 7d3c331259..692f2bda8b 100644 --- a/plugins/field-date/package.json +++ b/plugins/field-date/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -55,9 +55,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-date/src/field_date.ts b/plugins/field-date/src/field_date.ts index 8f3ab76906..4ef86214f1 100644 --- a/plugins/field-date/src/field_date.ts +++ b/plugins/field-date/src/field_date.ts @@ -36,8 +36,10 @@ export class FieldDate extends Blockly.FieldTextInput { * @param config A map of options used to configure the field. */ constructor( - value?: string, validator?: FieldDateValidator, - config?: FieldDateConfig) { + value?: string, + validator?: FieldDateValidator, + config?: FieldDateConfig, + ) { super(value, validator, config); } @@ -262,9 +264,10 @@ export function toLocalISOString(date: Date) { // '2000-02-21' at GMT+0, which is what `date.toISOString()` would return. // For a user whose timezone is GMT-6, this should return '2000-02-20'. // For a user whose timezone is GMT-5, that date should return '2000-02-21'. - return date.toLocaleDateString('en-US') - .replace(/(\d+)\/(\d+)\/(\d+)/, '$3-$1-$2') - .replace(/-(\d)(?!\d)/g, '-0$1'); + return date + .toLocaleDateString('en-US') + .replace(/(\d+)\/(\d+)\/(\d+)/, '$3-$1-$2') + .replace(/-(\d)(?!\d)/g, '-0$1'); } // NOTE: Set default here instead of in class so it's available at Field. diff --git a/plugins/field-date/test/field_date_test.mocha.js b/plugins/field-date/test/field_date_test.mocha.js index 627a8c8f6e..dc08abaa46 100644 --- a/plugins/field-date/test/field_date_test.mocha.js +++ b/plugins/field-date/test/field_date_test.mocha.js @@ -9,8 +9,12 @@ import {testHelpers} from '@blockly/dev-tools'; import {FieldDate} from '../src/index'; const { - assertFieldValue, FieldCreationTestCase, FieldValueTestCase, - runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, + assertFieldValue, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; // Add polyfill for global variables needed. @@ -20,7 +24,7 @@ if (!global.navigator) { }; } -suite('FieldDate', function() { +suite('FieldDate', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -37,13 +41,15 @@ suite('FieldDate', function() { * Configuration for field tests with valid values. * @type {Array} */ - const validValueTestCases = [{ - title: 'String', - value: '3030-03-30', - expectedValue: '3030-03-30', - expectedText: '3/30/3030', - }]; - const addArgsAndJson = function(testCase) { + const validValueTestCases = [ + { + title: 'String', + value: '3030-03-30', + expectedValue: '3030-03-30', + expectedText: '3/30/3030', + }, + ]; + const addArgsAndJson = function (testCase) { testCase.args = [testCase.value]; testCase.json = {'date': testCase.value}; }; @@ -51,12 +57,13 @@ suite('FieldDate', function() { validValueTestCases.forEach(addArgsAndJson); // Construct ISO string using current timezone. // Cannot use toISOString() because it returns in UTC. - const defaultFieldValue = new Date().toLocaleDateString('en-US') - .replace(/(\d+)\/(\d+)\/(\d+)/, '$3-$1-$2') - .replace(/-(\d)(?!\d)/g, '-0$1'); + const defaultFieldValue = new Date() + .toLocaleDateString('en-US') + .replace(/(\d+)\/(\d+)\/(\d+)/, '$3-$1-$2') + .replace(/-(\d)(?!\d)/g, '-0$1'); // NOTE: The actual text depends on system settings of the one running it. const defaultFieldText = new Date().toLocaleDateString(); - const assertFieldDefault = function(field) { + const assertFieldDefault = function (field) { assertFieldValue(field, defaultFieldValue, defaultFieldText); }; @@ -65,86 +72,94 @@ suite('FieldDate', function() { * @param {FieldDate} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertFieldValue(field, testCase.expectedValue, testCase.expectedText); }; runConstructorSuiteTests( - FieldDate, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldDate, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); runFromJsonSuiteTests( - FieldDate, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldDate, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - suite('setValue', function() { - suite('Empty -> New Value', function() { - setup(function() { + suite('setValue', function () { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldDate(); }); runSetValueTests( - validValueTestCases, - invalidValueTestCases, - defaultFieldValue, - defaultFieldText, + validValueTestCases, + invalidValueTestCases, + defaultFieldValue, + defaultFieldText, ); }); - suite('Value -> New Value', function() { + suite('Value -> New Value', function () { const initialValue = '2020-02-20'; const initialText = new Date(initialValue).toLocaleDateString(); - setup(function() { + setup(function () { this.field = new FieldDate(initialValue); }); runSetValueTests( - validValueTestCases, - invalidValueTestCases, - initialValue, - initialText, + validValueTestCases, + invalidValueTestCases, + initialValue, + initialText, ); }); }); - suite('Validators', function() { - setup(function() { + suite('Validators', function () { + setup(function () { this.field = new FieldDate('2020-02-20'); }); - teardown(function() { + teardown(function () { this.field.setValidator(null); }); - suite('when validator returns null', function() { - setup(function() { + suite('when validator returns null', function () { + setup(function () { this.field.setValidator(() => { return null; }); }); - test('should not set the new value', function() { + test('should not set the new value', function () { this.field.setValue('3030-03-30'); assertFieldValue(this.field, '2020-02-20', '2/20/2020'); }); }); - suite('when validator sets day to 20s', function() { - setup(function() { - this.field.setValidator(function(newValue) { + suite('when validator sets day to 20s', function () { + setup(function () { + this.field.setValidator(function (newValue) { return newValue.substr(0, 8) + '2' + newValue.substr(9, 1); }); }); - test('should set the value to a "20s" date', function() { + test('should set the value to a "20s" date', function () { this.field.setValue('3030-03-30'); assertFieldValue(this.field, '3030-03-20', '3/20/3030'); }); }); - suite('when validator returns undefined', function() { - setup(function() { + suite('when validator returns undefined', function () { + setup(function () { this.field.setValidator(() => {}); }); - test('should set the value without changing it', function() { + test('should set the value without changing it', function () { this.field.setValue('3030-03-30'); assertFieldValue(this.field, '3030-03-30', '3/30/3030'); }); }); }); - suite('Time Zones', function() { + suite('Time Zones', function () { // https://nodejs.org/api/cli.html#tz const INITIAL_TZ = process.env.TZ; const TZ_STRINGS = { diff --git a/plugins/field-date/test/index.html b/plugins/field-date/test/index.html index 8547c4f46c..1f568ca999 100644 --- a/plugins/field-date/test/index.html +++ b/plugins/field-date/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Date Playground + + - - - Blockly Field Date Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-date/test/index.ts b/plugins/field-date/test/index.ts index 1ec15be9d7..4e3535225a 100644 --- a/plugins/field-date/test/index.ts +++ b/plugins/field-date/test/index.ts @@ -27,8 +27,7 @@ const tooltipConfig: FieldDateFromJsonConfig = { tooltip: 'This date block has a tooltip!', }; -const emptyConfig: FieldDateFromJsonConfig = { -}; +const emptyConfig: FieldDateFromJsonConfig = {}; const toolbox = generateFieldTestBlocks('field_date', [ { @@ -51,13 +50,15 @@ const toolbox = generateFieldTestBlocks('field_date', [ * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-dependent-dropdown/README.md b/plugins/field-dependent-dropdown/README.md index fe47a09555..fa5478e200 100644 --- a/plugins/field-dependent-dropdown/README.md +++ b/plugins/field-dependent-dropdown/README.md @@ -5,23 +5,26 @@ A [Blockly](https://www.npmjs.com/package/blockly) dropdown field where the opti ## Installation ### Yarn + ``` yarn add @blockly/field-dependent-dropdown ``` ### npm + ``` npm install @blockly/field-dependent-dropdown --save ``` ## Usage + This plugin adds a field type `FieldDependentDropdown` that is an extension of `Blockly.FieldDropdown` and is registered as `'field_dependent_dropdown'` for the JSON API. You can associate it with a parent field that is attached to the same block, along with a mapping from the parent field's possible values to the desired menu options for this child field. Whenever the parent field's value changes, this field will automatically change its own available options to the options that correspond to the new parent value. You can also provide a set of default options that will be used if the parent field's value doesn't match any of the keys in your option mapping. -These changes are recorded properly in the undo history, and the fields can be [serialized and later deserialized](https://developers.google.com/blockly/guides/configure/web/serialization) while preserving their options, values, and validity. You can also create chains of dependent dropdowns that depend on other dependent dropdowns. +These changes are recorded properly in the undo history, and the fields can be [serialized and later deserialized](https://developers.google.com/blockly/guides/configure/web/serialization) while preserving their options, values, and validity. You can also create chains of dependent dropdowns that depend on other dependent dropdowns. Note that the parent field must be attached to the block before the child field, and the child field will attach a validator function to the parent field to intercept changes to its value. If you want to add your own [custom field validator](https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators) to the parent field, you need to use [the JavaScript API to define your block](https://developers.google.com/blockly/guides/create-custom-blocks/define-blocks#json_format_versus_javascript_api) and [pass your validator to the parent field's constructor](https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown#creating_a_dropdown_validator). If you try to set the parent's validator later, you'll overwrite the one added by this plugin. -To create a dependent dropdown, you'll need to add this field type to a block definition, and add that block to your toolbox. See below for an example of defining a block that uses this field. +To create a dependent dropdown, you'll need to add this field type to a block definition, and add that block to your toolbox. See below for an example of defining a block that uses this field. ### JSON @@ -61,28 +64,38 @@ import * as Blockly from 'blockly'; import {FieldDependentDropdown} from '@blockly/field-dependent-dropdown'; Blockly.Blocks['dependent_dropdown_example'] = { - init: function() { + init: function () { const parentFieldName = 'ANIMAL_CATEGORY'; const childFieldName = 'ANIMAL'; - const parentOptions = - [['Mammal', 'mammal'], ['Bird', 'bird'], ['Cryptid', 'cryptid']]; + const parentOptions = [ + ['Mammal', 'mammal'], + ['Bird', 'bird'], + ['Cryptid', 'cryptid'], + ]; const optionMapping = { - 'mammal': [['Dog', 'dog'], ['Cat', 'cat'], ['Hamster', 'hamster']], - 'bird': [['Parakeet', 'parakeet'], ['Canary', 'canary']], + 'mammal': [ + ['Dog', 'dog'], + ['Cat', 'cat'], + ['Hamster', 'hamster'], + ], + 'bird': [ + ['Parakeet', 'parakeet'], + ['Canary', 'canary'], + ], }; const defaultOptions = [['None available', 'noneAvailable']]; this.appendDummyInput() - .appendField('Category') - .appendField( - new Blockly.FieldDropdown(parentOptions), - parentFieldName) - .appendField('Animal') - .appendField( - new FieldDependentDropdown( - parentFieldName, - optionMapping, - defaultOptions), - childFieldName); + .appendField('Category') + .appendField(new Blockly.FieldDropdown(parentOptions), parentFieldName) + .appendField('Animal') + .appendField( + new FieldDependentDropdown( + parentFieldName, + optionMapping, + defaultOptions, + ), + childFieldName, + ); }, }; ``` diff --git a/plugins/field-dependent-dropdown/package.json b/plugins/field-dependent-dropdown/package.json index 5a71b1871b..3c8536fbf6 100644 --- a/plugins/field-dependent-dropdown/package.json +++ b/plugins/field-dependent-dropdown/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -55,9 +55,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-dependent-dropdown/src/dependent_dropdown_options_change.ts b/plugins/field-dependent-dropdown/src/dependent_dropdown_options_change.ts index 0c93f5a2dc..5a7d30b11f 100644 --- a/plugins/field-dependent-dropdown/src/dependent_dropdown_options_change.ts +++ b/plugins/field-dependent-dropdown/src/dependent_dropdown_options_change.ts @@ -20,18 +20,21 @@ import type {FieldDependentDropdown} from './field_dependent_dropdown'; * @returns Whether the arrays are deeply equivalent. */ function arraysAreEquivalent(a: T[], b: T[]): boolean { - return a.length === b.length && a.every((aElement, index) => { - const bElement = b[index]; - if (Array.isArray(aElement) && Array.isArray(bElement)) { - return arraysAreEquivalent(aElement, bElement); - } - return aElement === bElement; - }); + return ( + a.length === b.length && + a.every((aElement, index) => { + const bElement = b[index]; + if (Array.isArray(aElement) && Array.isArray(bElement)) { + return arraysAreEquivalent(aElement, bElement); + } + return aElement === bElement; + }) + ); } /** The structure of a serialized DependentDropdownOptionsChange. */ export interface DependentDropdownOptionsChangeJson - extends Blockly.Events.BlockBaseJson { + extends Blockly.Events.BlockBaseJson { name: string; newValue: string; oldValue: string; @@ -80,20 +83,23 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase { * @param newOptions New options for the dropdown. */ constructor( - block?: Blockly.Block, - name?: string, - oldValue?: string, - newValue?: string, - oldOptions?: Blockly.MenuOption[], - newOptions?: Blockly.MenuOption[]) { + block?: Blockly.Block, + name?: string, + oldValue?: string, + newValue?: string, + oldOptions?: Blockly.MenuOption[], + newOptions?: Blockly.MenuOption[], + ) { super(block); - if (!block || - !name || - !oldValue || - !newValue || - !oldOptions || - !newOptions) { + if ( + !block || + !name || + !oldValue || + !newValue || + !oldOptions || + !newOptions + ) { // Blank event to be populated by fromJson. return; } @@ -111,14 +117,17 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase { */ toJson(): DependentDropdownOptionsChangeJson { const json = super.toJson() as DependentDropdownOptionsChangeJson; - if (!this.name || - !this.oldValue || - !this.newValue || - !this.oldOptions || - !this.newOptions) { + if ( + !this.name || + !this.oldValue || + !this.newValue || + !this.oldOptions || + !this.newOptions + ) { throw new Error( - 'The changed element is undefined. Either pass all needed ' + - 'parameters to the constructor, or call fromJson.'); + 'The changed element is undefined. Either pass all needed ' + + 'parameters to the constructor, or call fromJson.', + ); } json['name'] = this.name; json['oldValue'] = this.oldValue; @@ -131,17 +140,19 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase { /** * Decode the JSON event. * @param json JSON representation. + * @param workspace + * @param event * @returns The deserialized event. */ static fromJson( - json: DependentDropdownOptionsChangeJson, - workspace: Blockly.Workspace, - event?: any + json: DependentDropdownOptionsChangeJson, + workspace: Blockly.Workspace, + event?: any, ): DependentDropdownOptionsChange { const newEvent = super.fromJson( - json, - workspace, - event + json, + workspace, + event, ) as DependentDropdownOptionsChange; newEvent.name = json['name']; newEvent.oldValue = json['oldValue']; @@ -157,9 +168,11 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase { */ isNull(): boolean { const valuesAreEqual = this.oldValue === this.newValue; - const optionsAreEquivalent = (this.oldOptions === this.newOptions) || - (Array.isArray(this.oldOptions) && Array.isArray(this.newOptions) && - arraysAreEquivalent(this.oldOptions, this.newOptions)); + const optionsAreEquivalent = + this.oldOptions === this.newOptions || + (Array.isArray(this.oldOptions) && + Array.isArray(this.newOptions) && + arraysAreEquivalent(this.oldOptions, this.newOptions)); return valuesAreEqual && optionsAreEquivalent; } @@ -168,25 +181,27 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase { * @param forward True if run forward, false if run backward (undo). */ run(forward: boolean): void { - if (!this.blockId || - !this.name || - !this.oldValue || - !this.newValue || - !this.oldOptions || - !this.newOptions) { - console.warn('Can\'t run uninitialized event.'); + if ( + !this.blockId || + !this.name || + !this.oldValue || + !this.newValue || + !this.oldOptions || + !this.newOptions + ) { + console.warn("Can't run uninitialized event."); return; } const workspace = this.getEventWorkspace_(); const block = workspace.getBlockById(this.blockId); if (!block) { - console.warn('Can\'t change non-existent block: ' + this.blockId); + console.warn("Can't change non-existent block: " + this.blockId); return; } const dropdown = block.getField(this.name) as FieldDependentDropdown; if (!dropdown) { - console.warn('Can\'t change non-existent dropdown field: ' + this.name); + console.warn("Can't change non-existent dropdown field: " + this.name); return; } @@ -205,6 +220,7 @@ export class DependentDropdownOptionsChange extends Blockly.Events.BlockBase { } Blockly.registry.register( - Blockly.registry.Type.EVENT, - DependentDropdownOptionsChange.EVENT_TYPE, - DependentDropdownOptionsChange); + Blockly.registry.Type.EVENT, + DependentDropdownOptionsChange.EVENT_TYPE, + DependentDropdownOptionsChange, +); diff --git a/plugins/field-dependent-dropdown/src/field_dependent_dropdown.ts b/plugins/field-dependent-dropdown/src/field_dependent_dropdown.ts index 65ff6cd7e6..fcd6deb981 100644 --- a/plugins/field-dependent-dropdown/src/field_dependent_dropdown.ts +++ b/plugins/field-dependent-dropdown/src/field_dependent_dropdown.ts @@ -18,8 +18,10 @@ export interface ChildOptionMapping { } // This type isn't exported from Blockly so we have to derive it from the API. -type FieldConfig = - Exclude[2], undefined>; +type FieldConfig = Exclude< + ConstructorParameters[2], + undefined +>; /** fromJson config for a dependent dropdown field. */ export interface FieldDependentDropdownFromJsonConfig extends FieldConfig { @@ -104,11 +106,12 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { * field, such as a tooltip. */ constructor( - parentName: string, - optionMapping: ChildOptionMapping, - defaultOptions?: Blockly.MenuOption[], - validator?: Blockly.FieldValidator, - config?: FieldConfig) { + parentName: string, + optionMapping: ChildOptionMapping, + defaultOptions?: Blockly.MenuOption[], + validator?: Blockly.FieldValidator, + config?: FieldConfig, + ) { // A menu generator needs to be passed to the super constructor, but it // needs to be able to reference data that hasn't been populated yet. We're // not allowed to refer to "this" in this constructor before calling @@ -162,13 +165,15 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { * @returns The new field instance. */ static fromJson( - options: FieldDependentDropdownFromJsonConfig): FieldDependentDropdown { + options: FieldDependentDropdownFromJsonConfig, + ): FieldDependentDropdown { return new FieldDependentDropdown( - options['parentName'], - options['optionMapping'], - options['defaultOptions'], - undefined, - options); + options['parentName'], + options['optionMapping'], + options['defaultOptions'], + undefined, + options, + ); } /** @@ -179,12 +184,16 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { setSourceBlock(block: Blockly.Block) { super.setSourceBlock(block); - const parentField: Blockly.Field | null = - block.getField(this.parentName); + const parentField: Blockly.Field | null = block.getField( + this.parentName, + ); if (!parentField) { - throw new Error('Could not find a parent field with the name ' + - this.parentName + ' for the dependent dropdown.'); + throw new Error( + 'Could not find a parent field with the name ' + + this.parentName + + ' for the dependent dropdown.', + ); } this.dependencyData.parentField = parentField; @@ -233,8 +242,9 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { const block = this.getSourceBlock(); if (!block) { throw new Error( - 'Could not validate a field that is not attached to a block: ' + - this.name); + 'Could not validate a field that is not attached to a block: ' + + this.name, + ); } const oldChildValue = this.getValue(); @@ -245,7 +255,8 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { newChildOptions = this.defaultOptions; } else { console.warn( - 'Could not find child options for the parent value: ' + newValue); + 'Could not find child options for the parent value: ' + newValue, + ); return; } } @@ -253,11 +264,10 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { // If the child field's value is still available in the new options, keep // it, otherwise change the field's value to the first available option. const newOptionsIncludeOldValue = - (newChildOptions.find((option) => option[1] == oldChildValue) != - undefined); - const newChildValue = newOptionsIncludeOldValue ? - oldChildValue : - newChildOptions[0][1]; + newChildOptions.find((option) => option[1] == oldChildValue) != undefined; + const newChildValue = newOptionsIncludeOldValue + ? oldChildValue + : newChildOptions[0][1]; // Record the options so that the option generator can access them. this.dependencyData.derivedOptions = newChildOptions; @@ -286,16 +296,21 @@ export class FieldDependentDropdown extends Blockly.FieldDropdown { } // Record that the child field's options and value have changed. - Blockly.Events.fire(new DependentDropdownOptionsChange( + Blockly.Events.fire( + new DependentDropdownOptionsChange( block, this.name, oldChildValue ?? undefined, newChildValue ?? undefined, oldChildOptions, - newChildOptions)); + newChildOptions, + ), + ); } } } Blockly.fieldRegistry.register( - 'field_dependent_dropdown', FieldDependentDropdown); + 'field_dependent_dropdown', + FieldDependentDropdown, +); diff --git a/plugins/field-dependent-dropdown/test/field_dependent_dropdown.mocha.js b/plugins/field-dependent-dropdown/test/field_dependent_dropdown.mocha.js index ba4cc26828..66abdab0a8 100644 --- a/plugins/field-dependent-dropdown/test/field_dependent_dropdown.mocha.js +++ b/plugins/field-dependent-dropdown/test/field_dependent_dropdown.mocha.js @@ -11,33 +11,37 @@ require('./field_dependent_dropdown_test_block'); const assert = chai.assert; -suite('fieldDependentDropdown', function() { - setup(function() { +suite('fieldDependentDropdown', function () { + setup(function () { this.workspace = new Blockly.Workspace(); this.clock = sinon.useFakeTimers(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); // Finish any remaining queued events then dispose the sinon environment. this.clock.runAll(); this.clock.restore(); }); - test('Changing a parent value changes the child options', function() { + test('Changing a parent value changes the child options', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); - assert.deepEqual( - childDropdown.getOptions(true), - [['A1', 'a1'], ['A2', 'a2'], ['Shared', 'shared']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['A1', 'a1'], + ['A2', 'a2'], + ['Shared', 'shared'], + ]); parentDropdown.setValue('b'); - assert.deepEqual( - childDropdown.getOptions(true), - [['B1', 'b1'], ['B2', 'b2'], ['Shared', 'shared']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['B1', 'b1'], + ['B2', 'b2'], + ['Shared', 'shared'], + ]); }); - test('Changing a parent value changes the child value', function() { + test('Changing a parent value changes the child value', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); @@ -46,7 +50,7 @@ suite('fieldDependentDropdown', function() { assert.equal(childDropdown.getValue(), 'b1'); }); - test('Changing a parent value preserves shared child value', function() { + test('Changing a parent value preserves shared child value', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); @@ -55,18 +59,22 @@ suite('fieldDependentDropdown', function() { assert.equal(childDropdown.getValue(), 'shared'); }); - test('Changing a parent value changes the grandchild options', function() { + test('Changing a parent value changes the grandchild options', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const grandchildDropdown = block.getField('GRANDCHILD_FIELD'); - assert.deepEqual( - grandchildDropdown.getOptions(true), [['A11', 'a11'], ['A12', 'a12']]); + assert.deepEqual(grandchildDropdown.getOptions(true), [ + ['A11', 'a11'], + ['A12', 'a12'], + ]); parentDropdown.setValue('b'); - assert.deepEqual( - grandchildDropdown.getOptions(true), [['B11', 'b11'], ['B12', 'b12']]); + assert.deepEqual(grandchildDropdown.getOptions(true), [ + ['B11', 'b11'], + ['B12', 'b12'], + ]); }); - test('Changing a parent value changes the grandchild value', function() { + test('Changing a parent value changes the grandchild value', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const grandchildDropdown = block.getField('GRANDCHILD_FIELD'); @@ -75,22 +83,27 @@ suite('fieldDependentDropdown', function() { assert.equal(grandchildDropdown.getValue(), 'b11'); }); - test('Uses default options if parent field not in mapping', function() { + test('Uses default options if parent field not in mapping', function () { const block = this.workspace.newBlock( - 'dependent_dropdown_default_options_test'); + 'dependent_dropdown_default_options_test', + ); const parentTextInput = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); - assert.deepEqual( - childDropdown.getOptions(true), [['Default Option', 'defaultOption']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['Default Option', 'defaultOption'], + ]); parentTextInput.setValue('a'); - assert.deepEqual( - childDropdown.getOptions(true), [['A1', 'a1'], ['A2', 'a2']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['A1', 'a1'], + ['A2', 'a2'], + ]); parentTextInput.setValue('b'); - assert.deepEqual( - childDropdown.getOptions(true), [['Default Option', 'defaultOption']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['Default Option', 'defaultOption'], + ]); }); - test('Parent field user validator composes with new validator', function() { + test('Parent field user validator composes with new validator', function () { const block = this.workspace.newBlock('dependent_dropdown_validation_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); @@ -101,28 +114,36 @@ suite('fieldDependentDropdown', function() { assert.equal(childDropdown.getValue(), 'valid1'); }); - test('undoing parent change undoes child and grandchild options', function() { + test('undoing parent change undoes child and grandchild options', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); const grandchildDropdown = block.getField('GRANDCHILD_FIELD'); parentDropdown.setValue('b'); - assert.deepEqual( - childDropdown.getOptions(true), - [['B1', 'b1'], ['B2', 'b2'], ['Shared', 'shared']]); - assert.deepEqual( - grandchildDropdown.getOptions(true), [['B11', 'b11'], ['B12', 'b12']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['B1', 'b1'], + ['B2', 'b2'], + ['Shared', 'shared'], + ]); + assert.deepEqual(grandchildDropdown.getOptions(true), [ + ['B11', 'b11'], + ['B12', 'b12'], + ]); // Wait for the change events to get fired and recorded in history. this.clock.runAll(); this.workspace.undo(false); - assert.deepEqual( - childDropdown.getOptions(true), - [['A1', 'a1'], ['A2', 'a2'], ['Shared', 'shared']]); - assert.deepEqual( - grandchildDropdown.getOptions(true), [['A11', 'a11'], ['A12', 'a12']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['A1', 'a1'], + ['A2', 'a2'], + ['Shared', 'shared'], + ]); + assert.deepEqual(grandchildDropdown.getOptions(true), [ + ['A11', 'a11'], + ['A12', 'a12'], + ]); }); - test('undoing parent change undoes child and grandchild values', function() { + test('undoing parent change undoes child and grandchild values', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); @@ -137,7 +158,7 @@ suite('fieldDependentDropdown', function() { assert.equal(grandchildDropdown.getValue(), 'a11'); }); - test('redoing parent change redoes child options', function() { + test('redoing parent change redoes child options', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); @@ -145,16 +166,20 @@ suite('fieldDependentDropdown', function() { // Wait for the change events to get fired and recorded in history. this.clock.runAll(); this.workspace.undo(false); - assert.deepEqual( - childDropdown.getOptions(true), - [['A1', 'a1'], ['A2', 'a2'], ['Shared', 'shared']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['A1', 'a1'], + ['A2', 'a2'], + ['Shared', 'shared'], + ]); this.workspace.undo(true); - assert.deepEqual( - childDropdown.getOptions(true), - [['B1', 'b1'], ['B2', 'b2'], ['Shared', 'shared']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['B1', 'b1'], + ['B2', 'b2'], + ['Shared', 'shared'], + ]); }); - test('redoing parent change redoes child values', function() { + test('redoing parent change redoes child values', function () { const block = this.workspace.newBlock('dependent_dropdown_test'); const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); @@ -167,43 +192,59 @@ suite('fieldDependentDropdown', function() { assert.equal(childDropdown.getValue(), 'b1'); }); - test('deserialized values affect available options', function() { + test('deserialized values affect available options', function () { const serializedWorkspace = { 'blocks': { - 'blocks': [{ - 'type': 'dependent_dropdown_test', - 'fields': { - 'PARENT_FIELD': 'b', 'CHILD_FIELD': 'b2', 'GRANDCHILD_FIELD': 'b21', + 'blocks': [ + { + 'type': 'dependent_dropdown_test', + 'fields': { + 'PARENT_FIELD': 'b', + 'CHILD_FIELD': 'b2', + 'GRANDCHILD_FIELD': 'b21', + }, }, - }], + ], }, }; Blockly.serialization.workspaces.load(serializedWorkspace, this.workspace); - const block = - this.workspace.getBlocksByType('dependent_dropdown_test', false)[0]; + const block = this.workspace.getBlocksByType( + 'dependent_dropdown_test', + false, + )[0]; const childDropdown = block.getField('CHILD_FIELD'); const grandchildDropdown = block.getField('GRANDCHILD_FIELD'); - assert.deepEqual( - childDropdown.getOptions(true), - [['B1', 'b1'], ['B2', 'b2'], ['Shared', 'shared']]); - assert.deepEqual( - grandchildDropdown.getOptions(true), [['B21', 'b21'], ['B22', 'b22']]); + assert.deepEqual(childDropdown.getOptions(true), [ + ['B1', 'b1'], + ['B2', 'b2'], + ['Shared', 'shared'], + ]); + assert.deepEqual(grandchildDropdown.getOptions(true), [ + ['B21', 'b21'], + ['B22', 'b22'], + ]); }); - test('deserializing preserves values not in default options', function() { + test('deserializing preserves values not in default options', function () { const serializedWorkspace = { 'blocks': { - 'blocks': [{ - 'type': 'dependent_dropdown_test', - 'fields': { - 'PARENT_FIELD': 'b', 'CHILD_FIELD': 'b2', 'GRANDCHILD_FIELD': 'b21', + 'blocks': [ + { + 'type': 'dependent_dropdown_test', + 'fields': { + 'PARENT_FIELD': 'b', + 'CHILD_FIELD': 'b2', + 'GRANDCHILD_FIELD': 'b21', + }, }, - }], + ], }, }; Blockly.serialization.workspaces.load(serializedWorkspace, this.workspace); - const block = - this.workspace.getBlocksByType('dependent_dropdown_test', false)[0]; + const block = this.workspace.getBlocksByType( + 'dependent_dropdown_test', + false, + )[0]; const parentDropdown = block.getField('PARENT_FIELD'); const childDropdown = block.getField('CHILD_FIELD'); const grandchildDropdown = block.getField('GRANDCHILD_FIELD'); @@ -212,27 +253,33 @@ suite('fieldDependentDropdown', function() { assert.equal(grandchildDropdown.getValue(), 'b21'); }); - test('deserializing invalid value replaces with valid value', function() { + test('deserializing invalid value replaces with valid value', function () { const serializedWorkspace = { 'blocks': { - 'blocks': [{ - 'type': 'dependent_dropdown_test', - 'fields': { - 'PARENT_FIELD': 'b', 'CHILD_FIELD': 'a2', 'GRANDCHILD_FIELD': 'b21', + 'blocks': [ + { + 'type': 'dependent_dropdown_test', + 'fields': { + 'PARENT_FIELD': 'b', + 'CHILD_FIELD': 'a2', + 'GRANDCHILD_FIELD': 'b21', + }, }, - }], + ], }, }; Blockly.serialization.workspaces.load(serializedWorkspace, this.workspace); - const block = - this.workspace.getBlocksByType('dependent_dropdown_test', false)[0]; + const block = this.workspace.getBlocksByType( + 'dependent_dropdown_test', + false, + )[0]; const childDropdown = block.getField('CHILD_FIELD'); const grandchildDropdown = block.getField('GRANDCHILD_FIELD'); assert.equal(childDropdown.getValue(), 'b1'); assert.equal(grandchildDropdown.getValue(), 'b11'); }); - test('round trip serialization/deserialization preserves values', function() { + test('round trip serialization/deserialization preserves values', function () { let block = this.workspace.newBlock('dependent_dropdown_test'); let parentDropdown = block.getField('PARENT_FIELD'); let childDropdown = block.getField('CHILD_FIELD'); @@ -240,11 +287,11 @@ suite('fieldDependentDropdown', function() { parentDropdown.setValue('b'); childDropdown.setValue('b2'); grandchildDropdown.setValue('b21'); - const serializedWorkspace = - Blockly.serialization.workspaces.save(this.workspace); + const serializedWorkspace = Blockly.serialization.workspaces.save( + this.workspace, + ); Blockly.serialization.workspaces.load(serializedWorkspace, this.workspace); - block = - this.workspace.getBlocksByType('dependent_dropdown_test', false)[0]; + block = this.workspace.getBlocksByType('dependent_dropdown_test', false)[0]; parentDropdown = block.getField('PARENT_FIELD'); childDropdown = block.getField('CHILD_FIELD'); grandchildDropdown = block.getField('GRANDCHILD_FIELD'); diff --git a/plugins/field-dependent-dropdown/test/field_dependent_dropdown_test_block.ts b/plugins/field-dependent-dropdown/test/field_dependent_dropdown_test_block.ts index 8123ce38d5..03b109ad91 100644 --- a/plugins/field-dependent-dropdown/test/field_dependent_dropdown_test_block.ts +++ b/plugins/field-dependent-dropdown/test/field_dependent_dropdown_test_block.ts @@ -9,15 +9,26 @@ Blockly.defineBlocksWithJsonArray([ { 'type': 'field_dropdown', 'name': 'PARENT_FIELD', - 'options': [['A', 'a'], ['B', 'b']], + 'options': [ + ['A', 'a'], + ['B', 'b'], + ], }, { 'type': 'field_dependent_dropdown', 'name': 'CHILD_FIELD', 'parentName': 'PARENT_FIELD', 'optionMapping': { - 'a': [['A1', 'a1'], ['A2', 'a2'], ['Shared', 'shared']], - 'b': [['B1', 'b1'], ['B2', 'b2'], ['Shared', 'shared']], + 'a': [ + ['A1', 'a1'], + ['A2', 'a2'], + ['Shared', 'shared'], + ], + 'b': [ + ['B1', 'b1'], + ['B2', 'b2'], + ['Shared', 'shared'], + ], }, }, { @@ -25,10 +36,22 @@ Blockly.defineBlocksWithJsonArray([ 'name': 'GRANDCHILD_FIELD', 'parentName': 'CHILD_FIELD', 'optionMapping': { - 'a1': [['A11', 'a11'], ['A12', 'a12']], - 'a2': [['A21', 'a21'], ['A22', 'a22']], - 'b1': [['B11', 'b11'], ['B12', 'b12']], - 'b2': [['B21', 'b21'], ['B22', 'b22']], + 'a1': [ + ['A11', 'a11'], + ['A12', 'a12'], + ], + 'a2': [ + ['A21', 'a21'], + ['A22', 'a22'], + ], + 'b1': [ + ['B11', 'b11'], + ['B12', 'b12'], + ], + 'b2': [ + ['B21', 'b21'], + ['B22', 'b22'], + ], 'shared': [['Only', 'only']], }, }, @@ -48,7 +71,10 @@ Blockly.defineBlocksWithJsonArray([ 'name': 'CHILD_FIELD', 'parentName': 'PARENT_FIELD', 'optionMapping': { - 'a': [['A1', 'a1'], ['A2', 'a2']], + 'a': [ + ['A1', 'a1'], + ['A2', 'a2'], + ], }, 'defaultOptions': [['Default Option', 'defaultOption']], }, @@ -58,32 +84,47 @@ Blockly.defineBlocksWithJsonArray([ ]); Blockly.Blocks['dependent_dropdown_validation_test'] = { - init: function() { + init: function () { const parentFieldName = 'PARENT_FIELD'; const childFieldName = 'CHILD_FIELD'; const parentOptions: Blockly.MenuOption[] = [ - ['Initial', 'initial'], ['Invalid', 'invalid'], ['Valid', 'valid'], + ['Initial', 'initial'], + ['Invalid', 'invalid'], + ['Valid', 'valid'], ]; const dependentOptions: ChildOptionMapping = { - 'initial': [['Initial1', 'initial1'], ['Initial2', 'initial2']], - 'invalid': [['Invalid1', 'invalid1'], ['Invalid2', 'invalid2']], - 'valid': [['Valid1', 'valid1'], ['Valid2', 'valid2']], + 'initial': [ + ['Initial1', 'initial1'], + ['Initial2', 'initial2'], + ], + 'invalid': [ + ['Invalid1', 'invalid1'], + ['Invalid2', 'invalid2'], + ], + 'valid': [ + ['Valid1', 'valid1'], + ['Valid2', 'valid2'], + ], }; - const parentValidator: Blockly.FieldDropdownValidator = function(newValue) { + const parentValidator: Blockly.FieldDropdownValidator = function ( + newValue, + ) { if (newValue == 'invalid') { return 'valid'; } return undefined; }; this.appendDummyInput() - .appendField('Parent') - .appendField( - new Blockly.FieldDropdown(parentOptions, parentValidator), - parentFieldName) - .appendField('Child') - .appendField( - new FieldDependentDropdown(parentFieldName, dependentOptions), - childFieldName); + .appendField('Parent') + .appendField( + new Blockly.FieldDropdown(parentOptions, parentValidator), + parentFieldName, + ) + .appendField('Child') + .appendField( + new FieldDependentDropdown(parentFieldName, dependentOptions), + childFieldName, + ); this.setColour(100); }, }; diff --git a/plugins/field-dependent-dropdown/test/index.html b/plugins/field-dependent-dropdown/test/index.html index 9d71bc9013..eb2b560a77 100644 --- a/plugins/field-dependent-dropdown/test/index.html +++ b/plugins/field-dependent-dropdown/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Dependent Dropdown Field Playground + + - - - Blockly Dependent Dropdown Field Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-dependent-dropdown/test/index.ts b/plugins/field-dependent-dropdown/test/index.ts index 7db9dc22ab..353b110978 100644 --- a/plugins/field-dependent-dropdown/test/index.ts +++ b/plugins/field-dependent-dropdown/test/index.ts @@ -43,13 +43,15 @@ const toolbox: Blockly.utils.toolbox.ToolboxDefinition = { * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-grid-dropdown/README.md b/plugins/field-grid-dropdown/README.md index 6c8d9e34a5..66e2718980 100644 --- a/plugins/field-grid-dropdown/README.md +++ b/plugins/field-grid-dropdown/README.md @@ -9,61 +9,82 @@ A [Blockly](https://www.npmjs.com/package/blockly) dropdown field with grid layo ## Installation ### Yarn + ``` yarn add @blockly/field-grid-dropdown ``` ### npm + ``` npm install @blockly/field-grid-dropdown --save ``` ## Usage -This field accepts the same parameters as the [Blockly.FieldDropdown]( -https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown#creation) +This field accepts the same parameters as the [Blockly.FieldDropdown](https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown#creation) in Blockly core. The config object bag passed into this field accepts additional optional parameters: + - `"columns"` to specify the number of columns in the dropdown field (must be an integer greater than 0). -If not provided, the default is 3 columns. + If not provided, the default is 3 columns. - `"primaryColour"` to specify the colour of the dropdown (must be a string CSS colour). If not provided, -the dropdown color will match the primary colour of the parent block. + the dropdown color will match the primary colour of the parent block. - `"borderColour"` to specify the colour of the border of the dropdown (must be a string CSS colour). If -not provided, the border colour will match the tertiary colour of the parent block. + not provided, the border colour will match the tertiary colour of the parent block. ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldGridDropdown} from '@blockly/field-grid-dropdown'; -Blockly.Blocks["test_field_grid_dropdown"] = { +Blockly.Blocks['test_field_grid_dropdown'] = { init: function () { this.appendDummyInput() - .appendField("grid dropdown: ") - .appendField(new FieldGridDropdown([ - ["A", "A"],["B", "B"], ["C", "C"],["D", "D"], ["E", "E"], ["F", "F"], - ["G", "G"], ["H", "H"]]), "FIELDNAME"); - } + .appendField('grid dropdown: ') + .appendField( + new FieldGridDropdown([ + ['A', 'A'], + ['B', 'B'], + ['C', 'C'], + ['D', 'D'], + ['E', 'E'], + ['F', 'F'], + ['G', 'G'], + ['H', 'H'], + ]), + 'FIELDNAME', + ); + }, }; ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/field-grid-dropdown'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_field_grid_dropdown", - "message0": "template: %1", - "args0": [ - { - "type": "field_grid_dropdown", - "name": "FIELDNAME", - "options": [ - ["A", "A"],["B", "B"], ["C", "C"],["D", "D"], - ["E", "E"], ["F", "F"], ["G", "G"], ["H", "H"] - ] - } - ] - }]); + { + 'type': 'test_field_grid_dropdown', + 'message0': 'template: %1', + 'args0': [ + { + 'type': 'field_grid_dropdown', + 'name': 'FIELDNAME', + 'options': [ + ['A', 'A'], + ['B', 'B'], + ['C', 'C'], + ['D', 'D'], + ['E', 'E'], + ['F', 'F'], + ['G', 'G'], + ['H', 'H'], + ], + }, + ], + }, +]); ``` ## License diff --git a/plugins/field-grid-dropdown/package-lock.json b/plugins/field-grid-dropdown/package-lock.json index 70c2635c1f..906aff5a9e 100644 --- a/plugins/field-grid-dropdown/package-lock.json +++ b/plugins/field-grid-dropdown/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache 2.0", "devDependencies": { "blockly": "^10.0.0", - "typescript": "^5.0.4" + "typescript": "^5.2.2" }, "engines": { "node": ">=8.17.0" diff --git a/plugins/field-grid-dropdown/package.json b/plugins/field-grid-dropdown/package.json index fdc109b248..acdf013da5 100644 --- a/plugins/field-grid-dropdown/package.json +++ b/plugins/field-grid-dropdown/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "npm run build && blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -51,9 +51,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/field-grid-dropdown/src/index.ts b/plugins/field-grid-dropdown/src/index.ts index 6d98756be5..dc6e4fcbcb 100644 --- a/plugins/field-grid-dropdown/src/index.ts +++ b/plugins/field-grid-dropdown/src/index.ts @@ -23,8 +23,8 @@ export interface FieldGridDropdownConfig extends Blockly.FieldDropdownConfig { /** * Construct a FieldGridDropdown from a JSON arg object. */ -export interface FieldGridDropdownFromJsonConfig extends - FieldGridDropdownConfig { +export interface FieldGridDropdownFromJsonConfig + extends FieldGridDropdownConfig { options?: Blockly.MenuGenerator; } @@ -61,9 +61,11 @@ export class FieldGridDropdown extends Blockly.FieldDropdown { * @constructor * @throws {TypeError} If `menuGenerator` options are incorrectly structured. */ - constructor(menuGenerator: Blockly.MenuGenerator, - validator?: FieldGridDropdownValidator, - config?: FieldGridDropdownConfig) { + constructor( + menuGenerator: Blockly.MenuGenerator, + validator?: FieldGridDropdownValidator, + config?: FieldGridDropdownConfig, + ) { super(menuGenerator, validator, config); if (config?.columns) { @@ -90,9 +92,10 @@ export class FieldGridDropdown extends Blockly.FieldDropdown { static fromJson(config: FieldGridDropdownFromJsonConfig) { if (!config.options) { throw new Error( - 'options are required for the dropdown field. The ' + + 'options are required for the dropdown field. The ' + 'options property must be assigned an array of ' + - '[humanReadableValue, languageNeutralValue] tuples.'); + '[humanReadableValue, languageNeutralValue] tuples.', + ); } // `this` might be a subclass of FieldDropdown if that class doesn't // override the static fromJson method. @@ -140,13 +143,14 @@ export class FieldGridDropdown extends Blockly.FieldDropdown { const menuElement = this.menu_?.getElement() ?? null; if (menuElement) { - Blockly.utils.dom.addClass(menuElement, - 'fieldGridDropDownContainer'); + Blockly.utils.dom.addClass(menuElement, 'fieldGridDropDownContainer'); } this.updateColumnsStyling_(); Blockly.DropDownDiv.showPositionedByField( - this, this.dropdownDispose_.bind(this)); + this, + this.dropdownDispose_.bind(this), + ); } /** @@ -155,8 +159,7 @@ export class FieldGridDropdown extends Blockly.FieldDropdown { private updateColumnsStyling_() { const menuElement = this.menu_ ? this.menu_.getElement() : null; if (menuElement) { - menuElement.style.gridTemplateColumns = - `repeat(${this.columns}, min-content)`; + menuElement.style.gridTemplateColumns = `repeat(${this.columns}, min-content)`; } } @@ -177,8 +180,9 @@ export class FieldGridDropdown extends Blockly.FieldDropdown { const sourceBlock = this.getSourceBlock(); if (!(sourceBlock instanceof Blockly.BlockSvg)) return; - const colourSource = sourceBlock.isShadow() ? sourceBlock.getParent() : - sourceBlock; + const colourSource = sourceBlock.isShadow() + ? sourceBlock.getParent() + : sourceBlock; if (!colourSource) return; return { diff --git a/plugins/field-grid-dropdown/test/field_test.mocha.js b/plugins/field-grid-dropdown/test/field_test.mocha.js index 1332c13548..a72fa2d0dc 100644 --- a/plugins/field-grid-dropdown/test/field_test.mocha.js +++ b/plugins/field-grid-dropdown/test/field_test.mocha.js @@ -8,11 +8,15 @@ const {testHelpers} = require('@blockly/dev-tools'); const {FieldGridDropdown} = require('../src/index'); const { - assertFieldValue, FieldCreationTestCase, FieldValueTestCase, - runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, + assertFieldValue, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; -suite('FieldGridDropdown', function() { +suite('FieldGridDropdown', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -20,38 +24,90 @@ suite('FieldGridDropdown', function() { const invalidValueCreationTestCases = [ {title: 'Undefined', args: [undefined]}, {title: 'Array Items not Arrays', args: [undefined]}, - {title: 'Array Items with Invalid IDs', - args: [[['1', 1], ['2', 2], ['3', 3]]]}, - {title: 'Array Items with Invalid Content', - args: [[[1, '1'], [2, '2'], [3, '3']]]}, + { + title: 'Array Items with Invalid IDs', + args: [ + [ + ['1', 1], + ['2', 2], + ['3', 3], + ], + ], + }, + { + title: 'Array Items with Invalid Content', + args: [ + [ + [1, '1'], + [2, '2'], + [3, '3'], + ], + ], + }, ]; /** * Configuration for field tests with valid values. * @type {Array} */ const validValueCreationTestCases = [ - {title: 'Text Dropdown', value: 'A', expectedValue: 'A', expectedText: 'a', - args: [[['a', 'A'], ['b', 'B'], ['c', 'C']]]}, - {title: 'Image Dropdown', value: 'A', expectedValue: 'A', expectedText: 'a', - args: [[ - [{src: 'scrA', alt: 'a'}, 'A'], - [{src: 'scrB', alt: 'b'}, 'B'], - [{src: 'scrC', alt: 'c'}, 'C']]]}, - {title: 'Dynamic Text Dropdown', value: 'A', expectedValue: 'A', + { + title: 'Text Dropdown', + value: 'A', + expectedValue: 'A', expectedText: 'a', - args: [() => { - return [['a', 'A'], ['b', 'B'], ['c', 'C']]; - }]}, - {title: 'Dynamic Image Dropdown', value: 'A', expectedValue: 'A', + args: [ + [ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ], + ], + }, + { + title: 'Image Dropdown', + value: 'A', + expectedValue: 'A', expectedText: 'a', - args: [() => { - return [ + args: [ + [ [{src: 'scrA', alt: 'a'}, 'A'], [{src: 'scrB', alt: 'b'}, 'B'], - [{src: 'scrC', alt: 'c'}, 'C']]; - }]}, + [{src: 'scrC', alt: 'c'}, 'C'], + ], + ], + }, + { + title: 'Dynamic Text Dropdown', + value: 'A', + expectedValue: 'A', + expectedText: 'a', + args: [ + () => { + return [ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]; + }, + ], + }, + { + title: 'Dynamic Image Dropdown', + value: 'A', + expectedValue: 'A', + expectedText: 'a', + args: [ + () => { + return [ + [{src: 'scrA', alt: 'a'}, 'A'], + [{src: 'scrB', alt: 'b'}, 'B'], + [{src: 'scrC', alt: 'c'}, 'C'], + ]; + }, + ], + }, ]; - const addJson = function(testCase) { + const addJson = function (testCase) { testCase.json = {'options': testCase.args[0]}; }; invalidValueCreationTestCases.forEach(addJson); @@ -62,17 +118,23 @@ suite('FieldGridDropdown', function() { * @param {!FieldGridDropdown} field The field to check. * @param {!FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertFieldValue(field, testCase.expectedValue, testCase.expectedText); }; runConstructorSuiteTests( - FieldGridDropdown, validValueCreationTestCases, - invalidValueCreationTestCases, validTestCaseAssertField); + FieldGridDropdown, + validValueCreationTestCases, + invalidValueCreationTestCases, + validTestCaseAssertField, + ); runFromJsonSuiteTests( - FieldGridDropdown, validValueCreationTestCases, - invalidValueCreationTestCases, validTestCaseAssertField); + FieldGridDropdown, + validValueCreationTestCases, + invalidValueCreationTestCases, + validTestCaseAssertField, + ); /** * Configuration for field tests with invalid values. @@ -91,51 +153,63 @@ suite('FieldGridDropdown', function() { {title: 'Valid ID', value: 'B', expectedValue: 'B', expectedText: 'b'}, ]; - suite('setValue', function() { - setup(function() { - this.field = new FieldGridDropdown( - [['a', 'A'], ['b', 'B'], ['c', 'C']]); + suite('setValue', function () { + setup(function () { + this.field = new FieldGridDropdown([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); }); runSetValueTests( - validValueSetValueTestCases, invalidValueSetValueTestCases, 'A', 'a'); + validValueSetValueTestCases, + invalidValueSetValueTestCases, + 'A', + 'a', + ); }); - suite('Validators', function() { - setup(function() { + suite('Validators', function () { + setup(function () { this.dropdownField = new FieldGridDropdown([ - ['1a', '1A'], ['1b', '1B'], ['1c', '1C'], - ['2a', '2A'], ['2b', '2B'], ['2c', '2C']]); + ['1a', '1A'], + ['1b', '1B'], + ['1c', '1C'], + ['2a', '2A'], + ['2b', '2B'], + ['2c', '2C'], + ]); }); - teardown(function() { + teardown(function () { this.dropdownField.setValidator(null); }); - suite('Null Validator', function() { - setup(function() { - this.dropdownField.setValidator(function() { + suite('Null Validator', function () { + setup(function () { + this.dropdownField.setValidator(function () { return null; }); }); - test('New Value', function() { + test('New Value', function () { this.dropdownField.setValue('1B'); assertFieldValue(this.dropdownField, '1A', '1a'); }); }); - suite('Force 1s Validator', function() { - setup(function() { - this.dropdownField.setValidator(function(newValue) { + suite('Force 1s Validator', function () { + setup(function () { + this.dropdownField.setValidator(function (newValue) { return '1' + newValue.charAt(1); }); }); - test('New Value', function() { + test('New Value', function () { this.dropdownField.setValue('2B'); assertFieldValue(this.dropdownField, '1B', '1b'); }); }); - suite('Returns Undefined Validator', function() { - setup(function() { - this.dropdownField.setValidator(function() {}); + suite('Returns Undefined Validator', function () { + setup(function () { + this.dropdownField.setValidator(function () {}); }); - test('New Value', function() { + test('New Value', function () { this.dropdownField.setValue('1B'); assertFieldValue(this.dropdownField, '1B', '1b'); }); diff --git a/plugins/field-grid-dropdown/test/index.html b/plugins/field-grid-dropdown/test/index.html index ba00bba01c..10cd0a0c1d 100644 --- a/plugins/field-grid-dropdown/test/index.html +++ b/plugins/field-grid-dropdown/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Test + + - - - Blockly Field Test - - - - -
- - - + +
+ + diff --git a/plugins/field-grid-dropdown/test/index.ts b/plugins/field-grid-dropdown/test/index.ts index 26babd3bb1..a9627eeca4 100644 --- a/plugins/field-grid-dropdown/test/index.ts +++ b/plugins/field-grid-dropdown/test/index.ts @@ -21,8 +21,10 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ['long text ', 'long text'], ['B', 'B'], ['C', 'C'], - ['really really really loooooong text', - 'really really really loooooong text'], + [ + 'really really really loooooong text', + 'really really really loooooong text', + ], ['D', 'D'], ['E', 'E'], ], @@ -67,8 +69,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ 'options': [ [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/a.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/a.png', 'width': 32, 'height': 32, 'alt': 'A', @@ -77,8 +78,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/b.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/b.png', 'width': 32, 'height': 32, 'alt': 'B', @@ -87,8 +87,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/c.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/c.png', 'width': 32, 'height': 32, 'alt': 'C', @@ -97,8 +96,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/d.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/d.png', 'width': 32, 'height': 32, 'alt': 'D', @@ -107,8 +105,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/e.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/e.png', 'width': 32, 'height': 32, 'alt': 'E', @@ -117,8 +114,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/f.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/f.png', 'width': 32, 'height': 32, 'alt': 'F', @@ -127,8 +123,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/g.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/g.png', 'width': 32, 'height': 32, 'alt': 'G', @@ -137,8 +132,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/h.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/h.png', 'width': 32, 'height': 32, 'alt': 'H', @@ -147,8 +141,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/i.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/i.png', 'width': 32, 'height': 32, 'alt': 'I', @@ -157,8 +150,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/j.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/j.png', 'width': 32, 'height': 32, 'alt': 'J', @@ -167,8 +159,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/k.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/k.png', 'width': 32, 'height': 32, 'alt': 'K', @@ -177,8 +168,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/l.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/l.png', 'width': 32, 'height': 32, 'alt': 'L', @@ -187,8 +177,7 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ ], [ { - 'src': - 'https://blockly-demo.appspot.com/static/tests/media/m.png', + 'src': 'https://blockly-demo.appspot.com/static/tests/media/m.png', 'width': 32, 'height': 32, 'alt': 'M', @@ -233,20 +222,21 @@ const toolbox = generateFieldTestBlocks('field_grid_dropdown', [ }, ]); - /** * Create a workspace. * @param blocklyDiv The blockly container div. * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.Workspace { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.Workspace { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-multilineinput/README.md b/plugins/field-multilineinput/README.md index 70ae1190af..3142a29490 100644 --- a/plugins/field-multilineinput/README.md +++ b/plugins/field-multilineinput/README.md @@ -5,11 +5,13 @@ A [Blockly](https://www.npmjs.com/package/blockly) multilineinput field. ## Installation ### Yarn + ``` yarn add @blockly/field-multilineinput ``` ### npm + ``` npm install @blockly/field-multilineinput --save ``` @@ -17,31 +19,35 @@ npm install @blockly/field-multilineinput --save ## Usage This field accepts up to 3 parameters: - * "text" to specify the default text. Defaults to `""`. - * "maxLines" to specify the maximum number of lines displayed before scrolling - functionality is enabled. Defaults to `Infinity`. - * "spellcheck" to specify whether spell checking is enabled. Defaults to + +- "text" to specify the default text. Defaults to `""`. +- "maxLines" to specify the maximum number of lines displayed before scrolling + functionality is enabled. Defaults to `Infinity`. +- "spellcheck" to specify whether spell checking is enabled. Defaults to `true`. The multiline input field is a subclass of Blockly.FieldInput ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldMultilineInput} from '@blockly/field-multilineinput'; -Blockly.Blocks["test_field_multilineinput"] = { +Blockly.Blocks['test_field_multilineinput'] = { init: function () { this.appendDummyInput() - .appendField("multilineinput: ") + .appendField('multilineinput: ') .appendField( - new FieldMultilineInput("some text \n with newlines"), - "FIELDNAME"); - } + new FieldMultilineInput('some text \n with newlines'), + 'FIELDNAME', + ); + }, }; ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/field-multilineinput'; @@ -61,12 +67,12 @@ Blockly.defineBlocksWithJsonArray([ ### API reference -* `setMaxLines`: Sets the maximum number of displayed lines before +- `setMaxLines`: Sets the maximum number of displayed lines before scrolling functionality is enabled. -* `getMaxLines`: Returns the maximum number of displayed lines before +- `getMaxLines`: Returns the maximum number of displayed lines before scrolling functionality is enabled. -* `setSpellcheck`: Sets whether spell checking is enabled. -* `getSpellcheck`: Returns whether spell checking is enabled. +- `setSpellcheck`: Sets whether spell checking is enabled. +- `getSpellcheck`: Returns whether spell checking is enabled. ## License diff --git a/plugins/field-multilineinput/package-lock.json b/plugins/field-multilineinput/package-lock.json index 2c88d57e99..271fe0e7a4 100644 --- a/plugins/field-multilineinput/package-lock.json +++ b/plugins/field-multilineinput/package-lock.json @@ -9,7 +9,6 @@ "version": "3.0.6", "license": "Apache-2.0", "devDependencies": { - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.2.0", "sinon": "^9.0.1", @@ -22,213 +21,6 @@ "blockly": "^10.0.0" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -273,136 +65,12 @@ "node": ">= 10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.5", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -415,78 +83,6 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -496,29 +92,12 @@ "node": "*" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "node_modules/blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -528,39 +107,6 @@ "jsdom": "22.1.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -579,23 +125,6 @@ "node": ">=4" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -605,26 +134,6 @@ "node": "*" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -637,28 +146,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -720,13 +207,6 @@ "node": ">=6" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -736,67 +216,22 @@ "node": ">=0.4.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "dependencies": { - "path-type": "^4.0.0" + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { "node": ">=0.12" @@ -805,372 +240,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -1185,20 +254,6 @@ "node": ">= 6" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -1208,59 +263,6 @@ "node": "*" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1321,100 +323,6 @@ "node": ">=0.10.0" } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -1427,34 +335,6 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -1497,60 +377,18 @@ } } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -1560,40 +398,6 @@ "get-func-name": "^2.0.0" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1615,32 +419,12 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -1660,77 +444,16 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, "node_modules/path-to-regexp": { @@ -1742,15 +465,6 @@ "isarray": "0.0.1" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -1760,38 +474,6 @@ "node": "*" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -1813,120 +495,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1945,44 +525,6 @@ "node": ">=v12.22.7" } }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -2010,81 +552,6 @@ "node": ">=0.3.1" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2103,66 +570,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -2190,40 +597,6 @@ "node": ">=14" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -2233,19 +606,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -2268,16 +628,6 @@ "node": ">= 4.0.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -2288,13 +638,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -2350,249 +693,44 @@ "node": ">=14" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true - }, - "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "engines": { + "node": ">=10.0.0" }, - "dependencies": { - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true + "utf-8-validate": { + "optional": true } } }, - "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "engines": { + "node": ">=12" } }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, + } + }, + "dependencies": { "@sinonjs/commons": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", @@ -2634,80 +772,12 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" - } - }, - "@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.5", - "eslint-visitor-keys": "^3.3.0" - } - }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2717,85 +787,18 @@ "debug": "4" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -2805,33 +808,6 @@ "jsdom": "22.1.0" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, "chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -2847,40 +823,12 @@ "type-detect": "^4.0.5" } }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2890,420 +838,70 @@ "delayed-stream": "~1.0.0" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "requires": { - "rrweb-cssom": "^0.6.0" - } - }, - "data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "dev": true, - "requires": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true + "rrweb-cssom": "^0.6.0" + } }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, "requires": { - "reusify": "^1.0.4" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" } }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "peer": true, "requires": { - "flat-cache": "^3.0.4" + "ms": "2.1.2" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "type-detect": "^4.0.0" } }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, - "peer": true, "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "webidl-conversions": "^7.0.0" } }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true }, "form-data": { "version": "4.0.0", @@ -3316,64 +914,12 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3419,76 +965,6 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -3501,31 +977,6 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -3557,57 +1008,18 @@ "xml-name-validator": "^4.0.0" } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -3617,31 +1029,6 @@ "get-func-name": "^2.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3657,29 +1044,12 @@ "mime-db": "1.52.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -3699,41 +1069,6 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, "parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -3743,20 +1078,6 @@ "entities": "^4.4.0" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, "path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -3766,38 +1087,12 @@ "isarray": "0.0.1" } }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -3816,70 +1111,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, "rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3895,32 +1138,6 @@ "xmlchars": "^2.2.0" } }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, "sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -3943,60 +1160,6 @@ } } }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4012,58 +1175,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -4085,44 +1196,12 @@ "punycode": "^2.3.0" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, "typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -4135,16 +1214,6 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -4155,13 +1224,6 @@ "requires-port": "^1.0.0" } }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -4202,30 +1264,6 @@ "webidl-conversions": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -4244,12 +1282,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } } diff --git a/plugins/field-multilineinput/package.json b/plugins/field-multilineinput/package.json index da7cbe78cd..24652748ee 100644 --- a/plugins/field-multilineinput/package.json +++ b/plugins/field-multilineinput/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm run clean && npm run build", "start": "blockly-scripts start", @@ -42,7 +42,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.2.0", "sinon": "^9.0.1", @@ -55,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-multilineinput/src/field_multilineinput.ts b/plugins/field-multilineinput/src/field_multilineinput.ts index 99aa365548..3118be833f 100644 --- a/plugins/field-multilineinput/src/field_multilineinput.ts +++ b/plugins/field-multilineinput/src/field_multilineinput.ts @@ -10,7 +10,6 @@ import * as Blockly from 'blockly/core'; - /** * Class for an editable text area input field. */ @@ -19,7 +18,7 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { * The SVG group element that will contain a text element for each text row * when initialized. */ - textGroup: SVGGElement|null = null; + textGroup: SVGGElement | null = null; /** * Defines the maximum number of lines of field. @@ -48,9 +47,10 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { * for a list of properties this parameter supports. */ constructor( - value?: string|typeof Blockly.Field.SKIP_SETUP, - validator?: FieldMultilineInputValidator, - config?: FieldMultilineInputConfig) { + value?: string | typeof Blockly.Field.SKIP_SETUP, + validator?: FieldMultilineInputValidator, + config?: FieldMultilineInputConfig, + ) { super(Blockly.Field.SKIP_SETUP); if (value === Blockly.Field.SKIP_SETUP) return; @@ -87,8 +87,10 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { // needed so the plain-text representation of the XML produced by // `Blockly.Xml.domToText` will appear on a single line (this is a // limitation of the plain-text format). - fieldElement.textContent = - (this.getValue() as string).replace(/\n/g, ' '); + fieldElement.textContent = (this.getValue() as string).replace( + /\n/g, + ' ', + ); return fieldElement; } @@ -137,10 +139,12 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { override initView() { this.createBorderRect_(); this.textGroup = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.G, { - 'class': 'blocklyEditableText', - }, - this.fieldGroup_); + Blockly.utils.Svg.G, + { + 'class': 'blocklyEditableText', + }, + this.fieldGroup_, + ); } /** @@ -153,8 +157,10 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { protected override getDisplayText_(): string { const block = this.getSourceBlock(); if (!block) { - throw new Error('The field has not yet been attached to its input. ' + - 'Call appendField to attach it.'); + throw new Error( + 'The field has not yet been attached to its input. ' + + 'Call appendField to attach it.', + ); } let textLines = this.getText(); if (!textLines) { @@ -163,8 +169,9 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { } const lines = textLines.split('\n'); textLines = ''; - const displayLinesNumber = - this.isOverflowedY_ ? this.maxLines_ : lines.length; + const displayLinesNumber = this.isOverflowedY_ + ? this.maxLines_ + : lines.length; for (let i = 0; i < displayLinesNumber; i++) { let text = lines[i]; if (text.length > this.maxDisplayLength) { @@ -211,13 +218,15 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { protected override render_() { const block = this.getSourceBlock(); if (!block) { - throw new Error('The field has not yet been attached to its input. ' + - 'Call appendField to attach it.'); + throw new Error( + 'The field has not yet been attached to its input. ' + + 'Call appendField to attach it.', + ); } // Remove all text group children. let currentChild; const textGroup = this.textGroup as SVGElement; - while (currentChild = textGroup.firstChild) { + while ((currentChild = textGroup.firstChild)) { textGroup.removeChild(currentChild); } @@ -228,16 +237,18 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { const lines = this.getDisplayText_().split('\n'); let y = 0; for (let i = 0; i < lines.length; i++) { - const lineHeight = constants.FIELD_TEXT_HEIGHT + - constants.FIELD_BORDER_RECT_Y_PADDING; + const lineHeight = + constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING; const span = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.TEXT, { - 'class': 'blocklyText blocklyMultilineText', - 'x': constants.FIELD_BORDER_RECT_X_PADDING, - 'y': y + constants.FIELD_BORDER_RECT_Y_PADDING, - 'dy': constants.FIELD_TEXT_BASELINE, - }, - textGroup); + Blockly.utils.Svg.TEXT, + { + 'class': 'blocklyText blocklyMultilineText', + 'x': constants.FIELD_BORDER_RECT_X_PADDING, + 'y': y + constants.FIELD_BORDER_RECT_Y_PADDING, + 'dy': constants.FIELD_TEXT_BASELINE, + }, + textGroup, + ); span.appendChild(document.createTextNode(lines[i])); y += lineHeight; } @@ -245,11 +256,15 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { if (this.isBeingEdited_) { const htmlInput = this.htmlInput_ as HTMLElement; if (this.isOverflowedY_) { - Blockly.utils.dom.addClass(htmlInput, - 'blocklyHtmlTextAreaInputOverflowedY'); + Blockly.utils.dom.addClass( + htmlInput, + 'blocklyHtmlTextAreaInputOverflowedY', + ); } else { - Blockly.utils.dom.removeClass(htmlInput, - 'blocklyHtmlTextAreaInputOverflowedY'); + Blockly.utils.dom.removeClass( + htmlInput, + 'blocklyHtmlTextAreaInputOverflowedY', + ); } } @@ -267,12 +282,18 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { const htmlInput = this.htmlInput_ as HTMLElement; if (!this.isTextValid_) { Blockly.utils.dom.addClass(htmlInput, 'blocklyInvalidInput'); - Blockly.utils.aria.setState(htmlInput, Blockly.utils.aria.State.INVALID, - true); + Blockly.utils.aria.setState( + htmlInput, + Blockly.utils.aria.State.INVALID, + true, + ); } else { Blockly.utils.dom.removeClass(htmlInput, 'blocklyInvalidInput'); - Blockly.utils.aria.setState(htmlInput, Blockly.utils.aria.State.INVALID, - false); + Blockly.utils.aria.setState( + htmlInput, + Blockly.utils.aria.State.INVALID, + false, + ); } } } @@ -292,12 +313,17 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { for (let i = 0; i < nodes.length; i++) { const tspan = nodes[i] as SVGTextElement; const textWidth = Blockly.utils.dom.getFastTextWidth( - tspan, fontSize, fontWeight, fontFamily); + tspan, + fontSize, + fontWeight, + fontFamily, + ); if (textWidth > totalWidth) { totalWidth = textWidth; } - totalHeight += constants.FIELD_TEXT_HEIGHT + - (i > 0 ? constants.FIELD_BORDER_RECT_Y_PADDING : 0); + totalHeight += + constants.FIELD_TEXT_HEIGHT + + (i > 0 ? constants.FIELD_BORDER_RECT_Y_PADDING : 0); } if (this.isBeingEdited_) { // The default width is based on the longest line in the display text, @@ -307,17 +333,24 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { // lines than this.maxLines_. const actualEditorLines = String(this.value_).split('\n'); const dummyTextElement = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.TEXT, - {'class': 'blocklyText blocklyMultilineText'}); + Blockly.utils.Svg.TEXT, + {'class': 'blocklyText blocklyMultilineText'}, + ); for (let i = 0; i < actualEditorLines.length; i++) { if (actualEditorLines[i].length > this.maxDisplayLength) { - actualEditorLines[i] = - actualEditorLines[i].substring(0, this.maxDisplayLength); + actualEditorLines[i] = actualEditorLines[i].substring( + 0, + this.maxDisplayLength, + ); } dummyTextElement.textContent = actualEditorLines[i]; const lineWidth = Blockly.utils.dom.getFastTextWidth( - dummyTextElement, fontSize, fontWeight, fontFamily); + dummyTextElement, + fontSize, + fontWeight, + fontFamily, + ); if (lineWidth > totalWidth) { totalWidth = lineWidth; } @@ -368,7 +401,7 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { // This can't happen, but TypeScript thinks it can and lint forbids `!.`. if (!constants) throw Error('Constants not found'); - const htmlInput = (document.createElement('textarea')); + const htmlInput = document.createElement('textarea'); htmlInput.className = 'blocklyHtmlInput blocklyHtmlTextAreaInput'; htmlInput.setAttribute('spellcheck', String(this.spellcheck_)); const fontSize = constants.FIELD_TEXT_FONTSIZE * scale + 'pt'; @@ -377,11 +410,11 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { const borderRadius = Blockly.FieldTextInput.BORDERRADIUS * scale + 'px'; htmlInput.style.borderRadius = borderRadius; const paddingX = constants.FIELD_BORDER_RECT_X_PADDING * scale; - const paddingY = constants.FIELD_BORDER_RECT_Y_PADDING * scale / 2; - htmlInput.style.padding = paddingY + 'px ' + paddingX + 'px ' + paddingY + - 'px ' + paddingX + 'px'; - const lineHeight = constants.FIELD_TEXT_HEIGHT + - constants.FIELD_BORDER_RECT_Y_PADDING; + const paddingY = (constants.FIELD_BORDER_RECT_Y_PADDING * scale) / 2; + htmlInput.style.padding = + paddingY + 'px ' + paddingX + 'px ' + paddingY + 'px ' + paddingX + 'px'; + const lineHeight = + constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING; htmlInput.style.lineHeight = lineHeight * scale + 'px'; div.appendChild(htmlInput); @@ -408,8 +441,11 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { * scrolling functionality is enabled. */ setMaxLines(maxLines: number) { - if (typeof maxLines === 'number' && maxLines > 0 && - maxLines !== this.maxLines_) { + if ( + typeof maxLines === 'number' && + maxLines > 0 && + maxLines !== this.maxLines_ + ) { this.maxLines_ = maxLines; this.forceRerender(); } @@ -445,8 +481,9 @@ export class FieldMultilineInput extends Blockly.FieldTextInput { * @returns The new field instance. * @nocollapse */ - static override fromJson(options: FieldMultilineInputFromJsonConfig): - FieldMultilineInput { + static override fromJson( + options: FieldMultilineInputFromJsonConfig, + ): FieldMultilineInput { const text = Blockly.utils.parsing.replaceMessageReferences(options.text); // `this` might be a subclass of FieldMultilineInput if that class doesn't // override the static fromJson method. @@ -462,7 +499,6 @@ Blockly.fieldRegistry.unregister('field_multilinetext'); Blockly.fieldRegistry.register('field_multilinetext', FieldMultilineInput); - /** * CSS for multiline field. */ @@ -483,16 +519,16 @@ Blockly.Css.register(` /** * Config options for the multiline input field. */ -export interface FieldMultilineInputConfig extends - Blockly.FieldTextInputConfig { +export interface FieldMultilineInputConfig + extends Blockly.FieldTextInputConfig { maxLines?: number; } /** * fromJson config options for the multiline input field. */ -export interface FieldMultilineInputFromJsonConfig extends - FieldMultilineInputConfig { +export interface FieldMultilineInputFromJsonConfig + extends FieldMultilineInputConfig { text?: string; } diff --git a/plugins/field-multilineinput/test/field_multilineinput_test.mocha.js b/plugins/field-multilineinput/test/field_multilineinput_test.mocha.js index 8e5ebea9b4..9993161ff7 100644 --- a/plugins/field-multilineinput/test/field_multilineinput_test.mocha.js +++ b/plugins/field-multilineinput/test/field_multilineinput_test.mocha.js @@ -9,11 +9,15 @@ const {FieldMultilineInput} = require('../src/index'); const {assert} = require('chai'); const { - assertFieldValue, FieldCreationTestCase, FieldValueTestCase, - runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, + assertFieldValue, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, } = testHelpers; -suite('FieldMultilineInput', function() { +suite('FieldMultilineInput', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -40,7 +44,7 @@ suite('FieldMultilineInput', function() { {title: 'Number (Falsy)', value: 0, expectedValue: '0'}, {title: 'NaN', value: NaN, expectedValue: 'NaN'}, ]; - const addArgsAndJson = function(testCase) { + const addArgsAndJson = function (testCase) { testCase.args = [testCase.value]; testCase.json = {'text': testCase.value}; }; @@ -56,7 +60,7 @@ suite('FieldMultilineInput', function() { * Asserts that the field property values are set to default. * @param {!FieldMultilineInput} field The field to check. */ - const assertFieldDefault = function(field) { + const assertFieldDefault = function (field) { assertFieldValue(field, defaultFieldValue); }; @@ -65,50 +69,66 @@ suite('FieldMultilineInput', function() { * @param {FieldMultilineInput} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertFieldValue(field, testCase.expectedValue); }; runConstructorSuiteTests( - FieldMultilineInput, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldMultilineInput, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); runFromJsonSuiteTests( - FieldMultilineInput, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertFieldDefault); + FieldMultilineInput, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertFieldDefault, + ); - suite('setValue', function() { - suite('Empty -> New Value', function() { - setup(function() { + suite('setValue', function () { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldMultilineInput(); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, defaultFieldValue); + validValueTestCases, + invalidValueTestCases, + defaultFieldValue, + ); }); - suite('Value -> New Value', function() { + suite('Value -> New Value', function () { const initialValue = 'oldValue'; - setup(function() { + setup(function () { this.field = new FieldMultilineInput(initialValue); }); runSetValueTests( - validValueTestCases, invalidValueTestCases, initialValue); + validValueTestCases, + invalidValueTestCases, + initialValue, + ); }); }); - suite('Serialization', function() { - setup(function() { + suite('Serialization', function () { + setup(function () { this.workspace = new Blockly.Workspace(); - Blockly.defineBlocksWithJsonArray([{ - 'type': 'row_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'input_value', - 'name': 'INPUT', - }, - ], - 'output': null, - }]); + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'row_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT', + }, + ], + 'output': null, + }, + ]); this.assertValue = (value) => { const block = this.workspace.newBlock('row_block'); @@ -119,15 +139,15 @@ suite('FieldMultilineInput', function() { }; }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - test('Single line', function() { + test('Single line', function () { this.assertValue('this is a single line'); }); - test('Multiple lines', function() { + test('Multiple lines', function () { this.assertValue('this\nis\n multiple\n lines'); }); }); diff --git a/plugins/field-multilineinput/test/index.html b/plugins/field-multilineinput/test/index.html index 6c36366564..cca1e934db 100644 --- a/plugins/field-multilineinput/test/index.html +++ b/plugins/field-multilineinput/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field MultilineInput Playground + + - - - Blockly Field MultilineInput Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-multilineinput/test/index.ts b/plugins/field-multilineinput/test/index.ts index 3837436c70..f57da6e109 100644 --- a/plugins/field-multilineinput/test/index.ts +++ b/plugins/field-multilineinput/test/index.ts @@ -27,8 +27,9 @@ All mimsy were the borogoves, label: 'Not spel chekt', args: { 'spellcheck': false, - 'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed' + - ' do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + 'text': + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed' + + ' do eiusmod tempor incididunt ut labore et dolore magna aliqua.', }, }, ]); @@ -39,13 +40,15 @@ All mimsy were the borogoves, * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/field-slider/README.md b/plugins/field-slider/README.md index 58d411a743..1b368428f2 100644 --- a/plugins/field-slider/README.md +++ b/plugins/field-slider/README.md @@ -5,47 +5,53 @@ A [Blockly](https://www.npmjs.com/package/blockly) slider field. ## Installation ### Yarn + ``` yarn add @blockly/field-slider ``` ### npm + ``` npm install @blockly/field-slider --save ``` ## Usage + This field is an extension of the Blockly.FieldNumber field. See the [Blockly.FieldNumber documentation](https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/number#creation) on what parameters and configurations this field supports. ### JavaScript + ```js import * as Blockly from 'blockly'; import {FieldSlider} from '@blockly/field-slider'; -Blockly.Blocks["test_field_slider"] = { +Blockly.Blocks['test_field_slider'] = { init: function () { this.appendDummyInput() - .appendField("slider: ") - .appendField(new FieldSlider(50), "FIELDNAME"); - } + .appendField('slider: ') + .appendField(new FieldSlider(50), 'FIELDNAME'); + }, }; ``` ### JSON + ```js import * as Blockly from 'blockly'; import '@blockly/field-slider'; Blockly.defineBlocksWithJsonArray([ - { - "type": "test_field_slider", - "message0": "slider: %1", - "args0": [ - { - "type": "field_slider", - "name": "FIELDNAME", - "value": 50 - } - ] - }]); + { + 'type': 'test_field_slider', + 'message0': 'slider: %1', + 'args0': [ + { + 'type': 'field_slider', + 'name': 'FIELDNAME', + 'value': 50, + }, + ], + }, +]); ``` ## License diff --git a/plugins/field-slider/package.json b/plugins/field-slider/package.json index ebba5bfbc0..9eb30dcab4 100644 --- a/plugins/field-slider/package.json +++ b/plugins/field-slider/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -53,9 +53,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/field-slider/src/field_slider.ts b/plugins/field-slider/src/field_slider.ts index 886f5bbac0..b208ad35cd 100644 --- a/plugins/field-slider/src/field_slider.ts +++ b/plugins/field-slider/src/field_slider.ts @@ -39,7 +39,7 @@ export class FieldSlider extends Blockly.FieldNumber { /** * The HTML range input element. */ - private sliderInput: HTMLInputElement|null = null; + private sliderInput: HTMLInputElement | null = null; /** * Class for an number slider field. @@ -56,9 +56,14 @@ export class FieldSlider extends Blockly.FieldNumber { * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/number#creation} * for a list of properties this parameter supports. */ - constructor(value?: string | number, min?: string | number, - max?: string | number, precision?: string | number, - validator?: FieldSliderValidator, config?: FieldSliderConfig) { + constructor( + value?: string | number, + min?: string | number, + max?: string | number, + precision?: string | number, + validator?: FieldSliderValidator, + config?: FieldSliderConfig, + ) { super(value, min, max, precision, validator, config); } @@ -74,7 +79,13 @@ export class FieldSlider extends Blockly.FieldNumber { // `this` might be a subclass of FieldSlider if that class doesn't override // the static fromJson method. return new this( - options.value, undefined, undefined, undefined, undefined, options); + options.value, + undefined, + undefined, + undefined, + undefined, + options, + ); } /* eslint-disable @typescript-eslint/naming-convention */ @@ -103,7 +114,9 @@ export class FieldSlider extends Blockly.FieldNumber { } Blockly.DropDownDiv.showPositionedByField( - this, this.dropdownDispose_.bind(this)); + this, + this.dropdownDispose_.bind(this), + ); // Focus on the slider field, unless quietInput is passed. if (!quietInput) { @@ -139,8 +152,14 @@ export class FieldSlider extends Blockly.FieldNumber { wrapper.appendChild(sliderInput); this.sliderInput = sliderInput; - this.boundEvents.push(Blockly.browserEvents.conditionalBind( - sliderInput, 'input', this, this.onSliderChange_)); + this.boundEvents.push( + Blockly.browserEvents.conditionalBind( + sliderInput, + 'input', + this, + this.onSliderChange_, + ), + ); return wrapper; } @@ -168,13 +187,9 @@ export class FieldSlider extends Blockly.FieldNumber { this.setEditorValue_(this.sliderInput?.value, false); if (this.getSourceBlock()) { Blockly.Events.fire( - new (Blockly.Events.get( - Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE))( - this.sourceBlock_, - this.name || null, - oldValue, - this.value_ - ) + new (Blockly.Events.get( + Blockly.Events.BLOCK_FIELD_INTERMEDIATE_CHANGE, + ))(this.sourceBlock_, this.name || null, oldValue, this.value_), ); } this.resizeEditor_(); diff --git a/plugins/field-slider/test/field_slider_test.mocha.js b/plugins/field-slider/test/field_slider_test.mocha.js index ce1f676d93..84f1758732 100644 --- a/plugins/field-slider/test/field_slider_test.mocha.js +++ b/plugins/field-slider/test/field_slider_test.mocha.js @@ -6,18 +6,24 @@ const {assert} = require('chai'); const sinon = require('sinon'); -const {assertSliderField, assertSliderFieldDefault} = require( - './field_slider_test_helpers.mocha'); +const { + assertSliderField, + assertSliderFieldDefault, +} = require('./field_slider_test_helpers.mocha'); const {testHelpers} = require('@blockly/dev-tools'); const {FieldSlider} = require('../src/index'); const { - assertFieldValue, FieldCreationTestCase, FieldValueTestCase, - runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, + assertFieldValue, + FieldCreationTestCase, + FieldValueTestCase, + runConstructorSuiteTests, + runFromJsonSuiteTests, + runSetValueTests, runTestCases, } = testHelpers; -suite('FieldSlider', function() { +suite('FieldSlider', function () { /** * Configuration for field tests with invalid values. * @type {Array} @@ -40,13 +46,20 @@ suite('FieldSlider', function() { {title: 'Infinity', value: Infinity, expectedValue: Infinity}, {title: 'Negative Infinity', value: -Infinity, expectedValue: -Infinity}, {title: 'Infinity String', value: 'Infinity', expectedValue: Infinity}, - {title: 'Negative Infinity String', value: '-Infinity', - expectedValue: -Infinity}, + { + title: 'Negative Infinity String', + value: '-Infinity', + expectedValue: -Infinity, + }, ]; - const addArgsAndJson = function(testCase) { + const addArgsAndJson = function (testCase) { testCase.args = Array(4).fill(testCase.value); - testCase.json = {'value': testCase.value, 'min': testCase.value, - 'max': testCase.value, 'precision': testCase.value}; + testCase.json = { + 'value': testCase.value, + 'min': testCase.value, + 'max': testCase.value, + 'precision': testCase.value, + }; }; invalidValueTestCases.forEach(addArgsAndJson); validValueTestCases.forEach(addArgsAndJson); @@ -56,91 +69,140 @@ suite('FieldSlider', function() { * @param {FieldSlider} field The field to check. * @param {FieldValueTestCase} testCase The test case. */ - const validTestCaseAssertField = function(field, testCase) { + const validTestCaseAssertField = function (field, testCase) { assertSliderField( - field, testCase.value, testCase.value, testCase.value, testCase.value); + field, + testCase.value, + testCase.value, + testCase.value, + testCase.value, + ); }; runConstructorSuiteTests( - FieldSlider, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertSliderFieldDefault); + FieldSlider, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertSliderFieldDefault, + ); - runFromJsonSuiteTests(FieldSlider, validValueTestCases, invalidValueTestCases, - validTestCaseAssertField, assertSliderFieldDefault); + runFromJsonSuiteTests( + FieldSlider, + validValueTestCases, + invalidValueTestCases, + validTestCaseAssertField, + assertSliderFieldDefault, + ); - suite('setValue', function() { - suite('Empty -> New Value', function() { - setup(function() { + suite('setValue', function () { + suite('Empty -> New Value', function () { + setup(function () { this.field = new FieldSlider(); }); runSetValueTests(validValueTestCases, invalidValueTestCases, 0); }); - suite('Value -> New Value', function() { - setup(function() { + suite('Value -> New Value', function () { + setup(function () { this.field = new FieldSlider(1); }); runSetValueTests(validValueTestCases, invalidValueTestCases, 1); }); - suite('Constraints', function() { + suite('Constraints', function () { const testCases = [ {title: 'Float', json: {}, value: 123.456, expectedValue: 123.456}, - {title: '0.01', json: {precision: 0.01}, value: 123.456, - expectedValue: 123.46}, - {title: '0.5', json: {precision: 0.5}, value: 123.456, - expectedValue: 123.5}, - {title: '1', json: {precision: 1}, value: 123.456, - expectedValue: 123}, - {title: '1.5', json: {precision: 1.5}, value: 123.456, - expectedValue: 123}, + { + title: '0.01', + json: {precision: 0.01}, + value: 123.456, + expectedValue: 123.46, + }, + { + title: '0.5', + json: {precision: 0.5}, + value: 123.456, + expectedValue: 123.5, + }, + {title: '1', json: {precision: 1}, value: 123.456, expectedValue: 123}, + { + title: '1.5', + json: {precision: 1.5}, + value: 123.456, + expectedValue: 123, + }, ]; - suite('Precision', function() { - runTestCases(testCases, function(testCase) { - return function() { + suite('Precision', function () { + runTestCases(testCases, function (testCase) { + return function () { const sliderField = FieldSlider.fromJson(testCase.json); sliderField.setValue(testCase.value); assertFieldValue(sliderField, testCase.expectedValue); }; }); - test('Null', function() { + test('Null', function () { const sliderField = FieldSlider.fromJson({precision: null}); assert.equal(sliderField.getPrecision(), 0); }); }); const setValueBoundsTestFn = (testCase) => { - return function() { + return function () { const sliderField = FieldSlider.fromJson(testCase.json); - testCase.values.forEach(function(value, i) { + testCase.values.forEach(function (value, i) { sliderField.setValue(value); assertFieldValue(sliderField, testCase.expectedValues[i]); }); }; }; - suite('Min', function() { + suite('Min', function () { const testCases = [ - {title: '-10', json: {min: -10}, values: [-20, 0, 20], - expectedValues: [-10, 0, 20]}, - {title: '0', json: {min: 0}, values: [-20, 0, 20], - expectedValues: [0, 0, 20]}, - {title: '+10', json: {min: 10}, values: [-20, 0, 20], - expectedValues: [10, 10, 20]}, + { + title: '-10', + json: {min: -10}, + values: [-20, 0, 20], + expectedValues: [-10, 0, 20], + }, + { + title: '0', + json: {min: 0}, + values: [-20, 0, 20], + expectedValues: [0, 0, 20], + }, + { + title: '+10', + json: {min: 10}, + values: [-20, 0, 20], + expectedValues: [10, 10, 20], + }, ]; runTestCases(testCases, setValueBoundsTestFn); - test('Null', function() { + test('Null', function () { const sliderField = FieldSlider.fromJson({min: null}); assert.equal(sliderField.getMin(), -Infinity); }); }); - suite('Max', function() { + suite('Max', function () { const testCases = [ - {title: '-10', json: {max: -10}, values: [-20, 0, 20], - expectedValues: [-20, -10, -10]}, - {title: '0', json: {max: 0}, values: [-20, 0, 20], - expectedValues: [-20, 0, 0]}, - {title: '+10', json: {max: 10}, values: [-20, 0, 20], - expectedValues: [-20, 0, 10]}, + { + title: '-10', + json: {max: -10}, + values: [-20, 0, 20], + expectedValues: [-20, -10, -10], + }, + { + title: '0', + json: {max: 0}, + values: [-20, 0, 20], + expectedValues: [-20, 0, 0], + }, + { + title: '+10', + json: {max: 10}, + values: [-20, 0, 20], + expectedValues: [-20, 0, 10], + }, ]; runTestCases(testCases, setValueBoundsTestFn); - test('Null', function() { + test('Null', function () { const sliderField = FieldSlider.fromJson({max: null}); assert.equal(sliderField.getMax(), Infinity); }); @@ -148,34 +210,44 @@ suite('FieldSlider', function() { }); }); - suite('Validators', function() { - setup(function() { + suite('Validators', function () { + setup(function () { this.sliderField = new FieldSlider(1); this.stub = sinon.stub(this.sliderField, 'resizeEditor_'); }); - teardown(function() { + teardown(function () { sinon.restore(); }); const testSuites = [ - {title: 'Null Validator', validator: - function() { - return null; - }, - value: 2, expectedValue: 1}, - {title: 'Force End with 6 Validator', validator: - function(newValue) { - return String(newValue).replace(/.$/, '6'); - }, - value: 25, expectedValue: 26}, - {title: 'Returns Undefined Validator', validator: function() {}, value: 2, - expectedValue: 2}, + { + title: 'Null Validator', + validator: function () { + return null; + }, + value: 2, + expectedValue: 1, + }, + { + title: 'Force End with 6 Validator', + validator: function (newValue) { + return String(newValue).replace(/.$/, '6'); + }, + value: 25, + expectedValue: 26, + }, + { + title: 'Returns Undefined Validator', + validator: function () {}, + value: 2, + expectedValue: 2, + }, ]; - testSuites.forEach(function(suiteInfo) { - suite(suiteInfo.title, function() { - setup(function() { + testSuites.forEach(function (suiteInfo) { + suite(suiteInfo.title, function () { + setup(function () { this.sliderField.setValidator(suiteInfo.validator); }); - test('When Not Editing', function() { + test('When Not Editing', function () { this.sliderField.setValue(suiteInfo.value); assertFieldValue(this.sliderField, suiteInfo.expectedValue); }); @@ -183,112 +255,148 @@ suite('FieldSlider', function() { }); }); - suite('Customizations', function() { - suite('Min', function() { - test('JS Constructor', function() { + suite('Customizations', function () { + suite('Min', function () { + test('JS Constructor', function () { const field = new FieldSlider(0, -10); assertSliderField(field, -10, Infinity, 0, 0); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldSlider.fromJson({ min: -10, }); assertSliderField(field, -10, Infinity, 0, 0); }); - test('Set Constraints', function() { + test('Set Constraints', function () { const field = new FieldSlider(); field.setConstraints(-10); assertSliderField(field, -10, Infinity, 0, 0); }); - test('Set Min', function() { + test('Set Min', function () { const field = new FieldSlider(); field.setMin(-10); assertSliderField(field, -10, Infinity, 0, 0); }); - test('JS Configuration - Simple', function() { + test('JS Configuration - Simple', function () { const field = new FieldSlider( - undefined, undefined, undefined, undefined, undefined, { - min: -10, - }); + undefined, + undefined, + undefined, + undefined, + undefined, + { + min: -10, + }, + ); assertSliderField(field, -10, Infinity, 0, 0); }); - test('JS Configuration - Ignore', function() { + test('JS Configuration - Ignore', function () { const field = new FieldSlider( - undefined, -1, undefined, undefined, undefined, { - min: -10, - }); + undefined, + -1, + undefined, + undefined, + undefined, + { + min: -10, + }, + ); assertSliderField(field, -10, Infinity, 0, 0); }); }); - suite('Max', function() { - test('JS Constructor', function() { + suite('Max', function () { + test('JS Constructor', function () { const field = new FieldSlider(0, undefined, 10); assertSliderField(field, -Infinity, 10, 0, 0); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldSlider.fromJson({ max: 10, }); assertSliderField(field, -Infinity, 10, 0, 0); }); - test('Set Constraints', function() { + test('Set Constraints', function () { const field = new FieldSlider(); field.setConstraints(undefined, 10); assertSliderField(field, -Infinity, 10, 0, 0); }); - test('Set Max', function() { + test('Set Max', function () { const field = new FieldSlider(); field.setMax(10); assertSliderField(field, -Infinity, 10, 0, 0); }); - test('JS Configuration - Simple', function() { + test('JS Configuration - Simple', function () { const field = new FieldSlider( - undefined, undefined, undefined, undefined, undefined, { - max: 10, - }); + undefined, + undefined, + undefined, + undefined, + undefined, + { + max: 10, + }, + ); assertSliderField(field, -Infinity, 10, 0, 0); }); - test('JS Configuration - Ignore', function() { + test('JS Configuration - Ignore', function () { const field = new FieldSlider( - undefined, undefined, 1, undefined, undefined, { - max: 10, - }); + undefined, + undefined, + 1, + undefined, + undefined, + { + max: 10, + }, + ); assertSliderField(field, -Infinity, 10, 0, 0); }); }); - suite('Precision', function() { - test('JS Constructor', function() { + suite('Precision', function () { + test('JS Constructor', function () { const field = new FieldSlider(0, undefined, undefined, 1); assertSliderField(field, -Infinity, Infinity, 1, 0); }); - test('JSON Definition', function() { + test('JSON Definition', function () { const field = FieldSlider.fromJson({ precision: 1, }); assertSliderField(field, -Infinity, Infinity, 1, 0); }); - test('Set Constraints', function() { + test('Set Constraints', function () { const field = new FieldSlider(); field.setConstraints(undefined, undefined, 1); assertSliderField(field, -Infinity, Infinity, 1, 0); }); - test('Set Precision', function() { + test('Set Precision', function () { const field = new FieldSlider(); field.setPrecision(1); assertSliderField(field, -Infinity, Infinity, 1, 0); }); - test('JS Configuration - Simple', function() { + test('JS Configuration - Simple', function () { const field = new FieldSlider( - undefined, undefined, undefined, undefined, undefined, { - precision: 1, - }); + undefined, + undefined, + undefined, + undefined, + undefined, + { + precision: 1, + }, + ); assertSliderField(field, -Infinity, Infinity, 1, 0); }); - test('JS Configuration - Ignore', function() { + test('JS Configuration - Ignore', function () { const field = new FieldSlider( - undefined, undefined, undefined, 0.5, undefined, { - precision: 1, - }); + undefined, + undefined, + undefined, + 0.5, + undefined, + { + precision: 1, + }, + ); assertSliderField(field, -Infinity, Infinity, 1, 0); }); }); diff --git a/plugins/field-slider/test/field_slider_test_helpers.mocha.js b/plugins/field-slider/test/field_slider_test_helpers.mocha.js index eb88b4e06a..c3d2116d03 100644 --- a/plugins/field-slider/test/field_slider_test_helpers.mocha.js +++ b/plugins/field-slider/test/field_slider_test_helpers.mocha.js @@ -8,7 +8,6 @@ const {assert} = require('chai'); const {assertFieldValue} = require('@blockly/dev-tools').testHelpers; const {FieldSlider} = require('../src/index'); - /** * Assert the slider field options. * @param {FieldSlider} sliderField The slider field. @@ -17,8 +16,13 @@ const {FieldSlider} = require('../src/index'); * @param {number} expectedPrecision The expected precision value. * @param {number} expectedValue The expected value. */ -function assertSliderField(sliderField, expectedMin, expectedMax, - expectedPrecision, expectedValue) { +function assertSliderField( + sliderField, + expectedMin, + expectedMax, + expectedPrecision, + expectedValue, +) { assertFieldValue(sliderField, expectedValue); assert.equal(sliderField.getMin(), expectedMin, 'Min'); assert.equal(sliderField.getMax(), expectedMax, 'Max'); diff --git a/plugins/field-slider/test/index.html b/plugins/field-slider/test/index.html index 731b72f3c9..fc1a8b22f1 100644 --- a/plugins/field-slider/test/index.html +++ b/plugins/field-slider/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Field Slider Playground + + - - - Blockly Field Slider Playground - - - - -
- - - + +
+ + diff --git a/plugins/field-slider/test/index.ts b/plugins/field-slider/test/index.ts index 0f43fc7849..33e73e0b28 100644 --- a/plugins/field-slider/test/index.ts +++ b/plugins/field-slider/test/index.ts @@ -50,13 +50,15 @@ const toolbox = generateFieldTestBlocks('field_slider', [ * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/fixed-edges/README.md b/plugins/fixed-edges/README.md index 14f6c8be18..073f213e46 100644 --- a/plugins/fixed-edges/README.md +++ b/plugins/fixed-edges/README.md @@ -6,11 +6,13 @@ fixed edges more easily configurable. ## Installation ### Yarn + ``` yarn add @blockly/fixed-edges ``` ### npm + ``` npm install @blockly/fixed-edges --save ``` @@ -39,7 +41,8 @@ const workspace = Blockly.inject('blocklyDiv', { ## API - `setFixedEdges`: Configures which edges are fixed. This does not prevent fixed -edges set by no scrollbars or single-direction scrollbars. + edges set by no scrollbars or single-direction scrollbars. ## License + Apache 2.0 diff --git a/plugins/fixed-edges/package.json b/plugins/fixed-edges/package.json index a31ba0649c..031c8eac06 100644 --- a/plugins/fixed-edges/package.json +++ b/plugins/fixed-edges/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start" }, @@ -49,9 +49,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/fixed-edges/src/index.js b/plugins/fixed-edges/src/index.js index 378cc0beec..05d84871c9 100644 --- a/plugins/fixed-edges/src/index.js +++ b/plugins/fixed-edges/src/index.js @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - /** * @fileoverview A metrics manager that makes fixed edges more easily * configurable. diff --git a/plugins/fixed-edges/test/index.html b/plugins/fixed-edges/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/fixed-edges/test/index.html +++ b/plugins/fixed-edges/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/fixed-edges/test/index.js b/plugins/fixed-edges/test/index.js index 78cece6799..6e9ecba01e 100644 --- a/plugins/fixed-edges/test/index.js +++ b/plugins/fixed-edges/test/index.js @@ -27,13 +27,16 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, plugins: { metricsManager: FixedEdgesMetricsManager, }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/jsconfig.json b/plugins/jsconfig.json index 9b711f8879..65ff71001a 100644 --- a/plugins/jsconfig.json +++ b/plugins/jsconfig.json @@ -5,9 +5,5 @@ "checkJs": true, "resolveJsonModule": true }, - "exclude": [ - "**/node_modules", - "**/build", - "**/dist", - ] + "exclude": ["**/node_modules", "**/build", "**/dist"] } diff --git a/plugins/keyboard-navigation/README.md b/plugins/keyboard-navigation/README.md index 16db9560ff..abf069175b 100644 --- a/plugins/keyboard-navigation/README.md +++ b/plugins/keyboard-navigation/README.md @@ -8,16 +8,19 @@ on our [keyboard navigation documentation page](https://developers.google.com/bl ## Installation ### Yarn + ``` yarn add @blockly/keyboard-navigation ``` ### npm + ``` npm install @blockly/keyboard-navigation --save ``` ## Usage + ```js import * as Blockly from 'blockly'; import {NavigationController} from '@blockly/keyboard-navigation'; @@ -34,7 +37,9 @@ navigationController.enable(workspace); ``` ## API + This plugin exports the following classes: + - `NavigationController`: Class in charge of registering all keyboard shortcuts. - `Navigation`: This holds all the functions necessary to navigate around Blockly using the keyboard. - `FlyoutCursor`: Cursor in charge of navigating the flyout. @@ -43,4 +48,5 @@ This plugin exports the following classes: You should only need to use these if you plan on changing the default functionality. ## License + Apache 2.0 diff --git a/plugins/keyboard-navigation/package.json b/plugins/keyboard-navigation/package.json index db517031ca..ee1725968e 100644 --- a/plugins/keyboard-navigation/package.json +++ b/plugins/keyboard-navigation/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -55,9 +55,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/keyboard-navigation/src/gesture_monkey_patch.js b/plugins/keyboard-navigation/src/gesture_monkey_patch.js index e5b55fd8aa..ba5d6eb790 100644 --- a/plugins/keyboard-navigation/src/gesture_monkey_patch.js +++ b/plugins/keyboard-navigation/src/gesture_monkey_patch.js @@ -14,7 +14,6 @@ import * as Blockly from 'blockly/core'; - const oldDoWorkspaceClick = Blockly.Gesture.prototype.doWorkspaceClick_; /** @@ -24,13 +23,15 @@ const oldDoWorkspaceClick = Blockly.Gesture.prototype.doWorkspaceClick_; * @this {Blockly.Gesture} * @override */ -Blockly.Gesture.prototype.doWorkspaceClick_ = function(e) { +Blockly.Gesture.prototype.doWorkspaceClick_ = function (e) { oldDoWorkspaceClick.call(this, e); const ws = this.creatorWorkspace_; if (e.shiftKey && ws.keyboardAccessibilityMode) { const screenCoord = new Blockly.utils.Coordinate(e.clientX, e.clientY); - const wsCoord = - Blockly.utils.svgMath.screenToWsCoordinates(ws, screenCoord); + const wsCoord = Blockly.utils.svgMath.screenToWsCoordinates( + ws, + screenCoord, + ); const wsNode = Blockly.ASTNode.createWorkspaceNode(ws, wsCoord); ws.getCursor().setCurNode(wsNode); } @@ -44,11 +45,15 @@ const oldDoBlockClick = Blockly.Gesture.prototype.doBlockClick_; * @this {Blockly.Gesture} * @override */ -Blockly.Gesture.prototype.doBlockClick_ = function(e) { +Blockly.Gesture.prototype.doBlockClick_ = function (e) { oldDoBlockClick.call(this, e); - if (!this.targetBlock_.isInFlyout && this.mostRecentEvent_.shiftKey && - this.targetBlock_.workspace.keyboardAccessibilityMode) { - this.creatorWorkspace_.getCursor().setCurNode( - Blockly.ASTNode.createTopNode(this.targetBlock_)); + if ( + !this.targetBlock_.isInFlyout && + this.mostRecentEvent_.shiftKey && + this.targetBlock_.workspace.keyboardAccessibilityMode + ) { + this.creatorWorkspace_ + .getCursor() + .setCurNode(Blockly.ASTNode.createTopNode(this.targetBlock_)); } }; diff --git a/plugins/keyboard-navigation/src/index.js b/plugins/keyboard-navigation/src/index.js index 0a2775c2e0..75ef7e0157 100644 --- a/plugins/keyboard-navigation/src/index.js +++ b/plugins/keyboard-navigation/src/index.js @@ -8,7 +8,8 @@ import * as Constants from '../src/constants'; import { FlyoutCursor, - pluginInfo as FlyoutCursorPluginInfo} from './flyout_cursor'; + pluginInfo as FlyoutCursorPluginInfo, +} from './flyout_cursor'; import {LineCursor, pluginInfo as LineCursorPluginInfo} from './line_cursor'; import {Navigation} from './navigation'; import {NavigationController} from './navigation_controller'; diff --git a/plugins/keyboard-navigation/src/line_cursor.js b/plugins/keyboard-navigation/src/line_cursor.js index 58674c67b2..8f1595b925 100644 --- a/plugins/keyboard-navigation/src/line_cursor.js +++ b/plugins/keyboard-navigation/src/line_cursor.js @@ -43,10 +43,12 @@ export class LineCursor extends Blockly.BasicCursor { let newNode = this.getNextNode_(curNode, this.validLineNode); // Skip the input or next value if there is a connected block. - if (newNode && - (newNode.getType() == Blockly.ASTNode.types.INPUT || - newNode.getType() == Blockly.ASTNode.types.NEXT) && - newNode.getLocation().targetBlock()) { + if ( + newNode && + (newNode.getType() == Blockly.ASTNode.types.INPUT || + newNode.getType() == Blockly.ASTNode.types.NEXT) && + newNode.getLocation().targetBlock() + ) { newNode = this.getNextNode_(newNode, this.validLineNode); } if (newNode) { @@ -88,10 +90,12 @@ export class LineCursor extends Blockly.BasicCursor { } let newNode = this.getPreviousNode_(curNode, this.validLineNode); - if (newNode && - (newNode.getType() == Blockly.ASTNode.types.INPUT || - newNode.getType() == Blockly.ASTNode.types.NEXT) && - newNode.getLocation().targetBlock()) { + if ( + newNode && + (newNode.getType() == Blockly.ASTNode.types.INPUT || + newNode.getType() == Blockly.ASTNode.types.NEXT) && + newNode.getLocation().targetBlock() + ) { newNode = this.getPreviousNode_(newNode, this.validLineNode); } @@ -141,7 +145,8 @@ export class LineCursor extends Blockly.BasicCursor { } } else if ( type == Blockly.ASTNode.types.INPUT && - location.type == Blockly.NEXT_STATEMENT) { + location.type == Blockly.NEXT_STATEMENT + ) { isValid = true; } else if (type == Blockly.ASTNode.types.NEXT) { isValid = true; @@ -167,14 +172,14 @@ export class LineCursor extends Blockly.BasicCursor { isValid = true; } else if ( type == Blockly.ASTNode.types.INPUT && - location.type == Blockly.INPUT_VALUE) { + location.type == Blockly.INPUT_VALUE + ) { isValid = true; } return isValid; } } - export const registrationName = 'LineCursor'; export const registrationType = Blockly.registry.Type.CURSOR; diff --git a/plugins/keyboard-navigation/src/navigation.js b/plugins/keyboard-navigation/src/navigation.js index e83d28abd4..4651c11b15 100644 --- a/plugins/keyboard-navigation/src/navigation.js +++ b/plugins/keyboard-navigation/src/navigation.js @@ -14,7 +14,8 @@ import * as Blockly from 'blockly/core'; import * as Constants from './constants'; import { registrationName as cursorRegistrationName, - registrationType as cursorRegistrationType} from './flyout_cursor'; + registrationType as cursorRegistrationType, +} from './flyout_cursor'; /** * Class that holds all methods necessary for keyboard navigation to work. @@ -109,8 +110,9 @@ export class Navigation { addWorkspace(workspace) { this.workspaces.push(workspace); const flyout = workspace.getFlyout(); - workspace.getMarkerManager().registerMarker( - this.MARKER_NAME, new Blockly.Marker()); + workspace + .getMarkerManager() + .registerMarker(this.MARKER_NAME, new Blockly.Marker()); workspace.addChangeListener(this.wsChangeWrapper); if (flyout) { @@ -187,7 +189,9 @@ export class Navigation { const flyoutWorkspace = flyout.getWorkspace(); flyoutWorkspace.addChangeListener(this.flyoutChangeWrapper); const FlyoutCursorClass = Blockly.registry.getClass( - cursorRegistrationType, cursorRegistrationName); + cursorRegistrationType, + cursorRegistrationName, + ); flyoutWorkspace.getMarkerManager().setCursor(new FlyoutCursorClass()); } @@ -221,16 +225,22 @@ export class Navigation { case Blockly.Events.BLOCK_CHANGE: if (e.element === 'mutation') { this.handleBlockMutation( - workspace, /** @type {Blockly.Events.BlockChange} */ (e)); + workspace, + /** @type {Blockly.Events.BlockChange} */ (e), + ); } break; case Blockly.Events.CLICK: this.handleWorkspaceClick( - workspace, /** @type {Blockly.Events.Click} */ (e)); + workspace, + /** @type {Blockly.Events.Click} */ (e), + ); break; case Blockly.Events.TOOLBOX_ITEM_SELECT: this.handleToolboxCategoryClick( - workspace, /** @type {Blockly.Events.ToolboxItemSelect} */ (e)); + workspace, + /** @type {Blockly.Events.ToolboxItemSelect} */ (e), + ); break; case Blockly.Events.BLOCK_CREATE: this.handleBlockCreate(workspace, e); @@ -251,9 +261,12 @@ export class Navigation { // This is called for simple toolboxes and for toolboxes that have a flyout // that does not close. Autoclosing flyouts close before we need to focus // the cursor on the block that was clicked. - if (mainWorkspace && mainWorkspace.keyboardAccessibilityMode && - !flyout.autoClose) { - if ((e.type === Blockly.Events.CLICK && e.targetType === 'block')) { + if ( + mainWorkspace && + mainWorkspace.keyboardAccessibilityMode && + !flyout.autoClose + ) { + if (e.type === Blockly.Events.CLICK && e.targetType === 'block') { const block = flyoutWorkspace.getBlockById(e.blockId); this.handleBlockClickInFlyout(mainWorkspace, block); } else if (e.type === Blockly.Events.SELECTED) { @@ -348,16 +361,23 @@ export class Navigation { const cursor = workspace.getCursor(); // Make sure the cursor is on a block. - if (!cursor || !cursor.getCurNode() || - !cursor.getCurNode().getSourceBlock()) { + if ( + !cursor || + !cursor.getCurNode() || + !cursor.getCurNode().getSourceBlock() + ) { return; } const curNode = cursor.getCurNode(); const sourceBlock = curNode.getSourceBlock(); if (sourceBlock.id === deletedBlockId || ids.indexOf(sourceBlock.id) > -1) { - cursor.setCurNode(Blockly.ASTNode.createWorkspaceNode( - workspace, this.WS_COORDINATE_ON_DELETE)); + cursor.setCurNode( + Blockly.ASTNode.createWorkspaceNode( + workspace, + this.WS_COORDINATE_ON_DELETE, + ), + ); } } @@ -376,8 +396,9 @@ export class Navigation { if (block.isShadow()) { block = /** @type {Blockly.BlockSvg}*/ (block.getParent()); } - this.getFlyoutCursor(mainWorkspace) - .setCurNode(Blockly.ASTNode.createStackNode(block)); + this.getFlyoutCursor(mainWorkspace).setCurNode( + Blockly.ASTNode.createStackNode(block), + ); this.setState(mainWorkspace, Constants.STATE.FLYOUT); } @@ -402,21 +423,32 @@ export class Navigation { // If the block has a parent move the cursor to their connection point. if (block.getParent()) { const topConnection = - block.previousConnection || block.outputConnection; + block.previousConnection || block.outputConnection; if (topConnection) { - cursor.setCurNode(Blockly.ASTNode.createConnectionNode( - topConnection.targetConnection)); + cursor.setCurNode( + Blockly.ASTNode.createConnectionNode( + topConnection.targetConnection, + ), + ); } } else { // If the block is by itself move the cursor to the workspace. - cursor.setCurNode(Blockly.ASTNode.createWorkspaceNode( - block.workspace, block.getRelativeToSurfaceXY())); + cursor.setCurNode( + Blockly.ASTNode.createWorkspaceNode( + block.workspace, + block.getRelativeToSurfaceXY(), + ), + ); } // If the cursor is on a block whose parent is being deleted, move the // cursor to the workspace. } else if (block && deletedBlock.getChildren(false).indexOf(block) > -1) { - cursor.setCurNode(Blockly.ASTNode.createWorkspaceNode( - block.workspace, block.getRelativeToSurfaceXY())); + cursor.setCurNode( + Blockly.ASTNode.createWorkspaceNode( + block.workspace, + block.getRelativeToSurfaceXY(), + ), + ); } } @@ -502,13 +534,16 @@ export class Navigation { const topBlocks = workspace.getTopBlocks(true); const cursor = workspace.getCursor(); const wsCoordinates = new Blockly.utils.Coordinate( - this.DEFAULT_WS_COORDINATE.x / workspace.scale, - this.DEFAULT_WS_COORDINATE.y / workspace.scale); + this.DEFAULT_WS_COORDINATE.x / workspace.scale, + this.DEFAULT_WS_COORDINATE.y / workspace.scale, + ); if (topBlocks.length > 0) { cursor.setCurNode(Blockly.ASTNode.createTopNode(topBlocks[0])); } else { - const wsNode = - Blockly.ASTNode.createWorkspaceNode(workspace, wsCoordinates); + const wsNode = Blockly.ASTNode.createWorkspaceNode( + workspace, + wsCoordinates, + ); cursor.setCurNode(wsNode); } } @@ -543,10 +578,16 @@ export class Navigation { return; } const markerNode = this.getMarker(workspace).getCurNode(); - if (!this.tryToConnectMarkerAndCursor( - workspace, markerNode, Blockly.ASTNode.createBlockNode(newBlock))) { + if ( + !this.tryToConnectMarkerAndCursor( + workspace, + markerNode, + Blockly.ASTNode.createBlockNode(newBlock), + ) + ) { this.warn( - 'Something went wrong while inserting a block from the flyout.'); + 'Something went wrong while inserting a block from the flyout.', + ); } this.focusWorkspace(workspace); @@ -565,15 +606,17 @@ export class Navigation { const flyout = workspace.getFlyout(); if (!flyout || !flyout.isVisible()) { this.warn( - 'Trying to insert from the flyout when the flyout does not ' + - ' exist or is not visible'); + 'Trying to insert from the flyout when the flyout does not ' + + ' exist or is not visible', + ); return null; } const curBlock = /** @type {!Blockly.BlockSvg} */ ( - this.getFlyoutCursor(workspace).getCurNode().getLocation()); + this.getFlyoutCursor(workspace).getCurNode().getLocation() + ); if (!curBlock.isEnabled()) { - this.warn('Can\'t insert a disabled block.'); + this.warn("Can't insert a disabled block."); return null; } @@ -616,7 +659,10 @@ export class Navigation { if (markerNode && cursorNode) { return this.tryToConnectMarkerAndCursor( - workspace, markerNode, cursorNode); + workspace, + markerNode, + cursorNode, + ); } return false; } @@ -641,23 +687,29 @@ export class Navigation { const cursorLoc = cursorNode.getLocation(); const markerLoc = markerNode.getLocation(); if (markerNode.isConnection() && cursorNode.isConnection()) { - const cursorConnection = - /** @type {!Blockly.RenderedConnection} */ (cursorLoc); - const markerConnection = - /** @type {!Blockly.RenderedConnection} */ (markerLoc); + const cursorConnection = /** @type {!Blockly.RenderedConnection} */ ( + cursorLoc + ); + const markerConnection = /** @type {!Blockly.RenderedConnection} */ ( + markerLoc + ); return this.connect(cursorConnection, markerConnection); } else if ( markerNode.isConnection() && - (cursorType == Blockly.ASTNode.types.BLOCK || - cursorType == Blockly.ASTNode.types.STACK)) { + (cursorType == Blockly.ASTNode.types.BLOCK || + cursorType == Blockly.ASTNode.types.STACK) + ) { const cursorBlock = /** @type {!Blockly.BlockSvg} */ (cursorLoc); - const markerConnection = - /** @type {!Blockly.RenderedConnection} */ (markerLoc); + const markerConnection = /** @type {!Blockly.RenderedConnection} */ ( + markerLoc + ); return this.insertBlock(cursorBlock, markerConnection); } else if (markerType == Blockly.ASTNode.types.WORKSPACE) { const block = cursorNode ? cursorNode.getSourceBlock() : null; return this.moveBlockToWorkspace( - /** @type {Blockly.BlockSvg} */ (block), markerNode); + /** @type {Blockly.BlockSvg} */ (block), + markerNode, + ); } this.warn('Unexpected state in tryToConnectMarkerAndCursor.'); return false; @@ -766,7 +818,6 @@ export class Navigation { * * If the given connections are not compatible try finding compatible * connections on the source blocks of the given connections. - * * @param {?Blockly.RenderedConnection} movingConnection The connection that * is being moved. * @param {?Blockly.RenderedConnection} destConnection The connection to be @@ -786,23 +837,32 @@ export class Navigation { const movingSuperior = this.getSuperiorConnection(movingConnection); const destInferior = this.getInferiorConnection(destConnection); - if (movingInferior && destSuperior && - this.moveAndConnect(movingInferior, destSuperior)) { + if ( + movingInferior && + destSuperior && + this.moveAndConnect(movingInferior, destSuperior) + ) { return true; // Try swapping the inferior and superior connections on the blocks. } else if ( - movingSuperior && destInferior && - this.moveAndConnect(movingSuperior, destInferior)) { + movingSuperior && + destInferior && + this.moveAndConnect(movingSuperior, destInferior) + ) { return true; } else if (this.moveAndConnect(movingConnection, destConnection)) { return true; } else { const checker = movingConnection.getConnectionChecker(); - const reason = - checker.canConnectWithReason(movingConnection, destConnection, false); + const reason = checker.canConnectWithReason( + movingConnection, + destConnection, + false, + ); this.warn( - 'Connection failed with error: ' + - checker.getErrorMessage(reason, movingConnection, destConnection)); + 'Connection failed with error: ' + + checker.getErrorMessage(reason, movingConnection, destConnection), + ); return false; } } @@ -863,8 +923,10 @@ export class Navigation { const movingBlock = movingConnection.getSourceBlock(); const checker = movingConnection.getConnectionChecker(); - if (checker.canConnect(movingConnection, destConnection, false) && - !destConnection.getSourceBlock().isShadow()) { + if ( + checker.canConnect(movingConnection, destConnection, false) && + !destConnection.getSourceBlock().isShadow() + ) { this.disconnectChild(movingConnection, destConnection); // Position the root block near the connection so it does not move the @@ -876,10 +938,14 @@ export class Navigation { x: destConnection.x - movingConnection.x, y: destConnection.y - movingConnection.y, }; - const originalOffsetInBlock = - movingConnection.getOffsetInBlock().clone(); + const originalOffsetInBlock = movingConnection + .getOffsetInBlock() + .clone(); rootBlock.positionNearConnection( - movingConnection, originalOffsetToTarget, originalOffsetInBlock); + movingConnection, + originalOffsetToTarget, + originalOffsetInBlock, + ); } destConnection.connect(movingConnection); return true; @@ -916,16 +982,22 @@ export class Navigation { case Blockly.OUTPUT_VALUE: for (let i = 0; i < block.inputList.length; i++) { const inputConnection = /** @type {Blockly.RenderedConnection} */ ( - block.inputList[i].connection); - if (inputConnection && inputConnection.type === Blockly.INPUT_VALUE && - this.connect(inputConnection, destConnection)) { + block.inputList[i].connection + ); + if ( + inputConnection && + inputConnection.type === Blockly.INPUT_VALUE && + this.connect(inputConnection, destConnection) + ) { return true; } } // If there are no input values pass the output and destination // connections to connect_ to find a way to connect the two. - if (block.outputConnection && - this.connect(block.outputConnection, destConnection)) { + if ( + block.outputConnection && + this.connect(block.outputConnection, destConnection) + ) { return true; } break; @@ -945,22 +1017,24 @@ export class Navigation { const curNode = workspace.getCursor().getCurNode(); if (!curNode.isConnection()) { this.log( - 'Cannot disconnect blocks when the cursor is not on a connection'); + 'Cannot disconnect blocks when the cursor is not on a connection', + ); return; } - const curConnection = - /** @type {!Blockly.RenderedConnection} */ (curNode.getLocation()); + const curConnection = /** @type {!Blockly.RenderedConnection} */ ( + curNode.getLocation() + ); if (!curConnection.isConnected()) { this.log('Cannot disconnect unconnected connection'); return; } - const superiorConnection = curConnection.isSuperior() ? - curConnection : - curConnection.targetConnection; + const superiorConnection = curConnection.isSuperior() + ? curConnection + : curConnection.targetConnection; - const inferiorConnection = curConnection.isSuperior() ? - curConnection.targetConnection : - curConnection; + const inferiorConnection = curConnection.isSuperior() + ? curConnection.targetConnection + : curConnection; if (inferiorConnection.getSourceBlock().isShadow()) { this.log('Cannot disconnect a shadow block'); @@ -973,7 +1047,7 @@ export class Navigation { rootBlock.bringToFront(); const connectionNode = - Blockly.ASTNode.createConnectionNode(superiorConnection); + Blockly.ASTNode.createConnectionNode(superiorConnection); workspace.getCursor().setCurNode(connectionNode); } @@ -1004,8 +1078,10 @@ export class Navigation { * @package */ enableKeyboardAccessibility(workspace) { - if (this.workspaces.indexOf(workspace) > -1 && - !workspace.keyboardAccessibilityMode) { + if ( + this.workspaces.indexOf(workspace) > -1 && + !workspace.keyboardAccessibilityMode + ) { workspace.keyboardAccessibilityMode = true; this.focusWorkspace(workspace); } @@ -1018,8 +1094,10 @@ export class Navigation { * @package */ disableKeyboardAccessibility(workspace) { - if (this.workspaces.indexOf(workspace) > -1 && - workspace.keyboardAccessibilityMode) { + if ( + this.workspaces.indexOf(workspace) > -1 && + workspace.keyboardAccessibilityMode + ) { workspace.keyboardAccessibilityMode = false; workspace.getCursor().hide(); this.getMarker(workspace).hide(); @@ -1092,8 +1170,12 @@ export class Navigation { const newX = xDirection * this.WS_MOVE_DISTANCE + wsCoord.x; const newY = yDirection * this.WS_MOVE_DISTANCE + wsCoord.y; - cursor.setCurNode(Blockly.ASTNode.createWorkspaceNode( - workspace, new Blockly.utils.Coordinate(newX, newY))); + cursor.setCurNode( + Blockly.ASTNode.createWorkspaceNode( + workspace, + new Blockly.utils.Coordinate(newX, newY), + ), + ); return true; } @@ -1107,9 +1189,11 @@ export class Navigation { const curNode = cursor.getCurNode(); const nodeType = curNode.getType(); if (nodeType == Blockly.ASTNode.types.FIELD) { - (/** @type {!Blockly.Field} */ (curNode.getLocation())).showEditor(); + /** @type {!Blockly.Field} */ (curNode.getLocation()).showEditor(); } else if ( - curNode.isConnection() || nodeType == Blockly.ASTNode.types.WORKSPACE) { + curNode.isConnection() || + nodeType == Blockly.ASTNode.types.WORKSPACE + ) { this.markAtCursor(workspace); } else if (nodeType == Blockly.ASTNode.types.BLOCK) { this.warn('Cannot mark a block.'); @@ -1156,7 +1240,10 @@ export class Navigation { const markedNode = workspace.getMarker(this.MARKER_NAME).getCurNode(); if (markedNode) { isHandled = this.tryToConnectMarkerAndCursor( - workspace, markedNode, Blockly.ASTNode.createBlockNode(block)); + workspace, + markedNode, + Blockly.ASTNode.createBlockNode(block), + ); } return isHandled; } diff --git a/plugins/keyboard-navigation/src/navigation_controller.js b/plugins/keyboard-navigation/src/navigation_controller.js index efd3ac2b6a..ae8aaa84f6 100644 --- a/plugins/keyboard-navigation/src/navigation_controller.js +++ b/plugins/keyboard-navigation/src/navigation_controller.js @@ -239,8 +239,9 @@ export class NavigationController { } const curNode = cursor.getCurNode(); if (curNode.getType() === Blockly.ASTNode.types.FIELD) { - return (/** @type {!Blockly.Field} */ (curNode.getLocation())) - .onShortcut(shortcut); + return /** @type {!Blockly.Field} */ (curNode.getLocation()).onShortcut( + shortcut, + ); } return false; } @@ -277,9 +278,9 @@ export class NavigationController { } return isHandled; case Constants.STATE.TOOLBOX: - return toolbox && typeof toolbox.onShortcut == 'function' ? - toolbox.onShortcut(shortcut) : - false; + return toolbox && typeof toolbox.onShortcut == 'function' + ? toolbox.onShortcut(shortcut) + : false; default: return false; } @@ -288,7 +289,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(previousShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.W, previousShortcut.name); + Blockly.utils.KeyCodes.W, + previousShortcut.name, + ); } /** @@ -311,10 +314,13 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(toggleKeyboardNavShortcut); const ctrlShiftK = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.K, - [Blockly.utils.KeyCodes.CTRL, Blockly.utils.KeyCodes.SHIFT]); + Blockly.utils.KeyCodes.K, + [Blockly.utils.KeyCodes.CTRL, Blockly.utils.KeyCodes.SHIFT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - ctrlShiftK, toggleKeyboardNavShortcut.name); + ctrlShiftK, + toggleKeyboardNavShortcut.name, + ); } /** @@ -344,9 +350,9 @@ export class NavigationController { this.navigation.focusToolbox(workspace); return true; case Constants.STATE.TOOLBOX: - return toolbox && typeof toolbox.onShortcut == 'function' ? - toolbox.onShortcut(shortcut) : - false; + return toolbox && typeof toolbox.onShortcut == 'function' + ? toolbox.onShortcut(shortcut) + : false; default: return false; } @@ -355,7 +361,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(outShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.A, outShortcut.name); + Blockly.utils.KeyCodes.A, + outShortcut.name, + ); } /** @@ -390,9 +398,9 @@ export class NavigationController { } return isHandled; case Constants.STATE.TOOLBOX: - return toolbox && typeof toolbox.onShortcut == 'function' ? - toolbox.onShortcut(shortcut) : - false; + return toolbox && typeof toolbox.onShortcut == 'function' + ? toolbox.onShortcut(shortcut) + : false; default: return false; } @@ -401,7 +409,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(nextShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.S, nextShortcut.name); + Blockly.utils.KeyCodes.S, + nextShortcut.name, + ); } /** @@ -428,9 +438,10 @@ export class NavigationController { } return isHandled; case Constants.STATE.TOOLBOX: - isHandled = toolbox && typeof toolbox.onShortcut == 'function' ? - toolbox.onShortcut(shortcut) : - false; + isHandled = + toolbox && typeof toolbox.onShortcut == 'function' + ? toolbox.onShortcut(shortcut) + : false; if (!isHandled) { this.navigation.focusFlyout(workspace); } @@ -443,7 +454,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(inShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.D, inShortcut.name); + Blockly.utils.KeyCodes.D, + inShortcut.name, + ); } /** @@ -456,8 +469,9 @@ export class NavigationController { const insertShortcut = { name: Constants.SHORTCUT_NAMES.INSERT, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { switch (this.navigation.getState(workspace)) { @@ -471,7 +485,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(insertShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.I, insertShortcut.name); + Blockly.utils.KeyCodes.I, + insertShortcut.name, + ); } /** @@ -483,8 +499,9 @@ export class NavigationController { const markShortcut = { name: Constants.SHORTCUT_NAMES.MARK, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { switch (this.navigation.getState(workspace)) { @@ -502,7 +519,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(markShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.ENTER, markShortcut.name); + Blockly.utils.KeyCodes.ENTER, + markShortcut.name, + ); } /** @@ -515,8 +534,9 @@ export class NavigationController { const disconnectShortcut = { name: Constants.SHORTCUT_NAMES.DISCONNECT, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { switch (this.navigation.getState(workspace)) { @@ -531,7 +551,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(disconnectShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.X, disconnectShortcut.name); + Blockly.utils.KeyCodes.X, + disconnectShortcut.name, + ); } /** @@ -544,8 +566,9 @@ export class NavigationController { const focusToolboxShortcut = { name: Constants.SHORTCUT_NAMES.TOOLBOX, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { switch (this.navigation.getState(workspace)) { @@ -564,7 +587,9 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(focusToolboxShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.T, focusToolboxShortcut.name); + Blockly.utils.KeyCodes.T, + focusToolboxShortcut.name, + ); } /** @@ -595,9 +620,15 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(exitShortcut, true); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.ESC, exitShortcut.name, true); + Blockly.utils.KeyCodes.ESC, + exitShortcut.name, + true, + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.E, exitShortcut.name, true); + Blockly.utils.KeyCodes.E, + exitShortcut.name, + true, + ); } /** @@ -610,8 +641,9 @@ export class NavigationController { const wsMoveLeftShortcut = { name: Constants.SHORTCUT_NAMES.MOVE_WS_CURSOR_LEFT, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { return this.navigation.moveWSCursor(workspace, -1, 0); @@ -620,9 +652,13 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(wsMoveLeftShortcut); const shiftA = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.A, [Blockly.utils.KeyCodes.SHIFT]); + Blockly.utils.KeyCodes.A, + [Blockly.utils.KeyCodes.SHIFT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - shiftA, wsMoveLeftShortcut.name); + shiftA, + wsMoveLeftShortcut.name, + ); } /** @@ -635,8 +671,9 @@ export class NavigationController { const wsMoveRightShortcut = { name: Constants.SHORTCUT_NAMES.MOVE_WS_CURSOR_RIGHT, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { return this.navigation.moveWSCursor(workspace, 1, 0); @@ -645,9 +682,13 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(wsMoveRightShortcut); const shiftD = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.D, [Blockly.utils.KeyCodes.SHIFT]); + Blockly.utils.KeyCodes.D, + [Blockly.utils.KeyCodes.SHIFT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - shiftD, wsMoveRightShortcut.name); + shiftD, + wsMoveRightShortcut.name, + ); } /** @@ -660,8 +701,9 @@ export class NavigationController { const wsMoveUpShortcut = { name: Constants.SHORTCUT_NAMES.MOVE_WS_CURSOR_UP, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { return this.navigation.moveWSCursor(workspace, 0, -1); @@ -670,9 +712,13 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(wsMoveUpShortcut); const shiftW = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.W, [Blockly.utils.KeyCodes.SHIFT]); + Blockly.utils.KeyCodes.W, + [Blockly.utils.KeyCodes.SHIFT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - shiftW, wsMoveUpShortcut.name); + shiftW, + wsMoveUpShortcut.name, + ); } /** @@ -685,8 +731,9 @@ export class NavigationController { const wsMoveDownShortcut = { name: Constants.SHORTCUT_NAMES.MOVE_WS_CURSOR_DOWN, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly; + return ( + workspace.keyboardAccessibilityMode && !workspace.options.readOnly + ); }, callback: (workspace) => { return this.navigation.moveWSCursor(workspace, 0, 1); @@ -695,9 +742,13 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(wsMoveDownShortcut); const shiftW = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.S, [Blockly.utils.KeyCodes.SHIFT]); + Blockly.utils.KeyCodes.S, + [Blockly.utils.KeyCodes.SHIFT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - shiftW, wsMoveDownShortcut.name); + shiftW, + wsMoveDownShortcut.name, + ); } /** @@ -709,20 +760,27 @@ export class NavigationController { const copyShortcut = { name: Constants.SHORTCUT_NAMES.COPY, preconditionFn: (workspace) => { - if (workspace.keyboardAccessibilityMode && - !workspace.options.readOnly) { + if ( + workspace.keyboardAccessibilityMode && + !workspace.options.readOnly + ) { const curNode = workspace.getCursor().getCurNode(); if (curNode && curNode.getSourceBlock()) { const sourceBlock = curNode.getSourceBlock(); - return !Blockly.Gesture.inProgress() && sourceBlock && - sourceBlock.isDeletable() && sourceBlock.isMovable(); + return ( + !Blockly.Gesture.inProgress() && + sourceBlock && + sourceBlock.isDeletable() && + sourceBlock.isMovable() + ); } } return false; }, callback: (workspace) => { - const sourceBlock =/** @type {Blockly.BlockSvg} */ ( - workspace.getCursor().getCurNode().getSourceBlock()); + const sourceBlock = /** @type {Blockly.BlockSvg} */ ( + workspace.getCursor().getCurNode().getSourceBlock() + ); workspace.hideChaff(); this.copyData = sourceBlock.toCopyData(); this.copyWorkspace = sourceBlock.workspace; @@ -733,19 +791,34 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(copyShortcut); const ctrlC = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.C, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.C, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - ctrlC, copyShortcut.name, true); + ctrlC, + copyShortcut.name, + true, + ); const altC = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.C, [Blockly.utils.KeyCodes.ALT]); + Blockly.utils.KeyCodes.C, + [Blockly.utils.KeyCodes.ALT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - altC, copyShortcut.name, true); + altC, + copyShortcut.name, + true, + ); const metaC = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.C, [Blockly.utils.KeyCodes.META]); + Blockly.utils.KeyCodes.C, + [Blockly.utils.KeyCodes.META], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - metaC, copyShortcut.name, true); + metaC, + copyShortcut.name, + true, + ); } /** @@ -757,8 +830,11 @@ export class NavigationController { const pasteShortcut = { name: Constants.SHORTCUT_NAMES.PASTE, preconditionFn: (workspace) => { - return workspace.keyboardAccessibilityMode && - !workspace.options.readOnly && !Blockly.Gesture.inProgress(); + return ( + workspace.keyboardAccessibilityMode && + !workspace.options.readOnly && + !Blockly.Gesture.inProgress() + ); }, callback: () => { if (!this.copyData || !this.copyWorkspace) return false; @@ -769,19 +845,34 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(pasteShortcut); const ctrlV = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.V, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.V, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - ctrlV, pasteShortcut.name, true); + ctrlV, + pasteShortcut.name, + true, + ); const altV = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.V, [Blockly.utils.KeyCodes.ALT]); + Blockly.utils.KeyCodes.V, + [Blockly.utils.KeyCodes.ALT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - altV, pasteShortcut.name, true); + altV, + pasteShortcut.name, + true, + ); const metaV = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.V, [Blockly.utils.KeyCodes.META]); + Blockly.utils.KeyCodes.V, + [Blockly.utils.KeyCodes.META], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - metaV, pasteShortcut.name, true); + metaV, + pasteShortcut.name, + true, + ); } /** @@ -794,21 +885,28 @@ export class NavigationController { const cutShortcut = { name: Constants.SHORTCUT_NAMES.CUT, preconditionFn: (workspace) => { - if (workspace.keyboardAccessibilityMode && - !workspace.options.readOnly) { + if ( + workspace.keyboardAccessibilityMode && + !workspace.options.readOnly + ) { const curNode = workspace.getCursor().getCurNode(); if (curNode && curNode.getSourceBlock()) { const sourceBlock = curNode.getSourceBlock(); - return !Blockly.Gesture.inProgress() && sourceBlock && - sourceBlock.isDeletable() && sourceBlock.isMovable() && - !sourceBlock.workspace.isFlyout; + return ( + !Blockly.Gesture.inProgress() && + sourceBlock && + sourceBlock.isDeletable() && + sourceBlock.isMovable() && + !sourceBlock.workspace.isFlyout + ); } } return false; }, callback: (workspace) => { - const sourceBlock =/** @type {Blockly.BlockSvg} */ ( - workspace.getCursor().getCurNode().getSourceBlock()); + const sourceBlock = /** @type {Blockly.BlockSvg} */ ( + workspace.getCursor().getCurNode().getSourceBlock() + ); this.copyData = sourceBlock.toCopyData(); this.copyWorkspace = sourceBlock.workspace; this.navigation.moveCursorOnBlockDelete(workspace, sourceBlock); @@ -820,19 +918,34 @@ export class NavigationController { Blockly.ShortcutRegistry.registry.register(cutShortcut); const ctrlX = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.X, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.X, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - ctrlX, cutShortcut.name, true); + ctrlX, + cutShortcut.name, + true, + ); const altX = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.X, [Blockly.utils.KeyCodes.ALT]); + Blockly.utils.KeyCodes.X, + [Blockly.utils.KeyCodes.ALT], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - altX, cutShortcut.name, true); + altX, + cutShortcut.name, + true, + ); const metaX = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.X, [Blockly.utils.KeyCodes.META]); + Blockly.utils.KeyCodes.X, + [Blockly.utils.KeyCodes.META], + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - metaX, cutShortcut.name, true); + metaX, + cutShortcut.name, + true, + ); } /** @@ -844,9 +957,11 @@ export class NavigationController { /** @type {!Blockly.ShortcutRegistry.KeyboardShortcut} */ const deleteShortcut = { name: Constants.SHORTCUT_NAMES.DELETE, - preconditionFn: function(workspace) { - if (workspace.keyboardAccessibilityMode && - !workspace.options.readOnly) { + preconditionFn: function (workspace) { + if ( + workspace.keyboardAccessibilityMode && + !workspace.options.readOnly + ) { const curNode = workspace.getCursor().getCurNode(); if (curNode && curNode.getSourceBlock()) { const sourceBlock = curNode.getSourceBlock(); @@ -873,9 +988,15 @@ export class NavigationController { }; Blockly.ShortcutRegistry.registry.register(deleteShortcut); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.DELETE, deleteShortcut.name, true); + Blockly.utils.KeyCodes.DELETE, + deleteShortcut.name, + true, + ); Blockly.ShortcutRegistry.registry.addKeyMapping( - Blockly.utils.KeyCodes.BACKSPACE, deleteShortcut.name, true); + Blockly.utils.KeyCodes.BACKSPACE, + deleteShortcut.name, + true, + ); } /** diff --git a/plugins/keyboard-navigation/test/index.html b/plugins/keyboard-navigation/test/index.html index b3cee29120..e0db0d3253 100644 --- a/plugins/keyboard-navigation/test/index.html +++ b/plugins/keyboard-navigation/test/index.html @@ -1,44 +1,53 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -

Keyboard Navigation is our first step towards an accessible Blockly.
- For more information on how the default keyboard navigation works please see - the documentation. -
-
- - Cursors
- The cursor controls how the user navigates the blocks, inputs, fields and connections on a workspace. - This demo shows three different cursors:
- Default Cursor: This cursor uses previous, next, in, and out to navigate through the different - parts of a block. See the developer documentation for more information.
- Basic Cursor: Uses pre order traversal to allow users to navigate - through everything using only the previous and next command.
- Line Cursor: We tried to make this cursor mimic a text editor. Navigating - up and down will take the cursor to the next and previous "line" of code. - Navigating in and out will move the cursor through all the fields and inputs - in that "line" of code. -

- - - -
- - + +

+ Keyboard Navigation is our first step towards an accessible Blockly.
+ For more information on how the default keyboard navigation works please + see the + documentation. +
+
+ Cursors
+ The cursor controls how the user navigates the blocks, inputs, fields and + connections on a workspace. This demo shows three different cursors:
+ Default Cursor: This cursor uses previous, next, in, and out to + navigate through the different parts of a block. See the + developer documentation + for more information.
+ Basic Cursor: Uses pre order traversal to allow users to navigate + through everything using only the previous and next command.
+ Line Cursor: We tried to make this cursor mimic a text editor. + Navigating up and down will take the cursor to the next and previous + "line" of code. Navigating in and out will move the cursor through all the + fields and inputs in that "line" of code. +

+ + + +
+ + diff --git a/plugins/keyboard-navigation/test/index.js b/plugins/keyboard-navigation/test/index.js index 881dd133ed..e5449280d4 100644 --- a/plugins/keyboard-navigation/test/index.js +++ b/plugins/keyboard-navigation/test/index.js @@ -13,7 +13,6 @@ import * as Blockly from 'blockly'; import {LineCursor, NavigationController} from '../src'; - let controller; /** @@ -28,29 +27,34 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { controller = new NavigationController(); controller.init(); const defaultOptions = { toolbox: toolboxCategories, }; createPlayground( - document.getElementById('root'), createWorkspace, defaultOptions); + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); -document.getElementById('accessibilityModeCheck') - .addEventListener('click', (e) => { - if (e.target.checked) { - controller.enable(Blockly.getMainWorkspace()); - } else { - controller.disable(Blockly.getMainWorkspace()); - } - }); +document + .getElementById('accessibilityModeCheck') + .addEventListener('click', (e) => { + if (e.target.checked) { + controller.enable(Blockly.getMainWorkspace()); + } else { + controller.disable(Blockly.getMainWorkspace()); + } + }); document.getElementById('cursorChanger').addEventListener('change', (e) => { const cursorType = e.target.value; - const accessibilityCheckbox = - document.getElementById('accessibilityModeCheck'); + const accessibilityCheckbox = document.getElementById( + 'accessibilityModeCheck', + ); const markerManager = Blockly.getMainWorkspace().getMarkerManager(); const oldCurNode = markerManager.getCursor().getCurNode(); diff --git a/plugins/keyboard-navigation/test/navigation_modify_test.mocha.js b/plugins/keyboard-navigation/test/navigation_modify_test.mocha.js index f55e1d99c7..65e4e2dfc4 100644 --- a/plugins/keyboard-navigation/test/navigation_modify_test.mocha.js +++ b/plugins/keyboard-navigation/test/navigation_modify_test.mocha.js @@ -11,7 +11,7 @@ const assert = chai.assert; const {testHelpers} = require('@blockly/dev-tools'); const {captureWarnings} = testHelpers; -suite('Insert/Modify', function() { +suite('Insert/Modify', function () { /** * Check that modify failed. * @param {Navigation} navigation The class under test. @@ -21,13 +21,19 @@ suite('Insert/Modify', function() { */ function assertModifyFails(navigation, workspace, markerNode, cursorNode) { let modifyResult; - const warnings = captureWarnings(function() { + const warnings = captureWarnings(function () { modifyResult = navigation.tryToConnectMarkerAndCursor( - workspace, markerNode, cursorNode); + workspace, + markerNode, + cursorNode, + ); }); assert.isFalse(modifyResult); assert.equal( - warnings.length, 1, 'Expecting 1 warnings for why modify failed.'); + warnings.length, + 1, + 'Expecting 1 warnings for why modify failed.', + ); } /** @@ -70,13 +76,14 @@ suite('Insert/Modify', function() { ]); } - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
'); + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + ); // We are running these tests in node even thought they require a rendered // workspace, which doesn't exactly work. The rendering system expects // cancelAnimationFrame to be defined so we need to define it. - window.cancelAnimationFrame = function() {}; + window.cancelAnimationFrame = function () {}; // NOTE: block positions chosen such that they aren't unintentionally // bumped out of bounds during tests. @@ -93,7 +100,6 @@ suite('Insert/Modify', function() { defineTestBlocks(); - this.workspace = Blockly.inject('blocklyDiv', { toolbox: ` `, }); Blockly.Xml.domToWorkspace( - Blockly.utils.xml.textToDom(xmlText), this.workspace); + Blockly.utils.xml.textToDom(xmlText), + this.workspace, + ); this.navigation = new Navigation(); this.navigation.addWorkspace(this.workspace); - this.stack_block_1 = this.workspace.getBlockById('stack_block_1'); this.stack_block_2 = this.workspace.getBlockById('stack_block_2'); this.row_block_1 = this.workspace.getBlockById('row_block_1'); @@ -117,7 +124,7 @@ suite('Insert/Modify', function() { this.navigation.enableKeyboardAccessibility(this.workspace); }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['stack_block']; delete Blockly.Blocks['row_block']; delete Blockly.Blocks['statement_block']; @@ -125,345 +132,559 @@ suite('Insert/Modify', function() { this.jsdomCleanup(); }); - suite('Marked Connection', function() { - suite('Marker on next', function() { - setup(function() { + suite('Marked Connection', function () { + suite('Marker on next', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_1.nextConnection); + this.stack_block_1.nextConnection, + ); }); - test('Cursor on workspace', function() { + test('Cursor on workspace', function () { const cursorNode = Blockly.ASTNode.createWorkspaceNode( - this.workspace, new Blockly.utils.Coordinate(0, 0)); + this.workspace, + new Blockly.utils.Coordinate(0, 0), + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on compatible connection', function() { + test('Cursor on compatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.previousConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_2.previousConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.stack_block_1.getNextBlock().id, 'stack_block_2'); }); - test('Cursor on incompatible connection', function() { + test('Cursor on incompatible connection', function () { // Connect method will try to find a way to connect blocks with // incompatible types. const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.nextConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_2.nextConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.stack_block_1.getNextBlock(), this.stack_block_2); }); - test('Cursor on really incompatible connection', function() { + test('Cursor on really incompatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.outputConnection); + this.row_block_1.outputConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); assert.isNull(this.stack_block_1.getNextBlock()); }); - test('Cursor on block', function() { + test('Cursor on block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.stack_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.stack_block_1.getNextBlock().id, 'stack_block_2'); }); }); - suite('Marker on previous', function() { - setup(function() { + suite('Marker on previous', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_1.previousConnection); + this.stack_block_1.previousConnection, + ); }); - test('Cursor on compatible connection', function() { + test('Cursor on compatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.nextConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_2.nextConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.stack_block_1.getPreviousBlock().id, 'stack_block_2'); }); - test('Cursor on incompatible connection', function() { + test('Cursor on incompatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.previousConnection); + this.stack_block_2.previousConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); assert.isNull(this.stack_block_1.getPreviousBlock()); }); - test('Cursor on really incompatible connection', function() { + test('Cursor on really incompatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.outputConnection); + this.row_block_1.outputConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); assert.isNull(this.stack_block_1.getNextBlock()); }); - test('Cursor on block', function() { + test('Cursor on block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.stack_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.stack_block_1.getPreviousBlock().id, 'stack_block_2'); }); - test('Cursor on incompatible block', function() { + test('Cursor on incompatible block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_1); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); assert.isNull(this.stack_block_1.getPreviousBlock()); }); }); - suite('Marker on value input', function() { - setup(function() { + suite('Marker on value input', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.inputList[0].connection); + this.row_block_1.inputList[0].connection, + ); }); - test('Cursor on compatible connection', function() { + test('Cursor on compatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_2.outputConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.row_block_2.outputConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.row_block_2.getParent().id, 'row_block_1'); }); - test('Cursor on incompatible connection', function() { + test('Cursor on incompatible connection', function () { // Connect method will try to find a way to connect blocks with // incompatible types. const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_2.inputList[0].connection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.row_block_2.inputList[0].connection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal( - this.row_block_1.inputList[0].connection.targetBlock(), - this.row_block_2); + this.row_block_1.inputList[0].connection.targetBlock(), + this.row_block_2, + ); }); - test('Cursor on really incompatible connection', function() { + test('Cursor on really incompatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_1.previousConnection); + this.stack_block_1.previousConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on block', function() { + test('Cursor on block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.row_block_2.getParent().id, 'row_block_1'); }); }); - suite('Marked Statement input', function() { - setup(function() { + suite('Marked Statement input', function () { + setup(function () { this.statement_block_1.inputList[0].connection.connect( - this.stack_block_1.previousConnection); + this.stack_block_1.previousConnection, + ); this.stack_block_1.nextConnection.connect( - this.stack_block_2.previousConnection); + this.stack_block_2.previousConnection, + ); this.markerNode = Blockly.ASTNode.createInputNode( - this.statement_block_1.inputList[0]); + this.statement_block_1.inputList[0], + ); }); - test('Cursor on block inside statement', function() { + test('Cursor on block inside statement', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.previousConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_2.previousConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal( - this.stack_block_2.previousConnection.targetBlock(), - this.statement_block_1); - }); - test('Cursor on stack', function() { - const cursorNode = - Blockly.ASTNode.createStackNode(this.statement_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_2.previousConnection.targetBlock(), + this.statement_block_1, + ); + }); + test('Cursor on stack', function () { + const cursorNode = Blockly.ASTNode.createStackNode( + this.statement_block_2, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal( - this.statement_block_2.getParent().id, 'statement_block_1'); + this.statement_block_2.getParent().id, + 'statement_block_1', + ); }); - test('Cursor on incompatible type', function() { + test('Cursor on incompatible type', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.outputConnection); + this.row_block_1.outputConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); assert.isNull(this.row_block_1.getParent()); }); }); - suite('Marker on output', function() { - setup(function() { + suite('Marker on output', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.outputConnection); + this.row_block_1.outputConnection, + ); }); - test('Cursor on compatible connection', function() { + test('Cursor on compatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_2.inputList[0].connection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.row_block_2.inputList[0].connection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.row_block_1.getParent().id, 'row_block_2'); }); - test('Cursor on incompatible connection', function() { + test('Cursor on incompatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_2.outputConnection); + this.row_block_2.outputConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on really incompatible connection', function() { + test('Cursor on really incompatible connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_1.previousConnection); + this.stack_block_1.previousConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on block', function() { + test('Cursor on block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.equal(this.row_block_1.getParent().id, 'row_block_2'); }); }); }); - - suite('Marked Workspace', function() { - setup(function() { + suite('Marked Workspace', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createWorkspaceNode( - this.workspace, new Blockly.utils.Coordinate(100, 200)); + this.workspace, + new Blockly.utils.Coordinate(100, 200), + ); }); - test('Cursor on row block', function() { + test('Cursor on row block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_1); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); const pos = this.row_block_1.getRelativeToSurfaceXY(); assert.equal(pos.x, 100); assert.equal(pos.y, 200); }); - test('Cursor on output connection', function() { + test('Cursor on output connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.outputConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.row_block_1.outputConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); const pos = this.row_block_1.getRelativeToSurfaceXY(); assert.equal(pos.x, 100); assert.equal(pos.y, 200); }); - test('Cursor on previous connection', function() { + test('Cursor on previous connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_1.previousConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_1.previousConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); const pos = this.stack_block_1.getRelativeToSurfaceXY(); assert.equal(pos.x, 100); assert.equal(pos.y, 200); }); - test('Cursor on input connection', function() { + test('Cursor on input connection', function () { // Move the source block to the marked location on the workspace. const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_1.inputList[0].connection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.row_block_1.inputList[0].connection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); }); - test('Cursor on next connection', function() { + test('Cursor on next connection', function () { // Move the source block to the marked location on the workspace. const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_1.nextConnection); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + this.stack_block_1.nextConnection, + ); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); }); - test('Cursor on child block (row)', function() { + test('Cursor on child block (row)', function () { this.row_block_1.inputList[0].connection.connect( - this.row_block_2.outputConnection); + this.row_block_2.outputConnection, + ); const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.isNull(this.row_block_2.getParent()); const pos = this.row_block_2.getRelativeToSurfaceXY(); assert.equal(pos.x, 100); assert.equal(pos.y, 200); }); - test('Cursor on child block (stack)', function() { + test('Cursor on child block (stack)', function () { this.stack_block_1.nextConnection.connect( - this.stack_block_2.previousConnection); + this.stack_block_2.previousConnection, + ); const cursorNode = Blockly.ASTNode.createBlockNode(this.stack_block_2); - assert.isTrue(this.navigation.tryToConnectMarkerAndCursor( - this.workspace, this.markerNode, cursorNode)); + assert.isTrue( + this.navigation.tryToConnectMarkerAndCursor( + this.workspace, + this.markerNode, + cursorNode, + ), + ); assert.isNull(this.stack_block_2.getParent()); const pos = this.stack_block_2.getRelativeToSurfaceXY(); assert.equal(pos.x, 100); assert.equal(pos.y, 200); }); - test('Cursor on workspace', function() { + test('Cursor on workspace', function () { const cursorNode = Blockly.ASTNode.createWorkspaceNode( - this.workspace, new Blockly.utils.Coordinate(100, 100)); + this.workspace, + new Blockly.utils.Coordinate(100, 100), + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); }); - suite('Marked Block', function() { - suite('Marked any block', function() { + suite('Marked Block', function () { + suite('Marked any block', function () { // These tests are using a stack block, but do not depend on the type of // the block. - setup(function() { + setup(function () { this.markerNode = Blockly.ASTNode.createBlockNode(this.stack_block_1); }); - test('Cursor on workspace', function() { + test('Cursor on workspace', function () { const cursorNode = Blockly.ASTNode.createWorkspaceNode( - this.workspace, new Blockly.utils.Coordinate(100, 100)); + this.workspace, + new Blockly.utils.Coordinate(100, 100), + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); }); - suite('Marked stack block', function() { - setup(function() { + suite('Marked stack block', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createBlockNode(this.stack_block_1); }); - test('Cursor on row block', function() { + test('Cursor on row block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_1); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on stack block', function() { + test('Cursor on stack block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.stack_block_1); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on next connection', function() { + test('Cursor on next connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.nextConnection); + this.stack_block_2.nextConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on previous connection', function() { + test('Cursor on previous connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.stack_block_2.previousConnection); + this.stack_block_2.previousConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); }); - suite('Marked row block', function() { - setup(function() { + suite('Marked row block', function () { + setup(function () { this.markerNode = Blockly.ASTNode.createBlockNode(this.row_block_1); }); - test('Cursor on stack block', function() { + test('Cursor on stack block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.stack_block_1); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on row block', function() { + test('Cursor on row block', function () { const cursorNode = Blockly.ASTNode.createBlockNode(this.row_block_1); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on value input connection', function() { + test('Cursor on value input connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_2.inputList[0].connection); + this.row_block_2.inputList[0].connection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); - test('Cursor on output connection', function() { + test('Cursor on output connection', function () { const cursorNode = Blockly.ASTNode.createConnectionNode( - this.row_block_2.outputConnection); + this.row_block_2.outputConnection, + ); assertModifyFails( - this.navigation, this.workspace, this.markerNode, cursorNode); + this.navigation, + this.workspace, + this.markerNode, + cursorNode, + ); }); }); }); diff --git a/plugins/keyboard-navigation/test/navigation_test.mocha.js b/plugins/keyboard-navigation/test/navigation_test.mocha.js index f563cf6bbc..0e0778f92c 100644 --- a/plugins/keyboard-navigation/test/navigation_test.mocha.js +++ b/plugins/keyboard-navigation/test/navigation_test.mocha.js @@ -10,29 +10,31 @@ */ 'use strict'; - const chai = require('chai'); const sinon = require('sinon'); const Blockly = require('blockly/node'); const {NavigationController, Constants} = require('../src/index'); -const {createNavigationWorkspace, createKeyDownEvent} = - require('./test_helper'); - -suite('Navigation', function() { - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
'); +const { + createNavigationWorkspace, + createKeyDownEvent, +} = require('./test_helper'); + +suite('Navigation', function () { + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + ); // We are running these tests in node even thought they require a rendered // workspace, which doesn't exactly work. The rendering system expects // cancelAnimationFrame to be defined so we need to define it. - window.cancelAnimationFrame = function() {}; + window.cancelAnimationFrame = function () {}; this.controller = new NavigationController(); this.controller.init(); this.navigation = this.controller.navigation; }); - teardown(function() { + teardown(function () { this.controller.dispose(); window.cancelAnimationFrame = undefined; this.jsdomCleanup(); @@ -40,24 +42,26 @@ suite('Navigation', function() { // Test that toolbox key handlers call through to the right functions and // transition correctly between toolbox, workspace, and flyout. - suite('Tests toolbox keys', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - }]); + suite('Tests toolbox keys', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.navigation.focusToolbox(this.workspace); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); @@ -87,11 +91,11 @@ suite('Navigation', function() { ], ]; - testCases.forEach(function(testCase) { + testCases.forEach(function (testCase) { const testCaseName = testCase[0]; const mockEvent = testCase[1]; const stubName = testCase[2]; - test(testCaseName, function() { + test(testCaseName, function () { const toolbox = this.workspace.getToolbox(); const selectStub = sinon.stub(toolbox, stubName); toolbox.selectedItem_ = toolbox.contents_[0]; @@ -100,244 +104,316 @@ suite('Navigation', function() { }); }); - test('Go to flyout', function() { + test('Go to flyout', function () { const navigation = this.navigation; - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.D, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.D, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - navigation.getState(this.workspace), Constants.STATE.FLYOUT); + navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); const flyoutCursor = navigation.getFlyoutCursor(this.workspace); // See test_helper.js for hardcoded field values. chai.assert.equal( - flyoutCursor.getCurNode().getLocation().getFieldValue('COLOURFIELD'), - '#ff0000'); + flyoutCursor.getCurNode().getLocation().getFieldValue('COLOURFIELD'), + '#ff0000', + ); }); - test('Focuses workspace from toolbox (e)', function() { + test('Focuses workspace from toolbox (e)', function () { const navigation = this.navigation; navigation.setState(this.workspace, Constants.STATE.TOOLBOX); - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.E, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.E, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Focuses workspace from toolbox (escape)', function() { + test('Focuses workspace from toolbox (escape)', function () { const navigation = this.navigation; navigation.setState(this.workspace, Constants.STATE.TOOLBOX); - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.ESC, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.ESC, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); }); // Test that flyout key handlers call through to the right functions and // transition correctly between toolbox, workspace, and flyout. - suite('Tests flyout keys', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - }]); + suite('Tests flyout keys', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.navigation.focusToolbox(this.workspace); this.navigation.focusFlyout(this.workspace); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); delete Blockly.Blocks['basic_block']; }); // Should be a no-op - test('Previous at beginning', function() { - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.W, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Previous at beginning', function () { + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.W, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); // See test_helper.js for hardcoded field values. chai.assert.equal( - this.navigation.getFlyoutCursor(this.workspace) - .getCurNode() - .getLocation() - .getFieldValue('COLOURFIELD'), - '#ff0000'); - }); - test('Previous', function() { - const flyoutBlocks = - this.workspace.getFlyout().getWorkspace().getTopBlocks(); - this.navigation.getFlyoutCursor(this.workspace) - .setCurNode(Blockly.ASTNode.createStackNode(flyoutBlocks[1])); - let flyoutBlock = this.navigation.getFlyoutCursor(this.workspace) + this.navigation + .getFlyoutCursor(this.workspace) .getCurNode() - .getLocation(); + .getLocation() + .getFieldValue('COLOURFIELD'), + '#ff0000', + ); + }); + test('Previous', function () { + const flyoutBlocks = this.workspace + .getFlyout() + .getWorkspace() + .getTopBlocks(); + this.navigation + .getFlyoutCursor(this.workspace) + .setCurNode(Blockly.ASTNode.createStackNode(flyoutBlocks[1])); + let flyoutBlock = this.navigation + .getFlyoutCursor(this.workspace) + .getCurNode() + .getLocation(); // See test_helper.js for hardcoded field values. - chai.assert.equal( - flyoutBlock.getFieldValue('COLOURFIELD'), '#00ff00'); + chai.assert.equal(flyoutBlock.getFieldValue('COLOURFIELD'), '#00ff00'); - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.W, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.W, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); - flyoutBlock = this.navigation.getFlyoutCursor(this.workspace) - .getCurNode() - .getLocation(); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); + flyoutBlock = this.navigation + .getFlyoutCursor(this.workspace) + .getCurNode() + .getLocation(); // See test_helper.js for hardcoded field values. - chai.assert.equal( - flyoutBlock.getFieldValue('COLOURFIELD'), '#ff0000'); + chai.assert.equal(flyoutBlock.getFieldValue('COLOURFIELD'), '#ff0000'); }); - test('Next', function() { - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.S, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Next', function () { + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.S, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); - const flyoutBlock = this.navigation.getFlyoutCursor(this.workspace) - .getCurNode() - .getLocation(); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); + const flyoutBlock = this.navigation + .getFlyoutCursor(this.workspace) + .getCurNode() + .getLocation(); // See test_helper.js for hardcoded field values. - chai.assert.equal( - flyoutBlock.getFieldValue('COLOURFIELD'), '#00ff00'); + chai.assert.equal(flyoutBlock.getFieldValue('COLOURFIELD'), '#00ff00'); }); - test('Out', function() { - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.A, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Out', function () { + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.A, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.TOOLBOX); + this.navigation.getState(this.workspace), + Constants.STATE.TOOLBOX, + ); }); - test('Mark', function() { - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.ENTER, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Mark', function () { + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.ENTER, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); chai.assert.equal(this.workspace.getTopBlocks().length, 1); }); - test('Mark - Disabled Block', function() { - this.navigation.loggingCallback = function(type, msg) { - chai.assert.equal(msg, 'Can\'t insert a disabled block.'); + test('Mark - Disabled Block', function () { + this.navigation.loggingCallback = function (type, msg) { + chai.assert.equal(msg, "Can't insert a disabled block."); }; const flyout = this.workspace.getFlyout(); const topBlock = flyout.getWorkspace().getTopBlocks()[0]; topBlock.setEnabled(false); - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.ENTER, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.ENTER, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); chai.assert.equal(this.workspace.getTopBlocks().length, 0); this.navigation.loggingCallback = null; }); - test('Exit', function() { - const mockEvent = - createKeyDownEvent(Blockly.utils.KeyCodes.ESC, 'NotAField'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Exit', function () { + const mockEvent = createKeyDownEvent( + Blockly.utils.KeyCodes.ESC, + 'NotAField', + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); }); // Test that workspace key handlers call through to the right functions and // transition correctly between toolbox, workspace, and flyout. - suite('Tests workspace keys', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - 'previousStatement': null, - 'nextStatement': null, - }]); + suite('Tests workspace keys', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + 'previousStatement': null, + 'nextStatement': null, + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.basicBlock = this.workspace.newBlock('basic_block'); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); delete Blockly.Blocks['basic_block']; }); - test('Previous', function() { + test('Previous', function () { const prevSpy = sinon.spy(this.workspace.getCursor(), 'prev'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const wEvent = createKeyDownEvent(Blockly.utils.KeyCodes.W, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, wEvent); @@ -345,13 +421,17 @@ suite('Navigation', function() { chai.assert.isTrue(keyDownSpy.returned(true)); sinon.assert.calledOnce(prevSpy); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Next', function() { + test('Next', function () { const nextSpy = sinon.spy(this.workspace.getCursor(), 'next'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const sEvent = createKeyDownEvent(Blockly.utils.KeyCodes.S, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, sEvent); @@ -359,13 +439,17 @@ suite('Navigation', function() { chai.assert.isTrue(keyDownSpy.returned(true)); sinon.assert.calledOnce(nextSpy); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Out', function() { + test('Out', function () { const outSpy = sinon.spy(this.workspace.getCursor(), 'out'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const aEvent = createKeyDownEvent(Blockly.utils.KeyCodes.A, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, aEvent); @@ -373,13 +457,17 @@ suite('Navigation', function() { chai.assert.isTrue(keyDownSpy.returned(true)); sinon.assert.calledOnce(outSpy); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('In', function() { + test('In', function () { const inSpy = sinon.spy(this.workspace.getCursor(), 'in'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const dEvent = createKeyDownEvent(Blockly.utils.KeyCodes.D, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, dEvent); @@ -387,19 +475,23 @@ suite('Navigation', function() { chai.assert.isTrue(keyDownSpy.returned(true)); sinon.assert.calledOnce(inSpy); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Insert', function() { + test('Insert', function () { const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); this.navigation.getMarker(this.workspace).setCurNode(blockNode); // Stub modify as we are not testing its behavior, only if it was called. // Otherwise, there is a warning because there is no marked node. - const modifyStub = - sinon.stub(this.navigation, 'tryToConnectMarkerAndCursor') - .returns(true); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const modifyStub = sinon + .stub(this.navigation, 'tryToConnectMarkerAndCursor') + .returns(true); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const iEvent = createKeyDownEvent(Blockly.utils.KeyCodes.I, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, iEvent); @@ -407,31 +499,46 @@ suite('Navigation', function() { chai.assert.isTrue(keyDownSpy.returned(true)); sinon.assert.calledOnce(modifyStub); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Mark', function() { - this.workspace.getCursor().setCurNode( + test('Mark', function () { + this.workspace + .getCursor() + .setCurNode( Blockly.ASTNode.createConnectionNode( - this.basicBlock.previousConnection)); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + this.basicBlock.previousConnection, + ), + ); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const enterEvent = createKeyDownEvent(Blockly.utils.KeyCodes.ENTER, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, enterEvent); - const markedNode = - this.workspace.getMarker(this.navigation.MARKER_NAME).getCurNode(); + const markedNode = this.workspace + .getMarker(this.navigation.MARKER_NAME) + .getCurNode(); chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - markedNode.getLocation(), this.basicBlock.previousConnection); + markedNode.getLocation(), + this.basicBlock.previousConnection, + ); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Toolbox', function() { - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Toolbox', function () { + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); const tEvent = createKeyDownEvent(Blockly.utils.KeyCodes.T, ''); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, tEvent); @@ -439,25 +546,31 @@ suite('Navigation', function() { const firstCategory = this.workspace.getToolbox().contents_[0]; chai.assert.isTrue(keyDownSpy.returned(true)); chai.assert.equal( - this.workspace.getToolbox().getSelectedItem(), firstCategory); + this.workspace.getToolbox().getSelectedItem(), + firstCategory, + ); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.TOOLBOX); + this.navigation.getState(this.workspace), + Constants.STATE.TOOLBOX, + ); }); }); - suite('Test key press', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - }]); + suite('Test key press', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.workspace.getCursor().drawer_ = null; @@ -465,22 +578,25 @@ suite('Navigation', function() { this.basicBlock.initSvg(); this.basicBlock.render(); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); delete Blockly.Blocks['basic_block']; }); - test('Action does not exist', function() { + test('Action does not exist', function () { const block = this.workspace.getTopBlocks()[0]; const field = block.inputList[0].fieldRow[0]; const fieldSpy = sinon.spy(field, 'onShortcut'); const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.N, ''); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); - this.workspace.getCursor().setCurNode( - Blockly.ASTNode.createFieldNode(field)); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); + this.workspace + .getCursor() + .setCurNode(Blockly.ASTNode.createFieldNode(field)); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); @@ -488,15 +604,18 @@ suite('Navigation', function() { sinon.assert.notCalled(fieldSpy); }); - test('Action exists - field handles action', function() { + test('Action exists - field handles action', function () { const block = this.workspace.getTopBlocks()[0]; const field = block.inputList[0].fieldRow[0]; const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.A, ''); const fieldSpy = sinon.stub(field, 'onShortcut').returns(true); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); - this.workspace.getCursor().setCurNode( - Blockly.ASTNode.createFieldNode(field)); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); + this.workspace + .getCursor() + .setCurNode(Blockly.ASTNode.createFieldNode(field)); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); @@ -504,15 +623,18 @@ suite('Navigation', function() { sinon.assert.calledOnce(fieldSpy); }); - test('Action exists - field does not handle action', function() { + test('Action exists - field does not handle action', function () { const block = this.workspace.getTopBlocks()[0]; const field = block.inputList[0].fieldRow[0]; const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.A, ''); const fieldSpy = sinon.spy(field, 'onShortcut'); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); - this.workspace.getCursor().setCurNode( - Blockly.ASTNode.createFieldNode(field)); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); + this.workspace + .getCursor() + .setCurNode(Blockly.ASTNode.createFieldNode(field)); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); @@ -520,12 +642,15 @@ suite('Navigation', function() { sinon.assert.calledOnce(fieldSpy); }); - test('Toggle Action Off', function() { - const mockEvent = createKeyDownEvent( - Blockly.utils.KeyCodes.K, '', - [Blockly.utils.KeyCodes.SHIFT, Blockly.utils.KeyCodes.CTRL]); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Toggle Action Off', function () { + const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.K, '', [ + Blockly.utils.KeyCodes.SHIFT, + Blockly.utils.KeyCodes.CTRL, + ]); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); this.workspace.keyboardAccessibilityMode = true; Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); @@ -534,12 +659,15 @@ suite('Navigation', function() { chai.assert.isFalse(this.workspace.keyboardAccessibilityMode); }); - test('Toggle Action On', function() { - const mockEvent = createKeyDownEvent( - Blockly.utils.KeyCodes.K, '', - [Blockly.utils.KeyCodes.SHIFT, Blockly.utils.KeyCodes.CTRL]); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + test('Toggle Action On', function () { + const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.K, '', [ + Blockly.utils.KeyCodes.SHIFT, + Blockly.utils.KeyCodes.CTRL, + ]); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); this.workspace.keyboardAccessibilityMode = false; Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); @@ -548,28 +676,30 @@ suite('Navigation', function() { chai.assert.isTrue(this.workspace.keyboardAccessibilityMode); }); - suite('Test key press in read only mode', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'field_block', - 'message0': '%1 %2', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - { - 'type': 'input_value', - 'name': 'NAME', - }, - ], - 'previousStatement': null, - 'nextStatement': null, - 'colour': 230, - 'tooltip': '', - 'helpUrl': '', - }]); + suite('Test key press in read only mode', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'field_block', + 'message0': '%1 %2', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + { + 'type': 'input_value', + 'name': 'NAME', + }, + ], + 'previousStatement': null, + 'nextStatement': null, + 'colour': 230, + 'tooltip': '', + 'helpUrl': '', + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true, true); Blockly.common.setMainWorkspace(this.workspace); this.workspace.getCursor().drawer_ = null; @@ -579,44 +709,50 @@ suite('Navigation', function() { this.fieldBlock1.render(); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); delete Blockly.Blocks['field_block']; }); - test('Perform valid action for read only', function() { + test('Perform valid action for read only', function () { const astNode = Blockly.ASTNode.createBlockNode(this.fieldBlock1); const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.S, ''); this.workspace.getCursor().setCurNode(astNode); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(true)); }); - test('Perform invalid action for read only', function() { + test('Perform invalid action for read only', function () { const astNode = Blockly.ASTNode.createBlockNode(this.fieldBlock1); const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.I, ''); this.workspace.getCursor().setCurNode(astNode); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); chai.assert.isTrue(keyDownSpy.returned(false)); }); - test('Try to perform action on a field', function() { + test('Try to perform action on a field', function () { const field = this.fieldBlock1.inputList[0].fieldRow[0]; const astNode = Blockly.ASTNode.createFieldNode(field); const mockEvent = createKeyDownEvent(Blockly.utils.KeyCodes.ENTER, ''); this.workspace.getCursor().setCurNode(astNode); - const keyDownSpy = - sinon.spy(Blockly.ShortcutRegistry.registry, 'onKeyDown'); + const keyDownSpy = sinon.spy( + Blockly.ShortcutRegistry.registry, + 'onKeyDown', + ); Blockly.ShortcutRegistry.registry.onKeyDown(this.workspace, mockEvent); @@ -624,21 +760,23 @@ suite('Navigation', function() { }); }); }); - suite('Insert Functions', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - 'previousStatement': null, - 'nextStatement': null, - }]); + suite('Insert Functions', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + 'previousStatement': null, + 'nextStatement': null, + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); @@ -649,18 +787,19 @@ suite('Navigation', function() { this.basicBlock2 = basicBlock2; }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); delete Blockly.Blocks['basic_block']; }); - test('Insert from flyout with a valid connection marked', function() { + test('Insert from flyout with a valid connection marked', function () { const previousConnection = this.basicBlock.previousConnection; const prevNode = Blockly.ASTNode.createConnectionNode(previousConnection); - this.workspace.getMarker(this.navigation.MARKER_NAME) - .setCurNode(prevNode); + this.workspace + .getMarker(this.navigation.MARKER_NAME) + .setCurNode(prevNode); this.navigation.focusToolbox(this.workspace); this.navigation.focusFlyout(this.workspace); @@ -670,10 +809,12 @@ suite('Navigation', function() { chai.assert.isTrue(insertedBlock !== null); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Insert Block from flyout without marking a connection', function() { + test('Insert Block from flyout without marking a connection', function () { this.navigation.focusToolbox(this.workspace); this.navigation.focusFlyout(this.workspace); this.navigation.insertFromFlyout(this.workspace); @@ -687,24 +828,31 @@ suite('Navigation', function() { // Make sure that the block was added to the workspace chai.assert.equal(numBlocks, 3); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Connect two blocks that are on the workspace', function() { + test('Connect two blocks that are on the workspace', function () { const targetNode = Blockly.ASTNode.createConnectionNode( - this.basicBlock.previousConnection); - const sourceNode = - Blockly.ASTNode.createConnectionNode(this.basicBlock2.nextConnection); + this.basicBlock.previousConnection, + ); + const sourceNode = Blockly.ASTNode.createConnectionNode( + this.basicBlock2.nextConnection, + ); this.navigation.tryToConnectMarkerAndCursor( - this.workspace, targetNode, sourceNode); + this.workspace, + targetNode, + sourceNode, + ); const insertedBlock = this.basicBlock.previousConnection.targetBlock(); chai.assert.isNotNull(insertedBlock); }); }); - suite('Connect Blocks', function() { - setup(function() { + suite('Connect Blocks', function () { + setup(function () { Blockly.defineBlocksWithJsonArray([ { 'type': 'basic_block', @@ -743,7 +891,6 @@ suite('Navigation', function() { const inlineBlock2 = this.workspace.newBlock('inline_block'); const inlineBlock3 = this.workspace.newBlock('inline_block'); - this.basicBlock = basicBlock; this.basicBlock2 = basicBlock2; this.basicBlock3 = basicBlock3; @@ -754,16 +901,19 @@ suite('Navigation', function() { this.inlineBlock3 = inlineBlock3; this.basicBlock.nextConnection.connect( - this.basicBlock2.previousConnection); + this.basicBlock2.previousConnection, + ); this.basicBlock3.nextConnection.connect( - this.basicBlock4.previousConnection); + this.basicBlock4.previousConnection, + ); this.inlineBlock1.inputList[0].connection.connect( - this.inlineBlock2.outputConnection); + this.inlineBlock2.outputConnection, + ); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); @@ -771,52 +921,64 @@ suite('Navigation', function() { delete Blockly.Blocks['inline_block']; }); - test('Connect cursor on previous into stack', function() { + test('Connect cursor on previous into stack', function () { const markedLocation = this.basicBlock2.previousConnection; const cursorLocation = this.basicBlock3.previousConnection; this.navigation.connect(cursorLocation, markedLocation); chai.assert.equal( - this.basicBlock.nextConnection.targetBlock(), this.basicBlock3); + this.basicBlock.nextConnection.targetBlock(), + this.basicBlock3, + ); chai.assert.equal( - this.basicBlock2.previousConnection.targetBlock(), this.basicBlock4); + this.basicBlock2.previousConnection.targetBlock(), + this.basicBlock4, + ); }); - test('Connect marker on previous into stack', function() { + test('Connect marker on previous into stack', function () { const markedLocation = this.basicBlock3.previousConnection; const cursorLocation = this.basicBlock2.previousConnection; this.navigation.connect(cursorLocation, markedLocation); chai.assert.equal( - this.basicBlock.nextConnection.targetBlock(), this.basicBlock3); + this.basicBlock.nextConnection.targetBlock(), + this.basicBlock3, + ); chai.assert.equal( - this.basicBlock2.previousConnection.targetBlock(), this.basicBlock4); + this.basicBlock2.previousConnection.targetBlock(), + this.basicBlock4, + ); }); - test('Connect cursor on next into stack', function() { + test('Connect cursor on next into stack', function () { const markedLocation = this.basicBlock2.previousConnection; const cursorLocation = this.basicBlock4.nextConnection; this.navigation.connect(cursorLocation, markedLocation); chai.assert.equal( - this.basicBlock.nextConnection.targetBlock(), this.basicBlock4); + this.basicBlock.nextConnection.targetBlock(), + this.basicBlock4, + ); chai.assert.isNull(this.basicBlock3.nextConnection.targetConnection); }); - test('Connect cursor with parents', function() { + test('Connect cursor with parents', function () { const markedLocation = this.basicBlock3.previousConnection; const cursorLocation = this.basicBlock2.nextConnection; this.navigation.connect(cursorLocation, markedLocation); chai.assert.equal( - this.basicBlock3.previousConnection.targetBlock(), this.basicBlock2); + this.basicBlock3.previousConnection.targetBlock(), + this.basicBlock2, + ); }); - test('Try to connect input that is descendant of output', function() { + test('Try to connect input that is descendant of output', function () { const markedLocation = this.inlineBlock2.inputList[0].connection; const cursorLocation = this.inlineBlock1.outputConnection; @@ -824,48 +986,57 @@ suite('Navigation', function() { chai.assert.isNull(this.inlineBlock2.outputConnection.targetBlock()); chai.assert.equal( - this.inlineBlock1.outputConnection.targetBlock(), this.inlineBlock2); + this.inlineBlock1.outputConnection.targetBlock(), + this.inlineBlock2, + ); }); - test.skip('Do not connect a shadow block', function() { + test.skip('Do not connect a shadow block', function () { // TODO(https://github.com/google/blockly-samples/issues/538): Update // tests after this bug is fixed. this.inlineBlock2.setShadow(true); const markedLocation = this.inlineBlock2.outputConnection; const cursorLocation = this.inlineBlock3.inputList[0].connection; - const didConnect = - this.navigation.connect(cursorLocation, markedLocation); + const didConnect = this.navigation.connect( + cursorLocation, + markedLocation, + ); chai.assert.isFalse(didConnect); chai.assert.isNull(this.inlineBlock2.outputConnection.targetBlock()); chai.assert.equal( - this.inlineBlock1.outputConnection.targetBlock(), this.inlineBlock2); + this.inlineBlock1.outputConnection.targetBlock(), + this.inlineBlock2, + ); }); }); - suite('Test cursor move on block delete', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '', - 'previousStatement': null, - 'nextStatement': null, - }]); + suite('Test cursor move on block delete', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '', + 'previousStatement': null, + 'nextStatement': null, + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.basicBlockA = this.workspace.newBlock('basic_block'); this.basicBlockB = this.workspace.newBlock('basic_block'); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); delete Blockly.Blocks['basic_block']; }); - test('Delete block - has parent ', function() { + test('Delete block - has parent ', function () { this.basicBlockA.nextConnection.connect( - this.basicBlockB.previousConnection); + this.basicBlockB.previousConnection, + ); const astNode = Blockly.ASTNode.createBlockNode(this.basicBlockB); // Set the cursor to be on the child block this.workspace.getCursor().setCurNode(astNode); @@ -880,11 +1051,12 @@ suite('Navigation', function() { Blockly.Events.enable(); chai.assert.equal( - this.workspace.getCursor().getCurNode().getType(), - Blockly.ASTNode.types.NEXT); + this.workspace.getCursor().getCurNode().getType(), + Blockly.ASTNode.types.NEXT, + ); }); - test('Delete block - no parent ', function() { + test('Delete block - no parent ', function () { const astNode = Blockly.ASTNode.createBlockNode(this.basicBlockB); this.workspace.getCursor().setCurNode(astNode); @@ -898,81 +1070,86 @@ suite('Navigation', function() { Blockly.Events.enable(); chai.assert.equal( - this.workspace.getCursor().getCurNode().getType(), - Blockly.ASTNode.types.WORKSPACE); + this.workspace.getCursor().getCurNode().getType(), + Blockly.ASTNode.types.WORKSPACE, + ); }); - test('Delete parent block', function() { + test('Delete parent block', function () { this.basicBlockA.nextConnection.connect( - this.basicBlockB.previousConnection); + this.basicBlockB.previousConnection, + ); const astNode = Blockly.ASTNode.createBlockNode(this.basicBlockB); const mockDeleteBlockEvent = { 'blockId': this.basicBlockA, - 'ids': [ - this.basicBlockA.id, - this.basicBlockB.id, - ], + 'ids': [this.basicBlockA.id, this.basicBlockB.id], }; // Set the cursor to be on the child block this.workspace.getCursor().setCurNode(astNode); // Remove the parent block this.navigation.handleBlockDeleteByDrag( - this.workspace, mockDeleteBlockEvent); + this.workspace, + mockDeleteBlockEvent, + ); chai.assert.equal( - this.workspace.getCursor().getCurNode().getType(), - Blockly.ASTNode.types.WORKSPACE); + this.workspace.getCursor().getCurNode().getType(), + Blockly.ASTNode.types.WORKSPACE, + ); }); - test('Delete top block in stack', function() { + test('Delete top block in stack', function () { this.basicBlockA.nextConnection.connect( - this.basicBlockB.previousConnection); + this.basicBlockB.previousConnection, + ); const astNode = Blockly.ASTNode.createStackNode(this.basicBlockA); const mockDeleteBlockEvent = { 'blockId': this.basicBlockA.id, - 'ids': [ - this.basicBlockA.id, - this.basicBlockB.id, - ], + 'ids': [this.basicBlockA.id, this.basicBlockB.id], }; // Set the cursor to be on the stack this.workspace.getCursor().setCurNode(astNode); // Remove the top block in the stack this.navigation.handleBlockDeleteByDrag( - this.workspace, mockDeleteBlockEvent); + this.workspace, + mockDeleteBlockEvent, + ); chai.assert.equal( - this.workspace.getCursor().getCurNode().getType(), - Blockly.ASTNode.types.WORKSPACE); + this.workspace.getCursor().getCurNode().getType(), + Blockly.ASTNode.types.WORKSPACE, + ); }); }); - suite('Test workspace listener', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - 'previousStatement': null, - 'nextStatement': null, - }]); + suite('Test workspace listener', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + 'previousStatement': null, + 'nextStatement': null, + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.workspaceChangeListener = this.navigation.wsChangeWrapper; this.basicBlockA = this.workspace.newBlock('basic_block'); }); - teardown(function() { + teardown(function () { this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); delete Blockly.Blocks['basic_block']; sinon.restore(); }); - test('Handle block mutation', function() { + test('Handle block mutation', function () { const e = { type: Blockly.Events.BLOCK_CHANGE, element: 'mutation', @@ -980,28 +1157,35 @@ suite('Navigation', function() { workspaceId: this.workspace.id, }; const cursor = this.workspace.getCursor(); - const nextNode = - Blockly.ASTNode.createConnectionNode(this.basicBlockA.nextConnection); + const nextNode = Blockly.ASTNode.createConnectionNode( + this.basicBlockA.nextConnection, + ); cursor.setCurNode(nextNode); this.workspaceChangeListener(e); chai.assert.equal( - cursor.getCurNode().getType(), Blockly.ASTNode.types.BLOCK); + cursor.getCurNode().getType(), + Blockly.ASTNode.types.BLOCK, + ); }); - test('Handle workspace click', function() { + test('Handle workspace click', function () { const e = { type: Blockly.Events.CLICK, workspaceId: this.workspace.id, }; this.navigation.focusFlyout(this.workspace); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); this.workspaceChangeListener(e); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Focus toolbox if category clicked', function() { + test('Focus toolbox if category clicked', function () { const e = { type: Blockly.Events.TOOLBOX_ITEM_SELECT, workspaceId: this.workspace.id, @@ -1011,15 +1195,19 @@ suite('Navigation', function() { this.navigation.focusWorkspace(this.workspace); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); this.workspaceChangeListener(e); sinon.assert.calledOnce(toolboxFocusStub); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.TOOLBOX); + this.navigation.getState(this.workspace), + Constants.STATE.TOOLBOX, + ); }); - test('Focus workspace if toolbox is unselected', function() { + test('Focus workspace if toolbox is unselected', function () { const e = { type: Blockly.Events.TOOLBOX_ITEM_SELECT, workspaceId: this.workspace.id, @@ -1032,9 +1220,11 @@ suite('Navigation', function() { sinon.assert.calledOnce(resetFlyoutStub); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); - test('Focus workspace when block created on workspace', function() { + test('Focus workspace when block created on workspace', function () { const e = { type: Blockly.Events.BLOCK_CREATE, workspaceId: this.workspace.id, @@ -1047,23 +1237,27 @@ suite('Navigation', function() { sinon.assert.calledOnce(resetFlyoutStub); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.WORKSPACE); + this.navigation.getState(this.workspace), + Constants.STATE.WORKSPACE, + ); }); }); - suite('Test simple flyout listener', function() { - setup(function() { - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '%1', - 'args0': [ - { - 'type': 'field_colour', - 'name': 'COLOURFIELD', - 'colour': '#ff4040', - }, - ], - }]); + suite('Test simple flyout listener', function () { + setup(function () { + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '%1', + 'args0': [ + { + 'type': 'field_colour', + 'name': 'COLOURFIELD', + 'colour': '#ff4040', + }, + ], + }, + ]); this.workspace = createNavigationWorkspace(this.navigation, true); this.flyoutChangeListener = this.navigation.flyoutChangeWrapper; this.basicBlockA = this.workspace.newBlock('basic_block'); @@ -1072,13 +1266,13 @@ suite('Navigation', function() { this.workspace.getFlyout().autoClose = false; }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['basic_block']; this.navigation.removeWorkspace(this.workspace); this.workspace.dispose(); sinon.restore(); }); - test('Handle block click in flyout - click event', function() { + test('Handle block click in flyout - click event', function () { const flyout = this.workspace.getFlyout(); const flyoutWorkspace = flyout.getWorkspace(); const firstFlyoutBlock = flyoutWorkspace.getTopBlocks()[0]; @@ -1094,11 +1288,15 @@ suite('Navigation', function() { this.flyoutChangeListener(e); chai.assert.equal( - flyoutCursor.getCurNode().getType(), Blockly.ASTNode.types.STACK); + flyoutCursor.getCurNode().getType(), + Blockly.ASTNode.types.STACK, + ); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); }); - test('Handle block click in flyout - select event', function() { + test('Handle block click in flyout - select event', function () { const flyout = this.workspace.getFlyout(); const flyoutWorkspace = flyout.getWorkspace(); const firstFlyoutBlock = flyoutWorkspace.getTopBlocks()[0]; @@ -1113,17 +1311,21 @@ suite('Navigation', function() { this.flyoutChangeListener(e); chai.assert.equal( - flyoutCursor.getCurNode().getType(), Blockly.ASTNode.types.STACK); + flyoutCursor.getCurNode().getType(), + Blockly.ASTNode.types.STACK, + ); chai.assert.equal( - this.navigation.getState(this.workspace), Constants.STATE.FLYOUT); + this.navigation.getState(this.workspace), + Constants.STATE.FLYOUT, + ); }); }); - suite('Test clean up methods', function() { - setup(function() { + suite('Test clean up methods', function () { + setup(function () { this.workspace = createNavigationWorkspace(this.navigation, true); }); - test('All listeners and markers removed', function() { + test('All listeners and markers removed', function () { const numListeners = this.workspace.listeners.length; const markerName = this.navigation.MARKER_NAME; this.navigation.removeWorkspace(this.workspace); @@ -1132,19 +1334,21 @@ suite('Navigation', function() { const marker = this.workspace.getMarkerManager().getMarker(markerName); chai.assert.isNull(marker); }); - test('Keyboard accessibility mode can not be enabled', function() { + test('Keyboard accessibility mode can not be enabled', function () { this.navigation.removeWorkspace(this.workspace); this.navigation.enableKeyboardAccessibility(this.workspace); chai.assert.isFalse(this.workspace.keyboardAccessibilityMode); }); - test('Dispose', function() { + test('Dispose', function () { const numListeners = this.workspace.listeners.length; const flyout = this.workspace.getFlyout(); const numFlyoutListeners = flyout.getWorkspace().listeners.length; this.navigation.dispose(); chai.assert.equal(this.workspace.listeners.length, numListeners - 1); chai.assert.equal( - flyout.getWorkspace().listeners.length, numFlyoutListeners - 1); + flyout.getWorkspace().listeners.length, + numFlyoutListeners - 1, + ); }); }); }); diff --git a/plugins/keyboard-navigation/test/shortcuts_test.mocha.js b/plugins/keyboard-navigation/test/shortcuts_test.mocha.js index 298fb0fb80..f8efc9749c 100644 --- a/plugins/keyboard-navigation/test/shortcuts_test.mocha.js +++ b/plugins/keyboard-navigation/test/shortcuts_test.mocha.js @@ -10,27 +10,32 @@ const chai = require('chai'); const Blockly = require('blockly/node'); const {NavigationController} = require('../src/index'); -const {createNavigationWorkspace, createKeyDownEvent} = - require('./test_helper'); +const { + createNavigationWorkspace, + createKeyDownEvent, +} = require('./test_helper'); -suite('Shortcut Tests', function() { - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
'); +suite('Shortcut Tests', function () { + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + ); // We are running these tests in node even thought they require a rendered // workspace, which doesn't exactly work. The rendering system expects // cancelAnimationFrame to be defined so we need to define it. - window.cancelAnimationFrame = function() {}; + window.cancelAnimationFrame = function () {}; - Blockly.utils.dom.getFastTextWidthWithSizeString = function() { + Blockly.utils.dom.getFastTextWidthWithSizeString = function () { return 10; }; - Blockly.defineBlocksWithJsonArray([{ - 'type': 'basic_block', - 'message0': '', - 'previousStatement': null, - 'nextStatement': null, - }]); + Blockly.defineBlocksWithJsonArray([ + { + 'type': 'basic_block', + 'message0': '', + 'previousStatement': null, + 'nextStatement': null, + }, + ]); this.controller = new NavigationController(); this.controller.init(); this.navigation = this.controller.navigation; @@ -39,7 +44,7 @@ suite('Shortcut Tests', function() { this.basicBlock = this.workspace.newBlock('basic_block'); }); - teardown(function() { + teardown(function () { window.cancelAnimationFrame = undefined; this.jsdomCleanup(); this.controller.dispose(); @@ -47,390 +52,480 @@ suite('Shortcut Tests', function() { this.workspace.dispose(); }); - suite('Deleting blocks', function() { - setup(function() { + suite('Deleting blocks', function () { + setup(function () { const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); this.workspace.getCursor().setCurNode(blockNode); }); - teardown(function() { + teardown(function () { sinon.restore(); }); const testCases = [ { name: 'Delete', - deleteEvent: - createKeyDownEvent(Blockly.utils.KeyCodes.DELETE, 'NotAField'), + deleteEvent: createKeyDownEvent( + Blockly.utils.KeyCodes.DELETE, + 'NotAField', + ), }, { name: 'Backspace', - deleteEvent: - createKeyDownEvent(Blockly.utils.KeyCodes.BACKSPACE, 'NotAField'), + deleteEvent: createKeyDownEvent( + Blockly.utils.KeyCodes.BACKSPACE, + 'NotAField', + ), }, ]; - suite('delete keybinds trigger deletion', function() { - testCases.forEach(function(testCase) { - test(testCase.name, function() { + suite('delete keybinds trigger deletion', function () { + testCases.forEach(function (testCase) { + test(testCase.name, function () { Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.deleteEvent); + this.workspace, + testCase.deleteEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 0, - 'Expected the block to be deleted.'); + this.workspace.getTopBlocks().length, + 0, + 'Expected the block to be deleted.', + ); }); }); }); suite( - 'delete keybinds do not trigger deletion if workspace is readonly', - function() { - testCases.forEach(function(testCase) { - test(testCase.name, function() { - this.workspace.options.readOnly = true; - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.deleteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be deleted.'); - }); + 'delete keybinds do not trigger deletion if workspace is readonly', + function () { + testCases.forEach(function (testCase) { + test(testCase.name, function () { + this.workspace.options.readOnly = true; + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.deleteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be deleted.', + ); }); }); + }, + ); }); - suite('Copy and paste', function() { - teardown(function() { + suite('Copy and paste', function () { + teardown(function () { sinon.restore(); }); const testCases = [ { name: 'Control', - copyEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.C, 'NotAField', - [Blockly.utils.KeyCodes.CTRL]), - pasteEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.V, 'NotAField', - [Blockly.utils.KeyCodes.CTRL]), + copyEvent: createKeyDownEvent(Blockly.utils.KeyCodes.C, 'NotAField', [ + Blockly.utils.KeyCodes.CTRL, + ]), + pasteEvent: createKeyDownEvent(Blockly.utils.KeyCodes.V, 'NotAField', [ + Blockly.utils.KeyCodes.CTRL, + ]), }, { name: 'Meta', - copyEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.C, 'NotAField', - [Blockly.utils.KeyCodes.META]), - pasteEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.V, 'NotAField', - [Blockly.utils.KeyCodes.META]), + copyEvent: createKeyDownEvent(Blockly.utils.KeyCodes.C, 'NotAField', [ + Blockly.utils.KeyCodes.META, + ]), + pasteEvent: createKeyDownEvent(Blockly.utils.KeyCodes.V, 'NotAField', [ + Blockly.utils.KeyCodes.META, + ]), }, { name: 'Alt', - copyEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.C, 'NotAField', - [Blockly.utils.KeyCodes.ALT]), - pasteEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.V, 'NotAField', - [Blockly.utils.KeyCodes.ALT]), + copyEvent: createKeyDownEvent(Blockly.utils.KeyCodes.C, 'NotAField', [ + Blockly.utils.KeyCodes.ALT, + ]), + pasteEvent: createKeyDownEvent(Blockly.utils.KeyCodes.V, 'NotAField', [ + Blockly.utils.KeyCodes.ALT, + ]), }, ]; - suite('copy and paste keybinds duplicate blocks', function() { - setup(function() { + suite('copy and paste keybinds duplicate blocks', function () { + setup(function () { const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); this.workspace.getCursor().setCurNode(blockNode); }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { + testCases.forEach(function (testCase) { + test(testCase.name, function () { Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.copyEvent); + this.workspace, + testCase.copyEvent, + ); Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); + this.workspace, + testCase.pasteEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 2, - 'Expected the block to be duplicated.'); + this.workspace.getTopBlocks().length, + 2, + 'Expected the block to be duplicated.', + ); }); }); }); suite( - 'copy and paste does nothing if the cursor is not on a block', - function() { - setup(function() { - const workspaceNode = Blockly.ASTNode.createWorkspaceNode( - this.workspace, new Blockly.utils.Coordinate(100, 100)); - this.workspace.getCursor().setCurNode(workspaceNode); - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.copyEvent); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); - }); + 'copy and paste does nothing if the cursor is not on a block', + function () { + setup(function () { + const workspaceNode = Blockly.ASTNode.createWorkspaceNode( + this.workspace, + new Blockly.utils.Coordinate(100, 100), + ); + this.workspace.getCursor().setCurNode(workspaceNode); + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.copyEvent, + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); + }, + ); suite( - 'copy and paste do nothing if the cursor is on a shadow block', - function() { - setup(function() { - this.basicBlock.setShadow(true); - const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); - this.workspace.getCursor().setCurNode(blockNode); - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.copyEvent); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); - }); + 'copy and paste do nothing if the cursor is on a shadow block', + function () { + setup(function () { + this.basicBlock.setShadow(true); + const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); + this.workspace.getCursor().setCurNode(blockNode); + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.copyEvent, + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); + }, + ); - suite('copy and paste do nothing if the workspace is readonly', function() { - setup(function() { - this.workspace.options.readonly = true; - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.copyEvent); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( + suite( + 'copy and paste do nothing if the workspace is readonly', + function () { + setup(function () { + this.workspace.options.readonly = true; + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.copyEvent, + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( this.workspace.getTopBlocks().length, 1, - 'Expected the block to not be duplicated.'); + 'Expected the block to not be duplicated.', + ); + }); }); - }); - }); + }, + ); - suite('copy and paste do nothing if a gesture is in progress', function() { - setup(function() { + suite('copy and paste do nothing if a gesture is in progress', function () { + setup(function () { sinon.stub(Blockly.Gesture, 'inProgress').returns(true); }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { + testCases.forEach(function (testCase) { + test(testCase.name, function () { Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.copyEvent); + this.workspace, + testCase.copyEvent, + ); Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); + this.workspace, + testCase.pasteEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); }); suite( - 'copy and paste do nothing if the block is not deletable', - function() { - setup(function() { - this.basicBlock.setDeletable(false); - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.copyEvent); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); - }); + 'copy and paste do nothing if the block is not deletable', + function () { + setup(function () { + this.basicBlock.setDeletable(false); + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.copyEvent, + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); + }, + ); }); - suite('Cut and paste', function() { - teardown(function() { + suite('Cut and paste', function () { + teardown(function () { sinon.restore(); }); const testCases = [ { name: 'Control', - cutEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.X, 'NotAField', - [Blockly.utils.KeyCodes.CTRL]), - pasteEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.V, 'NotAField', - [Blockly.utils.KeyCodes.CTRL]), + cutEvent: createKeyDownEvent(Blockly.utils.KeyCodes.X, 'NotAField', [ + Blockly.utils.KeyCodes.CTRL, + ]), + pasteEvent: createKeyDownEvent(Blockly.utils.KeyCodes.V, 'NotAField', [ + Blockly.utils.KeyCodes.CTRL, + ]), }, { name: 'Meta', - cutEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.X, 'NotAField', - [Blockly.utils.KeyCodes.META]), - pasteEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.V, 'NotAField', - [Blockly.utils.KeyCodes.META]), + cutEvent: createKeyDownEvent(Blockly.utils.KeyCodes.X, 'NotAField', [ + Blockly.utils.KeyCodes.META, + ]), + pasteEvent: createKeyDownEvent(Blockly.utils.KeyCodes.V, 'NotAField', [ + Blockly.utils.KeyCodes.META, + ]), }, { name: 'Alt', - cutEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.X, 'NotAField', - [Blockly.utils.KeyCodes.ALT]), - pasteEvent: createKeyDownEvent( - Blockly.utils.KeyCodes.V, 'NotAField', - [Blockly.utils.KeyCodes.ALT]), + cutEvent: createKeyDownEvent(Blockly.utils.KeyCodes.X, 'NotAField', [ + Blockly.utils.KeyCodes.ALT, + ]), + pasteEvent: createKeyDownEvent(Blockly.utils.KeyCodes.V, 'NotAField', [ + Blockly.utils.KeyCodes.ALT, + ]), }, ]; - suite('cut and paste keybinds duplicate blocks', function() { - setup(function() { + suite('cut and paste keybinds duplicate blocks', function () { + setup(function () { const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); this.workspace.getCursor().setCurNode(blockNode); }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { + testCases.forEach(function (testCase) { + test(testCase.name, function () { Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.cutEvent); + this.workspace, + testCase.cutEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 0, - 'Expected the block to be deleted.'); + this.workspace.getTopBlocks().length, + 0, + 'Expected the block to be deleted.', + ); Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); + this.workspace, + testCase.pasteEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to be duplicated.'); + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to be duplicated.', + ); }); }); }); suite( - 'cut and paste does nothing if the cursor is not on a block', - function() { - setup(function() { - const workspaceNode = Blockly.ASTNode.createWorkspaceNode( - this.workspace, new Blockly.utils.Coordinate(100, 100)); - this.workspace.getCursor().setCurNode(workspaceNode); - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.cutEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be deleted.'); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); - }); + 'cut and paste does nothing if the cursor is not on a block', + function () { + setup(function () { + const workspaceNode = Blockly.ASTNode.createWorkspaceNode( + this.workspace, + new Blockly.utils.Coordinate(100, 100), + ); + this.workspace.getCursor().setCurNode(workspaceNode); + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.cutEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be deleted.', + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); + }, + ); suite( - 'cut and paste do nothing if the cursor is on a shadow block', - function() { - setup(function() { - this.basicBlock.setShadow(true); - const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); - this.workspace.getCursor().setCurNode(blockNode); - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.cutEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be deleted.'); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); - }); + 'cut and paste do nothing if the cursor is on a shadow block', + function () { + setup(function () { + this.basicBlock.setShadow(true); + const blockNode = Blockly.ASTNode.createBlockNode(this.basicBlock); + this.workspace.getCursor().setCurNode(blockNode); + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.cutEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be deleted.', + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); + }, + ); - suite('cut and paste do nothing if the workspace is readonly', function() { - setup(function() { + suite('cut and paste do nothing if the workspace is readonly', function () { + setup(function () { this.workspace.options.readonly = true; }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { + testCases.forEach(function (testCase) { + test(testCase.name, function () { Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.cutEvent); + this.workspace, + testCase.cutEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be deleted.'); + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be deleted.', + ); Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); + this.workspace, + testCase.pasteEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); }); - suite('cut and paste do nothing if a gesture is in progress', function() { - setup(function() { + suite('cut and paste do nothing if a gesture is in progress', function () { + setup(function () { sinon.stub(Blockly.Gesture, 'inProgress').returns(true); }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { + testCases.forEach(function (testCase) { + test(testCase.name, function () { Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.cutEvent); + this.workspace, + testCase.cutEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be deleted.'); + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be deleted.', + ); Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); + this.workspace, + testCase.pasteEvent, + ); chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); }); suite( - 'cut and paste do nothing if the block is not deletable', - function() { - setup(function() { - this.basicBlock.setDeletable(false); - }); - testCases.forEach(function(testCase) { - test(testCase.name, function() { - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.cutEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be deleted.'); - Blockly.ShortcutRegistry.registry.onKeyDown( - this.workspace, testCase.pasteEvent); - chai.assert.equal( - this.workspace.getTopBlocks().length, - 1, - 'Expected the block to not be duplicated.'); - }); + 'cut and paste do nothing if the block is not deletable', + function () { + setup(function () { + this.basicBlock.setDeletable(false); + }); + testCases.forEach(function (testCase) { + test(testCase.name, function () { + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.cutEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be deleted.', + ); + Blockly.ShortcutRegistry.registry.onKeyDown( + this.workspace, + testCase.pasteEvent, + ); + chai.assert.equal( + this.workspace.getTopBlocks().length, + 1, + 'Expected the block to not be duplicated.', + ); }); }); + }, + ); }); }); diff --git a/plugins/keyboard-navigation/test/test_helper.js b/plugins/keyboard-navigation/test/test_helper.js index 8dce5ddd2e..21e321c845 100644 --- a/plugins/keyboard-navigation/test/test_helper.js +++ b/plugins/keyboard-navigation/test/test_helper.js @@ -17,7 +17,10 @@ const Blockly = require('blockly/node'); * @returns {Blockly.WorkspaceSvg} The created workspace. */ export function createNavigationWorkspace( - navigation, enableKeyboardNav, readOnly) { + navigation, + enableKeyboardNav, + readOnly, +) { const workspace = Blockly.inject('blocklyDiv', { toolbox: ` ')} ` + - `${chalk.green('--from ')}` + - '[--to ] [options] ' + - `${chalk.green('')}`); + .version( + scriptPackageJson.version, + '-v, --version', + 'output the version of this script', + ) + .usage( + `${chalk.blue('')} ` + + `${chalk.green('--from ')}` + + '[--to ] [options] ' + + `${chalk.green('')}`, + ); const HELP_COMMAND = new Command('help') - .argument('[version]', 'the version of Blockly to provide info about') - .description('display this help, or help for the specific version') - .action(function() { - if (this.args.length) { - showVersionHelp(this.args[0]); - } else { - ROOT_COMMAND.help(); - } - }); + .argument('[version]', 'the version of Blockly to provide info about') + .description('display this help, or help for the specific version') + .action(function () { + if (this.args.length) { + showVersionHelp(this.args[0]); + } else { + ROOT_COMMAND.help(); + } + }); ROOT_COMMAND.addCommand(HELP_COMMAND); @@ -92,11 +94,10 @@ export function createSubCommand(name, targetVersionRange, description) { migrations.push(migration); return new Command(name) - .description(description) - .requiredOption( - '--from ', 'Blockly version to migrate from') - .option('--to ', 'Blockly version to migrate to') - .argument('', 'Files to migrate'); + .description(description) + .requiredOption('--from ', 'Blockly version to migrate from') + .option('--to ', 'Blockly version to migrate to') + .argument('', 'Files to migrate'); } /** diff --git a/plugins/migration/bin/fix-imports.js b/plugins/migration/bin/fix-imports.js index baea7cec4f..1a07c17ffa 100644 --- a/plugins/migration/bin/fix-imports.js +++ b/plugins/migration/bin/fix-imports.js @@ -16,12 +16,14 @@ import {readFileSync, statSync, writeFileSync} from 'fs'; export const fixImports = createSubCommand( 'fix-imports', '>=9', - 'Add imports for modules that have been moved out of the Blockly namespace') + 'Add imports for modules that have been moved out of the Blockly namespace', +) .option( - '-i, --in-place [suffix]', - 'fix imports in-place, optionally create backup files with the ' + - 'given suffix. Otherwise output to stdout') - .action(function() { + '-i, --in-place [suffix]', + 'fix imports in-place, optionally create backup files with the ' + + 'given suffix. Otherwise output to stdout', + ) + .action(function () { // TODO (#1211): In the future we should use the fromVersion and toVersion // so that we can support doing this across multiple versions. But for // now we just need it to work for v9. @@ -63,46 +65,45 @@ const database = [ import: 'blockly/dart', newIdentifier: 'dartGenerator', newImport: `import {dartGenerator} from 'blockly/dart';`, - newRequire: `const {dartGenerator} = require('blockly/dart');` + newRequire: `const {dartGenerator} = require('blockly/dart');`, }, { import: 'blockly/javascript', oldIdentifier: 'Blockly.JavaScript', newIdentifier: 'javascriptGenerator', newImport: `import {javascriptGenerator} from 'blockly/javascript';`, - newRequire: `const {javascriptGenerator} = require('blockly/javascript');` + newRequire: `const {javascriptGenerator} = require('blockly/javascript');`, }, { import: 'blockly/lua', newIdentifier: 'luaGenerator', newImport: `import {luaGenerator} from 'blockly/lua';`, - newRequire: `const {luaGenerator} = require('blockly/lua');` + newRequire: `const {luaGenerator} = require('blockly/lua');`, }, { import: 'blockly/php', newIdentifier: 'phpGenerator', newImport: `import {phpGenerator} from 'blockly/php';`, - newRequire: `const {phpGenerator} = require('blockly/php');` + newRequire: `const {phpGenerator} = require('blockly/php');`, }, { import: 'blockly/python', newIdentifier: 'pythonGenerator', newImport: `import {pythonGenerator} from 'blockly/python';`, - newRequire: `const {pythonGenerator} = require('blockly/python');` + newRequire: `const {pythonGenerator} = require('blockly/python');`, }, { import: 'blockly/blocks', oldIdentifier: 'Blockly.libraryBlocks', newIdentifier: 'libraryBlocks', - newImport: `import * as libraryBlocks from 'blockly/blocks';`, - newRequire: `const libraryBlocks = require('blockly/blocks');` - } -] + newImport: `import * as libraryBlocks from 'blockly/blocks';`, + newRequire: `const libraryBlocks = require('blockly/blocks');`, + }, +]; /** * Migrates the contents of a particular file, renaming references and * adding/updating imports. - * * @param {string} contents The string contents of the file to migrate. * @returns {string} The migrated contents of the file. */ @@ -118,7 +119,6 @@ function migrateContents(contents) { * Migrates a particular import in a particular file. Renames references to * where the import used to exist on the namespace tree, and adds/updates * imports. - * * @param {string} contents The string contents of the file to migrate. * @param {MigrationData} migrationData Data defining what to migrate and how. * @returns {string} The migrated contents of the file. @@ -133,7 +133,6 @@ function fixImport(contents, migrationData) { /** * Returns the identifier a given import is assigned to. - * * @param {string} contents The string contents of the file to migrate. * @param {MigrationData} migrationData Data defining what to migrate and how. * @returns The identifier associated with the import associated with the @@ -141,10 +140,12 @@ function fixImport(contents, migrationData) { */ function getIdentifier(contents, migrationData) { const importMatch = contents.match( - new RegExp(`\\s(\\S*)\\s+from\\s+['"]${migrationData.import}['"]`)); + new RegExp(`\\s(\\S*)\\s+from\\s+['"]${migrationData.import}['"]`), + ); if (importMatch) return importMatch[1]; const requireMatch = contents.match( - new RegExp(`(\\S*)\\s+=\\s+require\\(['"]${migrationData.import}['"]\\)`)); + new RegExp(`(\\S*)\\s+=\\s+require\\(['"]${migrationData.import}['"]\\)`), + ); if (requireMatch) return requireMatch[1]; return migrationData.oldIdentifier; } @@ -152,16 +153,15 @@ function getIdentifier(contents, migrationData) { /** * Replaces references to where an import used to exist on the namespace tree * with references to the actual import (if any references are found). - * * @param {string} contents The string contents of the file to migrate. * @param {MigrationData} migrationData Data defining what to migrate and how. + * @param identifier * @returns {string} The migrated contents of the file. */ function replaceReferences(contents, migrationData, identifier) { return contents.replace(dottedIdentifier, (match) => { if (match.startsWith(identifier)) { - return migrationData.newIdentifier + - match.slice(identifier.length); + return migrationData.newIdentifier + match.slice(identifier.length); } return match; }); @@ -170,7 +170,6 @@ function replaceReferences(contents, migrationData, identifier) { /** * Replaces the any existing import with the new import, or if no import is * found, inserts a new one after the 'blockly' import. - * * @param {string} contents The string contents of the file to migrate. * @param {MigrationData} migrationData Data defining what to migrate and how. * @returns {string} The migrated contents of the file. @@ -180,30 +179,40 @@ function addImport(contents, migrationData) { const importMatch = contents.match(importRegExp); if (importMatch) { return contents.replace( - importRegExp, importMatch[1] + migrationData.newImport); + importRegExp, + importMatch[1] + migrationData.newImport, + ); } const requireRegExp = createRequireRegExp(migrationData.import); const requireMatch = contents.match(requireRegExp); if (requireMatch) { return contents.replace( - requireRegExp, requireMatch[1] + migrationData.newRequire); + requireRegExp, + requireMatch[1] + migrationData.newRequire, + ); } const blocklyImportMatch = contents.match(createImportRegExp('blockly')); if (blocklyImportMatch) { const match = blocklyImportMatch; - return contents.slice(0, match.index + match[0].length) + - '\n' + migrationData.newImport + - contents.slice(match.index + match[0].length); + return ( + contents.slice(0, match.index + match[0].length) + + '\n' + + migrationData.newImport + + contents.slice(match.index + match[0].length) + ); } const blocklyRequireMatch = contents.match(createRequireRegExp('blockly')); if (blocklyRequireMatch) { const match = blocklyRequireMatch; - return contents.slice(0, match.index + match[0].length) + - '\n' + migrationData.newRequire + - contents.slice(match.index + match[0].length); + return ( + contents.slice(0, match.index + match[0].length) + + '\n' + + migrationData.newRequire + + contents.slice(match.index + match[0].length) + ); } // Should never happen, but return something so we can keep going if it does. @@ -213,24 +222,23 @@ function addImport(contents, migrationData) { /** * Returns a regular expression that matches an import statement for the given * import identifier. - * * @param {string} importIdent The identifier of the import to match. * @returns {RegExp} The regular expression. */ function createImportRegExp(importIdent) { - return new RegExp(`(\\s*)import\\s+.+\\s+from\\s+['"]${importIdent}['"];`) + return new RegExp(`(\\s*)import\\s+.+\\s+from\\s+['"]${importIdent}['"];`); } /** * Returns a regular expression that matches a require statement for the given * identifier. - * * @param {string} importIdent The identifer of the import to match. * @returns {RegExp} The regular expression. */ function createRequireRegExp(importIdent) { return new RegExp( - `(\\s*)(const|let|var)\\s+.*\\s+=\\s+require\\(['"]${importIdent}['"]\\);`); + `(\\s*)(const|let|var)\\s+.*\\s+=\\s+require\\(['"]${importIdent}['"]\\);`, + ); } /** @@ -241,4 +249,4 @@ function createRequireRegExp(importIdent) { * that appears in each comment! */ const dottedIdentifier = - /[A-Za-z$_][A-Za-z0-9$_]*(\.[A-Za-z$_][A-Za-z0-9$_]*)+/g; + /[A-Za-z$_][A-Za-z0-9$_]*(\.[A-Za-z$_][A-Za-z0-9$_]*)+/g; diff --git a/plugins/migration/bin/migrate.js b/plugins/migration/bin/migrate.js index 465ee01645..2da6d97cb1 100644 --- a/plugins/migration/bin/migrate.js +++ b/plugins/migration/bin/migrate.js @@ -12,7 +12,6 @@ import {addSubCommand, parseAndRunMigrations} from './command.js'; import {rename} from './rename.js'; import {fixImports} from './fix-imports.js'; - addSubCommand(rename); addSubCommand(fixImports); diff --git a/plugins/migration/bin/rename.js b/plugins/migration/bin/rename.js index 87b6759b5b..cb6d3a5d1b 100644 --- a/plugins/migration/bin/rename.js +++ b/plugins/migration/bin/rename.js @@ -16,40 +16,43 @@ import {readFileSync, statSync, writeFileSync} from 'fs'; import * as versionUtils from './versions.js'; import JSON5 from 'json5'; - const DATABASE_URL = `https://raw.githubusercontent.com/google/blockly/master/scripts/migration/renamings.json5`; export const rename = createSubCommand( - 'rename', '>=5', 'Perform renamings for breaking changes') - .option( - '-i, --in-place [suffix]', - 'do renamings in-place, optionally create backup files with the ' + - 'given suffix. Otherwise output to stdout') - .option( - '--database ', - 'explicitly specify the URL for fetching the renamings database') - .action(async function() { - const {fromVersion, toVersion, fileNames} = extractRequiredInfo(this); - const url = this.opts().database; - - const renamer = new Renamer( - await getDatabase(url), fromVersion, toVersion); - fileNames.forEach((name) => { - if (statSync(name).isDirectory()) return; - const contents = readFileSync(name, 'utf8'); - const newContents = renamer.rename(contents); - const inPlace = this.opts().inPlace; - if (inPlace) { - if (typeof inPlace == 'string') { - writeFileSync(name + inPlace, contents); - } - writeFileSync(name, newContents); - process.stderr.write(`Migrated renamings in ${name}\n`); - } else { - process.stdout.write(newContents + '\n'); + 'rename', + '>=5', + 'Perform renamings for breaking changes', +) + .option( + '-i, --in-place [suffix]', + 'do renamings in-place, optionally create backup files with the ' + + 'given suffix. Otherwise output to stdout', + ) + .option( + '--database ', + 'explicitly specify the URL for fetching the renamings database', + ) + .action(async function () { + const {fromVersion, toVersion, fileNames} = extractRequiredInfo(this); + const url = this.opts().database; + + const renamer = new Renamer(await getDatabase(url), fromVersion, toVersion); + fileNames.forEach((name) => { + if (statSync(name).isDirectory()) return; + const contents = readFileSync(name, 'utf8'); + const newContents = renamer.rename(contents); + const inPlace = this.opts().inPlace; + if (inPlace) { + if (typeof inPlace == 'string') { + writeFileSync(name + inPlace, contents); } - }); + writeFileSync(name, newContents); + process.stderr.write(`Migrated renamings in ${name}\n`); + } else { + process.stdout.write(newContents + '\n'); + } }); + }); /** * Gets the database of renames. @@ -64,8 +67,10 @@ export async function getDatabase(url = undefined) { return JSON5.parse(body); } catch (e) { if (e instanceof SyntaxError) { - process.stderr.write('Unable to parse the renamings database. Please ' + - 'report the issue at github.com/google/blockly/issues/new/choose\n'); + process.stderr.write( + 'Unable to parse the renamings database. Please ' + + 'report the issue at github.com/google/blockly/issues/new/choose\n', + ); process.exit(); } throw e; @@ -86,8 +91,11 @@ export class Renamer { */ constructor(database, currVersion, newVersion) { /** @private @const {!Array} */ - this.versionRenamers_ = - Renamer.calculateRenamings(database, currVersion, newVersion); + this.versionRenamers_ = Renamer.calculateRenamings( + database, + currVersion, + newVersion, + ); } /** @@ -152,21 +160,24 @@ class VersionRenamer { const oldModulePath = module.oldPath || module.oldName; const newExport = module.newExport ? `.${module.newExport}` : ''; const newModulePath = - module.newPath || `${module.newName || oldModulePath}${newExport}`; + module.newPath || `${module.newName || oldModulePath}${newExport}`; if (module.exports) { for (const [oldExportName, info] of Object.entries(module.exports)) { const oldExportPath = - info.oldPath || `${oldModulePath}.${oldExportName}`; + info.oldPath || `${oldModulePath}.${oldExportName}`; const newBase = `${info.newModule || newModulePath}.`; const renaming = {old: oldExportPath}; - if (info.newPath) { // If newPath provided just use that. + if (info.newPath) { + // If newPath provided just use that. renaming.new = info.newPath; } else if (info.getMethod || info.setMethod) { - renaming.get = info.getMethod ? - `${newBase}${info.getMethod}` : null; - renaming.set = info.setMethod ? - `${newBase}${info.setMethod}` : null; + renaming.get = info.getMethod + ? `${newBase}${info.getMethod}` + : null; + renaming.set = info.setMethod + ? `${newBase}${info.setMethod}` + : null; } else { renaming.new = `${newBase}${info.newExport || oldExportName}`; } @@ -195,30 +206,38 @@ class VersionRenamer { for (const entry of this.renamings_) { if (str.startsWith(entry.old)) { const suffix = str.slice(entry.old.length); - if (suffix && suffix[0] !== '.') { // Did not match a whole identifier. + if (suffix && suffix[0] !== '.') { + // Did not match a whole identifier. continue; } - if (!entry.get && !entry.set) { // Normal case (no getter/setter). + if (!entry.get && !entry.set) { + // Normal case (no getter/setter). return entry.new + suffix; } process.stderr.write(`NOTE: ${entry.old} has been removed.\n`); if (entry.get) { - process.stderr.write(` - Call ${entry.get}() instead of ` + - 'reading it.\n'); + process.stderr.write( + ` - Call ${entry.get}() instead of ` + 'reading it.\n', + ); } if (entry.set) { - process.stderr.write(` - Call ${entry.set}(/* new value */) ` + - 'instead of setting it.\n'); + process.stderr.write( + ` - Call ${entry.set}(/* new value */) ` + + 'instead of setting it.\n', + ); } process.stderr.write('You will need to manually verify this update.\n'); - - if (entry.get && suffix) { // foo.bar.baz => foo.getBar().baz + + if (entry.get && suffix) { + // foo.bar.baz => foo.getBar().baz return `${entry.get}()${suffix}`; } - const get = entry.set ? `call ${entry.get}() to get get value` : - `can no longer be read`; - const set = entry.set ? `call ${entry.set}(new_value) to set value` : - `can no longer be set`; + const get = entry.set + ? `call ${entry.get}() to get get value` + : `can no longer be read`; + const set = entry.set + ? `call ${entry.set}(new_value) to set value` + : `can no longer be set`; return `/* FIXME: ${entry.old} has been replaced: ${get}; ${set}. */`; } } @@ -234,4 +253,4 @@ class VersionRenamer { * that appears in each comment! */ const dottedIdentifier = - /[A-Za-z$_][A-Za-z0-9$_]*(\.[A-Za-z$_][A-Za-z0-9$_]*)+/g; + /[A-Za-z$_][A-Za-z0-9$_]*(\.[A-Za-z$_][A-Za-z0-9$_]*)+/g; diff --git a/plugins/migration/bin/versions.js b/plugins/migration/bin/versions.js index fbfed2ee88..7ec8cfded8 100644 --- a/plugins/migration/bin/versions.js +++ b/plugins/migration/bin/versions.js @@ -11,7 +11,6 @@ import semver from 'semver'; - /** * The version associated with the unreleased version of Blockly. * @const {string} @@ -31,8 +30,9 @@ const LATEST = 'latest'; * @returns {string} The coerced version. */ export function coerce(version) { - return version === DEV_VERSION || version === LATEST? - version : semver.coerce(version).toString(); + return version === DEV_VERSION || version === LATEST + ? version + : semver.coerce(version).toString(); } /** diff --git a/plugins/migration/package.json b/plugins/migration/package.json index 359c78c370..2de83b4f0c 100644 --- a/plugins/migration/package.json +++ b/plugins/migration/package.json @@ -35,9 +35,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" }, diff --git a/plugins/migration/test/rename.mocha.js b/plugins/migration/test/rename.mocha.js index b1037c9e6c..602bd5b91c 100644 --- a/plugins/migration/test/rename.mocha.js +++ b/plugins/migration/test/rename.mocha.js @@ -12,45 +12,43 @@ import {assert} from 'chai'; import {getDatabase, Renamer} from '../bin/rename.js'; import {stub} from 'sinon'; - -suite('Rename', function() { +suite('Rename', function () { // Integration-ish test meant to test multiple things. - test('a javascript program with multiple renames works correctly', - function() { - const database = { - '1.0.0': [ - { - oldName: 'Blockly.moduleA', - newName: 'Blockly.newModuleA', - exports: { - 'exportA': { - newExport: 'newExportA', - }, - 'exportB': { - newExport: 'newExportB', - }, - 'exportC': { - newExport: 'someOtherName', - newPath: 'Blockly.moduleA.exportC', - }, - }, + test('a javascript program with multiple renames works correctly', function () { + const database = { + '1.0.0': [ + { + oldName: 'Blockly.moduleA', + newName: 'Blockly.newModuleA', + exports: { + 'exportA': { + newExport: 'newExportA', }, - { - oldName: 'Blockly.moduleB', - newName: 'Blockly.newModuleB', - newPath: 'Blockly.moduleB', + 'exportB': { + newExport: 'newExportB', }, - { - oldName: 'Blockly.moduleC', - newExport: 'ClassC', + 'exportC': { + newExport: 'someOtherName', + newPath: 'Blockly.moduleA.exportC', }, - { - oldName: 'Blockly.moduleD', - newExport: 'ClassD', - }, - ], - }; - const oldString = ` + }, + }, + { + oldName: 'Blockly.moduleB', + newName: 'Blockly.newModuleB', + newPath: 'Blockly.moduleB', + }, + { + oldName: 'Blockly.moduleC', + newExport: 'ClassC', + }, + { + oldName: 'Blockly.moduleD', + newExport: 'ClassD', + }, + ], + }; + const oldString = ` import Blockly from 'blockly'; class SubClass extends Blockly.moduleC { @@ -76,10 +74,9 @@ class SubClass extends Blockly.moduleC { } };`; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename(oldString); - const expectedString = ` + const expectedString = ` import Blockly from 'blockly'; class SubClass extends Blockly.moduleC.ClassC { @@ -104,11 +101,11 @@ class SubClass extends Blockly.moduleC.ClassC { return thing.someMethod(paramA, paramB); } };`; - assert.deepEqual(newString, expectedString); - }); + assert.deepEqual(newString, expectedString); + }); - suite('Database', function() { - test('getDatabase retrieves renamings.json5', async function() { + suite('Database', function () { + test('getDatabase retrieves renamings.json5', async function () { const database = await getDatabase(); // Sanity check example entry. @@ -118,16 +115,16 @@ class SubClass extends Blockly.moduleC.ClassC { }); }); - suite('Exports', function() { - setup(function() { + suite('Exports', function () { + setup(function () { this.errSpy = stub(process.stderr, 'write'); }); - teardown(function() { + teardown(function () { this.errSpy.restore(); }); - test('exports without new paths are renamed to the new export', function() { + test('exports without new paths are renamed to the new export', function () { const database = { '1.0.0': [ { @@ -142,13 +139,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.oldExportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.newExportName'); }); - test('exports with new paths are renamed to the new path', function() { + test('exports with new paths are renamed to the new path', function () { const database = { '1.0.0': [ { @@ -164,13 +162,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.oldExportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'otherModule.newExportName'); }); - test('suffixes on renamed exports without a new path are kept', function() { + test('suffixes on renamed exports without a new path are kept', function () { const database = { '1.0.0': [ { @@ -185,13 +184,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.oldExportName.suffix'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.newExportName.suffix'); }); - test('suffixes on renamed exports with a new path are kept', function() { + test('suffixes on renamed exports with a new path are kept', function () { const database = { '1.0.0': [ { @@ -207,13 +207,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.oldExportName.suffix'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'otherModule.newExportName.suffix'); }); - test('exports that are now properties are renamed properly', function() { + test('exports that are now properties are renamed properly', function () { const database = { '1.0.0': [ { @@ -228,13 +229,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.oldExportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.new.export.name'); }); - test('suffixes on exports that are now properties are kept', function() { + test('suffixes on exports that are now properties are kept', function () { const database = { '1.0.0': [ { @@ -249,13 +251,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.oldExportName.suffix'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.new.export.name.suffix'); }); - test('properties that are now exports are renamed properly', function() { + test('properties that are now exports are renamed properly', function () { const database = { '1.0.0': [ { @@ -270,13 +273,14 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.old.property.name'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.newExportName'); }); - test('suffixes on properties that are now exports are kept', function() { + test('suffixes on properties that are now exports are kept', function () { const database = { '1.0.0': [ { @@ -291,43 +295,48 @@ class SubClass extends Blockly.moduleC.ClassC { }; const oldString = 'module.old.property.name.suffix'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.newExportName.suffix'); }); - test('properties on renamed exports which are moved to new properties ' + - 'are renamed properly', function() { - const database = { - '1.0.0': [ - { - oldName: 'module', - exports: { - 'export.property': { - newExport: 'newExport', - }, - 'export': { - newExport: 'newNameForExistingExport', + test( + 'properties on renamed exports which are moved to new properties ' + + 'are renamed properly', + function () { + const database = { + '1.0.0': [ + { + oldName: 'module', + exports: { + 'export.property': { + newExport: 'newExport', + }, + 'export': { + newExport: 'newNameForExistingExport', + }, }, }, - }, - ], - }; - const oldString = ` + ], + }; + const oldString = ` const foo = module.export.property; const bar = module.export;`; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - const expectedString = ` + const expectedString = ` const foo = module.newExport; const bar = module.newNameForExistingExport;`; - assert.deepEqual(newString, expectedString); - }); + assert.deepEqual(newString, expectedString); + }, + ); - test('exports with get methods are changed to use get methods', function() { + test('exports with get methods are changed to use get methods', function () { const database = { '1.0.0': [ { @@ -342,14 +351,14 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'const foo = module.oldExportName.suffix;'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'const foo = module.getExport().suffix;'); }); - test('exports with get+set methods are changed to include FIXME comment', - function() { + test('exports with get+set methods are changed to include FIXME comment', function () { const database = { '1.0.0': [ { @@ -365,15 +374,16 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'const foo = module.oldExportName;'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.match(newString, /FIXME/, 'contains FIXME comment'); assert.match(newString, /module\.getExport\(/, 'contains get example'); assert.match(newString, /module\.setExport\(/, 'contains set example'); }); - test('exports with set methods trigger console output', function() { + test('exports with set methods trigger console output', function () { const database = { '1.0.0': [ { @@ -388,13 +398,17 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'module.oldExportName = foo;'; - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + new Renamer(database, '0.0.0', '1.0.0').rename(oldString); - assert.isTrue(this.errSpy.calledWith(' - Call module.setExport(' + - '/* new value */) instead of setting it.\n')); + assert.isTrue( + this.errSpy.calledWith( + ' - Call module.setExport(' + + '/* new value */) instead of setting it.\n', + ), + ); }); - test('renamed exports in renamed modules get properly renamed', function() { + test('renamed exports in renamed modules get properly renamed', function () { const database = { '1.0.0': [ { @@ -410,37 +424,42 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'oldModule.oldExport'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'newModule.newExport'); }); - test('renamed exports on renamed modules with backwards compatible new ' + - 'paths do not have their modules renamed', function() { - const database = { - '1.0.0': [ - { - oldName: 'oldModule', - newName: 'newModule', - newPath: 'oldModule', - exports: { - 'oldExport': { - newExport: 'newExport', + test( + 'renamed exports on renamed modules with backwards compatible new ' + + 'paths do not have their modules renamed', + function () { + const database = { + '1.0.0': [ + { + oldName: 'oldModule', + newName: 'newModule', + newPath: 'oldModule', + exports: { + 'oldExport': { + newExport: 'newExport', + }, }, }, - }, - ], - }; - const oldString = 'oldModule.oldExport'; + ], + }; + const oldString = 'oldModule.oldExport'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'oldModule.newExport'); - }); + assert.deepEqual(newString, 'oldModule.newExport'); + }, + ); - test('exports with new modules are "moved" to new modules', function() { + test('exports with new modules are "moved" to new modules', function () { const database = { '1.0.0': [ { @@ -455,131 +474,148 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'oldModule.exportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'newModule.exportName'); }); - test('exports moved to the old version of renamed modules are renamed ' + - 'properly', function() { - const database = { - '1.0.0': [ - { - oldName: 'moduleA', - exports: { - 'exportName': { - newModule: 'moduleB', + test( + 'exports moved to the old version of renamed modules are renamed ' + + 'properly', + function () { + const database = { + '1.0.0': [ + { + oldName: 'moduleA', + exports: { + 'exportName': { + newModule: 'moduleB', + }, }, }, - }, - { - oldName: 'moduleB', - newName: 'moduleC', - }, - ], - }; - const oldString = 'moduleA.exportName'; + { + oldName: 'moduleB', + newName: 'moduleC', + }, + ], + }; + const oldString = 'moduleA.exportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'moduleB.exportName'); - }); + assert.deepEqual(newString, 'moduleB.exportName'); + }, + ); - test('exports moved to the new version of renamed modules are renamed ' + - 'properly', function() { - const database = { - '1.0.0': [ - { - oldName: 'moduleA', - exports: { - 'exportName': { - newModule: 'moduleC', + test( + 'exports moved to the new version of renamed modules are renamed ' + + 'properly', + function () { + const database = { + '1.0.0': [ + { + oldName: 'moduleA', + exports: { + 'exportName': { + newModule: 'moduleC', + }, }, }, - }, - { - oldName: 'moduleB', - newName: 'moduleC', - }, - ], - }; - const oldString = 'moduleA.exportName'; + { + oldName: 'moduleB', + newName: 'moduleC', + }, + ], + }; + const oldString = 'moduleA.exportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'moduleC.exportName'); - }); + assert.deepEqual(newString, 'moduleC.exportName'); + }, + ); - test('exports which are renamed in consecutive versions get the most ' + - 'recent rename', function() { - const database = { - '1.0.0': [ - { - oldName: 'moduleA', - exports: { - 'exportA1': { - newExport: 'exportA2', + test( + 'exports which are renamed in consecutive versions get the most ' + + 'recent rename', + function () { + const database = { + '1.0.0': [ + { + oldName: 'moduleA', + exports: { + 'exportA1': { + newExport: 'exportA2', + }, }, }, - }, - ], - '2.0.0': [ - { - oldName: 'moduleA', - exports: { - 'exportA2': { - newExport: 'exportA3', + ], + '2.0.0': [ + { + oldName: 'moduleA', + exports: { + 'exportA2': { + newExport: 'exportA3', + }, }, }, - }, - ], - }; - const oldString = 'moduleA.exportA1'; + ], + }; + const oldString = 'moduleA.exportA1'; - const newString = - (new Renamer(database, '0.0.0', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '2.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'moduleA.exportA3'); - }); + assert.deepEqual(newString, 'moduleA.exportA3'); + }, + ); - test('exports which are renamed and then reexported at their old path ' + - 'in a newer version are not renamed', function() { - const database = { - '1.0.0': [ - { - oldName: 'moduleA', - exports: { - 'exportA1': { - newExport: 'exportA2', + test( + 'exports which are renamed and then reexported at their old path ' + + 'in a newer version are not renamed', + function () { + const database = { + '1.0.0': [ + { + oldName: 'moduleA', + exports: { + 'exportA1': { + newExport: 'exportA2', + }, }, }, - }, - ], - '2.0.0': [ - { - oldName: 'moduleA', - exports: { - 'exportA2': { - newPath: 'moduleA.exportA1', + ], + '2.0.0': [ + { + oldName: 'moduleA', + exports: { + 'exportA2': { + newPath: 'moduleA.exportA1', + }, }, }, - }, - ], - }; - const oldString = 'moduleA.exportA1'; + ], + }; + const oldString = 'moduleA.exportA1'; - const newString = - (new Renamer(database, '0.0.0', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '2.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'moduleA.exportA1'); - }); + assert.deepEqual(newString, 'moduleA.exportA1'); + }, + ); }); - suite('Modules', function() { - test('modules without new paths are renamed to the new name', function() { + suite('Modules', function () { + test('modules without new paths are renamed to the new name', function () { const database = { '1.0.0': [ { @@ -590,13 +626,14 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'base.oldModuleName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'base.newModuleName'); }); - test('modules with new paths are renamed to the new path', function() { + test('modules with new paths are renamed to the new path', function () { const database = { '1.0.0': [ { @@ -608,88 +645,56 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'base.oldModuleName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'base.newModuleName'); }); - test('suffixes on renamed modules without new exports are kept', - function() { - const database = { - '1.0.0': [ - { - oldName: 'base.oldModuleName', - newName: 'base.newModuleName', - }, - ], - }; - const oldString = 'base.oldModuleName.suffix'; - - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); - - assert.deepEqual(newString, 'base.newModuleName.suffix'); - }); - - test('suffixes on renamed modules without new exports but with new paths ' + - 'are kept', function() { + test('suffixes on renamed modules without new exports are kept', function () { const database = { '1.0.0': [ { oldName: 'base.oldModuleName', - newName: 'base.someOtherName', - newPath: 'base.newModuleName', + newName: 'base.newModuleName', }, ], }; - const oldString = 'base.oldModuleName.suffix'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'base.newModuleName.suffix'); }); - test('modules with new exports and without new paths gain the new export', - function() { - const database = { - '1.0.0': [ - { - oldName: 'base.moduleName', - newExport: 'newExport', - }, - ], - }; - const oldString = 'base.moduleName'; - - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); - - assert.deepEqual(newString, 'base.moduleName.newExport'); - }); - - test('modules with new exports with new paths are renamed to the new path', - function() { - const database = { - '1.0.0': [ - { - oldName: 'base.moduleName', - newExport: 'someOtherName', - newPath: 'base.newModuleName.newExport', - }, - ], - }; - const oldString = 'base.moduleName'; + test( + 'suffixes on renamed modules without new exports but with new paths ' + + 'are kept', + function () { + const database = { + '1.0.0': [ + { + oldName: 'base.oldModuleName', + newName: 'base.someOtherName', + newPath: 'base.newModuleName', + }, + ], + }; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const oldString = 'base.oldModuleName.suffix'; - assert.deepEqual(newString, 'base.newModuleName.newExport'); - }); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - test('suffixes on modules with new exports are kept', function() { + assert.deepEqual(newString, 'base.newModuleName.suffix'); + }, + ); + + test('modules with new exports and without new paths gain the new export', function () { const database = { '1.0.0': [ { @@ -698,82 +703,128 @@ const bar = module.newNameForExistingExport;`; }, ], }; - const oldString = 'base.moduleName.suffix'; + const oldString = 'base.moduleName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'base.moduleName.newExport.suffix'); + assert.deepEqual(newString, 'base.moduleName.newExport'); }); - test('modules with new exports and new names are renamed properly', - function() { - const database = { - '1.0.0': [ - { - oldName: 'base.oldModuleName', - newName: 'base.newModuleName', - newExport: 'newExport', - }, - ], - }; - const oldString = 'base.oldModuleName'; - - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); - - assert.deepEqual(newString, 'base.newModuleName.newExport'); - }); - - test('modules which are renamed in consecutive versions get the most ' + - 'recent rename', function() { + test('modules with new exports with new paths are renamed to the new path', function () { const database = { '1.0.0': [ { - oldName: 'base.moduleA1', - newName: 'base.moduleA2', - }, - ], - '2.0.0': [ - { - oldName: 'base.moduleA2', - newName: 'base.moduleA3', + oldName: 'base.moduleName', + newExport: 'someOtherName', + newPath: 'base.newModuleName.newExport', }, ], }; - const oldString = 'base.moduleA1'; + const oldString = 'base.moduleName'; - const newString = - (new Renamer(database, '0.0.0', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'base.moduleA3'); + assert.deepEqual(newString, 'base.newModuleName.newExport'); }); - test('modules which are renamed and then reexported at their old path ' + - 'in a newer version are not renamed', function() { + test('suffixes on modules with new exports are kept', function () { const database = { '1.0.0': [ { - oldName: 'base.moduleA1', - newName: 'base.moduleA2', + oldName: 'base.moduleName', + newExport: 'newExport', }, ], - '2.0.0': [ + }; + const oldString = 'base.moduleName.suffix'; + + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); + + assert.deepEqual(newString, 'base.moduleName.newExport.suffix'); + }); + + test('modules with new exports and new names are renamed properly', function () { + const database = { + '1.0.0': [ { - oldName: 'base.moduleA2', - newPath: 'base.moduleA1', + oldName: 'base.oldModuleName', + newName: 'base.newModuleName', + newExport: 'newExport', }, ], }; - const oldString = 'base.moduleA1'; + const oldString = 'base.oldModuleName'; - const newString = - (new Renamer(database, '0.0.0', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'base.moduleA1'); + assert.deepEqual(newString, 'base.newModuleName.newExport'); }); - test('partial matches are ignored', function() { + test( + 'modules which are renamed in consecutive versions get the most ' + + 'recent rename', + function () { + const database = { + '1.0.0': [ + { + oldName: 'base.moduleA1', + newName: 'base.moduleA2', + }, + ], + '2.0.0': [ + { + oldName: 'base.moduleA2', + newName: 'base.moduleA3', + }, + ], + }; + const oldString = 'base.moduleA1'; + + const newString = new Renamer(database, '0.0.0', '2.0.0').rename( + oldString, + ); + + assert.deepEqual(newString, 'base.moduleA3'); + }, + ); + + test( + 'modules which are renamed and then reexported at their old path ' + + 'in a newer version are not renamed', + function () { + const database = { + '1.0.0': [ + { + oldName: 'base.moduleA1', + newName: 'base.moduleA2', + }, + ], + '2.0.0': [ + { + oldName: 'base.moduleA2', + newPath: 'base.moduleA1', + }, + ], + }; + const oldString = 'base.moduleA1'; + + const newString = new Renamer(database, '0.0.0', '2.0.0').rename( + oldString, + ); + + assert.deepEqual(newString, 'base.moduleA1'); + }, + ); + + test('partial matches are ignored', function () { const database = { '1.0.0': [ { @@ -784,81 +835,82 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'moduleAA'; - const newString = - (new Renamer(database, '0.0.0', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '2.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'moduleAA'); }); }); - suite('Versions', function() { - test('renames below the lower bound of the version range are not applied', - function() { - const database = { - '2.0.0': [ - { - oldName: 'module', - exports: { - 'oldExportName': { - newExport: 'newExportName', - }, - }, + suite('Versions', function () { + test('renames below the lower bound of the version range are not applied', function () { + const database = { + '2.0.0': [ + { + oldName: 'module', + exports: { + 'oldExportName': { + newExport: 'newExportName', }, - ], - }; - const oldString = 'module.oldExportName'; - - const newString = - (new Renamer(database, '3.0.0', '4.0.0')).rename(oldString); - - assert.deepEqual(newString, 'module.oldExportName'); - }); - - test('renames in the lower bound of the version range are not applied', - function() { - const database = { - '2.0.0': [ - { - oldName: 'module', - exports: { - 'oldExportName': { - newExport: 'newExportName', - }, - }, + }, + }, + ], + }; + const oldString = 'module.oldExportName'; + + const newString = new Renamer(database, '3.0.0', '4.0.0').rename( + oldString, + ); + + assert.deepEqual(newString, 'module.oldExportName'); + }); + + test('renames in the lower bound of the version range are not applied', function () { + const database = { + '2.0.0': [ + { + oldName: 'module', + exports: { + 'oldExportName': { + newExport: 'newExportName', }, - ], - }; - const oldString = 'module.oldExportName'; - - const newString = - (new Renamer(database, '2.0.0', '3.0.0')).rename(oldString); - - assert.deepEqual(newString, 'module.oldExportName'); - }); - - test('renames in the upper bound of the version range are applied', - function() { - const database = { - '2.0.0': [ - { - oldName: 'module', - exports: { - 'oldExportName': { - newExport: 'newExportName', - }, - }, + }, + }, + ], + }; + const oldString = 'module.oldExportName'; + + const newString = new Renamer(database, '2.0.0', '3.0.0').rename( + oldString, + ); + + assert.deepEqual(newString, 'module.oldExportName'); + }); + + test('renames in the upper bound of the version range are applied', function () { + const database = { + '2.0.0': [ + { + oldName: 'module', + exports: { + 'oldExportName': { + newExport: 'newExportName', }, - ], - }; - const oldString = 'module.oldExportName'; + }, + }, + ], + }; + const oldString = 'module.oldExportName'; - const newString = - (new Renamer(database, '1.0.0', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '1.0.0', '2.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'module.newExportName'); - }); + assert.deepEqual(newString, 'module.newExportName'); + }); - test('renames in the middle of the version range are applied', function() { + test('renames in the middle of the version range are applied', function () { const database = { '2.0.0': [ { @@ -873,35 +925,36 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'module.oldExportName'; - const newString = - (new Renamer(database, '1.0.0', '3.0.0')).rename(oldString); + const newString = new Renamer(database, '1.0.0', '3.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'module.newExportName'); }); - test('renames above the upper bound of the version range are not applied', - function() { - const database = { - '2.0.0': [ - { - oldName: 'module', - exports: { - 'oldExportName': { - newExport: 'newExportName', - }, - }, + test('renames above the upper bound of the version range are not applied', function () { + const database = { + '2.0.0': [ + { + oldName: 'module', + exports: { + 'oldExportName': { + newExport: 'newExportName', }, - ], - }; - const oldString = 'module.oldExportName'; + }, + }, + ], + }; + const oldString = 'module.oldExportName'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); - assert.deepEqual(newString, 'module.oldExportName'); - }); + assert.deepEqual(newString, 'module.oldExportName'); + }); - test('from-version assumes the earliest matching version', function() { + test('from-version assumes the earliest matching version', function () { const database = { '1.0.0': [ { @@ -926,13 +979,12 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'module.exportA; module.exportB'; - const newString = - (new Renamer(database, '1', '2.0.0')).rename(oldString); + const newString = new Renamer(database, '1', '2.0.0').rename(oldString); assert.deepEqual(newString, 'module.exportA; module.newExportB'); }); - test('to-version assumes the latest matching version', function() { + test('to-version assumes the latest matching version', function () { const database = { '2.0.0': [ { @@ -957,13 +1009,12 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'module.exportA; module.exportB'; - const newString = - (new Renamer(database, '1.0.0', '2')).rename(oldString); + const newString = new Renamer(database, '1.0.0', '2').rename(oldString); assert.deepEqual(newString, 'module.newExportA; module.newExportB'); }); - test('the develop version is outside all ranges', function() { + test('the develop version is outside all ranges', function () { const database = { 'develop': [ { @@ -974,13 +1025,14 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'base.oldModule'; - const newString = - (new Renamer(database, '0.0.0', '1.0.0')).rename(oldString); + const newString = new Renamer(database, '0.0.0', '1.0.0').rename( + oldString, + ); assert.deepEqual(newString, 'base.oldModule'); }); - test('the develop version works if directly targeted', function() { + test('the develop version works if directly targeted', function () { const database = { 'develop': [ { @@ -991,8 +1043,9 @@ const bar = module.newNameForExistingExport;`; }; const oldString = 'base.oldModule'; - const newString = - (new Renamer(database, '0.0.0', 'develop')).rename(oldString); + const newString = new Renamer(database, '0.0.0', 'develop').rename( + oldString, + ); assert.deepEqual(newString, 'base.newModule'); }); diff --git a/plugins/migration/test/versions.mocha.js b/plugins/migration/test/versions.mocha.js index c408081aa3..1b57275f41 100644 --- a/plugins/migration/test/versions.mocha.js +++ b/plugins/migration/test/versions.mocha.js @@ -11,96 +11,96 @@ import {assert} from 'chai'; import {coerce, compare, lte, gt} from '../bin/versions.js'; -suite('Version utils', function() { - suite('Coercion', function() { - test('develop is not coerced', function() { +suite('Version utils', function () { + suite('Coercion', function () { + test('develop is not coerced', function () { assert.equal(coerce('develop'), 'develop'); }); - test('latest is not coerced', function() { + test('latest is not coerced', function () { assert.equal(coerce('latest'), 'latest'); }); - test('semver is coerced', function() { + test('semver is coerced', function () { assert.equal(coerce('3'), '3.0.0'); }); }); - suite('Comparison', function() { - test('develop is greater than any semver', function() { + suite('Comparison', function () { + test('develop is greater than any semver', function () { assert.equal(compare('1000.0.0', 'develop'), -1); assert.equal(compare('develop', '1000.0.0'), 1); }); - test('develop is greater than latest', function() { + test('develop is greater than latest', function () { assert.equal(compare('latest', 'develop'), -1); assert.equal(compare('develop', 'latest'), 1); }); - test('develop equals develop', function() { + test('develop equals develop', function () { assert.equal(compare('develop', 'develop'), 0); }); - test('latest is greater than any semver', function() { + test('latest is greater than any semver', function () { assert.equal(compare('1000.0.0', 'latest'), -1); assert.equal(compare('latest', '1000.0.0'), 1); }); - test('latest equals latest', function() { + test('latest equals latest', function () { assert.equal(compare('latest', 'latest'), 0); }); }); - suite('Less than or equal', function() { - test('develop is greater than any semver', function() { + suite('Less than or equal', function () { + test('develop is greater than any semver', function () { assert.isTrue(lte('1000.0.0', 'develop')); assert.isFalse(lte('develop', '1000.0.0')); }); - test('develop is greater than latest', function() { + test('develop is greater than latest', function () { assert.isTrue(lte('latest', 'develop')); assert.isFalse(lte('develop', 'latest')); }); - test('develop equals develop', function() { + test('develop equals develop', function () { assert.isTrue(lte('develop', 'develop')); }); - test('latest is greater than any semver', function() { + test('latest is greater than any semver', function () { assert.isTrue(lte('1000.0.0', 'latest')); assert.isFalse(lte('latest', '1000.0.0')); }); - test('latest equals latest', function() { + test('latest equals latest', function () { assert.isTrue(lte('latest', 'latest')); }); }); - suite('Greater than', function() { - test('develop is greater than any semver', function() { + suite('Greater than', function () { + test('develop is greater than any semver', function () { assert.isFalse(gt('1000.0.0', 'develop')); assert.isTrue(gt('develop', '1000.0.0')); }); - test('develop is greater than latest', function() { + test('develop is greater than latest', function () { assert.isFalse(gt('latest', 'develop')); assert.isTrue(gt('develop', 'latest')); }); - test('develop equals develop', function() { + test('develop equals develop', function () { assert.isFalse(gt('develop', 'develop')); }); - test('latest is greater than any semver', function() { + test('latest is greater than any semver', function () { assert.isFalse(gt('1000.0.0', 'latest')); assert.isTrue(gt('latest', '1000.0.0')); }); - test('latest equals latest', function() { + test('latest equals latest', function () { assert.isFalse(gt('latest', 'latest')); }); - test('semver is only greater if first non-zero is greater', function() { + test('semver is only greater if first non-zero is greater', function () { assert.isFalse(gt('7.2.0', '7.0.0')); assert.isFalse(gt('7.2.0', '7.1.0')); }); diff --git a/plugins/modal/README.md b/plugins/modal/README.md index 3486e05fd2..1fcf20cef1 100644 --- a/plugins/modal/README.md +++ b/plugins/modal/README.md @@ -5,11 +5,13 @@ A [Blockly](https://www.npmjs.com/package/blockly) plugin that renders a modal. ## Installation ### Yarn + ``` yarn add @blockly/plugin-modal ``` ### npm + ``` npm install @blockly/plugin-modal --save ``` @@ -31,7 +33,9 @@ modal.init(); ``` ## API + ### Methods + - `init`: Create a modal. - `dispose`: Dispose of the modal. - `show`: Show the modal and focus on the first interactable element. @@ -39,9 +43,11 @@ modal.init(); - `render`: Create all the dom elements for the modal. ### Properties + - `shouldCloseOnOverlayClick`: (default true) If set to true will close the -overlay when a user clicks outside of the modal. + overlay when a user clicks outside of the modal. - `shouldCloseOnEsc`: (default true) If set to true will close the modal when the user hits escape. ## License + Apache 2.0 diff --git a/plugins/modal/package.json b/plugins/modal/package.json index 3482e22602..d6289d02fe 100644 --- a/plugins/modal/package.json +++ b/plugins/modal/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -54,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/modal/src/index.js b/plugins/modal/src/index.js index 9e351445b0..e494098802 100644 --- a/plugins/modal/src/index.js +++ b/plugins/modal/src/index.js @@ -9,7 +9,6 @@ * @author aschmiedt@google.com (Abby Schmiedt) */ - import * as Blockly from 'blockly/core'; /** @@ -106,17 +105,22 @@ export class Modal { * Shows the Blockly modal and focus on the first focusable element. */ show() { - Blockly.WidgetDiv.show(this, this.workspace_.RTL, - () => this.widgetDispose_()); + Blockly.WidgetDiv.show(this, this.workspace_.RTL, () => + this.widgetDispose_(), + ); this.widgetCreate_(); - const focusableEls = this.htmlDiv_.querySelectorAll('a[href],' + + const focusableEls = this.htmlDiv_.querySelectorAll( + 'a[href],' + 'area[href], input:not([disabled]), select:not([disabled]),' + - 'textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'); + 'textarea:not([disabled]), button:not([disabled]), [tabindex="0"]', + ); if (focusableEls.length > 0) { this.firstFocusableEl_ = focusableEls[0]; this.lastFocusableEl_ = focusableEls[focusableEls.length - 1]; - if (focusableEls[0].classList.contains('blocklyModalBtnClose') && - focusableEls.length > 1) { + if ( + focusableEls[0].classList.contains('blocklyModalBtnClose') && + focusableEls.length > 1 + ) { focusableEls[1].focus(); } else { this.firstFocusableEl_.focus(); @@ -190,8 +194,10 @@ export class Modal { handleKeyDown_(e) { if (e.key === 'Tab') { // If there are no elements or there is one element don't wrap. - if (!this.firstFocusableEl_ || - this.firstFocusableEl_ === this.lastFocusableEl_) { + if ( + !this.firstFocusableEl_ || + this.firstFocusableEl_ === this.lastFocusableEl_ + ) { e.preventDefault(); e.stopPropagation(); return; @@ -216,8 +222,12 @@ export class Modal { * @protected */ addEvent_(node, name, thisObject, func) { - const event = - Blockly.browserEvents.conditionalBind(node, name, thisObject, func); + const event = Blockly.browserEvents.conditionalBind( + node, + name, + thisObject, + func, + ); this.boundEvents_.push(event); } @@ -252,8 +262,12 @@ export class Modal { // End creating the container // Add Events - this.addEvent_(/** @type{!HTMLDivElement} */ modalContainer, 'keydown', - this, this.handleKeyDown_); + this.addEvent_( + /** @type{!HTMLDivElement} */ modalContainer, + 'keydown', + this, + this.handleKeyDown_, + ); if (this.shouldCloseOnOverlayClick) { this.addEvent_(this.htmlDiv_, 'click', this, this.hide); diff --git a/plugins/modal/test/index.html b/plugins/modal/test/index.html index 650e7eedc6..a5ed2455a7 100644 --- a/plugins/modal/test/index.html +++ b/plugins/modal/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Modal Test + + - - - Blockly Modal Test - - - - -
- - - + +
+ + diff --git a/plugins/modal/test/index.js b/plugins/modal/test/index.js index d556f090a1..d47eabbd0d 100644 --- a/plugins/modal/test/index.js +++ b/plugins/modal/test/index.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly'; import {toolboxCategories, createPlayground} from '@blockly/dev-tools'; import {Modal} from '../src/index'; - /** * Create a workspace. * @param {HTMLElement} blocklyDiv The blockly container div. @@ -29,10 +28,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/modal/test/modal_test.mocha.js b/plugins/modal/test/modal_test.mocha.js index 24c4dbcf33..2ef4eb346d 100644 --- a/plugins/modal/test/modal_test.mocha.js +++ b/plugins/modal/test/modal_test.mocha.js @@ -15,40 +15,47 @@ const sinon = require('sinon'); const Modal = require('../src/index.js').Modal; -suite('Modal', function() { - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
'); +suite('Modal', function () { + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + ); this.workspace = Blockly.inject('blocklyDiv', {}); this.modal = new Modal('Title', this.workspace); }); - teardown(function() { + teardown(function () { this.jsdomCleanup(); sinon.restore(); }); - suite('init()', function() { - test('Calls render', function() { + suite('init()', function () { + test('Calls render', function () { this.modal.render = sinon.fake(); this.modal.init(); sinon.assert.calledOnce(this.modal.render); }); }); - suite('show()', function() { - test('Elements focused', function() { + suite('show()', function () { + test('Elements focused', function () { this.modal.init(); this.modal.show(); - assert.equal('blocklyModalBtn blocklyModalBtnClose', - this.modal.firstFocusableEl_.className, 'first element'); - assert.equal('blocklyModalBtn blocklyModalBtnClose', - this.modal.lastFocusableEl_.className, 'last element'); + assert.equal( + 'blocklyModalBtn blocklyModalBtnClose', + this.modal.firstFocusableEl_.className, + 'first element', + ); + assert.equal( + 'blocklyModalBtn blocklyModalBtnClose', + this.modal.lastFocusableEl_.className, + 'last element', + ); }); }); - suite('dispose()', function() { - test('Events and button callback removed', function() { + suite('dispose()', function () { + test('Events and button callback removed', function () { this.modal.init(); const numEvents = this.modal.boundEvents_.length; Blockly.browserEvents.unbind = sinon.fake(); @@ -59,8 +66,8 @@ suite('Modal', function() { }); }); - suite('handleKeyDown()', function() { - setup(function() { + suite('handleKeyDown()', function () { + setup(function () { this.modal.init(); this.modal.show(); }); @@ -80,19 +87,19 @@ suite('Modal', function() { event.preventDefault = sinon.fake(); return event; } - test('Tab pressed with only one element', function() { + test('Tab pressed with only one element', function () { const event = makeEvent('Tab', false); this.modal.handleForwardTab_ = sinon.fake(); this.modal.handleKeyDown_(event); sinon.assert.notCalled(this.modal.handleForwardTab_); }); - test('Shift tab pressed with only one element', function() { + test('Shift tab pressed with only one element', function () { const event = makeEvent('Tab', true); this.modal.handleBackwardTab_ = sinon.fake(); this.modal.handleKeyDown_(event); sinon.assert.notCalled(this.modal.handleBackwardTab_); }); - test('Escape pressed', function() { + test('Escape pressed', function () { const event = makeEvent('Escape', false); this.modal.hide = sinon.fake(); this.modal.handleKeyDown_(event); diff --git a/plugins/renderer-inline-row-separators/README.md b/plugins/renderer-inline-row-separators/README.md index 1c90b1f2e3..c7bdc846bd 100644 --- a/plugins/renderer-inline-row-separators/README.md +++ b/plugins/renderer-inline-row-separators/README.md @@ -15,11 +15,13 @@ It is strongly recommended that instead of using this plugin, you upgrade to a v ## Installation ### Yarn + ``` yarn add @blockly/renderer-inline-row-separators ``` ### npm + ``` npm install @blockly/renderer-inline-row-separators --save ``` diff --git a/plugins/renderer-inline-row-separators/package.json b/plugins/renderer-inline-row-separators/package.json index d8fe87ce75..c38303fd85 100644 --- a/plugins/renderer-inline-row-separators/package.json +++ b/plugins/renderer-inline-row-separators/package.json @@ -7,7 +7,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -54,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/renderer-inline-row-separators/src/index.ts b/plugins/renderer-inline-row-separators/src/index.ts index fd701a28e5..7b2dae1380 100644 --- a/plugins/renderer-inline-row-separators/src/index.ts +++ b/plugins/renderer-inline-row-separators/src/index.ts @@ -5,8 +5,10 @@ */ import * as Blockly from 'blockly/core'; -import {addInlineRowSeparators, InlineRenderer} - from './inline_row_separators_renderer'; +import { + addInlineRowSeparators, + InlineRenderer, +} from './inline_row_separators_renderer'; import './inline_text_join'; import './inline_lists_create_with'; import './inline_procedures_defreturn'; @@ -18,10 +20,10 @@ export {addInlineRowSeparators, InlineRenderer}; * "lists_create_with", and "procedures_defreturn" with alternatives that * render the value inputs as inline inputs on separate rows. */ -export const overrideOldBlockDefinitions = function() { +export const overrideOldBlockDefinitions = function () { Blockly.Blocks['text_join'] = Blockly.Blocks['inline_text_join']; Blockly.Blocks['lists_create_with'] = - Blockly.Blocks['inline_lists_create_with']; + Blockly.Blocks['inline_lists_create_with']; Blockly.Blocks['procedures_defreturn'] = - Blockly.Blocks['inline_procedures_defreturn']; + Blockly.Blocks['inline_procedures_defreturn']; }; diff --git a/plugins/renderer-inline-row-separators/src/inline_lists_create_with.ts b/plugins/renderer-inline-row-separators/src/inline_lists_create_with.ts index c3caf9c2cc..3d50f8752b 100644 --- a/plugins/renderer-inline-row-separators/src/inline_lists_create_with.ts +++ b/plugins/renderer-inline-row-separators/src/inline_lists_create_with.ts @@ -24,41 +24,41 @@ const builtInListBlock = Blockly.Blocks['lists_create_with']; // init and updateShape_ methods to enabline inline input mode and insert dummy // inputs between value inputs. Blockly.Blocks['inline_lists_create_with'] = Object.assign( - {}, - builtInListBlock, - { - init: function(this: ListBlock) { - builtInListBlock.init.apply(this); - this.inputsInline = true; - }, + {}, + builtInListBlock, + { + init: function (this: ListBlock) { + builtInListBlock.init.apply(this); + this.inputsInline = true; + }, - /* eslint-disable @typescript-eslint/naming-convention */ - updateShape_: function(this: ListBlock) { - /* eslint-enable @typescript-eslint/naming-convention */ - if (this.itemCount_ && this.getInput('EMPTY')) { - this.removeInput('EMPTY'); - } else if (!this.itemCount_ && !this.getInput('EMPTY')) { - this.appendDummyInput('EMPTY').appendField( - Blockly.Msg['LISTS_CREATE_EMPTY_TITLE']); - } + /* eslint-disable @typescript-eslint/naming-convention */ + updateShape_: function (this: ListBlock) { + /* eslint-enable @typescript-eslint/naming-convention */ + if (this.itemCount_ && this.getInput('EMPTY')) { + this.removeInput('EMPTY'); + } else if (!this.itemCount_ && !this.getInput('EMPTY')) { + this.appendDummyInput('EMPTY').appendField( + Blockly.Msg['LISTS_CREATE_EMPTY_TITLE'], + ); + } - // Add new inputs. - for (let i = 0; i < this.itemCount_; i++) { - if (!this.getInput('ADD' + i)) { - const dummy = this.appendDummyInput('DUMMY' + i); - if (i === 0) { - dummy.appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); - } - this.appendValueInput('ADD' + i).setAlign( - Blockly.Input.Align.LEFT); + // Add new inputs. + for (let i = 0; i < this.itemCount_; i++) { + if (!this.getInput('ADD' + i)) { + const dummy = this.appendDummyInput('DUMMY' + i); + if (i === 0) { + dummy.appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); } + this.appendValueInput('ADD' + i).setAlign(Blockly.Input.Align.LEFT); } + } - // Remove deleted inputs. - for (let i = this.itemCount_; this.getInput('ADD' + i); i++) { - this.removeInput('DUMMY' + i); - this.removeInput('ADD' + i); - } - }, - } + // Remove deleted inputs. + for (let i = this.itemCount_; this.getInput('ADD' + i); i++) { + this.removeInput('DUMMY' + i); + this.removeInput('ADD' + i); + } + }, + }, ); diff --git a/plugins/renderer-inline-row-separators/src/inline_procedures_defreturn.ts b/plugins/renderer-inline-row-separators/src/inline_procedures_defreturn.ts index 2703d82c47..8caf92a930 100644 --- a/plugins/renderer-inline-row-separators/src/inline_procedures_defreturn.ts +++ b/plugins/renderer-inline-row-separators/src/inline_procedures_defreturn.ts @@ -15,13 +15,13 @@ import * as Blockly from 'blockly/core'; // init method to enabline inline input mode. const builtInProcedureBlock = Blockly.Blocks['procedures_defreturn']; Blockly.Blocks['inline_procedures_defreturn'] = Object.assign( - {}, - builtInProcedureBlock, - { - init: function(this: Blockly.Block) { - builtInProcedureBlock.init.apply(this); - this.inputsInline = true; - this.getInput('RETURN')?.setAlign(Blockly.Input.Align.LEFT); - }, - } + {}, + builtInProcedureBlock, + { + init: function (this: Blockly.Block) { + builtInProcedureBlock.init.apply(this); + this.inputsInline = true; + this.getInput('RETURN')?.setAlign(Blockly.Input.Align.LEFT); + }, + }, ); diff --git a/plugins/renderer-inline-row-separators/src/inline_row_separators_renderer.ts b/plugins/renderer-inline-row-separators/src/inline_row_separators_renderer.ts index 2725471b2f..04cb253a3d 100644 --- a/plugins/renderer-inline-row-separators/src/inline_row_separators_renderer.ts +++ b/plugins/renderer-inline-row-separators/src/inline_row_separators_renderer.ts @@ -11,10 +11,12 @@ import * as Blockly from 'blockly/core'; /* eslint-disable @typescript-eslint/no-explicit-any */ -type RendererConstructor = new (...args: any[]) => - Blockly.blockRendering.Renderer; -type RenderInfoConstructor = new (...args: any[]) => - Blockly.blockRendering.RenderInfo; +type RendererConstructor = new ( + ...args: any[] +) => Blockly.blockRendering.Renderer; +type RenderInfoConstructor = new ( + ...args: any[] +) => Blockly.blockRendering.RenderInfo; /* eslint-enable @typescript-eslint/no-explicit-any */ /** @@ -29,10 +31,9 @@ type RenderInfoConstructor = new (...args: any[]) => * @returns The new renderer class. It's up to you to register it with Blockly. */ export function addInlineRowSeparators< - RendererBase extends RendererConstructor, - RenderInfoBase extends RenderInfoConstructor>( - rendererBase: RendererBase, - renderInfoBase: RenderInfoBase): RendererBase { + RendererBase extends RendererConstructor, + RenderInfoBase extends RenderInfoConstructor, +>(rendererBase: RendererBase, renderInfoBase: RenderInfoBase): RendererBase { /** * A subclass of the provided RenderInfo that renders all dummy inputs like * line breaks, forcing any following input to be rendered on a separate row, @@ -48,7 +49,9 @@ export function addInlineRowSeparators< * @returns True if the next input should be rendered on a new row. */ protected shouldStartNewRow_( - input: Blockly.Input, lastInput?: Blockly.Input): boolean { + input: Blockly.Input, + lastInput?: Blockly.Input, + ): boolean { /* eslint-enable @typescript-eslint/naming-convention */ if (lastInput?.type === Blockly.inputTypes.DUMMY) { return true; @@ -68,8 +71,7 @@ export function addInlineRowSeparators< * @param block The block to measure. * @returns The render info object. */ - protected makeRenderInfo_(block: Blockly.BlockSvg): - InlineRenderInfo { + protected makeRenderInfo_(block: Blockly.BlockSvg): InlineRenderInfo { /* eslint-enable @typescript-eslint/naming-convention */ return new InlineRenderInfo(this, block); } @@ -77,7 +79,11 @@ export function addInlineRowSeparators< } export const InlineRenderer = addInlineRowSeparators( - Blockly.thrasos.Renderer, Blockly.thrasos.RenderInfo); + Blockly.thrasos.Renderer, + Blockly.thrasos.RenderInfo, +); Blockly.blockRendering.register( - 'thrasos-inline-row-separators', InlineRenderer); + 'thrasos-inline-row-separators', + InlineRenderer, +); diff --git a/plugins/renderer-inline-row-separators/src/inline_text_join.ts b/plugins/renderer-inline-row-separators/src/inline_text_join.ts index 5820363fb5..4a299697ed 100644 --- a/plugins/renderer-inline-row-separators/src/inline_text_join.ts +++ b/plugins/renderer-inline-row-separators/src/inline_text_join.ts @@ -32,24 +32,22 @@ Blockly.defineBlocksWithJsonArray([ 'helpUrl': '%{BKY_TEXT_JOIN_HELPURL}', 'tooltip': '%{BKY_TEXT_JOIN_TOOLTIP}', 'mutator': 'text_join_mutator', - 'extensions': [ - 'inline_text_join_extension', - ], + 'extensions': ['inline_text_join_extension'], }, ]); // An extension that enables inline input mode and overrides the updateShape_ // method to insert dummy inputs between value inputs. -const inlineTextJoinExtension = function(this: TextJoinBlock) { +const inlineTextJoinExtension = function (this: TextJoinBlock) { this.inputsInline = true; - this.updateShape_ = function(this: TextJoinBlock) { + this.updateShape_ = function (this: TextJoinBlock) { if (this.itemCount_ && this.getInput('EMPTY')) { this.removeInput('EMPTY'); } else if (!this.itemCount_ && !this.getInput('EMPTY')) { this.appendDummyInput('EMPTY') - .appendField(this.newQuote_(true)) - .appendField(this.newQuote_(false)); + .appendField(this.newQuote_(true)) + .appendField(this.newQuote_(false)); } // Add new inputs. @@ -80,4 +78,6 @@ const inlineTextJoinExtension = function(this: TextJoinBlock) { }; Blockly.Extensions.register( - 'inline_text_join_extension', inlineTextJoinExtension); + 'inline_text_join_extension', + inlineTextJoinExtension, +); diff --git a/plugins/renderer-inline-row-separators/test/.mocharc.js b/plugins/renderer-inline-row-separators/test/.mocharc.js index 85ca3d1002..1fe22b180f 100644 --- a/plugins/renderer-inline-row-separators/test/.mocharc.js +++ b/plugins/renderer-inline-row-separators/test/.mocharc.js @@ -2,5 +2,5 @@ module.exports = { ui: 'tdd', - require: ['jsdom-global/register'] + require: ['jsdom-global/register'], }; diff --git a/plugins/renderer-inline-row-separators/test/index.html b/plugins/renderer-inline-row-separators/test/index.html index f84e951278..d5ebccc0ed 100644 --- a/plugins/renderer-inline-row-separators/test/index.html +++ b/plugins/renderer-inline-row-separators/test/index.html @@ -1,19 +1,18 @@ - + + + + Inline Row Separators Playground + + - - - Inline Row Separators Playground - - - - -
- - - + +
+ + diff --git a/plugins/renderer-inline-row-separators/test/index.ts b/plugins/renderer-inline-row-separators/test/index.ts index 1ae8c37dc6..8d6e31d8e0 100644 --- a/plugins/renderer-inline-row-separators/test/index.ts +++ b/plugins/renderer-inline-row-separators/test/index.ts @@ -95,12 +95,14 @@ const toolbox: Blockly.utils.toolbox.ToolboxDefinition = { * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { return Blockly.inject(blocklyDiv, options); } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, renderer: 'thrasos-inline-row-separators', diff --git a/plugins/renderer-inline-row-separators/test/inline_row_separators_test.mocha.js b/plugins/renderer-inline-row-separators/test/inline_row_separators_test.mocha.js index c7a056f905..9459ded0ed 100644 --- a/plugins/renderer-inline-row-separators/test/inline_row_separators_test.mocha.js +++ b/plugins/renderer-inline-row-separators/test/inline_row_separators_test.mocha.js @@ -8,17 +8,20 @@ require('../src/inline_row_separators_renderer'); const chai = require('chai'); const Blockly = require('blockly'); const jsdomGlobal = require('jsdom-global'); -const {addInlineRowSeparators, overrideOldBlockDefinitions} = - require('../src/index'); +const { + addInlineRowSeparators, + overrideOldBlockDefinitions, +} = require('../src/index'); overrideOldBlockDefinitions(); const assert = chai.assert; -suite('inlineRowSeparates', function() { - setup(function() { - this.jsdomCleanup = - jsdomGlobal('
'); +suite('inlineRowSeparates', function () { + setup(function () { + this.jsdomCleanup = jsdomGlobal( + '
', + ); this.workspace = Blockly.inject('blocklyDiv', { renderer: 'thrasos-inline-row-separators', }); @@ -37,39 +40,45 @@ suite('inlineRowSeparates', function() { ]); }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['test_block']; this.workspace.dispose(); this.jsdomCleanup(); }); - test('shouldStartNewRow_ returns true if last input is a dummy', function() { + test('shouldStartNewRow_ returns true if last input is a dummy', function () { const block = this.workspace.newBlock('test_block'); const renderInfo = this.renderer.makeRenderInfo_(block); // Test that a dummy after a value still remains on one row. assert.isFalse( - renderInfo.shouldStartNewRow_(block.inputList[1], block.inputList[0])); + renderInfo.shouldStartNewRow_(block.inputList[1], block.inputList[0]), + ); // Test that a value after a dummy is put on a new row. assert.isTrue( - renderInfo.shouldStartNewRow_(block.inputList[2], block.inputList[1])); + renderInfo.shouldStartNewRow_(block.inputList[2], block.inputList[1]), + ); }); - test('addInlineRowSeparators adds row separators to renderer', function() { + test('addInlineRowSeparators adds row separators to renderer', function () { const Renderer = addInlineRowSeparators( - Blockly.zelos.Renderer, Blockly.zelos.RenderInfo); + Blockly.zelos.Renderer, + Blockly.zelos.RenderInfo, + ); const block = this.workspace.newBlock('test_block'); const renderer = new Renderer('test_renderer'); renderer.init(this.workspace.getTheme()); const renderInfo = renderer.makeRenderInfo_(block); // Test that a dummy after a value still remains on one row. assert.isFalse( - renderInfo.shouldStartNewRow_(block.inputList[1], block.inputList[0])); + renderInfo.shouldStartNewRow_(block.inputList[1], block.inputList[0]), + ); // Test that a value after a dummy is put on a new row. assert.isTrue( - renderInfo.shouldStartNewRow_(block.inputList[2], block.inputList[1])); + renderInfo.shouldStartNewRow_(block.inputList[2], block.inputList[1]), + ); }); - test('inline_text_join is inline and inserts dummies', function() { + test('inline_text_join is inline and inserts dummies', function () { const block = this.workspace.newBlock('inline_text_join'); // Test that the alternative block inserts dummies between values. assert.isTrue(block.inputList[0].type === Blockly.inputTypes.DUMMY); @@ -80,7 +89,7 @@ suite('inlineRowSeparates', function() { assert.isTrue(block.inputsInline); }); - test('inline_lists_create_with is inline and inserts dummies', function() { + test('inline_lists_create_with is inline and inserts dummies', function () { const block = this.workspace.newBlock('inline_lists_create_with'); // Test that the alternative block inserts dummies between values. assert.isTrue(block.inputList[0].type === Blockly.inputTypes.DUMMY); @@ -93,18 +102,23 @@ suite('inlineRowSeparates', function() { assert.isTrue(block.inputsInline); }); - test('inline_procedures_defreturn is inline', function() { + test('inline_procedures_defreturn is inline', function () { const block = this.workspace.newBlock('inline_procedures_defreturn'); // Test that the alternative block's inputs are rendered in inline mode. assert.isTrue(block.inputsInline); }); - test('overrideOldBlockDefinitions replaces blocks', function() { - assert.isTrue(Blockly.Blocks['text_join'] === - Blockly.Blocks['inline_text_join']); - assert.isTrue(Blockly.Blocks['lists_create_with'] === - Blockly.Blocks['inline_lists_create_with']); - assert.isTrue(Blockly.Blocks['procedures_defreturn'] === - Blockly.Blocks['inline_procedures_defreturn']); + test('overrideOldBlockDefinitions replaces blocks', function () { + assert.isTrue( + Blockly.Blocks['text_join'] === Blockly.Blocks['inline_text_join'], + ); + assert.isTrue( + Blockly.Blocks['lists_create_with'] === + Blockly.Blocks['inline_lists_create_with'], + ); + assert.isTrue( + Blockly.Blocks['procedures_defreturn'] === + Blockly.Blocks['inline_procedures_defreturn'], + ); }); }); diff --git a/plugins/scroll-options/README.md b/plugins/scroll-options/README.md index a36737bcbd..a0eee4b783 100644 --- a/plugins/scroll-options/README.md +++ b/plugins/scroll-options/README.md @@ -5,10 +5,10 @@ scroll features. This plugin adds two features related to scrolling: -- Users can scroll the workspace with the mousewheel while dragging a block - ("wheel scroll"). -- The workspace will automatically scroll when a block is dragged near the - edge of the workspace ("edge scroll"). +- Users can scroll the workspace with the mousewheel while dragging a block + ("wheel scroll"). +- The workspace will automatically scroll when a block is dragged near the + edge of the workspace ("edge scroll"). Each of these options can be enabled or disabled independently, if you only want one of these behaviors. The edge scrolling behavior can also be configured with @@ -38,16 +38,20 @@ parameters for edge scrolling. ```js import * as Blockly from 'blockly'; -import {ScrollOptions, ScrollBlockDragger, ScrollMetricsManager} from '@blockly/plugin-scroll-options'; +import { + ScrollOptions, + ScrollBlockDragger, + ScrollMetricsManager, +} from '@blockly/plugin-scroll-options'; // Inject Blockly. const workspace = Blockly.inject('blocklyDiv', { toolbox: toolboxCategories, plugins: { - // These are both required. - 'blockDragger': ScrollBlockDragger, - 'metricsManager': ScrollMetricsManager, - }, + // These are both required. + 'blockDragger': ScrollBlockDragger, + 'metricsManager': ScrollMetricsManager, + }, move: { wheel: true, // Required for wheel scroll to work. }, @@ -81,9 +85,9 @@ The plugin is configured during initialization for convenience. It can also be configured, or reconfigured, at any time afterwards using the following methods on `ScrollOptions`: -- `enableWheelScroll`/`disableWheelScroll` -- `enableEdgeScroll`/`disableEdgeScroll` -- `updateEdgeScrollOptions` +- `enableWheelScroll`/`disableWheelScroll` +- `enableEdgeScroll`/`disableEdgeScroll` +- `updateEdgeScrollOptions` **IMPORTANT**: Currently, the options to configure the edge scroll behavior are provided statically due to the way a BlockDragger is initialized. Thus, each @@ -96,29 +100,29 @@ blocking issue for you, please file an issue on blockly-samples. The edge scroll options are provided in an object with the following properties (default values in parentheses): -- `slowBlockSpeed` (0.28), `fastBlockSpeed` (1.4): Pixels per ms to scroll - based on how far the block is from the edge of the viewport. -- `slowBlockStartDistance` (0): Distance in workspace units that the edge of - the block is from the edge of the viewport before the corresponding scroll - speed will be used. Can be negative to start scrolling before the block - extends over the edge. -- `fastBlockStartDistance` (50): Same as above, for fast speed. Must be larger - than `slowBlockStartDistance`. -- `oversizeBlockThreshold` (0.85): If a block takes up this percentage of the - viewport or more, it will be considered oversized. Rather than using the - block edge, we use the mouse cursor plus the given margin size to activate - block-based scrolling. -- `oversizeBlockMargin` (15): Cursor margin to use for oversized blocks. A - bigger value will cause the workspace to scroll sooner, i.e., the mouse can - be further inward from the edge when scrolling begins. -- `slowMouseSpeed` (0.5), `fastMouseSpeed` (1.6): Pixels per ms to scroll - based on how far the mouse is from the edge of the viewport. -- `slowMouseStartDistance` (0): Distance in workspace units that the mouse is - from the edge of the viewport before the corresponding scroll speed will be - used. Can be negative to start scrolling before the mouse extends over the - edge. -- `fastMouseStartDistance` (35): Same as above, for fast speed. Must be larger - than `slowMouseStartDistance`. +- `slowBlockSpeed` (0.28), `fastBlockSpeed` (1.4): Pixels per ms to scroll + based on how far the block is from the edge of the viewport. +- `slowBlockStartDistance` (0): Distance in workspace units that the edge of + the block is from the edge of the viewport before the corresponding scroll + speed will be used. Can be negative to start scrolling before the block + extends over the edge. +- `fastBlockStartDistance` (50): Same as above, for fast speed. Must be larger + than `slowBlockStartDistance`. +- `oversizeBlockThreshold` (0.85): If a block takes up this percentage of the + viewport or more, it will be considered oversized. Rather than using the + block edge, we use the mouse cursor plus the given margin size to activate + block-based scrolling. +- `oversizeBlockMargin` (15): Cursor margin to use for oversized blocks. A + bigger value will cause the workspace to scroll sooner, i.e., the mouse can + be further inward from the edge when scrolling begins. +- `slowMouseSpeed` (0.5), `fastMouseSpeed` (1.6): Pixels per ms to scroll + based on how far the mouse is from the edge of the viewport. +- `slowMouseStartDistance` (0): Distance in workspace units that the mouse is + from the edge of the viewport before the corresponding scroll speed will be + used. Can be negative to start scrolling before the mouse extends over the + edge. +- `fastMouseStartDistance` (35): Same as above, for fast speed. Must be larger + than `slowMouseStartDistance`. Each of these options is configured with the default value shown, which is specified in `ScrollBlockDragger.js`. When you call `updateEdgeScrollOptions`, diff --git a/plugins/scroll-options/package.json b/plugins/scroll-options/package.json index b57f1a91a0..987a81a7ef 100644 --- a/plugins/scroll-options/package.json +++ b/plugins/scroll-options/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/scroll-options/src/AutoScroll.js b/plugins/scroll-options/src/AutoScroll.js index 9d07205b57..e8e15a3b24 100644 --- a/plugins/scroll-options/src/AutoScroll.js +++ b/plugins/scroll-options/src/AutoScroll.js @@ -89,8 +89,9 @@ export class AutoScroll { this.scrollTick_(delta); } - this.animationFrameId_ = - requestAnimationFrame((time) => this.nextAnimationStep_(time)); + this.animationFrameId_ = requestAnimationFrame((time) => + this.nextAnimationStep_(time), + ); } } @@ -117,9 +118,9 @@ export class AutoScroll { // As we scroll, we shouldn't expand past the content area that existed // before the block was picked up. Therefore, we use cached ContentMetrics // so that the content area does not change as we scroll. - const metricsManager = - /** @type {ScrollMetricsManager} */ ( - this.workspace_.getMetricsManager()); + const metricsManager = /** @type {ScrollMetricsManager} */ ( + this.workspace_.getMetricsManager() + ); metricsManager.useCachedContentMetrics = true; const newX = this.workspace_.scrollX + scrollDx; const newY = this.workspace_.scrollY + scrollDy; @@ -136,8 +137,9 @@ export class AutoScroll { // The dragger will update its values so that things like connection // markers will stay consistent. if (deltaX || deltaY) { - this.workspace_.currentGesture_.getCurrentDragger() - .moveBlockWhileDragging(deltaX, deltaY); + this.workspace_.currentGesture_ + .getCurrentDragger() + .moveBlockWhileDragging(deltaX, deltaY); } } diff --git a/plugins/scroll-options/src/ScrollBlockDragger.js b/plugins/scroll-options/src/ScrollBlockDragger.js index 0fd0fb70f4..590066e07c 100644 --- a/plugins/scroll-options/src/ScrollBlockDragger.js +++ b/plugins/scroll-options/src/ScrollBlockDragger.js @@ -106,8 +106,10 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { this.scrollDelta_.y -= deltaY; // The total amount the block has moved since being picked up. - const totalDelta = - Blockly.utils.Coordinate.sum(this.scrollDelta_, this.dragDelta_); + const totalDelta = Blockly.utils.Coordinate.sum( + this.scrollDelta_, + this.dragDelta_, + ); const delta = this.pixelsToWorkspaceUnits_(totalDelta); const newLoc = Blockly.utils.Coordinate.sum(this.startXY_, delta); @@ -119,10 +121,12 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { // As we scroll, show the insertion markers. this.draggedConnectionManager_.update( - new Blockly.utils.Coordinate( - totalDelta.x / this.workspace_.scale, - totalDelta.y / this.workspace_.scale), - null); + new Blockly.utils.Coordinate( + totalDelta.x / this.workspace_.scale, + totalDelta.y / this.workspace_.scale, + ), + null, + ); } /** @@ -131,8 +135,10 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { * @override */ startDrag(currentDragDeltaXY, healStack) { - const totalDelta = - Blockly.utils.Coordinate.sum(this.scrollDelta_, currentDragDeltaXY); + const totalDelta = Blockly.utils.Coordinate.sum( + this.scrollDelta_, + currentDragDeltaXY, + ); super.startDrag(totalDelta, healStack); this.dragDelta_ = currentDragDeltaXY; } @@ -143,8 +149,10 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { * @override */ drag(e, currentDragDeltaXY) { - const totalDelta = - Blockly.utils.Coordinate.sum(this.scrollDelta_, currentDragDeltaXY); + const totalDelta = Blockly.utils.Coordinate.sum( + this.scrollDelta_, + currentDragDeltaXY, + ); super.drag(e, totalDelta); this.dragDelta_ = currentDragDeltaXY; @@ -169,11 +177,15 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { */ getNewLocationAfterDrag_(currentDragDeltaXY) { const newValues = {}; - const totalDelta = - Blockly.utils.Coordinate.sum(this.scrollDelta_, currentDragDeltaXY); + const totalDelta = Blockly.utils.Coordinate.sum( + this.scrollDelta_, + currentDragDeltaXY, + ); newValues.delta = this.pixelsToWorkspaceUnits_(totalDelta); - newValues.newLocation = - Blockly.utils.Coordinate.sum(this.startXY_, newValues.delta); + newValues.newLocation = Blockly.utils.Coordinate.sum( + this.startXY_, + newValues.delta, + ); return newValues; } @@ -204,7 +216,9 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { right: new Blockly.utils.Coordinate(-1, 0), }; const mouse = Blockly.utils.svgMath.screenToWsCoordinates( - this.workspace_, new Blockly.utils.Coordinate(e.clientX, e.clientY)); + this.workspace_, + new Blockly.utils.Coordinate(e.clientX, e.clientY), + ); /** * List of possible scrolls in each direction. This will be modified in @@ -221,8 +235,9 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { }; // Get ViewMetrics in workspace coordinates. - const viewMetrics = - this.workspace_.getMetricsManager().getViewMetrics(true); + const viewMetrics = this.workspace_ + .getMetricsManager() + .getViewMetrics(true); // Get possible scroll velocities based on the location of both the block // and the mouse. @@ -234,15 +249,19 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { // If the workspace should not be scrolled any longer, cancel the // autoscroll. - if (Blockly.utils.Coordinate.equals( - overallScrollVector, new Blockly.utils.Coordinate(0, 0))) { + if ( + Blockly.utils.Coordinate.equals( + overallScrollVector, + new Blockly.utils.Coordinate(0, 0), + ) + ) { this.stopAutoScrolling(); return; } // Update the autoscroll or start a new one. this.activeAutoScroll_ = - this.activeAutoScroll_ || new AutoScroll(this.workspace_); + this.activeAutoScroll_ || new AutoScroll(this.workspace_); this.activeAutoScroll_.updateProperties(overallScrollVector); } @@ -265,18 +284,22 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { getOverallScrollVector_(candidateScrolls) { let overallScrollVector = new Blockly.utils.Coordinate(0, 0); for (const direction of this.scrollDirections_) { - const fastestScroll = - candidateScrolls[direction].reduce((fastest, current) => { - if (!fastest) { - return current; - } - return Blockly.utils.Coordinate.magnitude(fastest) > - Blockly.utils.Coordinate.magnitude(current) ? - fastest : - current; - }, new Blockly.utils.Coordinate(0, 0)); // Initial value - overallScrollVector = - Blockly.utils.Coordinate.sum(overallScrollVector, fastestScroll); + const fastestScroll = candidateScrolls[direction].reduce( + (fastest, current) => { + if (!fastest) { + return current; + } + return Blockly.utils.Coordinate.magnitude(fastest) > + Blockly.utils.Coordinate.magnitude(current) + ? fastest + : current; + }, + new Blockly.utils.Coordinate(0, 0), + ); // Initial value + overallScrollVector = Blockly.utils.Coordinate.sum( + overallScrollVector, + fastestScroll, + ); } return overallScrollVector; } @@ -301,11 +324,12 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { const overflow = blockOverflows[direction]; if (overflow > ScrollBlockDragger.options.slowBlockStartDistance) { const speed = - overflow > ScrollBlockDragger.options.fastBlockStartDistance ? - ScrollBlockDragger.options.fastBlockSpeed : - ScrollBlockDragger.options.slowBlockSpeed; - const scrollVector = - this.SCROLL_DIRECTION_VECTORS_[direction].clone().scale(speed); + overflow > ScrollBlockDragger.options.fastBlockStartDistance + ? ScrollBlockDragger.options.fastBlockSpeed + : ScrollBlockDragger.options.slowBlockSpeed; + const scrollVector = this.SCROLL_DIRECTION_VECTORS_[direction] + .clone() + .scale(speed); candidateScrolls[direction].push(scrollVector); } } @@ -331,11 +355,12 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { const overflow = mouseOverflows[direction]; if (overflow > ScrollBlockDragger.options.slowMouseStartDistance) { const speed = - overflow > ScrollBlockDragger.options.fastMouseStartDistance ? - ScrollBlockDragger.options.fastMouseSpeed : - ScrollBlockDragger.options.slowMouseSpeed; - const scrollVector = - this.SCROLL_DIRECTION_VECTORS_[direction].clone().scale(speed); + overflow > ScrollBlockDragger.options.fastMouseStartDistance + ? ScrollBlockDragger.options.fastMouseSpeed + : ScrollBlockDragger.options.slowMouseSpeed; + const scrollVector = this.SCROLL_DIRECTION_VECTORS_[direction] + .clone() + .scale(speed); candidateScrolls[direction].push(scrollVector); } } @@ -355,7 +380,6 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { * overflow values. This calculation is done independently in both the * horizontal and vertical directions. These values can be configured in the * options for the plugin. - * * @param {!Blockly.MetricsManager.ContainerRegion} viewMetrics View metrics * for the workspace. * @param {!Blockly.utils.Coordinate} mouse Mouse coordinates. @@ -369,26 +393,34 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { // Handle large blocks. If the block is nearly as tall as the viewport, // use a margin around the cursor rather than the height of the block. const blockHeight = blockBounds.bottom - blockBounds.top; - if (blockHeight > viewMetrics.height * - ScrollBlockDragger.options.oversizeBlockThreshold) { + if ( + blockHeight > + viewMetrics.height * ScrollBlockDragger.options.oversizeBlockThreshold + ) { blockBounds.top = Math.max( - blockBounds.top, - mouse.y - ScrollBlockDragger.options.oversizeBlockMargin); + blockBounds.top, + mouse.y - ScrollBlockDragger.options.oversizeBlockMargin, + ); blockBounds.bottom = Math.min( - blockBounds.bottom, - mouse.y + ScrollBlockDragger.options.oversizeBlockMargin); + blockBounds.bottom, + mouse.y + ScrollBlockDragger.options.oversizeBlockMargin, + ); } // Same logic, but for block width. const blockWidth = blockBounds.right - blockBounds.left; - if (blockWidth > viewMetrics.width * - ScrollBlockDragger.options.oversizeBlockThreshold) { + if ( + blockWidth > + viewMetrics.width * ScrollBlockDragger.options.oversizeBlockThreshold + ) { blockBounds.left = Math.max( - blockBounds.left, - mouse.x - ScrollBlockDragger.options.oversizeBlockMargin); + blockBounds.left, + mouse.x - ScrollBlockDragger.options.oversizeBlockMargin, + ); blockBounds.right = Math.min( - blockBounds.right, - mouse.x + ScrollBlockDragger.options.oversizeBlockMargin); + blockBounds.right, + mouse.x + ScrollBlockDragger.options.oversizeBlockMargin, + ); } // The coordinate system is negative in the top and left directions, and @@ -410,7 +442,6 @@ export class ScrollBlockDragger extends Blockly.BlockDragger { * the given edge of the viewport. If the pointer is outside the viewport, * the value will be positive. If the pointer is inside the viewport, the * value will be negative. - * * @param {!Blockly.MetricsManager.ContainerRegion} viewMetrics View metrics * for the workspace. * @param {!Blockly.utils.Coordinate} mouse Mouse coordinates. @@ -477,16 +508,19 @@ ScrollBlockDragger.options = defaultOptions; * the available options. Any properties not present will use the existing * value. */ -ScrollBlockDragger.updateOptions = function(options) { +ScrollBlockDragger.updateOptions = function (options) { ScrollBlockDragger.options = {...ScrollBlockDragger.options, ...options}; }; /** * Resets the options object to the default options. */ -ScrollBlockDragger.resetOptions = function() { +ScrollBlockDragger.resetOptions = function () { ScrollBlockDragger.options = defaultOptions; }; -Blockly.registry.register(Blockly.registry.Type.BLOCK_DRAGGER, - 'ScrollBlockDragger', ScrollBlockDragger); +Blockly.registry.register( + Blockly.registry.Type.BLOCK_DRAGGER, + 'ScrollBlockDragger', + ScrollBlockDragger, +); diff --git a/plugins/scroll-options/src/index.js b/plugins/scroll-options/src/index.js index d4e43c8e40..629092d125 100644 --- a/plugins/scroll-options/src/index.js +++ b/plugins/scroll-options/src/index.js @@ -46,15 +46,17 @@ export class ScrollOptions { * `edgeScrollOptions` is an optional configuration for the edge scrolling * behavior. See `ScrollBlockDrager.updateOptions` for more details. */ - init({ - enableWheelScroll = true, - enableEdgeScroll = true, - edgeScrollOptions = null, - } = { - enableWheelScroll: true, - enableEdgeScroll: true, - edgeScrollOptions: null, - }) { + init( + { + enableWheelScroll = true, + enableEdgeScroll = true, + edgeScrollOptions = null, + } = { + enableWheelScroll: true, + enableEdgeScroll: true, + edgeScrollOptions: null, + }, + ) { if (enableWheelScroll) { this.enableWheelScroll(); } else { @@ -79,7 +81,11 @@ export class ScrollOptions { // TODO(blockly/#7157): We should maybe add an accessor for the svgGroup_? this.wheelEvent_ = Blockly.browserEvents.conditionalBind( - this.workspace_.svgGroup_, 'wheel', this, this.onMouseWheel_); + this.workspace_.svgGroup_, + 'wheel', + this, + this.onMouseWheel_, + ); } /** @@ -125,14 +131,18 @@ export class ScrollOptions { * @param {!Event} e Mouse wheel event. */ onMouseWheel_(e) { - const canWheelMove = this.workspace_.options.moveOptions && - this.workspace_.options.moveOptions.wheel; + const canWheelMove = + this.workspace_.options.moveOptions && + this.workspace_.options.moveOptions.wheel; const currentGesture = this.workspace_.getGesture(e); // Do not try to scroll if we are not dragging a block, or the workspace // does not allow moving by wheel. - if (!canWheelMove || !currentGesture || - !(currentGesture.getCurrentDragger() instanceof Blockly.BlockDragger)) { + if ( + !canWheelMove || + !currentGesture || + !(currentGesture.getCurrentDragger() instanceof Blockly.BlockDragger) + ) { return; } diff --git a/plugins/scroll-options/test/index.html b/plugins/scroll-options/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/scroll-options/test/index.html +++ b/plugins/scroll-options/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/scroll-options/test/index.js b/plugins/scroll-options/test/index.js index 9a762b139c..a446d2f5bc 100644 --- a/plugins/scroll-options/test/index.js +++ b/plugins/scroll-options/test/index.js @@ -11,8 +11,11 @@ import {createPlayground, toolboxCategories} from '@blockly/dev-tools'; import * as Blockly from 'blockly'; -/* eslint-disable-next-line max-len */ -import {ScrollBlockDragger, ScrollMetricsManager, ScrollOptions} from '../src/index'; +import { + ScrollBlockDragger, + ScrollMetricsManager, + ScrollOptions, +} from '../src/index'; /** * Create a workspace. @@ -31,7 +34,7 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, plugins: { @@ -44,5 +47,8 @@ document.addEventListener('DOMContentLoaded', function() { }, }; createPlayground( - document.getElementById('root'), createWorkspace, defaultOptions); + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/serialize-disabled-interactions/README.md b/plugins/serialize-disabled-interactions/README.md index 0dc4966bf1..5a3633cf46 100644 --- a/plugins/serialize-disabled-interactions/README.md +++ b/plugins/serialize-disabled-interactions/README.md @@ -14,7 +14,7 @@ attributes is now handled by core in versions of Blockly >= v9.3.0. If you had previously used this plugin to serialize workspaces, you should use v3.0 of the plugin. This version will deserialize the old saves, but it will no longer serialize the disabled properties (since that is now handled by core). -Once all of your saves have been "cleaned" you can safely remove your use of +Once all of your saves have been "cleaned" you can safely remove your use of this plugin. ### For Blockly versions < v9.3.0 diff --git a/plugins/serialize-disabled-interactions/package.json b/plugins/serialize-disabled-interactions/package.json index c60f8e2c79..c832de1244 100644 --- a/plugins/serialize-disabled-interactions/package.json +++ b/plugins/serialize-disabled-interactions/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" diff --git a/plugins/serialize-disabled-interactions/src/index.js b/plugins/serialize-disabled-interactions/src/index.js index a48e888b92..d10240c60c 100644 --- a/plugins/serialize-disabled-interactions/src/index.js +++ b/plugins/serialize-disabled-interactions/src/index.js @@ -12,7 +12,6 @@ import * as Blockly from 'blockly/core'; - /** * Defines the state type returned by this serializer. */ @@ -102,8 +101,10 @@ class DisabledInteractionsSerializer { * @param {!Blockly.Workspace} _workspace The workspace to clear the state * of. */ - clear(_workspace) { } + clear(_workspace) {} } Blockly.serialization.registry.register( - 'disabledInteractions', new DisabledInteractionsSerializer()); + 'disabledInteractions', + new DisabledInteractionsSerializer(), +); diff --git a/plugins/serialize-disabled-interactions/test/index.html b/plugins/serialize-disabled-interactions/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/serialize-disabled-interactions/test/index.html +++ b/plugins/serialize-disabled-interactions/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/serialize-disabled-interactions/test/index.js b/plugins/serialize-disabled-interactions/test/index.js index 73cb9c7c28..cb09608ce1 100644 --- a/plugins/serialize-disabled-interactions/test/index.js +++ b/plugins/serialize-disabled-interactions/test/index.js @@ -24,10 +24,13 @@ function createWorkspace(blocklyDiv, options) { return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/serialize-disabled-interactions/test/serializer_test.mocha.js b/plugins/serialize-disabled-interactions/test/serializer_test.mocha.js index 1a16f8bbfd..ec607cd075 100644 --- a/plugins/serialize-disabled-interactions/test/serializer_test.mocha.js +++ b/plugins/serialize-disabled-interactions/test/serializer_test.mocha.js @@ -14,114 +14,129 @@ const Blockly = require('blockly/node'); // Require for the side effect of registering. require('../src/index.js'); -suite('DisabledInteractionSerializer', function() { - setup(function() { +suite('DisabledInteractionSerializer', function () { + setup(function () { this.workspace = new Blockly.Workspace(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); }); - suite('Deserialization', function() { - test('None', function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'controls_if', - 'id': 'test_id', - }, - ], + suite('Deserialization', function () { + test('None', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ + { + 'type': 'controls_if', + 'id': 'test_id', + }, + ], + }, }, - }, this.workspace); + this.workspace, + ); const block = this.workspace.getTopBlocks()[0]; chai.assert.isTrue(block.isDeletable()); chai.assert.isTrue(block.isMovable()); chai.assert.isTrue(block.isEditable()); }); - test('Not deletable', function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'controls_if', - 'id': 'test_id', - }, - ], + test('Not deletable', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ + { + 'type': 'controls_if', + 'id': 'test_id', + }, + ], + }, + 'disabledInteractions': { + 'notDeletable': ['test_id'], + }, }, - 'disabledInteractions': { - 'notDeletable': ['test_id'], - }, - }, this.workspace); + this.workspace, + ); const block = this.workspace.getTopBlocks()[0]; chai.assert.isFalse(block.isDeletable()); chai.assert.isTrue(block.isMovable()); chai.assert.isTrue(block.isEditable()); }); - test('Not movable', function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'controls_if', - 'id': 'test_id', - }, - ], - }, - 'disabledInteractions': { - 'notMovable': ['test_id'], + test('Not movable', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ + { + 'type': 'controls_if', + 'id': 'test_id', + }, + ], + }, + 'disabledInteractions': { + 'notMovable': ['test_id'], + }, }, - }, this.workspace); + this.workspace, + ); const block = this.workspace.getTopBlocks()[0]; chai.assert.isTrue(block.isDeletable()); chai.assert.isFalse(block.isMovable()); chai.assert.isTrue(block.isEditable()); }); - test('Not editable', function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'controls_if', - 'id': 'test_id', - }, - ], + test('Not editable', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ + { + 'type': 'controls_if', + 'id': 'test_id', + }, + ], + }, + 'disabledInteractions': { + 'notEditable': ['test_id'], + }, }, - 'disabledInteractions': { - 'notEditable': ['test_id'], - }, - }, this.workspace); + this.workspace, + ); const block = this.workspace.getTopBlocks()[0]; chai.assert.isTrue(block.isDeletable()); chai.assert.isTrue(block.isMovable()); chai.assert.isFalse(block.isEditable()); }); - test('All', function() { - Blockly.serialization.workspaces.load({ - 'blocks': { - 'languageVersion': 0, - 'blocks': [ - { - 'type': 'controls_if', - 'id': 'test_id', - }, - ], - }, - 'disabledInteractions': { - 'notDeletable': ['test_id'], - 'notMovable': ['test_id'], - 'notEditable': ['test_id'], + test('All', function () { + Blockly.serialization.workspaces.load( + { + 'blocks': { + 'languageVersion': 0, + 'blocks': [ + { + 'type': 'controls_if', + 'id': 'test_id', + }, + ], + }, + 'disabledInteractions': { + 'notDeletable': ['test_id'], + 'notMovable': ['test_id'], + 'notEditable': ['test_id'], + }, }, - }, this.workspace); + this.workspace, + ); const block = this.workspace.getTopBlocks()[0]; chai.assert.isFalse(block.isDeletable()); chai.assert.isFalse(block.isMovable()); diff --git a/plugins/shadow-block-converter/README.md b/plugins/shadow-block-converter/README.md index 20562161b6..2361127c8a 100644 --- a/plugins/shadow-block-converter/README.md +++ b/plugins/shadow-block-converter/README.md @@ -5,16 +5,19 @@ A [Blockly](https://www.npmjs.com/package/blockly) plugin for automatically conv ## Installation ### Yarn + ``` yarn add @blockly/shadow-block-converter ``` ### npm + ``` npm install @blockly/shadow-block-converter --save ``` ## Usage + This plugin exports a function called `shadowBlockConversionChangeListener`. If you add it as a change listener to your blockly workspace then any shadow block the user edits will be converted to a real block. See below for an example using diff --git a/plugins/shadow-block-converter/package.json b/plugins/shadow-block-converter/package.json index 179d4bd3f4..a8d1e22829 100644 --- a/plugins/shadow-block-converter/package.json +++ b/plugins/shadow-block-converter/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -53,9 +53,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.0.0" } diff --git a/plugins/shadow-block-converter/src/shadow_block_converter.ts b/plugins/shadow-block-converter/src/shadow_block_converter.ts index 2db7d099d7..71e33b5f44 100644 --- a/plugins/shadow-block-converter/src/shadow_block_converter.ts +++ b/plugins/shadow-block-converter/src/shadow_block_converter.ts @@ -13,7 +13,6 @@ import {Block} from 'blockly/core/block'; import {Abstract} from 'blockly/core/events/events_abstract'; import {BlockChangeJson} from 'blockly/core/events/events_block_change'; - /** * A new blockly event class specifically for recording changes to the shadow * state of a block. This implementation is similar to and could be merged with @@ -73,14 +72,14 @@ export class BlockShadowChange extends Blockly.Events.BlockBase { * @override */ static fromJson( - json: BlockChangeJson, - workspace: Blockly.Workspace, - event?: any, + json: BlockChangeJson, + workspace: Blockly.Workspace, + event?: any, ): BlockShadowChange { const newEvent = super.fromJson( - json, - workspace, - event + json, + workspace, + event, ) as BlockShadowChange; newEvent.oldValue = json['oldValue']; newEvent.newValue = json['newValue']; @@ -105,14 +104,16 @@ export class BlockShadowChange extends Blockly.Events.BlockBase { const workspace = this.getEventWorkspace_(); if (!this.blockId) { throw new Error( - 'The block ID is undefined. Either pass a block to ' + - 'the constructor, or call fromJson'); + 'The block ID is undefined. Either pass a block to ' + + 'the constructor, or call fromJson', + ); } const block = workspace.getBlockById(this.blockId); if (!block) { throw new Error( - 'The associated block is undefined. Either pass a ' + - 'block to the constructor, or call fromJson'); + 'The associated block is undefined. Either pass a ' + + 'block to the constructor, or call fromJson', + ); } const value = forward ? this.newValue : this.oldValue; @@ -121,9 +122,10 @@ export class BlockShadowChange extends Blockly.Events.BlockBase { } Blockly.registry.register( - Blockly.registry.Type.EVENT, - BlockShadowChange.EVENT_TYPE, - BlockShadowChange); + Blockly.registry.Type.EVENT, + BlockShadowChange.EVENT_TYPE, + BlockShadowChange, +); /** * Add this function to your workspace as a change listener to automatically @@ -137,8 +139,7 @@ Blockly.registry.register( * * @param event An event broadcast by the workspace. */ -export function shadowBlockConversionChangeListener( - event: Abstract) { +export function shadowBlockConversionChangeListener(event: Abstract) { // Auto-converting shadow blocks to real blocks should happen in response to // new user action events (which get recorded as undo events) but not when // undoing or redoing events (which do not get recorded again). @@ -194,9 +195,9 @@ export function shadowBlockConversionChangeListener( // If connected blocks need to be converted too, add them to the list. const outputBlock: Block | null | undefined = - shadowBlock.outputConnection?.targetBlock(); + shadowBlock.outputConnection?.targetBlock(); const previousBlock: Block | null | undefined = - shadowBlock.previousConnection?.targetBlock(); + shadowBlock.previousConnection?.targetBlock(); if (outputBlock?.isShadow()) { shadowBlocks.push(outputBlock); } diff --git a/plugins/shadow-block-converter/test/index.html b/plugins/shadow-block-converter/test/index.html index 92ad49b18b..258a26e1b8 100644 --- a/plugins/shadow-block-converter/test/index.html +++ b/plugins/shadow-block-converter/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Shadow Block Converter Playground + + - - - Blockly Shadow Block Converter Playground - - - - -
- - - + +
+ + diff --git a/plugins/shadow-block-converter/test/index.ts b/plugins/shadow-block-converter/test/index.ts index f6afc76023..10bf55fd8c 100644 --- a/plugins/shadow-block-converter/test/index.ts +++ b/plugins/shadow-block-converter/test/index.ts @@ -117,14 +117,16 @@ const toolbox: Blockly.utils.toolbox.ToolboxDefinition = { * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); workspace.addChangeListener(shadowBlockConversionChangeListener); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions: Blockly.BlocklyOptions = { toolbox, }; diff --git a/plugins/shadow-block-converter/test/shadow_block_converter_test.mocha.js b/plugins/shadow-block-converter/test/shadow_block_converter_test.mocha.js index 3b01f8fbb0..567ffa909e 100644 --- a/plugins/shadow-block-converter/test/shadow_block_converter_test.mocha.js +++ b/plugins/shadow-block-converter/test/shadow_block_converter_test.mocha.js @@ -7,26 +7,28 @@ const chai = require('chai'); const sinon = require('sinon'); const Blockly = require('blockly'); -const {BlockShadowChange, shadowBlockConversionChangeListener} = - require('../src/index'); +const { + BlockShadowChange, + shadowBlockConversionChangeListener, +} = require('../src/index'); const assert = chai.assert; -suite('shadowBlockConversionChangeListener', function() { - setup(function() { +suite('shadowBlockConversionChangeListener', function () { + setup(function () { this.workspace = new Blockly.Workspace(); this.workspace.addChangeListener(shadowBlockConversionChangeListener); this.clock = sinon.useFakeTimers(); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); // Finish any remaining queued events then dispose the sinon environment. this.clock.runAll(); this.clock.restore(); }); - test('directly running shadow event changes shadow', function() { + test('directly running shadow event changes shadow', function () { const block = this.workspace.newBlock('text'); const event = new BlockShadowChange(block, false, true); event.run(true); @@ -35,7 +37,7 @@ suite('shadowBlockConversionChangeListener', function() { assert.isFalse(block.isShadow()); }); - test('responds to field change', function() { + test('responds to field change', function () { const block = this.workspace.newBlock('text'); block.setShadow(true); block.getField('TEXT').setValue('new value'); @@ -43,16 +45,21 @@ suite('shadowBlockConversionChangeListener', function() { assert.isFalse(block.isShadow()); }); - test('responds to block change event', function() { + test('responds to block change event', function () { const block = this.workspace.newBlock('text'); block.setShadow(true); const event = new Blockly.Events.BlockChange( - block, 'field', 'TEXT', 'old value', 'new value'); + block, + 'field', + 'TEXT', + 'old value', + 'new value', + ); this.workspace.fireChangeListener(event); assert.isFalse(block.isShadow()); }); - test('ignores block move event', function() { + test('ignores block move event', function () { const block = this.workspace.newBlock('text'); block.setShadow(true); const event = new Blockly.Events.BlockMove(block); @@ -60,7 +67,7 @@ suite('shadowBlockConversionChangeListener', function() { assert.isTrue(block.isShadow()); }); - test('undo shadow change', function() { + test('undo shadow change', function () { const block = this.workspace.newBlock('text'); block.setShadow(true); block.getField('TEXT').setValue('new value'); @@ -73,7 +80,7 @@ suite('shadowBlockConversionChangeListener', function() { assert.isTrue(block.isShadow()); }); - test('redo shadow change', function() { + test('redo shadow change', function () { const block = this.workspace.newBlock('text'); block.setShadow(true); block.getField('TEXT').setValue('new value'); @@ -87,11 +94,12 @@ suite('shadowBlockConversionChangeListener', function() { assert.isFalse(block.isShadow()); }); - test('shadow change follows output connection', function() { + test('shadow change follows output connection', function () { const statementBlock = this.workspace.newBlock('text_print'); const expressionBlock = this.workspace.newBlock('text'); statementBlock.inputList[0].connection.connect( - expressionBlock.outputConnection); + expressionBlock.outputConnection, + ); expressionBlock.setShadow(true); statementBlock.setShadow(true); expressionBlock.getField('TEXT').setValue('new value'); @@ -100,7 +108,7 @@ suite('shadowBlockConversionChangeListener', function() { assert.isFalse(statementBlock.isShadow()); }); - test('shadow change follows previous connection', function() { + test('shadow change follows previous connection', function () { const block1 = this.workspace.newBlock('controls_whileUntil'); const block2 = this.workspace.newBlock('controls_whileUntil'); block1.nextConnection.connect(block2.previousConnection); @@ -112,7 +120,7 @@ suite('shadowBlockConversionChangeListener', function() { assert.isFalse(block1.isShadow()); }); - test('parent blocks are reified before child blocks', function() { + test('parent blocks are reified before child blocks', function () { const block1 = this.workspace.newBlock('text_print'); const block2 = this.workspace.newBlock('text_print'); const block3 = this.workspace.newBlock('text_print'); @@ -127,8 +135,10 @@ suite('shadowBlockConversionChangeListener', function() { const reifiedBlocks = []; this.workspace.addChangeListener((event) => { - if (event.type === BlockShadowChange.EVENT_TYPE && - event.newValue == false) { + if ( + event.type === BlockShadowChange.EVENT_TYPE && + event.newValue == false + ) { reifiedBlocks.push(event.blockId); } }); @@ -140,7 +150,11 @@ suite('shadowBlockConversionChangeListener', function() { assert.isFalse(block2.isShadow()); assert.isFalse(block1.isShadow()); - assert.deepEqual( - reifiedBlocks, [block1.id, block2.id, block3.id, block4.id]); + assert.deepEqual(reifiedBlocks, [ + block1.id, + block2.id, + block3.id, + block4.id, + ]); }); }); diff --git a/plugins/strict-connection-checker/README.md b/plugins/strict-connection-checker/README.md index 3ffd5cd124..9c3e304b1f 100644 --- a/plugins/strict-connection-checker/README.md +++ b/plugins/strict-connection-checker/README.md @@ -7,11 +7,13 @@ This checker still expects nullable arrays of string for connection type checks, ## Installation ### Yarn + ``` yarn add @blockly/plugin-strict-connection-checker ``` ### npm + ``` npm install @blockly/plugin-strict-connection-checker --save ``` @@ -28,8 +30,8 @@ import {pluginInfo as StrictConnectionsPluginInfo} from '@blockly/plugin-strict- const workspace = Blockly.inject('blocklyDiv', { toolbox: toolboxCategories, plugins: { - ...StrictConnectionsPluginInfo, - }, + ...StrictConnectionsPluginInfo, + }, }); ``` @@ -40,4 +42,5 @@ Note that this uses the [spread operator](https://developer.mozilla.org/en-US/do This plugin exports a class, `StrictConnectionChecker`, and registers it as a connection checker with Blockly. You should not need to instantiate it directly. ## License + Apache 2.0 diff --git a/plugins/strict-connection-checker/package.json b/plugins/strict-connection-checker/package.json index d00297d052..999efce413 100644 --- a/plugins/strict-connection-checker/package.json +++ b/plugins/strict-connection-checker/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -52,9 +52,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/strict-connection-checker/src/index.js b/plugins/strict-connection-checker/src/index.js index aa87b4b75f..098865f8ba 100644 --- a/plugins/strict-connection-checker/src/index.js +++ b/plugins/strict-connection-checker/src/index.js @@ -56,9 +56,11 @@ export const registrationName = 'StrictConnectionChecker'; // Register the checker so that it can be used by name. Blockly.registry.register( - registrationType, registrationName, StrictConnectionChecker); + registrationType, + registrationName, + StrictConnectionChecker, +); export const pluginInfo = { [registrationType]: registrationName, }; - diff --git a/plugins/strict-connection-checker/test/checker_test.mocha.js b/plugins/strict-connection-checker/test/checker_test.mocha.js index da615a731d..6c71e220ba 100644 --- a/plugins/strict-connection-checker/test/checker_test.mocha.js +++ b/plugins/strict-connection-checker/test/checker_test.mocha.js @@ -14,10 +14,10 @@ const chai = require('chai'); const Blockly = require('blockly/node'); const StrictConnectionChecker = - require('../src/index.js').StrictConnectionChecker; + require('../src/index.js').StrictConnectionChecker; -suite('StrictConnectionChecker', function() { - suiteSetup(function() { +suite('StrictConnectionChecker', function () { + suiteSetup(function () { this.checker = new StrictConnectionChecker(); }); /** @@ -29,12 +29,12 @@ suite('StrictConnectionChecker', function() { */ function makeBlock(isShadow) { return { - isShadow: function() { + isShadow: function () { return isShadow; }, }; } - suite('Safety checks', function() { + suite('Safety checks', function () { /** * Assert that the given connections pass or fail safety checks for the * given reason, and in both orders. @@ -51,39 +51,46 @@ suite('StrictConnectionChecker', function() { chai.assert.equal(checker.canConnectWithReason(two, one), reason); } - test('Target Null', function() { + test('Target Null', function () { const connection = new Blockly.Connection({}, Blockly.INPUT_VALUE); assertReasonHelper( - this.checker, - connection, - null, - Blockly.Connection.REASON_TARGET_NULL); + this.checker, + connection, + null, + Blockly.Connection.REASON_TARGET_NULL, + ); }); - test('Target Self', function() { + test('Target Self', function () { const block = {workspace: 1}; const connection1 = new Blockly.Connection(block, Blockly.INPUT_VALUE); const connection2 = new Blockly.Connection(block, Blockly.OUTPUT_VALUE); assertReasonHelper( - this.checker, - connection1, - connection2, - Blockly.Connection.REASON_SELF_CONNECTION); + this.checker, + connection1, + connection2, + Blockly.Connection.REASON_SELF_CONNECTION, + ); }); - test('Different Workspaces', function() { + test('Different Workspaces', function () { const connection1 = new Blockly.Connection( - {workspace: 1}, Blockly.INPUT_VALUE); + {workspace: 1}, + Blockly.INPUT_VALUE, + ); const connection2 = new Blockly.Connection( - {workspace: 2}, Blockly.OUTPUT_VALUE); + {workspace: 2}, + Blockly.OUTPUT_VALUE, + ); assertReasonHelper( - this.checker, - connection1, - connection2, - Blockly.Connection.REASON_DIFFERENT_WORKSPACES); + this.checker, + connection1, + connection2, + Blockly.Connection.REASON_DIFFERENT_WORKSPACES, + ); }); - suite('Types', function() { - setup(function() { + suite('Types', function () { + setup(function () { // We have to declare each separately so that the connections belong // on different blocks. const prevBlock = makeBlock(false); @@ -91,180 +98,202 @@ suite('StrictConnectionChecker', function() { const outBlock = makeBlock(false); const inBlock = makeBlock(false); this.previous = new Blockly.Connection( - prevBlock, Blockly.PREVIOUS_STATEMENT); - this.next = new Blockly.Connection( - nextBlock, Blockly.NEXT_STATEMENT); - this.output = new Blockly.Connection( - outBlock, Blockly.OUTPUT_VALUE); - this.input = new Blockly.Connection( - inBlock, Blockly.INPUT_VALUE); + prevBlock, + Blockly.PREVIOUS_STATEMENT, + ); + this.next = new Blockly.Connection(nextBlock, Blockly.NEXT_STATEMENT); + this.output = new Blockly.Connection(outBlock, Blockly.OUTPUT_VALUE); + this.input = new Blockly.Connection(inBlock, Blockly.INPUT_VALUE); }); - test('Previous, Next', function() { + test('Previous, Next', function () { assertReasonHelper( - this.checker, - this.previous, - this.next, - Blockly.Connection.CAN_CONNECT); + this.checker, + this.previous, + this.next, + Blockly.Connection.CAN_CONNECT, + ); }); - test('Previous, Output', function() { + test('Previous, Output', function () { assertReasonHelper( - this.checker, - this.previous, - this.output, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.previous, + this.output, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Previous, Input', function() { + test('Previous, Input', function () { assertReasonHelper( - this.checker, - this.previous, - this.input, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.previous, + this.input, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Next, Previous', function() { + test('Next, Previous', function () { assertReasonHelper( - this.checker, - this.next, - this.previous, - Blockly.Connection.CAN_CONNECT); + this.checker, + this.next, + this.previous, + Blockly.Connection.CAN_CONNECT, + ); }); - test('Next, Output', function() { + test('Next, Output', function () { assertReasonHelper( - this.checker, - this.next, - this.output, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.next, + this.output, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Next, Input', function() { + test('Next, Input', function () { assertReasonHelper( - this.checker, - this.next, - this.input, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.next, + this.input, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Output, Previous', function() { + test('Output, Previous', function () { assertReasonHelper( - this.checker, - this.previous, - this.output, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.previous, + this.output, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Output, Next', function() { + test('Output, Next', function () { assertReasonHelper( - this.checker, - this.output, - this.next, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.output, + this.next, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Output, Input', function() { + test('Output, Input', function () { assertReasonHelper( - this.checker, - this.output, - this.input, - Blockly.Connection.CAN_CONNECT); + this.checker, + this.output, + this.input, + Blockly.Connection.CAN_CONNECT, + ); }); - test('Input, Previous', function() { + test('Input, Previous', function () { assertReasonHelper( - this.checker, - this.previous, - this.input, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.previous, + this.input, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Input, Next', function() { + test('Input, Next', function () { assertReasonHelper( - this.checker, - this.input, - this.next, - Blockly.Connection.REASON_WRONG_TYPE); + this.checker, + this.input, + this.next, + Blockly.Connection.REASON_WRONG_TYPE, + ); }); - test('Input, Output', function() { + test('Input, Output', function () { assertReasonHelper( - this.checker, - this.input, - this.output, - Blockly.Connection.CAN_CONNECT); + this.checker, + this.input, + this.output, + Blockly.Connection.CAN_CONNECT, + ); }); }); - suite('Shadows', function() { - test('Previous Shadow', function() { + suite('Shadows', function () { + test('Previous Shadow', function () { const prevBlock = makeBlock(true); const nextBlock = makeBlock(false); - const prev = new Blockly.Connection(prevBlock, - Blockly.PREVIOUS_STATEMENT); - const next = new Blockly.Connection(nextBlock, - Blockly.NEXT_STATEMENT); + const prev = new Blockly.Connection( + prevBlock, + Blockly.PREVIOUS_STATEMENT, + ); + const next = new Blockly.Connection(nextBlock, Blockly.NEXT_STATEMENT); assertReasonHelper( - this.checker, - prev, - next, - Blockly.Connection.CAN_CONNECT); + this.checker, + prev, + next, + Blockly.Connection.CAN_CONNECT, + ); }); - test('Next Shadow', function() { + test('Next Shadow', function () { const prevBlock = makeBlock(false); const nextBlock = makeBlock(true); - const prev = new Blockly.Connection(prevBlock, - Blockly.PREVIOUS_STATEMENT); + const prev = new Blockly.Connection( + prevBlock, + Blockly.PREVIOUS_STATEMENT, + ); const next = new Blockly.Connection(nextBlock, Blockly.NEXT_STATEMENT); assertReasonHelper( - this.checker, - prev, - next, - Blockly.Connection.REASON_SHADOW_PARENT); + this.checker, + prev, + next, + Blockly.Connection.REASON_SHADOW_PARENT, + ); }); - test('Prev and Next Shadow', function() { + test('Prev and Next Shadow', function () { const prevBlock = makeBlock(true); const nextBlock = makeBlock(true); - const prev = new Blockly.Connection(prevBlock, - Blockly.PREVIOUS_STATEMENT); + const prev = new Blockly.Connection( + prevBlock, + Blockly.PREVIOUS_STATEMENT, + ); const next = new Blockly.Connection(nextBlock, Blockly.NEXT_STATEMENT); assertReasonHelper( - this.checker, - prev, - next, - Blockly.Connection.CAN_CONNECT); + this.checker, + prev, + next, + Blockly.Connection.CAN_CONNECT, + ); }); - test('Output Shadow', function() { + test('Output Shadow', function () { const outBlock = makeBlock(true); const inBlock = makeBlock(false); const outCon = new Blockly.Connection(outBlock, Blockly.OUTPUT_VALUE); const inCon = new Blockly.Connection(inBlock, Blockly.INPUT_VALUE); assertReasonHelper( - this.checker, - outCon, - inCon, - Blockly.Connection.CAN_CONNECT); + this.checker, + outCon, + inCon, + Blockly.Connection.CAN_CONNECT, + ); }); - test('Input Shadow', function() { + test('Input Shadow', function () { const outBlock = makeBlock(false); const inBlock = makeBlock(true); const outCon = new Blockly.Connection(outBlock, Blockly.OUTPUT_VALUE); const inCon = new Blockly.Connection(inBlock, Blockly.INPUT_VALUE); assertReasonHelper( - this.checker, - outCon, - inCon, - Blockly.Connection.REASON_SHADOW_PARENT); + this.checker, + outCon, + inCon, + Blockly.Connection.REASON_SHADOW_PARENT, + ); }); - test('Output and Input Shadow', function() { + test('Output and Input Shadow', function () { const outBlock = makeBlock(true); const inBlock = makeBlock(true); const outCon = new Blockly.Connection(outBlock, Blockly.OUTPUT_VALUE); const inCon = new Blockly.Connection(inBlock, Blockly.INPUT_VALUE); assertReasonHelper( - this.checker, - outCon, - inCon, - Blockly.Connection.CAN_CONNECT); + this.checker, + outCon, + inCon, + Blockly.Connection.CAN_CONNECT, + ); }); }); }); - suite('Check Types', function() { - setup(function() { + suite('Check Types', function () { + setup(function () { this.con1 = new Blockly.Connection({}, Blockly.PREVIOUS_STATEMENT); this.con2 = new Blockly.Connection({}, Blockly.NEXT_STATEMENT); }); @@ -281,30 +310,30 @@ suite('StrictConnectionChecker', function() { // Order should not matter. chai.assert.isTrue(checker.doTypeChecks(one, two)); } - test('No Types', function() { + test('No Types', function () { assertCheckTypes(this.checker, this.con1, this.con2); }); - test('Same Type', function() { + test('Same Type', function () { this.con1.setCheck('type1'); this.con2.setCheck('type1'); assertCheckTypes(this.checker, this.con1, this.con2); }); - test('Same Types', function() { + test('Same Types', function () { this.con1.setCheck(['type1', 'type2']); this.con2.setCheck(['type1', 'type2']); assertCheckTypes(this.checker, this.con1, this.con2); }); - test('Single Same Type', function() { + test('Single Same Type', function () { this.con1.setCheck(['type1', 'type2']); this.con2.setCheck(['type1', 'type3']); assertCheckTypes(this.checker, this.con1, this.con2); }); - test('One Typed, One Null', function() { + test('One Typed, One Null', function () { this.con1.setCheck('type1'); // This is the only difference between this and the base checker. chai.assert.isFalse(this.checker.doTypeChecks(this.con1, this.con2)); }); - test('No Compatible Types', function() { + test('No Compatible Types', function () { this.con1.setCheck('type1'); this.con2.setCheck('type2'); chai.assert.isFalse(this.checker.doTypeChecks(this.con1, this.con2)); diff --git a/plugins/strict-connection-checker/test/index.html b/plugins/strict-connection-checker/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/strict-connection-checker/test/index.html +++ b/plugins/strict-connection-checker/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/strict-connection-checker/test/index.js b/plugins/strict-connection-checker/test/index.js index 95f69c3b85..0f253711dd 100644 --- a/plugins/strict-connection-checker/test/index.js +++ b/plugins/strict-connection-checker/test/index.js @@ -23,13 +23,16 @@ function createWorkspace(blocklyDiv, options) { return Blockly.inject(blocklyDiv, options); } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, plugins: { ...StrictTypesPluginInfo, }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/suggested-blocks/README.md b/plugins/suggested-blocks/README.md index 27a541f27a..e68a8a1d82 100644 --- a/plugins/suggested-blocks/README.md +++ b/plugins/suggested-blocks/README.md @@ -5,27 +5,32 @@ A [Blockly](https://www.npmjs.com/package/blockly) plugin that suggests blocks f ## Installation ### Yarn + ``` yarn add @blockly/suggested-blocks ``` ### npm + ``` npm install @blockly/suggested-blocks --save ``` ## Usage + ```js import * as Blockly from 'blockly'; import * as SuggestedBlocks from '@blockly/suggested-blocks'; const toolbox = { - "kind": "categoryToolbox", - "contents": [ + 'kind': 'categoryToolbox', + 'contents': [ { - "kind": "category", - "name": "My Category", - "contents": [ /* your category contents */ ] + 'kind': 'category', + 'name': 'My Category', + 'contents': [ + /* your category contents */ + ], }, { 'kind': 'category', @@ -39,10 +44,9 @@ const toolbox = { 'custom': 'RECENTLY_USED', 'categorystyle': 'recently_used_category', }, - ] + ], }; - // Inject Blockly. const workspace = Blockly.inject('blocklyDiv', { toolbox: toolbox, @@ -51,6 +55,7 @@ const workspace = Blockly.inject('blocklyDiv', { // Initialize the plugin SuggestedBlocks.init(workspace); ``` + ## API - `init`: Initializes the suggested blocks categories in the toolbox. Takes several arguments: @@ -68,4 +73,5 @@ SuggestedBlocks.init(workspace); serialized state do not affect the statistics. ## License + Apache 2.0 diff --git a/plugins/suggested-blocks/package.json b/plugins/suggested-blocks/package.json index 3f713757d9..41fb971bcf 100644 --- a/plugins/suggested-blocks/package.json +++ b/plugins/suggested-blocks/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -53,9 +53,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/suggested-blocks/src/index.js b/plugins/suggested-blocks/src/index.js index da8c2bc82d..16d90539cd 100644 --- a/plugins/suggested-blocks/src/index.js +++ b/plugins/suggested-blocks/src/index.js @@ -59,7 +59,7 @@ export class BlockSuggestor { * Includes a secondary sort by most recent blocks. * @returns {!Array}A list of block JSON */ - getMostUsed = function() { + getMostUsed = function () { // Store the frequency of each block, as well as the index first appears at. const countMap = new Map(); const recencyMap = new Map(); @@ -76,8 +76,12 @@ export class BlockSuggestor { freqUsedBlockTypes.push(key); } // Use recency as a tiebreak. - freqUsedBlockTypes.sort((a, b) => countMap.get(b) - countMap.get(a) + - 0.01 * (recencyMap.get(a) - recencyMap.get(b))); + freqUsedBlockTypes.sort( + (a, b) => + countMap.get(b) - + countMap.get(a) + + 0.01 * (recencyMap.get(a) - recencyMap.get(b)), + ); return this.generateBlockData(freqUsedBlockTypes); }; @@ -86,7 +90,7 @@ export class BlockSuggestor { * Generates a list of the 10 most recently used blocks. * @returns {Array } A list of block JSON objects */ - getRecentlyUsed = function() { + getRecentlyUsed = function () { const uniqueRecentBlocks = [...new Set(this.recentlyUsedBlocks)]; const recencyMap = new Map(); for (const [index, key] of this.recentlyUsedBlocks.entries()) { @@ -96,23 +100,24 @@ export class BlockSuggestor { } uniqueRecentBlocks.sort((a, b) => recencyMap[a] - recencyMap[b]); return this.generateBlockData(uniqueRecentBlocks); - } + }; /** * Converts a list of block types to a full-fledge list of block data. * @param {Array} blockTypeList the list of block types * @returns {Array} the block data list */ - generateBlockData = function(blockTypeList) { - const blockList = blockTypeList.slice(0, this.numBlocksPerCategory).map( - (key) => { - const json = (this.defaultJsonForBlockLookup[key] || {}); - json['kind'] = 'BLOCK'; - json['type'] = key; - json['x'] = null; - json['y'] = null; - return json; - }); + generateBlockData = function (blockTypeList) { + const blockList = blockTypeList + .slice(0, this.numBlocksPerCategory) + .map((key) => { + const json = this.defaultJsonForBlockLookup[key] || {}; + json['kind'] = 'BLOCK'; + json['type'] = key; + json['x'] = null; + json['y'] = null; + return json; + }); if (blockList.length == 0) { blockList.push({ @@ -121,7 +126,7 @@ export class BlockSuggestor { }); } return blockList; - } + }; /** * Loads the state of this object from a serialized JSON. @@ -160,8 +165,10 @@ export class BlockSuggestor { this.workspaceHasFinishedLoading = true; return; } - if (e.type == Blockly.Events.BLOCK_CREATE && - this.workspaceHasFinishedLoading) { + if ( + e.type == Blockly.Events.BLOCK_CREATE && + this.workspaceHasFinishedLoading + ) { const newBlockType = e.json.type; // If this is the first time creating this block, store its default // configuration so we know how exactly to render it in the toolbox. @@ -182,12 +189,17 @@ export class BlockSuggestor { * FINISHED_LOADING event before responding to BLOCK_CREATE events. Set to false * if you disable events during initial load. Defaults to true. */ -export const init = function( - workspace, numBlocksPerCategory = 10, waitForFinishedLoading = true) { +export const init = function ( + workspace, + numBlocksPerCategory = 10, + waitForFinishedLoading = true, +) { const suggestor = new BlockSuggestor(numBlocksPerCategory); workspace.registerToolboxCategoryCallback('MOST_USED', suggestor.getMostUsed); - workspace.registerToolboxCategoryCallback('RECENTLY_USED', - suggestor.getRecentlyUsed); + workspace.registerToolboxCategoryCallback( + 'RECENTLY_USED', + suggestor.getRecentlyUsed, + ); // If user says not to wait to hear FINISHED_LOADING event, // then always respond to BLOCK_CREATE events. if (!waitForFinishedLoading) suggestor.workspaceHasFinishedLoading = true; @@ -239,5 +251,6 @@ class BlockSuggestorSerializer { } Blockly.serialization.registry.register( - 'suggested-blocks', // Name - new BlockSuggestorSerializer()); + 'suggested-blocks', // Name + new BlockSuggestorSerializer(), +); diff --git a/plugins/suggested-blocks/test/index.html b/plugins/suggested-blocks/test/index.html index 1e9c077c1e..6049a25d4a 100644 --- a/plugins/suggested-blocks/test/index.html +++ b/plugins/suggested-blocks/test/index.html @@ -1,19 +1,18 @@ - + + + + Suggested Blocks Plugin Test + + - - - Suggested Blocks Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/suggested-blocks/test/index.js b/plugins/suggested-blocks/test/index.js index 7743ed55b3..166c9d9e93 100644 --- a/plugins/suggested-blocks/test/index.js +++ b/plugins/suggested-blocks/test/index.js @@ -37,7 +37,7 @@ const customTheme = Blockly.Theme.defineTheme('classic_with_suggestions', { 'startHats': null, }); -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { // Insert two new categories toolboxCategories['contents'].push({ 'kind': 'category', @@ -55,6 +55,9 @@ document.addEventListener('DOMContentLoaded', function() { toolbox: toolboxCategories, theme: customTheme, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/suggested-blocks/test/suggested_blocks.mocha.js b/plugins/suggested-blocks/test/suggested_blocks.mocha.js index 6838179cb4..17d9fe4f6a 100644 --- a/plugins/suggested-blocks/test/suggested_blocks.mocha.js +++ b/plugins/suggested-blocks/test/suggested_blocks.mocha.js @@ -126,8 +126,7 @@ const FREQUENCY_TIEBREAK_TEST_CASE = { ], }; - -suite('Suggested blocks', function() { +suite('Suggested blocks', function () { /** * Asserts that the list of blocks matches the expected list. * @param {Array } blockList list of block JSON objects @@ -148,11 +147,12 @@ suite('Suggested blocks', function() { clock.tick(10); }; - setup(function() { + setup(function () { // Create a workspace and integrate with the suggested blocks plugin this.workspace = new Blockly.Workspace(); this.suggestor = new SuggestedBlocks.BlockSuggestor( - /* numBlocksPerCategory= */ 10); + /* numBlocksPerCategory= */ 10, + ); this.workspace.addChangeListener(this.suggestor.eventListener); this.workspace.fireChangeListener({type: Blockly.Events.FINISHED_LOADING}); @@ -163,7 +163,7 @@ suite('Suggested blocks', function() { } }); - test('No blocks, shows label', function() { + test('No blocks, shows label', function () { // (No setup code needed because no blocks created) const mostUsed = this.suggestor.getMostUsed(); @@ -175,54 +175,68 @@ suite('Suggested blocks', function() { assert.equal(recentlyUsed[0].kind, 'LABEL'); }); - test('Standard case, most used', function() { + test('Standard case, most used', function () { simulateTestCase(STANDARD_TEST_CASE, this.workspace, this.clock); - assertSuggestedListEquals(this.suggestor.getMostUsed(), - STANDARD_TEST_CASE.expectedFrequentBlocks); + assertSuggestedListEquals( + this.suggestor.getMostUsed(), + STANDARD_TEST_CASE.expectedFrequentBlocks, + ); }); - test('Standard case, recently used', function() { + test('Standard case, recently used', function () { simulateTestCase(STANDARD_TEST_CASE, this.workspace, this.clock); - assertSuggestedListEquals(this.suggestor.getRecentlyUsed(), - STANDARD_TEST_CASE.expectedRecentBlocks); + assertSuggestedListEquals( + this.suggestor.getRecentlyUsed(), + STANDARD_TEST_CASE.expectedRecentBlocks, + ); }); - test('Many blocks case, most used', function() { + test('Many blocks case, most used', function () { simulateTestCase(MANY_UNIQUE_BLOCKS_TEST_CASE, this.workspace, this.clock); - assertSuggestedListEquals(this.suggestor.getMostUsed(), - MANY_UNIQUE_BLOCKS_TEST_CASE.expectedFrequentBlocks); + assertSuggestedListEquals( + this.suggestor.getMostUsed(), + MANY_UNIQUE_BLOCKS_TEST_CASE.expectedFrequentBlocks, + ); }); - test('Many blocks case, recently used', function() { + test('Many blocks case, recently used', function () { simulateTestCase(MANY_UNIQUE_BLOCKS_TEST_CASE, this.workspace, this.clock); - assertSuggestedListEquals(this.suggestor.getRecentlyUsed(), - MANY_UNIQUE_BLOCKS_TEST_CASE.expectedRecentBlocks); + assertSuggestedListEquals( + this.suggestor.getRecentlyUsed(), + MANY_UNIQUE_BLOCKS_TEST_CASE.expectedRecentBlocks, + ); }); - test('Frequency tiebreak case, most used', function() { + test('Frequency tiebreak case, most used', function () { simulateTestCase(FREQUENCY_TIEBREAK_TEST_CASE, this.workspace, this.clock); - assertSuggestedListEquals(this.suggestor.getMostUsed(), - FREQUENCY_TIEBREAK_TEST_CASE.expectedFrequentBlocks); + assertSuggestedListEquals( + this.suggestor.getMostUsed(), + FREQUENCY_TIEBREAK_TEST_CASE.expectedFrequentBlocks, + ); }); - test('Frequency tiebreak case, recently used', function() { + test('Frequency tiebreak case, recently used', function () { simulateTestCase(FREQUENCY_TIEBREAK_TEST_CASE, this.workspace, this.clock); - assertSuggestedListEquals(this.suggestor.getRecentlyUsed(), - FREQUENCY_TIEBREAK_TEST_CASE.expectedRecentBlocks); + assertSuggestedListEquals( + this.suggestor.getRecentlyUsed(), + FREQUENCY_TIEBREAK_TEST_CASE.expectedRecentBlocks, + ); }); - test('Can serialize/de-serialize', function() { + test('Can serialize/de-serialize', function () { simulateTestCase(STANDARD_TEST_CASE, this.workspace, this.clock); const serializedData = this.suggestor.saveToSerializedData(); this.suggestor.clearPriorBlockData(); this.suggestor.loadFromSerializedData(serializedData); - assertSuggestedListEquals(this.suggestor.getMostUsed(), - STANDARD_TEST_CASE.expectedFrequentBlocks); + assertSuggestedListEquals( + this.suggestor.getMostUsed(), + STANDARD_TEST_CASE.expectedFrequentBlocks, + ); }); - teardown(function() { + teardown(function () { this.workspace.dispose(); this.suggestor = null; }); diff --git a/plugins/theme-dark/README.md b/plugins/theme-dark/README.md index 62827893b6..e3b9b1722e 100644 --- a/plugins/theme-dark/README.md +++ b/plugins/theme-dark/README.md @@ -7,11 +7,13 @@ A [Blockly](https://www.npmjs.com/package/blockly) dark theme. ## Installation ### Yarn + ``` yarn add @blockly/theme-dark ``` ### npm + ``` npm install @blockly/theme-dark --save ``` @@ -25,8 +27,8 @@ import DarkTheme from '@blockly/theme-dark'; Blockly.inject('blocklyDiv', { theme: DarkTheme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/theme-dark/package.json b/plugins/theme-dark/package.json index 1b9cb12b96..d805449022 100644 --- a/plugins/theme-dark/package.json +++ b/plugins/theme-dark/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/theme-dark/test/index.html b/plugins/theme-dark/test/index.html index 01ca0565af..92f64001ae 100644 --- a/plugins/theme-dark/test/index.html +++ b/plugins/theme-dark/test/index.html @@ -1,29 +1,26 @@ - + + + + Blockly Dark Theme Test + + - - - Blockly Dark Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/theme-dark/test/index.js b/plugins/theme-dark/test/index.js index 2a81086744..3aa35dee82 100644 --- a/plugins/theme-dark/test/index.js +++ b/plugins/theme-dark/test/index.js @@ -878,7 +878,7 @@ const toolbox = { // Do not use the advanced playground here because it will create a circular // dependency with the @blockly/dev-tools package. -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { Blockly.inject('root', { theme: Theme, toolbox, diff --git a/plugins/theme-deuteranopia/README.md b/plugins/theme-deuteranopia/README.md index abfcbf053a..19a7108c5e 100644 --- a/plugins/theme-deuteranopia/README.md +++ b/plugins/theme-deuteranopia/README.md @@ -9,11 +9,13 @@ people that have protanopia (the inability to perceive red light). ## Installation ### Yarn + ``` yarn add @blockly/theme-deuteranopia ``` ### npm + ``` npm install @blockly/theme-deuteranopia --save ``` @@ -27,8 +29,8 @@ import Theme from '@blockly/theme-deuteranopia'; Blockly.inject('blocklyDiv', { theme: Theme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/theme-deuteranopia/package.json b/plugins/theme-deuteranopia/package.json index 82948a9da4..335235b634 100644 --- a/plugins/theme-deuteranopia/package.json +++ b/plugins/theme-deuteranopia/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/theme-deuteranopia/test/index.html b/plugins/theme-deuteranopia/test/index.html index 766fa16010..6535b9e920 100644 --- a/plugins/theme-deuteranopia/test/index.html +++ b/plugins/theme-deuteranopia/test/index.html @@ -1,29 +1,26 @@ - + + + + Blockly Deuteranopia Theme Test + + - - - Blockly Deuteranopia Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/theme-deuteranopia/test/index.js b/plugins/theme-deuteranopia/test/index.js index 115f0af037..367e99825f 100644 --- a/plugins/theme-deuteranopia/test/index.js +++ b/plugins/theme-deuteranopia/test/index.js @@ -878,7 +878,7 @@ const toolbox = { // Do not use the advanced playground here because it will create a circular // dependency with the @blockly/dev-tools package. -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { Blockly.inject('root', { theme: Theme, toolbox, diff --git a/plugins/theme-highcontrast/README.md b/plugins/theme-highcontrast/README.md index 310aa9c57d..823366b95a 100644 --- a/plugins/theme-highcontrast/README.md +++ b/plugins/theme-highcontrast/README.md @@ -8,11 +8,13 @@ for the blocks to create contrast between the block color and the white text. ## Installation ### Yarn + ``` yarn add @blockly/theme-highcontrast ``` ### npm + ``` npm install @blockly/theme-highcontrast --save ``` @@ -26,8 +28,8 @@ import Theme from '@blockly/theme-highcontrast'; Blockly.inject('blocklyDiv', { theme: Theme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/theme-highcontrast/package.json b/plugins/theme-highcontrast/package.json index 12f5ff051a..64bf88d982 100644 --- a/plugins/theme-highcontrast/package.json +++ b/plugins/theme-highcontrast/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/theme-highcontrast/test/index.html b/plugins/theme-highcontrast/test/index.html index 600afcf262..59680e5ac7 100644 --- a/plugins/theme-highcontrast/test/index.html +++ b/plugins/theme-highcontrast/test/index.html @@ -1,29 +1,26 @@ - + + + + Blockly High-contrast Theme Test + + - - - Blockly High-contrast Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/theme-highcontrast/test/index.js b/plugins/theme-highcontrast/test/index.js index 61b4616881..9c8b41fb1d 100644 --- a/plugins/theme-highcontrast/test/index.js +++ b/plugins/theme-highcontrast/test/index.js @@ -878,7 +878,7 @@ const toolbox = { // Do not use the advanced playground here because it will create a circular // dependency with the @blockly/dev-tools package. -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { Blockly.inject('root', { theme: Theme, toolbox, diff --git a/plugins/theme-modern/README.md b/plugins/theme-modern/README.md index fb2a0fcd7e..53d29eb6ea 100644 --- a/plugins/theme-modern/README.md +++ b/plugins/theme-modern/README.md @@ -10,11 +10,13 @@ Zelos renderer. ## Installation ### Yarn + ``` yarn add @blockly/theme-modern ``` ### npm + ``` npm install @blockly/theme-modern --save ``` @@ -28,8 +30,8 @@ import Theme from '@blockly/theme-modern'; Blockly.inject('blocklyDiv', { theme: Theme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/theme-modern/package.json b/plugins/theme-modern/package.json index b1e0de5221..51afaecde5 100644 --- a/plugins/theme-modern/package.json +++ b/plugins/theme-modern/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/theme-modern/test/index.html b/plugins/theme-modern/test/index.html index 5b68502483..3460fc19dd 100644 --- a/plugins/theme-modern/test/index.html +++ b/plugins/theme-modern/test/index.html @@ -1,29 +1,26 @@ - + + + + Blockly Modern Theme Test + + - - - Blockly Modern Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/theme-modern/test/index.js b/plugins/theme-modern/test/index.js index ad6e2161a5..d4056fcfa9 100644 --- a/plugins/theme-modern/test/index.js +++ b/plugins/theme-modern/test/index.js @@ -878,7 +878,7 @@ const toolbox = { // Do not use the advanced playground here because it will create a circular // dependency with the @blockly/dev-tools package. -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { Blockly.inject('root', { theme: Theme, toolbox, diff --git a/plugins/theme-tritanopia/README.md b/plugins/theme-tritanopia/README.md index 1f93108f9d..897d331fd5 100644 --- a/plugins/theme-tritanopia/README.md +++ b/plugins/theme-tritanopia/README.md @@ -8,11 +8,13 @@ tritanopia (the inability to perceive blue light). ## Installation ### Yarn + ``` yarn add @blockly/theme-tritanopia ``` ### npm + ``` npm install @blockly/theme-tritanopia --save ``` @@ -26,8 +28,8 @@ import Theme from '@blockly/theme-tritanopia'; Blockly.inject('blocklyDiv', { theme: Theme, }); - ``` ## License + Apache 2.0 diff --git a/plugins/theme-tritanopia/package.json b/plugins/theme-tritanopia/package.json index 4db3d99782..7f022a0463 100644 --- a/plugins/theme-tritanopia/package.json +++ b/plugins/theme-tritanopia/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/theme-tritanopia/test/index.html b/plugins/theme-tritanopia/test/index.html index c6cc269132..342b0d2a0b 100644 --- a/plugins/theme-tritanopia/test/index.html +++ b/plugins/theme-tritanopia/test/index.html @@ -1,29 +1,26 @@ - + + + + Blockly Tritanopia Theme Test + + - - - Blockly Tritanopia Theme Test - - - - -
- - - + +
+ + diff --git a/plugins/theme-tritanopia/test/index.js b/plugins/theme-tritanopia/test/index.js index 3757d4052e..366e5060e7 100644 --- a/plugins/theme-tritanopia/test/index.js +++ b/plugins/theme-tritanopia/test/index.js @@ -878,7 +878,7 @@ const toolbox = { // Do not use the advanced playground here because it will create a circular // dependency with the @blockly/dev-tools package. -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { Blockly.inject('root', { theme: Theme, toolbox, diff --git a/plugins/toolbox-search/README.md b/plugins/toolbox-search/README.md index 2aa0e91a6f..ee9b2075fd 100644 --- a/plugins/toolbox-search/README.md +++ b/plugins/toolbox-search/README.md @@ -7,16 +7,19 @@ type. The Blockly docs have [more information about toolbox definitions and cate ## Installation ### Yarn + ``` yarn add @blockly/toolbox-search ``` ### npm + ``` npm install @blockly/toolbox-search --save ``` ## Usage + ``` import * as Blockly from 'blockly'; import '@blockly/toolbox-search'; @@ -39,4 +42,5 @@ const workspace = Blockly.inject('blocklyDiv', { ``` ## License + Apache 2.0 diff --git a/plugins/toolbox-search/package-lock.json b/plugins/toolbox-search/package-lock.json index 2a12e16cf8..c363a99c3d 100644 --- a/plugins/toolbox-search/package-lock.json +++ b/plugins/toolbox-search/package-lock.json @@ -9,7 +9,6 @@ "version": "1.1.6", "license": "Apache-2.0", "devDependencies": { - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.3.7", "typescript": "^5.0.4" @@ -18,223 +17,6 @@ "blockly": "^10.0.0" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -244,136 +26,12 @@ "node": ">= 10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz", - "integrity": "sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/typescript-estree": "5.60.1", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz", - "integrity": "sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz", - "integrity": "sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz", - "integrity": "sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz", - "integrity": "sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.60.1", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -386,78 +44,6 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -467,29 +53,12 @@ "node": "*" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "node_modules/blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -499,39 +68,6 @@ "jsdom": "22.1.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -550,23 +86,6 @@ "node": ">=4" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -576,26 +95,6 @@ "node": "*" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -608,28 +107,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -691,13 +168,6 @@ "node": ">=6" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -707,31 +177,6 @@ "node": ">=0.4.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -744,30 +189,10 @@ "node": ">=12" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { "node": ">=0.12" @@ -776,372 +201,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -1156,20 +215,6 @@ "node": ">= 6" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -1179,69 +224,6 @@ "node": "*" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -1293,134 +275,12 @@ "node": ">=0.10.0" } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -1463,90 +323,14 @@ } } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "node_modules/loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, - "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.0" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } + "dependencies": { + "get-func-name": "^2.0.0" + } }, "node_modules/mime-db": { "version": "1.52.0", @@ -1569,79 +353,18 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "node_modules/nwsapi": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.5.tgz", "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "peer": true, - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -1654,35 +377,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -1692,38 +386,6 @@ "node": "*" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -1745,120 +407,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1877,198 +437,12 @@ "node": ">=v12.22.7" } }, - "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -2096,40 +470,6 @@ "node": ">=14" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -2139,19 +479,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -2174,16 +501,6 @@ "node": ">= 4.0.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -2194,13 +511,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -2256,29 +566,6 @@ "node": ">=14" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -2314,268 +601,21 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } }, "dependencies": { - "@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true - }, - "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "peer": true - }, - "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - } - } - }, - "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, "@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@typescript-eslint/parser": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz", - "integrity": "sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/typescript-estree": "5.60.1", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz", - "integrity": "sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1" - } - }, - "@typescript-eslint/types": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz", - "integrity": "sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz", - "integrity": "sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz", - "integrity": "sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.60.1", - "eslint-visitor-keys": "^3.3.0" - } - }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "peer": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2585,85 +625,18 @@ "debug": "4" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "peer": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "peer": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -2673,33 +646,6 @@ "jsdom": "22.1.0" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, "chai": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", @@ -2715,40 +661,12 @@ "type-detect": "^4.0.5" } }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2758,25 +676,6 @@ "delayed-stream": "~1.0.0" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -2784,394 +683,63 @@ "dev": true, "requires": { "rrweb-cssom": "^0.6.0" - } - }, - "data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "dev": true, - "requires": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "peer": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "peer": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "peer": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "peer": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "peer": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "peer": true - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true + } }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, "requires": { - "reusify": "^1.0.4" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" } }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "peer": true, "requires": { - "flat-cache": "^3.0.4" + "ms": "2.1.2" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "type-detect": "^4.0.0" } }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, - "peer": true, "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "webidl-conversions": "^7.0.0" } }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true }, "form-data": { "version": "4.0.0", @@ -3184,71 +752,12 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true, - "peer": true - }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true - }, "html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -3288,107 +797,12 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -3420,45 +834,6 @@ "xml-name-validator": "^4.0.0" } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true - }, "loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -3468,31 +843,6 @@ "get-func-name": "^2.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3508,70 +858,18 @@ "mime-db": "1.52.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "nwsapi": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.5.tgz", "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "peer": true, - "requires": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, "parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -3581,52 +879,12 @@ "entities": "^4.4.0" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "peer": true - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -3645,70 +903,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, "rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3724,154 +930,12 @@ "xmlchars": "^2.2.0" } }, - "semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "peer": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^4.0.0" - } - }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -3893,44 +957,12 @@ "punycode": "^2.3.0" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, "typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -3943,16 +975,6 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -3963,13 +985,6 @@ "requires-port": "^1.0.0" } }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -4010,23 +1025,6 @@ "webidl-conversions": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -4045,12 +1043,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } } diff --git a/plugins/toolbox-search/package.json b/plugins/toolbox-search/package.json index f4c117fe7e..25b0691be1 100644 --- a/plugins/toolbox-search/package.json +++ b/plugins/toolbox-search/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -42,7 +42,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "chai": "^4.3.7", "typescript": "^5.0.4" @@ -53,8 +52,5 @@ "publishConfig": { "access": "public", "registry": "https://wombat-dressing-room.appspot.com" - }, - "eslintConfig": { - "extends": "@blockly/eslint-config" } } diff --git a/plugins/toolbox-search/src/block_searcher.ts b/plugins/toolbox-search/src/block_searcher.ts index 44238e69fa..d75cf8f94d 100644 --- a/plugins/toolbox-search/src/block_searcher.ts +++ b/plugins/toolbox-search/src/block_searcher.ts @@ -59,11 +59,16 @@ export class BlockSearcher { * @returns A list of block types matching the query. */ blockTypesMatching(query: string): string[] { - return [...this.generateTrigrams(query).map((trigram) => { - return this.trigramsToBlocks.get(trigram) ?? new Set(); - }).reduce((matches, current) => { - return this.getIntersection(matches, current); - }).values()]; + return [ + ...this.generateTrigrams(query) + .map((trigram) => { + return this.trigramsToBlocks.get(trigram) ?? new Set(); + }) + .reduce((matches, current) => { + return this.getIntersection(matches, current); + }) + .values(), + ]; } /** diff --git a/plugins/toolbox-search/src/toolbox_search.ts b/plugins/toolbox-search/src/toolbox_search.ts index f263314822..7c535684a7 100644 --- a/plugins/toolbox-search/src/toolbox_search.ts +++ b/plugins/toolbox-search/src/toolbox_search.ts @@ -32,9 +32,10 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { * a parent. */ constructor( - categoryDef: Blockly.utils.toolbox.CategoryInfo, - parentToolbox: Blockly.IToolbox, - opt_parent?: Blockly.ICollapsibleToolboxItem) { + categoryDef: Blockly.utils.toolbox.CategoryInfo, + parentToolbox: Blockly.IToolbox, + opt_parent?: Blockly.ICollapsibleToolboxItem, + ) { super(categoryDef, parentToolbox, opt_parent); this.initBlockSearcher(); this.registerShortcut(); @@ -49,8 +50,9 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { this.searchField = document.createElement('input'); this.searchField.type = 'search'; this.searchField.placeholder = 'Search'; - this.workspace_.RTL ? this.searchField.style.marginRight = '8px' : - this.searchField.style.marginLeft = '8px'; + this.workspace_.RTL + ? (this.searchField.style.marginRight = '8px') + : (this.searchField.style.marginLeft = '8px'); this.searchField.addEventListener('keyup', (event) => { if (event.key === 'Escape') { this.parentToolbox_.clearSelection(); @@ -84,7 +86,9 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { */ private registerShortcut() { const shortcut = Blockly.ShortcutRegistry.registry.createSerializedKey( - Blockly.utils.KeyCodes.B, [Blockly.utils.KeyCodes.CTRL]); + Blockly.utils.KeyCodes.B, + [Blockly.utils.KeyCodes.CTRL], + ); Blockly.ShortcutRegistry.registry.register({ name: ToolboxSearchCategory.START_SEARCH_SHORTCUT, callback: () => { @@ -104,7 +108,9 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { * so far. */ private getAvailableBlocks( - schema: Blockly.utils.toolbox.ToolboxItemInfo, allBlocks: Set) { + schema: Blockly.utils.toolbox.ToolboxItemInfo, + allBlocks: Set, + ) { if ('contents' in schema) { schema.contents.forEach((contents) => { this.getAvailableBlocks(contents, allBlocks); @@ -121,8 +127,9 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { */ private initBlockSearcher() { const availableBlocks = new Set(); - this.workspace_.options.languageTree.contents.map( - (item) => this.getAvailableBlocks(item, availableBlocks)); + this.workspace_.options.languageTree.contents.map((item) => + this.getAvailableBlocks(item, availableBlocks), + ); this.blockSearcher.indexBlocks([...availableBlocks]); } @@ -158,20 +165,22 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { private matchBlocks() { const query = this.searchField.value; - this.flyoutItems_ = query ? - this.blockSearcher.blockTypesMatching(query).map( - (blockType) => { - return { - kind: 'block', - type: blockType, - }; - }) : []; + this.flyoutItems_ = query + ? this.blockSearcher.blockTypesMatching(query).map((blockType) => { + return { + kind: 'block', + type: blockType, + }; + }) + : []; if (!this.flyoutItems_.length) { this.flyoutItems_.push({ kind: 'label', - text: query.length < 3 ? 'Type to search for blocks' : - 'No matching blocks found', + text: + query.length < 3 + ? 'Type to search for blocks' + : 'No matching blocks found', }); } this.parentToolbox_.refreshSelection(); @@ -183,10 +192,13 @@ export class ToolboxSearchCategory extends Blockly.ToolboxCategory { override dispose() { super.dispose(); Blockly.ShortcutRegistry.registry.unregister( - ToolboxSearchCategory.START_SEARCH_SHORTCUT); + ToolboxSearchCategory.START_SEARCH_SHORTCUT, + ); } } Blockly.registry.register( - Blockly.registry.Type.TOOLBOX_ITEM, - ToolboxSearchCategory.SEARCH_CATEGORY_KIND, ToolboxSearchCategory); + Blockly.registry.Type.TOOLBOX_ITEM, + ToolboxSearchCategory.SEARCH_CATEGORY_KIND, + ToolboxSearchCategory, +); diff --git a/plugins/toolbox-search/test/index.html b/plugins/toolbox-search/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/toolbox-search/test/index.html +++ b/plugins/toolbox-search/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/toolbox-search/test/index.ts b/plugins/toolbox-search/test/index.ts index 1d5e40c4ca..69190ee673 100644 --- a/plugins/toolbox-search/test/index.ts +++ b/plugins/toolbox-search/test/index.ts @@ -18,12 +18,14 @@ import '../src/toolbox_search'; * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { return Blockly.inject(blocklyDiv, options); } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const toolbox = Object.assign({}, toolboxCategories); toolbox['contents'].push({ 'kind': 'search', @@ -34,5 +36,8 @@ document.addEventListener('DOMContentLoaded', function() { toolbox, }; createPlayground( - document.getElementById('root'), createWorkspace, defaultOptions); + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/toolbox-search/test/tests.mocha.js b/plugins/toolbox-search/test/tests.mocha.js index a17379c085..e4248122e3 100644 --- a/plugins/toolbox-search/test/tests.mocha.js +++ b/plugins/toolbox-search/test/tests.mocha.js @@ -6,9 +6,11 @@ import {BlockSearcher} from '../src/block_searcher'; suite('Toolbox search', () => { test('registers itself as a toolbox item', () => { assert( - Blockly.registry.hasItem( - Blockly.registry.Type.TOOLBOX_ITEM, - ToolboxSearchCategory.SEARCH_CATEGORY_KIND)); + Blockly.registry.hasItem( + Blockly.registry.Type.TOOLBOX_ITEM, + ToolboxSearchCategory.SEARCH_CATEGORY_KIND, + ), + ); }); }); diff --git a/plugins/typed-variable-modal/README.md b/plugins/typed-variable-modal/README.md index 57c13eb53a..a5b1aab3a2 100644 --- a/plugins/typed-variable-modal/README.md +++ b/plugins/typed-variable-modal/README.md @@ -10,16 +10,19 @@ npm install @blockly/plugin-typed-variable-modal --save ``` ## Usage + To add a Typed Variable Modal to your application you will have to create a custom dynamically populated flyout category. More information on custom flyouts can be found [here](https://developers.google.com/blockly/guides/configure/web/toolbox?hl=en#dynamic_categories). #### Import + ```js import * as Blockly from 'blockly'; -import { TypedVariableModal } from '@blockly/plugin-typed-variable-modal'; +import {TypedVariableModal} from '@blockly/plugin-typed-variable-modal'; ``` + or ```js @@ -29,66 +32,79 @@ or #### Setup Create your workspace. + ```js workspace = Blockly.inject('blocklyDiv', { - toolbox: toolbox + toolbox: toolbox, }); ``` Add a custom category to your toolbox. + ```xml ``` Define a callback to provide the category content. + ```js -const createFlyout = function(workspace) { - let xmlList = []; - // Add your button and give it a callback name. - const button = document.createElement('button'); - button.setAttribute('text', 'Create Typed Variable'); - button.setAttribute('callbackKey', 'callbackName'); - - xmlList.push(button); - - // This gets all the variables that the user creates and adds them to the - // flyout. - const blockList = Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace); - xmlList = xmlList.concat(blockList); - return xmlList; +const createFlyout = function (workspace) { + let xmlList = []; + // Add your button and give it a callback name. + const button = document.createElement('button'); + button.setAttribute('text', 'Create Typed Variable'); + button.setAttribute('callbackKey', 'callbackName'); + + xmlList.push(button); + + // This gets all the variables that the user creates and adds them to the + // flyout. + const blockList = Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace); + xmlList = xmlList.concat(blockList); + return xmlList; }; ``` Register the callback for the toolbox category. + ```js -workspace.registerToolboxCategoryCallback('CREATE_TYPED_VARIABLE', createFlyout); +workspace.registerToolboxCategoryCallback( + 'CREATE_TYPED_VARIABLE', + createFlyout, +); ``` Create your Typed Variable Modal using the workspace, callbackName for the button and your types. + ```js -const typedVarModal = new TypedVariableModal(workspace, 'callbackName', [["PENGUIN", "Penguin"], ["GIRAFFE", "Giraffe"]]); +const typedVarModal = new TypedVariableModal(workspace, 'callbackName', [ + ['PENGUIN', 'Penguin'], + ['GIRAFFE', 'Giraffe'], +]); typedVarModal.init(); ``` #### Blockly Languages + We do not currently support translating the text in this plugin to different languages. However, if you would like to support multiple languages the different messages in the typed variable modal can be set by calling `typedVarModal.setLocale(messages)`. Messages that need to be translated for a Typed Variable Modal: + - `TYPED_VAR_MODAL_CONFIRM_BUTTON` (Default: "Ok"): The label for the confirmation button. - `TYPED_VAR_MODAL_VARIABLE_NAME_LABEL` (Default: "Variable Name: "): The label in front of the variable input. - `TYPED_VAR_MODAL_TYPES_LABEL` (Default: "Variable Types"): The label in front of the types. - `TYPED_VAR_MODAL_CANCEL_BUTTON` (Default: "Cancel"): The label for the cancel button. - `TYPED_VAR_MODAL_TITLE` (Default: "Create Typed Variable"): The modal title. - `TYPED_VAR_MODAL_INVALID_NAME` -(Default: "Name is not valid. Please choose a different name.") The message used -when a user gives an invalid variable name. Name is invalid if it is the message -used for renaming a variable, creating a variable, or an empty string. - + (Default: "Name is not valid. Please choose a different name.") The message used + when a user gives an invalid variable name. Name is invalid if it is the message + used for renaming a variable, creating a variable, or an empty string. ## API + - `init`: Create a typed variable modal and register it with the given button name. - `dispose`: Dispose of the typed variable modal. - `show`: Shows the modal and focus on the first focusable element. @@ -96,6 +112,6 @@ used for renaming a variable, creating a variable, or an empty string. - `render`: Create all the dom elements for the modal. - `setLocale`: Change the language for the typed variable modal. - ## License + Apache 2.0 diff --git a/plugins/typed-variable-modal/package.json b/plugins/typed-variable-modal/package.json index fbf2d6d7d8..364ac64223 100644 --- a/plugins/typed-variable-modal/package.json +++ b/plugins/typed-variable-modal/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -57,9 +57,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/typed-variable-modal/src/TypedVariableModal.js b/plugins/typed-variable-modal/src/TypedVariableModal.js index b5cf33cbea..8ea70a8800 100644 --- a/plugins/typed-variable-modal/src/TypedVariableModal.js +++ b/plugins/typed-variable-modal/src/TypedVariableModal.js @@ -10,7 +10,6 @@ * @author aschmiedt@google.com (Abby Schmiedt) */ - import * as Blockly from 'blockly/core'; import {Modal} from '@blockly/plugin-modal'; @@ -31,8 +30,9 @@ export class TypedVariableModal extends Modal { * variable modal. */ constructor(workspace, btnCallbackName, types, optMessages) { - const title = (optMessages && optMessages['TYPED_VAR_MODAL_TITLE']) || - 'Create Typed Variable'; + const title = + (optMessages && optMessages['TYPED_VAR_MODAL_TITLE']) || + 'Create Typed Variable'; super(title, workspace); /** @@ -85,7 +85,7 @@ export class TypedVariableModal extends Modal { 'TYPED_VAR_MODAL_CONFIRM_BUTTON': 'Ok', 'TYPED_VAR_MODAL_CANCEL_BUTTON': 'Cancel', 'TYPED_VAR_MODAL_INVALID_NAME': - 'Name is not valid. Please choose a different name.', + 'Name is not valid. Please choose a different name.', }; Object.assign(messages, optMessages); @@ -113,7 +113,6 @@ export class TypedVariableModal extends Modal { * }} TypedVarModalMessages */ - /** * Create a typed variable modal and display it on the given button name. */ @@ -172,18 +171,22 @@ export class TypedVariableModal extends Modal { const text = this.getValidInput_(); const type = this.getSelectedType_() || ''; if (text) { - const existing = - Blockly.Variables.nameUsedWithAnyType(text, this.workspace_); + const existing = Blockly.Variables.nameUsedWithAnyType( + text, + this.workspace_, + ); if (existing) { let msg = ''; if (existing.type === type) { msg = Blockly.Msg['VARIABLE_ALREADY_EXISTS'].replace( - '%1', existing.name); + '%1', + existing.name, + ); } else { - msg = - Blockly.Msg['VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE']; - msg = msg.replace('%1', existing.name).replace('%2', - this.getDisplayName_(existing.type)); + msg = Blockly.Msg['VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE']; + msg = msg + .replace('%1', existing.name) + .replace('%2', this.getDisplayName_(existing.type)); } Blockly.dialog.alert(msg); } else { @@ -221,8 +224,10 @@ export class TypedVariableModal extends Modal { let newVar = this.variableNameInput_.value; if (newVar) { newVar = newVar.replace(/[\s\xa0]+/g, ' ').trim(); - if (newVar === Blockly.Msg['RENAME_VARIABLE'] || - newVar === Blockly.Msg['NEW_VARIABLE']) { + if ( + newVar === Blockly.Msg['RENAME_VARIABLE'] || + newVar === Blockly.Msg['NEW_VARIABLE'] + ) { // Ok, not ALL names are legal... newVar = null; } @@ -237,8 +242,9 @@ export class TypedVariableModal extends Modal { */ renderContent_(contentContainer) { const varNameContainer = this.createVarNameContainer_(); - this.variableNameInput_ = varNameContainer - .querySelector('.typedModalVariableNameInput'); + this.variableNameInput_ = varNameContainer.querySelector( + '.typedModalVariableNameInput', + ); const typedVarDiv = document.createElement('div'); typedVarDiv.className = 'typedModalTypes'; @@ -287,7 +293,6 @@ export class TypedVariableModal extends Modal { return cancelBtn; } - /** * Check the first type in the list. * @protected diff --git a/plugins/typed-variable-modal/test/InputModal.js b/plugins/typed-variable-modal/test/InputModal.js index d6beebe231..92dd19d499 100644 --- a/plugins/typed-variable-modal/test/InputModal.js +++ b/plugins/typed-variable-modal/test/InputModal.js @@ -1,4 +1,3 @@ - import {TypedVariableModal} from '../src/TypedVariableModal.js'; /** @@ -52,7 +51,7 @@ export class InputModal extends TypedVariableModal { const randomBtn = document.createElement('button'); randomBtn.className = 'blocklyModalBtn'; randomBtn.innerText = 'Create random name'; - this.addEvent_(randomBtn, 'click', this, ()=> this.randomName()); + this.addEvent_(randomBtn, 'click', this, () => this.randomName()); footerContainer.appendChild(randomBtn); footerContainer.appendChild(this.createCancelBtn_()); } diff --git a/plugins/typed-variable-modal/test/index.html b/plugins/typed-variable-modal/test/index.html index 41fae60143..2a14e9a32d 100644 --- a/plugins/typed-variable-modal/test/index.html +++ b/plugins/typed-variable-modal/test/index.html @@ -1,11 +1,11 @@ - + - - + + Typed Variable Modal - - + +
- - + + diff --git a/plugins/typed-variable-modal/test/index.js b/plugins/typed-variable-modal/test/index.js index 332d092a37..e69955189f 100644 --- a/plugins/typed-variable-modal/test/index.js +++ b/plugins/typed-variable-modal/test/index.js @@ -14,7 +14,6 @@ import {TypedVariableModal} from '../src/index.js'; import {toolboxCategories, createPlayground} from '@blockly/dev-tools'; import '../src/index.js'; - /** * Create a workspace. * @param {HTMLElement} blocklyDiv The blockly container div. @@ -27,7 +26,7 @@ function createWorkspace(blocklyDiv, options) { * @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace. * @returns {!Array.} Array of XML block elements. */ - const createFlyout = function(workspace) { + const createFlyout = function (workspace) { let xmlList = []; const button = document.createElement('button'); button.setAttribute('text', 'Create Typed Variable'); @@ -40,18 +39,26 @@ function createWorkspace(blocklyDiv, options) { return xmlList; }; - const types = [['Penguin', 'PENGUIN'], ['Giraffe', 'GIRAFFE']]; + const types = [ + ['Penguin', 'PENGUIN'], + ['Giraffe', 'GIRAFFE'], + ]; const workspace = Blockly.inject(blocklyDiv, options); workspace.registerToolboxCategoryCallback( - 'CREATE_TYPED_VARIABLE', createFlyout); - const typedVarModal = - new TypedVariableModal(workspace, 'CREATE_TYPED_VARIABLE', types); + 'CREATE_TYPED_VARIABLE', + createFlyout, + ); + const typedVarModal = new TypedVariableModal( + workspace, + 'CREATE_TYPED_VARIABLE', + types, + ); typedVarModal.init(); return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { toolboxCategories['contents'].push({ 'kind': 'category', 'name': 'Typed Variables', @@ -62,6 +69,9 @@ document.addEventListener('DOMContentLoaded', function() { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/typed-variable-modal/test/typed_variable_modal_test.mocha.js b/plugins/typed-variable-modal/test/typed_variable_modal_test.mocha.js index e2c2f82e6d..ad94d74618 100644 --- a/plugins/typed-variable-modal/test/typed_variable_modal_test.mocha.js +++ b/plugins/typed-variable-modal/test/typed_variable_modal_test.mocha.js @@ -15,7 +15,7 @@ const sinon = require('sinon'); const {TypedVariableModal} = require('../src/index.js'); -suite('TypedVariableModal', function() { +suite('TypedVariableModal', function () { /** * Set up the workspace to test with typed variable modal. * @param {string} toolbox The toolbox. @@ -25,7 +25,7 @@ suite('TypedVariableModal', function() { */ function workspaceSetup(toolbox, types) { const options = {}; - const createFlyout = function(workspace) { + const createFlyout = function (workspace) { let xmlList = []; const button = document.createElement('button'); button.setAttribute('text', 'Create Typed Variable'); @@ -33,8 +33,8 @@ suite('TypedVariableModal', function() { xmlList.push(button); - const blockList = Blockly.VariablesDynamic - .flyoutCategoryBlocks(workspace); + const blockList = + Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace); xmlList = xmlList.concat(blockList); return xmlList; }; @@ -58,41 +58,52 @@ suite('TypedVariableModal', function() { return toolbox; } - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
'); - const types = [['Penguin', 'PENGUIN'], ['Giraffe', 'GIRAFFE']]; + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + ); + const types = [ + ['Penguin', 'PENGUIN'], + ['Giraffe', 'GIRAFFE'], + ]; this.workspace = workspaceSetup(getTestToolbox(), types); - this.typedVarModal = new TypedVariableModal(this.workspace, - 'CREATE_TYPED_VARIABLE', types); + this.typedVarModal = new TypedVariableModal( + this.workspace, + 'CREATE_TYPED_VARIABLE', + types, + ); }); - teardown(function() { + teardown(function () { this.jsdomCleanup(); sinon.restore(); }); - suite('init()', function() { - test('Registers button', function() { + suite('init()', function () { + test('Registers button', function () { this.workspace.registerButtonCallback = sinon.fake(); this.typedVarModal.init(); sinon.assert.calledOnce(this.workspace.registerButtonCallback); }); }); - suite('show()', function() { - test('Elements focused', function() { + suite('show()', function () { + test('Elements focused', function () { this.typedVarModal.init(); this.typedVarModal.show(); - assert.equal(this.typedVarModal.firstFocusableEl_.className, - 'blocklyModalBtn blocklyModalBtnClose'); - assert.equal(this.typedVarModal.lastFocusableEl_.className, - 'blocklyModalBtn'); + assert.equal( + this.typedVarModal.firstFocusableEl_.className, + 'blocklyModalBtn blocklyModalBtnClose', + ); + assert.equal( + this.typedVarModal.lastFocusableEl_.className, + 'blocklyModalBtn', + ); }); }); - suite('setLocale()', function() { - test('Messages added', function() { + suite('setLocale()', function () { + test('Messages added', function () { this.typedVarModal.init(); const messages = { 'TYPED_VAR_MODAL_CONFIRM_BUTTON': 'confirm_test', @@ -100,90 +111,102 @@ suite('TypedVariableModal', function() { }; this.typedVarModal.setLocale(messages); - assert.equal(Blockly.Msg['TYPED_VAR_MODAL_CONFIRM_BUTTON'], - 'confirm_test'); + assert.equal( + Blockly.Msg['TYPED_VAR_MODAL_CONFIRM_BUTTON'], + 'confirm_test', + ); }); }); - suite('onConfirm_()', function() { - setup(function() { + suite('onConfirm_()', function () { + setup(function () { this.alertStub = sinon.stub(Blockly.dialog, 'alert'); this.typedVarModal.init(); this.typedVarModal.getSelectedType_ = sinon.fake.returns('Giraffe'); this.typedVarModal.getDisplayName_ = sinon.fake.returns('Giraffe'); }); - test('No text', function() { + test('No text', function () { this.typedVarModal.getValidInput_ = sinon.fake.returns(null); this.typedVarModal.onConfirm_(); - assert(this.alertStub - .calledWith('Name is not valid. Please choose a different name.')); + assert( + this.alertStub.calledWith( + 'Name is not valid. Please choose a different name.', + ), + ); }); - test('Valid name', function() { + test('Valid name', function () { this.typedVarModal.getValidInput_ = sinon.fake.returns('varName'); this.workspace.createVariable = sinon.fake(); this.typedVarModal.onConfirm_(); assert(this.workspace.createVariable.calledOnce); }); - test('Variable with different type already exists', function() { + test('Variable with different type already exists', function () { Blockly.Variables.nameUsedWithAnyType = sinon.fake.returns({ 'type': 'Penguin', 'name': 'varName', }); this.typedVarModal.getValidInput_ = sinon.fake.returns('varName'); this.typedVarModal.onConfirm_(); - assert(this.alertStub.calledWith('A variable named \'varName\' already ' + - 'exists for another type: \'Giraffe\'.')); - }); - test('Variable with same type already exits', function() { + assert( + this.alertStub.calledWith( + "A variable named 'varName' already " + + "exists for another type: 'Giraffe'.", + ), + ); + }); + test('Variable with same type already exits', function () { Blockly.Variables.nameUsedWithAnyType = sinon.fake.returns({ 'type': 'Giraffe', 'name': 'varName', }); this.typedVarModal.getValidInput_ = sinon.fake.returns('varName'); this.typedVarModal.onConfirm_(); - assert(this.alertStub.calledWith('A variable named \'varName\' already ' + - 'exists.')); + assert( + this.alertStub.calledWith( + "A variable named 'varName' already " + 'exists.', + ), + ); }); }); - suite('getDisplayName_()', function() { - test('Get display name', function() { + suite('getDisplayName_()', function () { + test('Get display name', function () { assert.equal(this.typedVarModal.getDisplayName_('GIRAFFE'), 'Giraffe'); }); - test('No display name', function() { + test('No display name', function () { assert.equal(this.typedVarModal.getDisplayName_('SOMETHING'), ''); }); }); - suite('getValidInput_()', function() { - setup(function() { + suite('getValidInput_()', function () { + setup(function () { this.typedVarModal.init(); }); - test('Using rename variable name', function() { + test('Using rename variable name', function () { this.typedVarModal.variableNameInput_.value = 'Rename variable...'; assert.equal(this.typedVarModal.getValidInput_(), null); }); - test('Using new variable name', function() { + test('Using new variable name', function () { this.typedVarModal.variableNameInput_.value = 'Create variable...'; assert.equal(this.typedVarModal.getValidInput_(), null); }); - test('Valid variable name', function() { + test('Valid variable name', function () { this.typedVarModal.variableNameInput_.value = 'varName'; assert.equal(this.typedVarModal.getValidInput_(), 'varName'); }); }); - suite('render', function() { - setup(function() { + suite('render', function () { + setup(function () { this.typedVarModal.render(); }); - test('renderContent_()', function() { + test('renderContent_()', function () { const htmlDiv = this.typedVarModal.htmlDiv_; const modalContent = htmlDiv.querySelector('.blocklyModalContent'); assert(modalContent.querySelector('.typedModalVariableNameInput')); assert(modalContent.querySelector('.typedModalTypes')); }); - test('renderFooter_()', function() { + test('renderFooter_()', function () { const htmlDiv = this.typedVarModal.htmlDiv_; const modalFooter = htmlDiv.querySelector('.blocklyModalFooter'); const allBtns = modalFooter.querySelectorAll('.blocklyModalBtn'); @@ -191,25 +214,28 @@ suite('TypedVariableModal', function() { }); }); - suite('create', function() { - test('createConfirmBtn_()', function() { + suite('create', function () { + test('createConfirmBtn_()', function () { const btn = this.typedVarModal.createConfirmBtn_(); assert.equal(btn.className, 'blocklyModalBtn blocklyModalBtnPrimary'); }); - test('createCancelBtn_()', function() { + test('createCancelBtn_()', function () { const btn = this.typedVarModal.createCancelBtn_(); assert.equal(btn.className, 'blocklyModalBtn'); }); - test('createVariableTypeContainer_()', function() { + test('createVariableTypeContainer_()', function () { const types = this.typedVarModal.types_; const typeList = this.typedVarModal.createVariableTypeContainer_(types); - assert.equal(typeList.querySelectorAll('.typedModalTypes') - .length, types.length); + assert.equal( + typeList.querySelectorAll('.typedModalTypes').length, + types.length, + ); }); - test('createVarNameContainer_()', function() { + test('createVarNameContainer_()', function () { const container = this.typedVarModal.createVarNameContainer_(); - const varNameInput = container - .querySelector('.typedModalVariableNameInput'); + const varNameInput = container.querySelector( + '.typedModalVariableNameInput', + ); const varNameLabel = container.querySelector('.typedModalVariableLabel'); assert.equal(varNameLabel.getAttribute('for'), 'variableInput'); assert.equal(varNameInput.id, 'variableInput'); diff --git a/plugins/workspace-backpack/README.md b/plugins/workspace-backpack/README.md index 68a33d73bd..88559e8bf5 100644 --- a/plugins/workspace-backpack/README.md +++ b/plugins/workspace-backpack/README.md @@ -5,25 +5,30 @@ A [Blockly](https://www.npmjs.com/package/blockly) plugin that adds a Backpack t ## Installation ### Yarn + ``` yarn add @blockly/workspace-backpack ``` ### npm + ``` npm install @blockly/workspace-backpack --save ``` + ## Features + ### Context Menus + The following context menu options are available for the backpack: + - "Copy all Blocks" to Backpack in main Workspace - "Paste all Blocks" from Backpack in main Workspace - "Remove from Backpack" on Block stack in Backpack Flyout - "Copy to Backpack" on a Block stack in main Workspace - "Empty" option when right clicking the Backpack that is disabled if the Backpack is empty -![An animated picture of all the context menu options in use]( -https://github.com/google/blockly-samples/raw/master/plugins/workspace-backpack/readme-media/context-menu.gif) +![An animated picture of all the context menu options in use](https://github.com/google/blockly-samples/raw/master/plugins/workspace-backpack/readme-media/context-menu.gif) ## Usage @@ -42,7 +47,9 @@ backpack.init(); ``` ### Configuration + This plugin takes an optional configuration object. + ``` { allowEmptyBackpackOpen: (boolean|undefined), @@ -62,6 +69,7 @@ This plugin takes an optional configuration object. The configuration options are passed in to the constructor. In this configuration object, you can currently configure which context menu options are registered at `init`. + ```js const backpackOptions = { allowEmptyBackpackOpen: true, @@ -72,11 +80,12 @@ const backpackOptions = { copyToBackpack: false, }, }; -const backpack = new Backpack(workspace, backpackOptions); +const backpack = new Backpack(workspace, backpackOptions); ``` The following options are the default values used for any property in the passed in options that is undefined: + ```js const defaultOptions = { allowEmptyBackpackOpen: true, @@ -106,28 +115,29 @@ context menu option from disabling the context menu option if the block is already in the Backpack. Setting this flag to `true` to disable the check can be beneficial for performance if you expect blocks stacks to be very large. -![An animated picture of the "Copy to Backpack" context menu]( -https://github.com/google/blockly-samples/raw/master/plugins/workspace-backpack/readme-media/context-menu-precondition.gif) +![An animated picture of the "Copy to Backpack" context menu](https://github.com/google/blockly-samples/raw/master/plugins/workspace-backpack/readme-media/context-menu-precondition.gif) Note: Currently the empty Backpack context menu is registered globally, while the others are registered per workspace. ### Blockly Languages + We do not currently support translating the text in this plugin to different languages. However, if you would like to support multiple languages the messages can be translated by assigning the following properties of Blockly.Msg + - `EMPTY_BACKPACK` (Default: "Empty") context menu - Empty the backpack. - `REMOVE_FROM_BACKPACK` (Default: "Remove from Backpack") context menu - Remove -the selected Block from the backpack. + the selected Block from the backpack. - `COPY_TO_BACKPACK` (Default: "Copy to Backpack") context menu - Copy the -selected Block to the backpack. + selected Block to the backpack. - `COPY_ALL_TO_BACKPACK` (Default: "Copy All Blocks to Backpack") Context menu - -copy all Blocks on the workspace to the backpack. + copy all Blocks on the workspace to the backpack. - `PASTE_ALL_FROM_BACKPACK` (Default: "Paste All Blocks from Backpack") context -menu - Paste all Blocks from the backpack to the workspace. + menu - Paste all Blocks from the backpack to the workspace. ```javascript -Blockly.Msg['EMPTY_BACKPACK'] = 'Opróżnij plecak'; // Polish +Blockly.Msg['EMPTY_BACKPACK'] = 'Opróżnij plecak'; // Polish // Inject workspace, etc... ``` @@ -139,7 +149,7 @@ Blockly.Msg['EMPTY_BACKPACK'] = 'Opróżnij plecak'; // Polish - `getCount`: Returns the count of items in the backpack. - `getContents` Returns backpack contents. - `empty`: Empties the backpack's contents. If the contents-flyout is currently -open it will be closed. + open it will be closed. - `addBlock`: Adds Block to backpack. - `addBlocks`: Adds Blocks to backpack. - `removeBlock`: Removes Block to backpack. @@ -156,21 +166,24 @@ open it will be closed. - `onDragExit`: Handle mouse exit. - `getBoundingRectangle`: Returns the bounding rectangle of the UI element in -pixel units relative to the Blockly injection div. + pixel units relative to the Blockly injection div. - `position`: Positions the backpack UI element. ## Compatibility ### Multiple Backpacks per Workspace + This plugin also currently only supports one Backpack per Workspace. ### Blockly.configureContextMenu + This plugin registers a custom context menu by overriding `Blockly.configureContextMenu` in `init` in order to support the context menu for emptying the Backpack. If you also override `Blockly.configureContextMenu` after initializing this plugin, you must also call the old `Blockly.configureContextMenu` function. Example: + ``` const prevConfigureContextMenu = workspace.configureContextMenu; workspace.configureContextMenu = (menuOptions, e) => { @@ -181,6 +194,7 @@ workspace.configureContextMenu = (menuOptions, e) => { ``` ### Backpack Flyout + The Backpack Flyout uses the registered Flyout for either `Blockly.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX` or `Blockly.registry.Type.FLYOUTS_VERTICAL_TOOLBOX`, similar to the implementation @@ -188,4 +202,5 @@ for `Blockly.Trashcan`. If a custom class is registered for either of these types, then the Backpack Flyout may need to be tested for compatibility. ## License + Apache 2.0 diff --git a/plugins/workspace-backpack/package.json b/plugins/workspace-backpack/package.json index d88f429bd6..270c390bd9 100644 --- a/plugins/workspace-backpack/package.json +++ b/plugins/workspace-backpack/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -52,9 +52,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/workspace-backpack/src/backpack.ts b/plugins/workspace-backpack/src/backpack.ts index 1f7ffb47da..25356994e1 100644 --- a/plugins/workspace-backpack/src/backpack.ts +++ b/plugins/workspace-backpack/src/backpack.ts @@ -21,8 +21,10 @@ import {BackpackChange, BackpackOpen} from './ui_events'; * Class for backpack that can be used save blocks from the workspace for * future use. */ -export class Backpack extends Blockly.DragTarget implements - Blockly.IAutoHideable, Blockly.IPositionable { +export class Backpack + extends Blockly.DragTarget + implements Blockly.IAutoHideable, Blockly.IPositionable +{ /** The unique id for this component. */ id = 'backpack'; @@ -34,7 +36,7 @@ export class Backpack extends Blockly.DragTarget implements private options: BackpackOptions; /** The backpack flyout. Initialized during init. */ - protected flyout_: Blockly.IFlyout|null = null; + protected flyout_: Blockly.IFlyout | null = null; /** A list of JSON (stored as strings) representing blocks in the backpack. */ protected contents_: string[] = []; @@ -64,10 +66,10 @@ export class Backpack extends Blockly.DragTarget implements protected readonly HOTSPOT_MARGIN_ = 10; /** The SVG group containing the backpack. */ - protected svgGroup_: SVGElement|null = null; + protected svgGroup_: SVGElement | null = null; /** The SVG image of the backpack. */ - protected svgImg_: SVGImageElement|null = null; + protected svgImg_: SVGImageElement | null = null; /** Top offset for backpack svg in pixels. */ private spriteTop = 10; @@ -88,8 +90,9 @@ export class Backpack extends Blockly.DragTarget implements * @param backpackOptions The backpack options to use. */ constructor( - protected workspace_: Blockly.WorkspaceSvg, - backpackOptions?: BackpackOptions) { + protected workspace_: Blockly.WorkspaceSvg, + backpackOptions?: BackpackOptions, + ) { super(); this.options = parseOptions(backpackOptions); this.registerSerializer(); @@ -104,13 +107,16 @@ export class Backpack extends Blockly.DragTarget implements return; } - if (Blockly.registry.hasItem( - Blockly.registry.Type.SERIALIZER, 'backpack')) { + if ( + Blockly.registry.hasItem(Blockly.registry.Type.SERIALIZER, 'backpack') + ) { return; } Blockly.serialization.registry.register( - 'backpack', new BackpackSerializer()); + 'backpack', + new BackpackSerializer(), + ); } /** @@ -168,23 +174,25 @@ export class Backpack extends Blockly.DragTarget implements // Create vertical or horizontal flyout. if (this.workspace_.horizontalLayout) { flyoutWorkspaceOptions.toolboxPosition = - (this.workspace_.toolboxPosition === - Blockly.utils.toolbox.Position.TOP) ? - Blockly.utils.toolbox.Position.BOTTOM : - Blockly.utils.toolbox.Position.TOP; + this.workspace_.toolboxPosition === Blockly.utils.toolbox.Position.TOP + ? Blockly.utils.toolbox.Position.BOTTOM + : Blockly.utils.toolbox.Position.TOP; const HorizontalFlyout = Blockly.registry.getClassFromOptions( - Blockly.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX, - this.workspace_.options, true); + Blockly.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX, + this.workspace_.options, + true, + ); this.flyout_ = new HorizontalFlyout(flyoutWorkspaceOptions); } else { flyoutWorkspaceOptions.toolboxPosition = - (this.workspace_.toolboxPosition === - Blockly.utils.toolbox.Position.RIGHT) ? - Blockly.utils.toolbox.Position.LEFT : - Blockly.utils.toolbox.Position.RIGHT; + this.workspace_.toolboxPosition === Blockly.utils.toolbox.Position.RIGHT + ? Blockly.utils.toolbox.Position.LEFT + : Blockly.utils.toolbox.Position.RIGHT; const VerticalFlyout = Blockly.registry.getClassFromOptions( - Blockly.registry.Type.FLYOUTS_VERTICAL_TOOLBOX, - this.workspace_.options, true); + Blockly.registry.Type.FLYOUTS_VERTICAL_TOOLBOX, + this.workspace_.options, + true, + ); this.flyout_ = new VerticalFlyout(flyoutWorkspaceOptions); } // Add flyout to DOM. @@ -197,33 +205,47 @@ export class Backpack extends Blockly.DragTarget implements * Creates DOM for UI element. */ protected createDom() { - this.svgGroup_ = - Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.G, {}, null); + this.svgGroup_ = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.G, + {}, + null, + ); const rnd = Blockly.utils.idGenerator.genUid(); const clip = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.CLIPPATH, {'id': 'blocklyBackpackClipPath' + rnd}, - this.svgGroup_); + Blockly.utils.Svg.CLIPPATH, + {'id': 'blocklyBackpackClipPath' + rnd}, + this.svgGroup_, + ); Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.RECT, { - 'width': this.WIDTH_, - 'height': this.HEIGHT_, - }, - clip); + Blockly.utils.Svg.RECT, + { + 'width': this.WIDTH_, + 'height': this.HEIGHT_, + }, + clip, + ); this.svgImg_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.IMAGE, { - 'class': 'blocklyBackpack', - 'clip-path': 'url(#blocklyBackpackClipPath' + rnd + ')', - 'width': this.spriteSize + 'px', - 'x': -this.spriteLeft, - 'height': this.spriteSize + 'px', - 'y': -this.spriteTop, - }, - this.svgGroup_); + Blockly.utils.Svg.IMAGE, + { + 'class': 'blocklyBackpack', + 'clip-path': 'url(#blocklyBackpackClipPath' + rnd + ')', + 'width': this.spriteSize + 'px', + 'x': -this.spriteLeft, + 'height': this.spriteSize + 'px', + 'y': -this.spriteTop, + }, + this.svgGroup_, + ); this.svgImg_.setAttributeNS( - Blockly.utils.dom.XLINK_NS, 'xlink:href', backpackSvgDataUri); + Blockly.utils.dom.XLINK_NS, + 'xlink:href', + backpackSvgDataUri, + ); Blockly.utils.dom.insertAfter( - this.svgGroup_, this.workspace_.getBubbleCanvas()); + this.svgGroup_, + this.workspace_.getBubbleCanvas(), + ); } /** @@ -231,7 +253,11 @@ export class Backpack extends Blockly.DragTarget implements */ protected attachListeners() { this.addEvent( - this.svgGroup_, 'mousedown', this, this.blockMouseDownWhenOpenable); + this.svgGroup_, + 'mousedown', + this, + this.blockMouseDownWhenOpenable, + ); this.addEvent(this.svgGroup_, 'mouseup', this, this.onClick); this.addEvent(this.svgGroup_, 'mouseover', this, this.onMouseOver); this.addEvent(this.svgGroup_, 'mouseout', this, this.onMouseOut); @@ -245,8 +271,11 @@ export class Backpack extends Blockly.DragTarget implements * @param func Function to call when event is triggered. */ private addEvent( - node: Element, name: string, thisObject: object, - func: (event: Event) => void) { + node: Element, + name: string, + thisObject: object, + func: (event: Event) => void, + ) { const event = Blockly.browserEvents.bind(node, name, thisObject, func); this.boundEvents.push(event); } @@ -255,7 +284,7 @@ export class Backpack extends Blockly.DragTarget implements * Returns the backpack flyout. * @returns The backpack flyout. */ - getFlyout(): Blockly.IFlyout|null { + getFlyout(): Blockly.IFlyout | null { return this.flyout_; } @@ -265,7 +294,7 @@ export class Backpack extends Blockly.DragTarget implements * @returns The component's bounding box. Null if drag * target area should be ignored. */ - getClientRect(): Blockly.utils.Rect|null { + getClientRect(): Blockly.utils.Rect | null { if (!this.svgGroup_) { return null; } @@ -285,8 +314,11 @@ export class Backpack extends Blockly.DragTarget implements */ getBoundingRectangle(): Blockly.utils.Rect { return new Blockly.utils.Rect( - this.top_, this.top_ + this.HEIGHT_, this.left_, - this.left_ + this.WIDTH_); + this.top_, + this.top_ + this.HEIGHT_, + this.left_, + this.left_ + this.WIDTH_, + ); } /** @@ -298,23 +330,31 @@ export class Backpack extends Blockly.DragTarget implements * are already on the workspace. */ position( - metrics: Blockly.MetricsManager.UiMetrics, - savedPositions: Blockly.utils.Rect[]) { + metrics: Blockly.MetricsManager.UiMetrics, + savedPositions: Blockly.utils.Rect[], + ) { if (!this.initialized_) { return; } const scrollbars = this.workspace_.scrollbar; - const hasVerticalScrollbars = scrollbars && scrollbars.isVisible() && - scrollbars.canScrollVertically(); - const hasHorizontalScrollbars = scrollbars && scrollbars.isVisible() && - scrollbars.canScrollHorizontally(); - - if (metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT || - (this.workspace_.horizontalLayout && !this.workspace_.RTL)) { + const hasVerticalScrollbars = + scrollbars && scrollbars.isVisible() && scrollbars.canScrollVertically(); + const hasHorizontalScrollbars = + scrollbars && + scrollbars.isVisible() && + scrollbars.canScrollHorizontally(); + + if ( + metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT || + (this.workspace_.horizontalLayout && !this.workspace_.RTL) + ) { // Right corner placement. - this.left_ = metrics.absoluteMetrics.left + metrics.viewMetrics.width - - this.WIDTH_ - this.MARGIN_HORIZONTAL_; + this.left_ = + metrics.absoluteMetrics.left + + metrics.viewMetrics.width - + this.WIDTH_ - + this.MARGIN_HORIZONTAL_; if (hasVerticalScrollbars && !this.workspace_.RTL) { this.left_ -= Blockly.Scrollbar.scrollbarThickness; } @@ -327,11 +367,14 @@ export class Backpack extends Blockly.DragTarget implements } const startAtBottom = - metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_BOTTOM; + metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_BOTTOM; if (startAtBottom) { // Bottom corner placement - this.top_ = metrics.absoluteMetrics.top + metrics.viewMetrics.height - - this.HEIGHT_ - this.MARGIN_VERTICAL_; + this.top_ = + metrics.absoluteMetrics.top + + metrics.viewMetrics.height - + this.HEIGHT_ - + this.MARGIN_VERTICAL_; if (hasHorizontalScrollbars) { // The horizontal scrollbars are always positioned on the bottom. this.top_ -= Blockly.Scrollbar.scrollbarThickness; @@ -345,9 +388,11 @@ export class Backpack extends Blockly.DragTarget implements let boundingRect = this.getBoundingRectangle(); for (let i = 0, otherEl; (otherEl = savedPositions[i]); i++) { if (boundingRect.intersects(otherEl)) { - if (startAtBottom) { // Bump up. + if (startAtBottom) { + // Bump up. this.top_ = otherEl.top - this.HEIGHT_ - this.MARGIN_VERTICAL_; - } else { // Bump down. + } else { + // Bump down. this.top_ = otherEl.bottom + this.MARGIN_VERTICAL_; } // Recheck other savedPositions @@ -357,7 +402,9 @@ export class Backpack extends Blockly.DragTarget implements } this.svgGroup_.setAttribute( - 'transform', `translate(${this.left_},${this.top_})`); + 'transform', + `translate(${this.left_},${this.top_})`, + ); } /** @@ -405,7 +452,7 @@ export class Backpack extends Blockly.DragTarget implements const keys = ['id', 'height', 'width', 'pinned', 'enabled']; // Traverse the JSON recursively. - const traverseJson = function(json, keys) { + const traverseJson = function (json, keys) { for (const key in json) { if (key) { if (keys.includes(key)) { @@ -435,8 +482,8 @@ export class Backpack extends Blockly.DragTarget implements const workspace = new Blockly.Workspace(); try { const block = Blockly.Xml.domToBlock( - Blockly.utils.xml.textToDom(blockXml), - workspace, + Blockly.utils.xml.textToDom(blockXml), + workspace, ); return this.blockToJsonString(block); } finally { @@ -462,7 +509,6 @@ export class Backpack extends Blockly.DragTarget implements this.addItem(this.blockToJsonString(block)); } - /** * Adds the provided blocks to backpack. * @param blocks The blocks to be added to the @@ -472,7 +518,6 @@ export class Backpack extends Blockly.DragTarget implements this.addItems(blocks.map(this.blockToJsonString)); } - /** * Removes the specified block from the backpack. * @param block The block to be removed from the backpack. @@ -522,12 +567,14 @@ export class Backpack extends Blockly.DragTarget implements setContents(contents: string[]) { this.contents_ = []; this.contents_ = this.filterDuplicates( - // Support XML serialized content for backwards compatiblity: - // https://github.com/google/blockly-samples/issues/1827 - contents.map( - (content) => content.startsWith(' + content.startsWith(' 0) { this.svgImg_.setAttributeNS( - Blockly.utils.dom.XLINK_NS, 'xlink:href', - backpackFilledSvgDataUri); + Blockly.utils.dom.XLINK_NS, + 'xlink:href', + backpackFilledSvgDataUri, + ); } else { this.svgImg_.setAttributeNS( - Blockly.utils.dom.XLINK_NS, 'xlink:href', backpackSvgDataUri); + Blockly.utils.dom.XLINK_NS, + 'xlink:href', + backpackSvgDataUri, + ); } } @@ -581,9 +633,9 @@ export class Backpack extends Blockly.DragTarget implements * @returns Whether the backpack is open-able. */ protected isOpenable(): boolean { - return !this.isOpen() && this.options.allowEmptyBackpackOpen ? - true : - this.getCount() > 0; + return !this.isOpen() && this.options.allowEmptyBackpackOpen + ? true + : this.getCount() > 0; } /** @@ -606,8 +658,10 @@ export class Backpack extends Blockly.DragTarget implements // TODO: We can remove the setVisible check when updating from ^10.0.0 to // ^11. /* eslint-disable @typescript-eslint/no-explicit-any */ - if (this.workspace_.scrollbar && - (this.workspace_.scrollbar as any).setVisible) { + if ( + this.workspace_.scrollbar && + (this.workspace_.scrollbar as any).setVisible + ) { (this.workspace_.scrollbar as any).setVisible(false); } /* eslint-enable @typescript-eslint/no-explicit-any */ @@ -636,8 +690,10 @@ export class Backpack extends Blockly.DragTarget implements // TODO: We can remove the setVisible check when updating from ^10.0.0 to // ^11. /* eslint-disable @typescript-eslint/no-explicit-any */ - if (this.workspace_.scrollbar && - (this.workspace_.scrollbar as any).setVisible) { + if ( + this.workspace_.scrollbar && + (this.workspace_.scrollbar as any).setVisible + ) { (this.workspace_.scrollbar as any).setVisible(true); } /* eslint-enable @typescript-eslint/no-explicit-any */ @@ -667,7 +723,10 @@ export class Backpack extends Blockly.DragTarget implements } this.open(); const uiEvent = new (Blockly.Events.get(Blockly.Events.CLICK))( - null, this.workspace_.id, 'backpack'); + null, + this.workspace_.id, + 'backpack', + ); Blockly.Events.fire(uiEvent); } @@ -748,66 +807,67 @@ export class Backpack extends Blockly.DragTarget implements * Base64 encoded data uri for backpack icon. */ const backpackSvgDataUri = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + - '9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjI0cHgiIH' + - 'ZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0cHgiIGZpbGw9IiM0NTVBNjQiPjxnPjxyZW' + - 'N0IGZpbGw9Im5vbmUiIGhlaWdodD0iMjQiIHdpZHRoPSIyNCIvPjwvZz48Zz48Zy8+PGc+PH' + - 'BhdGggZD0iTTEzLjk3LDUuMzRDMTMuOTgsNS4yMywxNCw1LjEyLDE0LDVjMC0xLjEtMC45LT' + - 'ItMi0ycy0yLDAuOS0yLDJjMCwwLjEyLDAuMDIsMC4yMywwLjAzLDAuMzRDNy42OSw2LjE1LD' + - 'YsOC4zOCw2LDExdjggYzAsMS4xLDAuOSwyLDIsMmg4YzEuMSwwLDItMC45LDItMnYtOEMxOC' + - 'w4LjM4LDE2LjMxLDYuMTUsMTMuOTcsNS4zNHogTTExLDVjMC0wLjU1LDAuNDUtMSwxLTFzMS' + - 'wwLjQ1LDEsMSBjMCwwLjAzLTAuMDEsMC4wNi0wLjAyLDAuMDlDMTIuNjYsNS4wMywxMi4zNC' + - 'w1LDEyLDVzLTAuNjYsMC4wMy0wLjk4LDAuMDlDMTEuMDEsNS4wNiwxMSw1LjAzLDExLDV6IE' + - '0xNiwxM3YxdjAuNSBjMCwwLjI4LTAuMjIsMC41LTAuNSwwLjVTMTUsMTQuNzgsMTUsMTQuNV' + - 'YxNHYtMUg4di0xaDdoMVYxM3oiLz48L2c+PC9nPjwvc3ZnPg=='; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + + '9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjI0cHgiIH' + + 'ZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0cHgiIGZpbGw9IiM0NTVBNjQiPjxnPjxyZW' + + 'N0IGZpbGw9Im5vbmUiIGhlaWdodD0iMjQiIHdpZHRoPSIyNCIvPjwvZz48Zz48Zy8+PGc+PH' + + 'BhdGggZD0iTTEzLjk3LDUuMzRDMTMuOTgsNS4yMywxNCw1LjEyLDE0LDVjMC0xLjEtMC45LT' + + 'ItMi0ycy0yLDAuOS0yLDJjMCwwLjEyLDAuMDIsMC4yMywwLjAzLDAuMzRDNy42OSw2LjE1LD' + + 'YsOC4zOCw2LDExdjggYzAsMS4xLDAuOSwyLDIsMmg4YzEuMSwwLDItMC45LDItMnYtOEMxOC' + + 'w4LjM4LDE2LjMxLDYuMTUsMTMuOTcsNS4zNHogTTExLDVjMC0wLjU1LDAuNDUtMSwxLTFzMS' + + 'wwLjQ1LDEsMSBjMCwwLjAzLTAuMDEsMC4wNi0wLjAyLDAuMDlDMTIuNjYsNS4wMywxMi4zNC' + + 'w1LDEyLDVzLTAuNjYsMC4wMy0wLjk4LDAuMDlDMTEuMDEsNS4wNiwxMSw1LjAzLDExLDV6IE' + + '0xNiwxM3YxdjAuNSBjMCwwLjI4LTAuMjIsMC41LTAuNSwwLjVTMTUsMTQuNzgsMTUsMTQuNV' + + 'YxNHYtMUg4di0xaDdoMVYxM3oiLz48L2c+PC9nPjwvc3ZnPg=='; /** * Base64 encoded data uri for backpack icon when filled. */ -const backpackFilledSvgDataUri = 'data:image/svg+xml;base64,PD94bWwgdmVyc2' + - 'lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYX' + - 'RlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2Zw' + - 'ogICB3aWR0aD0iMjQiCiAgIGhlaWdodD0iMjQiCiAgIHZpZXdCb3g9IjAgMCAyNCAyNCIKIC' + - 'AgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnNSIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3' + - 'JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj' + - '4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiIgLz4KICA8ZwogICAgIGlkPSJsYXllcjEiPgogIC' + - 'AgPGcKICAgICAgIHN0eWxlPSJmaWxsOiM0NTVhNjQiCiAgICAgICBpZD0iZzg0OCIKICAgIC' + - 'AgIHRyYW5zZm9ybT0ibWF0cml4KDAuMjY0NTgzMzMsMCwwLDAuMjY0NTgzMzMsOC44MjQ5OT' + - 'k3LDguODI0OTk5NykiPgogICAgICA8ZwogICAgICAgICBpZD0iZzgyNiI+CiAgICAgICAgPH' + - 'JlY3QKICAgICAgICAgICBmaWxsPSJub25lIgogICAgICAgICAgIGhlaWdodD0iMjQiCiAgIC' + - 'AgICAgICAgd2lkdGg9IjI0IgogICAgICAgICAgIGlkPSJyZWN0ODI0IgogICAgICAgICAgIH' + - 'g9IjAiCiAgICAgICAgICAgeT0iMCIgLz4KICAgICAgPC9nPgogICAgICA8ZwogICAgICAgIC' + - 'BpZD0iZzgzNCI+CiAgICAgICAgPGcKICAgICAgICAgICBpZD0iZzgyOCIgLz4KICAgICAgIC' + - 'A8ZwogICAgICAgICAgIGlkPSJnMjIyMyI+CiAgICAgICAgICA8ZwogICAgICAgICAgICAgaW' + - 'Q9ImcyMTAxNiI+CiAgICAgICAgICAgIDxnCiAgICAgICAgICAgICAgIHN0eWxlPSJmaWxsOi' + - 'M0NTVhNjQiCiAgICAgICAgICAgICAgIGlkPSJnMTQ5MyIKICAgICAgICAgICAgICAgdHJhbn' + - 'Nmb3JtPSJtYXRyaXgoMy43Nzk1Mjc2LDAsMCwzLjc3OTUyNzYsLTMzLjM1NDMzLC0zMy4zNT' + - 'QzMykiPgogICAgICAgICAgICAgIDxnCiAgICAgICAgICAgICAgICAgaWQ9ImcxNDcxIj4KIC' + - 'AgICAgICAgICAgICAgIDxwYXRoCiAgICAgICAgICAgICAgICAgICBpZD0icmVjdDE0NjkiCi' + - 'AgICAgICAgICAgICAgICAgICBzdHlsZT0iZmlsbDpub25lIgogICAgICAgICAgICAgICAgIC' + - 'AgZD0iTSAwLDAgSCAyNCBWIDI0IEggMCBaIiAvPgogICAgICAgICAgICAgIDwvZz4KICAgIC' + - 'AgICAgICAgICA8ZwogICAgICAgICAgICAgICAgIGlkPSJnMTQ3OSI+CiAgICAgICAgICAgIC' + - 'AgICA8ZwogICAgICAgICAgICAgICAgICAgaWQ9ImcxNDczIiAvPgogICAgICAgICAgICAgIC' + - 'AgPGcKICAgICAgICAgICAgICAgICAgIGlkPSJnMTQ3NyI+CiAgICAgICAgICAgICAgICAgID' + - 'xwYXRoCiAgICAgICAgICAgICAgICAgICAgIGlkPSJwYXRoMTQ3NSIKICAgICAgICAgICAgIC' + - 'AgICAgICAgZD0ibSAxMiwzIGMgLTEuMSwwIC0yLDAuOSAtMiwyIDAsMC4xMiAwLjAxOTMsMC' + - '4yMjk4NDM4IDAuMDI5MywwLjMzOTg0MzggQyA3LjY4OTI5NjUsNi4xNDk4NDMzIDYsOC4zOC' + - 'A2LDExIHYgOCBjIDAsMS4xIDAuOSwyIDIsMiBoIDggYyAxLjEsMCAyLC0wLjkgMiwtMiBWID' + - 'ExIEMgMTgsOC4zOCAxNi4zMTA3MDMsNi4xNDk4NDMzIDEzLjk3MDcwMyw1LjMzOTg0MzggMT' + - 'MuOTgwNzAzLDUuMjI5ODQzOCAxNCw1LjEyIDE0LDUgMTQsMy45IDEzLjEsMyAxMiwzIFogbS' + - 'AwLDEgYyAwLjU1LDAgMSwwLjQ1IDEsMSAwLDAuMDMgLTAuMDA5NSwwLjA1OTg0NCAtMC4wMT' + - 'k1MywwLjA4OTg0NCBDIDEyLjY2MDQ2OSw1LjAyOTg0MzggMTIuMzQsNSAxMiw1IDExLjY2LD' + - 'UgMTEuMzM5NTMxLDUuMDI5ODQzOCAxMS4wMTk1MzEsNS4wODk4NDM4IDExLjAwOTUzMSw1Lj' + - 'A1OTg0MzggMTEsNS4wMyAxMSw1IDExLDQuNDUgMTEuNDUsNCAxMiw0IFogbSAtMy40NzI2NT' + - 'YyLDYuMzk4NDM4IGggMS4xNTYyNSB2IDIuNjQwNjI0IGggMC4zMDkzMzU0IGwgLTIuMzdlLT' + - 'UsLTEuMTcxMTQ2IDEuMDgyNzEwNSwtMTBlLTcgMC4wMTEsMS4xNzExNDYgaCAwLjMzMzMwNC' + - 'BsIC0wLjAzNTA0LC0yLjU4NzMxNSBoIDAuNTc4MTI1IDAuNTc4MTI1IGwgMC4wMTEwNSwyLj' + - 'U4NzMxNSBoIDAuMzU2MDI0IFYgMTIuMDYwNTQ3IEggMTQuMDYyNSB2IDAuOTc4NTE1IGggMC' + - '4zMzAwNzggdiAtMi41NTI3MzQgaCAxLjE1NjI1IHYgMi41NTI3MzQgaCAwLjk2Njc5NyB2ID' + - 'AuMzU3NDIyIEggOS42ODM1OTM4IDguNTI3MzQzOCA3LjYwMzUxNTYgdiAtMC4zNTc0MjIgaC' + - 'AwLjkyMzgyODIgeiIKICAgICAgICAgICAgICAgICAgICAgLz4KICAgICAgICAgICAgICAgID' + - 'wvZz4KICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICAgIDwvZz' + - '4KICAgICAgICA8L2c+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo='; +const backpackFilledSvgDataUri = + 'data:image/svg+xml;base64,PD94bWwgdmVyc2' + + 'lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYX' + + 'RlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2Zw' + + 'ogICB3aWR0aD0iMjQiCiAgIGhlaWdodD0iMjQiCiAgIHZpZXdCb3g9IjAgMCAyNCAyNCIKIC' + + 'AgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnNSIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3' + + 'JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj' + + '4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiIgLz4KICA8ZwogICAgIGlkPSJsYXllcjEiPgogIC' + + 'AgPGcKICAgICAgIHN0eWxlPSJmaWxsOiM0NTVhNjQiCiAgICAgICBpZD0iZzg0OCIKICAgIC' + + 'AgIHRyYW5zZm9ybT0ibWF0cml4KDAuMjY0NTgzMzMsMCwwLDAuMjY0NTgzMzMsOC44MjQ5OT' + + 'k3LDguODI0OTk5NykiPgogICAgICA8ZwogICAgICAgICBpZD0iZzgyNiI+CiAgICAgICAgPH' + + 'JlY3QKICAgICAgICAgICBmaWxsPSJub25lIgogICAgICAgICAgIGhlaWdodD0iMjQiCiAgIC' + + 'AgICAgICAgd2lkdGg9IjI0IgogICAgICAgICAgIGlkPSJyZWN0ODI0IgogICAgICAgICAgIH' + + 'g9IjAiCiAgICAgICAgICAgeT0iMCIgLz4KICAgICAgPC9nPgogICAgICA8ZwogICAgICAgIC' + + 'BpZD0iZzgzNCI+CiAgICAgICAgPGcKICAgICAgICAgICBpZD0iZzgyOCIgLz4KICAgICAgIC' + + 'A8ZwogICAgICAgICAgIGlkPSJnMjIyMyI+CiAgICAgICAgICA8ZwogICAgICAgICAgICAgaW' + + 'Q9ImcyMTAxNiI+CiAgICAgICAgICAgIDxnCiAgICAgICAgICAgICAgIHN0eWxlPSJmaWxsOi' + + 'M0NTVhNjQiCiAgICAgICAgICAgICAgIGlkPSJnMTQ5MyIKICAgICAgICAgICAgICAgdHJhbn' + + 'Nmb3JtPSJtYXRyaXgoMy43Nzk1Mjc2LDAsMCwzLjc3OTUyNzYsLTMzLjM1NDMzLC0zMy4zNT' + + 'QzMykiPgogICAgICAgICAgICAgIDxnCiAgICAgICAgICAgICAgICAgaWQ9ImcxNDcxIj4KIC' + + 'AgICAgICAgICAgICAgIDxwYXRoCiAgICAgICAgICAgICAgICAgICBpZD0icmVjdDE0NjkiCi' + + 'AgICAgICAgICAgICAgICAgICBzdHlsZT0iZmlsbDpub25lIgogICAgICAgICAgICAgICAgIC' + + 'AgZD0iTSAwLDAgSCAyNCBWIDI0IEggMCBaIiAvPgogICAgICAgICAgICAgIDwvZz4KICAgIC' + + 'AgICAgICAgICA8ZwogICAgICAgICAgICAgICAgIGlkPSJnMTQ3OSI+CiAgICAgICAgICAgIC' + + 'AgICA8ZwogICAgICAgICAgICAgICAgICAgaWQ9ImcxNDczIiAvPgogICAgICAgICAgICAgIC' + + 'AgPGcKICAgICAgICAgICAgICAgICAgIGlkPSJnMTQ3NyI+CiAgICAgICAgICAgICAgICAgID' + + 'xwYXRoCiAgICAgICAgICAgICAgICAgICAgIGlkPSJwYXRoMTQ3NSIKICAgICAgICAgICAgIC' + + 'AgICAgICAgZD0ibSAxMiwzIGMgLTEuMSwwIC0yLDAuOSAtMiwyIDAsMC4xMiAwLjAxOTMsMC' + + '4yMjk4NDM4IDAuMDI5MywwLjMzOTg0MzggQyA3LjY4OTI5NjUsNi4xNDk4NDMzIDYsOC4zOC' + + 'A2LDExIHYgOCBjIDAsMS4xIDAuOSwyIDIsMiBoIDggYyAxLjEsMCAyLC0wLjkgMiwtMiBWID' + + 'ExIEMgMTgsOC4zOCAxNi4zMTA3MDMsNi4xNDk4NDMzIDEzLjk3MDcwMyw1LjMzOTg0MzggMT' + + 'MuOTgwNzAzLDUuMjI5ODQzOCAxNCw1LjEyIDE0LDUgMTQsMy45IDEzLjEsMyAxMiwzIFogbS' + + 'AwLDEgYyAwLjU1LDAgMSwwLjQ1IDEsMSAwLDAuMDMgLTAuMDA5NSwwLjA1OTg0NCAtMC4wMT' + + 'k1MywwLjA4OTg0NCBDIDEyLjY2MDQ2OSw1LjAyOTg0MzggMTIuMzQsNSAxMiw1IDExLjY2LD' + + 'UgMTEuMzM5NTMxLDUuMDI5ODQzOCAxMS4wMTk1MzEsNS4wODk4NDM4IDExLjAwOTUzMSw1Lj' + + 'A1OTg0MzggMTEsNS4wMyAxMSw1IDExLDQuNDUgMTEuNDUsNCAxMiw0IFogbSAtMy40NzI2NT' + + 'YyLDYuMzk4NDM4IGggMS4xNTYyNSB2IDIuNjQwNjI0IGggMC4zMDkzMzU0IGwgLTIuMzdlLT' + + 'UsLTEuMTcxMTQ2IDEuMDgyNzEwNSwtMTBlLTcgMC4wMTEsMS4xNzExNDYgaCAwLjMzMzMwNC' + + 'BsIC0wLjAzNTA0LC0yLjU4NzMxNSBoIDAuNTc4MTI1IDAuNTc4MTI1IGwgMC4wMTEwNSwyLj' + + 'U4NzMxNSBoIDAuMzU2MDI0IFYgMTIuMDYwNTQ3IEggMTQuMDYyNSB2IDAuOTc4NTE1IGggMC' + + '4zMzAwNzggdiAtMi41NTI3MzQgaCAxLjE1NjI1IHYgMi41NTI3MzQgaCAwLjk2Njc5NyB2ID' + + 'AuMzU3NDIyIEggOS42ODM1OTM4IDguNTI3MzQzOCA3LjYwMzUxNTYgdiAtMC4zNTc0MjIgaC' + + 'AwLjkyMzgyODIgeiIKICAgICAgICAgICAgICAgICAgICAgLz4KICAgICAgICAgICAgICAgID' + + 'wvZz4KICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICAgIDwvZz' + + '4KICAgICAgICA8L2c+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo='; Blockly.Css.register(` .blocklyBackpack { @@ -821,7 +881,6 @@ Blockly.Css.register(` } `); - /** * Custom serializer so that the backpack can save and later recall which * blocks have been saved in a workspace. diff --git a/plugins/workspace-backpack/src/backpack_helpers.ts b/plugins/workspace-backpack/src/backpack_helpers.ts index 043f6a193c..a096ea08d9 100644 --- a/plugins/workspace-backpack/src/backpack_helpers.ts +++ b/plugins/workspace-backpack/src/backpack_helpers.ts @@ -23,18 +23,19 @@ import {BackpackContextMenuOptions} from './options'; function registerEmptyBackpack(workspace: Blockly.WorkspaceSvg) { const prevConfigureContextMenu = workspace.configureContextMenu; workspace.configureContextMenu = (menuOptions, e: PointerEvent) => { - const backpack = - workspace.getComponentManager().getComponent('backpack') as Backpack; + const backpack = workspace + .getComponentManager() + .getComponent('backpack') as Backpack; if (!backpack || !backpack.getClientRect().contains(e.clientX, e.clientY)) { prevConfigureContextMenu && - prevConfigureContextMenu.call(null, menuOptions, e); + prevConfigureContextMenu.call(null, menuOptions, e); return; } menuOptions.length = 0; const backpackOptions = { text: Blockly.Msg['EMPTY_BACKPACK'], enabled: !!backpack.getCount(), - callback: function() { + callback: function () { backpack.empty(); }, scope: { @@ -55,21 +56,22 @@ function registerRemoveFromBackpack() { } const removeFromBackpack = { displayText: Blockly.Msg['REMOVE_FROM_BACKPACK'], - preconditionFn: function(scope: Blockly.ContextMenuRegistry.Scope) { + preconditionFn: function (scope: Blockly.ContextMenuRegistry.Scope) { const ws = scope.block.workspace; if (ws.isFlyout && ws.targetWorkspace) { - const backpack = ws.targetWorkspace.getComponentManager().getComponent( - 'backpack') as Backpack; + const backpack = ws.targetWorkspace + .getComponentManager() + .getComponent('backpack') as Backpack; if (backpack && backpack.getFlyout().getWorkspace().id === ws.id) { return 'enabled'; } } return 'hidden'; }, - callback: function(scope: Blockly.ContextMenuRegistry.Scope) { - const backpack = - scope.block.workspace.targetWorkspace.getComponentManager() - .getComponent('backpack') as Backpack; + callback: function (scope: Blockly.ContextMenuRegistry.Scope) { + const backpack = scope.block.workspace.targetWorkspace + .getComponentManager() + .getComponent('backpack') as Backpack; backpack.removeBlock(scope.block); }, scopeType: Blockly.ContextMenuRegistry.ScopeType.BLOCK, @@ -90,20 +92,22 @@ function registerCopyToBackpack(disablePreconditionContainsCheck: boolean) { return; } const copyToBackpack = { - displayText: function(scope: Blockly.ContextMenuRegistry.Scope) { + displayText: function (scope: Blockly.ContextMenuRegistry.Scope) { if (!scope.block) { return; } - const backpack = scope.block.workspace.getComponentManager().getComponent( - 'backpack') as Backpack; + const backpack = scope.block.workspace + .getComponentManager() + .getComponent('backpack') as Backpack; const backpackCount = backpack.getCount(); return `${Blockly.Msg['COPY_TO_BACKPACK']} (${backpackCount})`; }, - preconditionFn: function(scope: Blockly.ContextMenuRegistry.Scope) { + preconditionFn: function (scope: Blockly.ContextMenuRegistry.Scope) { const ws = scope.block.workspace; if (!ws.isFlyout) { - const backpack = - ws.getComponentManager().getComponent('backpack') as Backpack; + const backpack = ws + .getComponentManager() + .getComponent('backpack') as Backpack; if (backpack) { if (disablePreconditionContainsCheck) { return 'enabled'; @@ -113,9 +117,10 @@ function registerCopyToBackpack(disablePreconditionContainsCheck: boolean) { } return 'hidden'; }, - callback: function(scope: Blockly.ContextMenuRegistry.Scope) { - const backpack = scope.block.workspace.getComponentManager().getComponent( - 'backpack') as Backpack; + callback: function (scope: Blockly.ContextMenuRegistry.Scope) { + const backpack = scope.block.workspace + .getComponentManager() + .getComponent('backpack') as Backpack; backpack.addBlock(scope.block); }, scopeType: Blockly.ContextMenuRegistry.ScopeType.BLOCK, @@ -136,7 +141,7 @@ function registerCopyAllBackpack() { } const copyAllToBackpack = { displayText: Blockly.Msg['COPY_ALL_TO_BACKPACK'], - preconditionFn: function(scope: Blockly.ContextMenuRegistry.Scope) { + preconditionFn: function (scope: Blockly.ContextMenuRegistry.Scope) { const ws = scope.workspace; if (!ws.isFlyout) { const backpack = ws.getComponentManager().getComponent('backpack'); @@ -146,10 +151,11 @@ function registerCopyAllBackpack() { } return 'hidden'; }, - callback: function(scope: Blockly.ContextMenuRegistry.Scope) { + callback: function (scope: Blockly.ContextMenuRegistry.Scope) { const ws = scope.workspace; - const backpack = - ws.getComponentManager().getComponent('backpack') as Backpack; + const backpack = ws + .getComponentManager() + .getComponent('backpack') as Backpack; backpack.addBlocks(ws.getTopBlocks(true)); }, scopeType: Blockly.ContextMenuRegistry.ScopeType.WORKSPACE, @@ -169,16 +175,17 @@ function registerPasteAllBackpack() { return; } const pasteAllFromBackpack = { - displayText: function(scope: Blockly.ContextMenuRegistry.Scope) { + displayText: function (scope: Blockly.ContextMenuRegistry.Scope) { if (!scope.workspace) { return; } - const backpack = scope.workspace.getComponentManager().getComponent( - 'backpack') as Backpack; + const backpack = scope.workspace + .getComponentManager() + .getComponent('backpack') as Backpack; const backpackCount = backpack.getCount(); return `${Blockly.Msg['PASTE_ALL_FROM_BACKPACK']} (${backpackCount})`; }, - preconditionFn: function(scope: Blockly.ContextMenuRegistry.Scope) { + preconditionFn: function (scope: Blockly.ContextMenuRegistry.Scope) { const ws = scope.workspace; if (!ws.isFlyout) { const backpack = ws.getComponentManager().getComponent('backpack'); @@ -188,14 +195,17 @@ function registerPasteAllBackpack() { } return 'hidden'; }, - callback: function(scope: Blockly.ContextMenuRegistry.Scope) { + callback: function (scope: Blockly.ContextMenuRegistry.Scope) { const ws = scope.workspace; - const backpack = - ws.getComponentManager().getComponent('backpack') as Backpack; + const backpack = ws + .getComponentManager() + .getComponent('backpack') as Backpack; const contents = backpack.getContents(); contents.forEach((blockText) => { const block = Blockly.serialization.blocks.append( - JSON.parse(blockText), ws) as Blockly.BlockSvg; + JSON.parse(blockText), + ws, + ) as Blockly.BlockSvg; block.scheduleSnapAndBump(); }); }, @@ -213,8 +223,9 @@ function registerPasteAllBackpack() { * @param workspace The workspace to register the context menu options. */ export function registerContextMenus( - contextMenuOptions: BackpackContextMenuOptions, - workspace: Blockly.WorkspaceSvg) { + contextMenuOptions: BackpackContextMenuOptions, + workspace: Blockly.WorkspaceSvg, +) { if (contextMenuOptions.emptyBackpack) { registerEmptyBackpack(workspace); } diff --git a/plugins/workspace-backpack/src/options.ts b/plugins/workspace-backpack/src/options.ts index b0cc63b937..1018ae6955 100644 --- a/plugins/workspace-backpack/src/options.ts +++ b/plugins/workspace-backpack/src/options.ts @@ -53,11 +53,11 @@ export function parseOptions(options?: BackpackOptions): BackpackOptions { return { allowEmptyBackpackOpen: - options.allowEmptyBackpackOpen ?? defaults.allowEmptyBackpackOpen, + options.allowEmptyBackpackOpen ?? defaults.allowEmptyBackpackOpen, useFilledBackpackImage: - options.useFilledBackpackImage ?? defaults.useFilledBackpackImage, - skipSerializerRegistration: options.skipSerializerRegistration ?? - defaults.skipSerializerRegistration, + options.useFilledBackpackImage ?? defaults.useFilledBackpackImage, + skipSerializerRegistration: + options.skipSerializerRegistration ?? defaults.skipSerializerRegistration, contextMenu: { ...defaults.contextMenu, ...options.contextMenu, diff --git a/plugins/workspace-backpack/src/ui_events.ts b/plugins/workspace-backpack/src/ui_events.ts index dcf8fd5585..5824b6fa33 100644 --- a/plugins/workspace-backpack/src/ui_events.ts +++ b/plugins/workspace-backpack/src/ui_events.ts @@ -32,7 +32,10 @@ export class BackpackOpen extends Blockly.Events.UiBase { * @param workspaceId The workspace identifier for this event. * Undefined for a blank event. */ - constructor(public isOpen?: boolean, workspaceId?: string) { + constructor( + public isOpen?: boolean, + workspaceId?: string, + ) { super(workspaceId); } @@ -54,21 +57,26 @@ export class BackpackOpen extends Blockly.Events.UiBase { * @returns A newly deserialized BackpackOpen event. */ static fromJson( - json: BackpackOpenEventJson, workspace: Blockly.Workspace, - event: unknown): BackpackOpen { + json: BackpackOpenEventJson, + workspace: Blockly.Workspace, + event: unknown, + ): BackpackOpen { const newEvent = super.fromJson(json, workspace, event) as BackpackOpen; newEvent.isOpen = json['isOpen']; return newEvent; } } -export interface BackpackOpenEventJson extends - Blockly.Events.AbstractEventJson { +export interface BackpackOpenEventJson + extends Blockly.Events.AbstractEventJson { isOpen?: boolean; } Blockly.registry.register( - Blockly.registry.Type.EVENT, backpackOpen, BackpackOpen); + Blockly.registry.Type.EVENT, + backpackOpen, + BackpackOpen, +); /** * Name of event that records a backpack change. @@ -86,4 +94,7 @@ export class BackpackChange extends Blockly.Events.UiBase { } Blockly.registry.register( - Blockly.registry.Type.EVENT, backpackChange, BackpackChange); + Blockly.registry.Type.EVENT, + backpackChange, + BackpackChange, +); diff --git a/plugins/workspace-backpack/test/index.html b/plugins/workspace-backpack/test/index.html index f73ccbd95e..577d3bd5dc 100644 --- a/plugins/workspace-backpack/test/index.html +++ b/plugins/workspace-backpack/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Backpack Test + + - - - Blockly Backpack Test - - - - -
- - - + +
+ + diff --git a/plugins/workspace-backpack/test/index.ts b/plugins/workspace-backpack/test/index.ts index 98ac7874c6..d27f236b9a 100644 --- a/plugins/workspace-backpack/test/index.ts +++ b/plugins/workspace-backpack/test/index.ts @@ -16,8 +16,9 @@ import {Backpack} from '../src/index'; * @returns The created workspace. */ function createWorkspace( - blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); const backpack = new Backpack(workspace); @@ -26,10 +27,13 @@ function createWorkspace( return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; createPlayground( - document.getElementById('root'), createWorkspace, defaultOptions); + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/workspace-minimap/README.md b/plugins/workspace-minimap/README.md index ca2a9305de..8876b49c58 100644 --- a/plugins/workspace-minimap/README.md +++ b/plugins/workspace-minimap/README.md @@ -8,18 +8,22 @@ There is a focus region within the minimap that highlights the users's current v ## Installation ### Yarn + ``` yarn add @blockly/workspace-minimap ``` ### npm + ``` npm install @blockly/workspace-minimap --save ``` ## Usage + ### Positioned Minimap -A positioned minimap is an embedded component that lies on top of the primary workspace. When using a PositionedMinimap, the size of the minimap is determined by the window size, and the position by the primary workspace layout configuration. + +A positioned minimap is an embedded component that lies on top of the primary workspace. When using a PositionedMinimap, the size of the minimap is determined by the window size, and the position by the primary workspace layout configuration. ```js import * as Blockly from 'blockly'; @@ -36,6 +40,7 @@ minimap.init(); ``` ### Unpositioned Minimap + A raw minimap is an object whose size and position is configured using css. ```js @@ -64,10 +69,12 @@ minimap.init(); ``` ### Configuration + The minimap takes a workspace as input and it inherits its RTL and theme properties (so that they don't need to be configured manually). Additional styling of the minimap is possible with CSS. Use the `blockly-minimap` class for the minimap (box-shadow, etc.) and `blockly-focus-region` for the focus region (fill color, etc.). ## API + - `init`: Initializes the minimap. - `dispose`: Disposes of the minimap. @@ -76,9 +83,11 @@ Additional styling of the minimap is possible with CSS. Use the `blockly-minimap - `disableFocusRegion`: Turns off the focus region in the minimap. The following methods are also accessible with PositionedMinimap instances. + - `position`: Positions the minimap UI element. - `getBoundingRectangle`: Returns the bounding rectangle of the UI element in -pixel units relative to the Blockly injection div. + pixel units relative to the Blockly injection div. ## License + Apache 2.0 diff --git a/plugins/workspace-minimap/package.json b/plugins/workspace-minimap/package.json index be2434e470..89c81072e4 100644 --- a/plugins/workspace-minimap/package.json +++ b/plugins/workspace-minimap/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -50,8 +50,5 @@ "publishConfig": { "access": "public", "registry": "https://wombat-dressing-room.appspot.com" - }, - "eslintConfig": { - "extends": "@blockly/eslint-config" } } diff --git a/plugins/workspace-minimap/src/focus_region.ts b/plugins/workspace-minimap/src/focus_region.ts index 2b8ce65ba8..a3f124ebf0 100644 --- a/plugins/workspace-minimap/src/focus_region.ts +++ b/plugins/workspace-minimap/src/focus_region.ts @@ -18,7 +18,8 @@ const blockEvents = new Set([ Blockly.Events.BLOCK_CREATE, Blockly.Events.BLOCK_DELETE, Blockly.Events.BLOCK_DRAG, - Blockly.Events.BLOCK_MOVE]); + Blockly.Events.BLOCK_MOVE, +]); const borderRadius = 6; @@ -26,167 +27,176 @@ const borderRadius = 6; * A class that highlights the user's viewport on the minimap. */ export class FocusRegion { - private onChangeWrapper: (e: Blockly.Events.Abstract) => void; - private svgGroup: SVGElement; - private rect: SVGElement; - private background: SVGElement; - private id: string; - private initialized = false; - - - /** - * Constructor for the focus region. - * @param primaryWorkspace The primary workspaceSvg. - * @param minimapWorkspace The minimap workspaceSvg. - */ - constructor(private primaryWorkspace: Blockly.WorkspaceSvg, - private minimapWorkspace: Blockly.WorkspaceSvg) { - this.id = String(Math.random()).substring(2); + private onChangeWrapper: (e: Blockly.Events.Abstract) => void; + private svgGroup: SVGElement; + private rect: SVGElement; + private background: SVGElement; + private id: string; + private initialized = false; + + /** + * Constructor for the focus region. + * @param primaryWorkspace The primary workspaceSvg. + * @param minimapWorkspace The minimap workspaceSvg. + */ + constructor( + private primaryWorkspace: Blockly.WorkspaceSvg, + private minimapWorkspace: Blockly.WorkspaceSvg, + ) { + this.id = String(Math.random()).substring(2); + } + + /** + * Initializes focus region. + */ + init() { + // Make the svg group element. + this.svgGroup = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.G, + {'class': 'blockly-focus-region'}, + null, + ); + + // Make the mask under the svg group. + const mask = Blockly.utils.dom.createSvgElement( + new Blockly.utils.Svg('mask'), + {'id': 'focusRegionMask' + this.id}, + this.svgGroup, + ); + + // Make the background under the svg group. + this.background = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.RECT, + { + 'x': 0, + 'y': 0, + 'width': '100%', + 'height': '100%', + 'mask': 'url(#focusRegionMask' + this.id + ')', + }, + this.svgGroup, + ); + + // Make the white layer under the svg mask. + Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.RECT, + { + 'x': 0, + 'y': 0, + 'width': '100%', + 'height': '100%', + 'fill': 'white', + }, + mask, + ); + + // Make the black layer under the mask. + this.rect = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.RECT, + { + 'x': 0, + 'y': 0, + 'rx': borderRadius, + 'ry': borderRadius, + 'fill': 'black', + }, + mask, + ); + + // Add the svg group to the minimap. + const parentSvg = this.minimapWorkspace.getParentSvg(); + if (parentSvg.firstChild) { + parentSvg.insertBefore(this.svgGroup, parentSvg.firstChild); + } else { + parentSvg.appendChild(this.svgGroup); } - - /** - * Initializes focus region. - */ - init() { - // Make the svg group element. - this.svgGroup = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.G, {'class': 'blockly-focus-region'}, null); - - // Make the mask under the svg group. - const mask = Blockly.utils.dom.createSvgElement( - new Blockly.utils.Svg('mask'), - {'id': 'focusRegionMask' + this.id}, - this.svgGroup); - - // Make the background under the svg group. - this.background = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.RECT, { - 'x': 0, - 'y': 0, - 'width': '100%', - 'height': '100%', - 'mask': 'url(#focusRegionMask' + this.id + ')', - }, this.svgGroup); - - // Make the white layer under the svg mask. - Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.RECT, { - 'x': 0, - 'y': 0, - 'width': '100%', - 'height': '100%', - 'fill': 'white', - }, mask); - - // Make the black layer under the mask. - this.rect = Blockly.utils.dom.createSvgElement( - Blockly.utils.Svg.RECT, { - 'x': 0, - 'y': 0, - 'rx': borderRadius, - 'ry': borderRadius, - 'fill': 'black', - }, mask); - - // Add the svg group to the minimap. - const parentSvg = this.minimapWorkspace.getParentSvg(); - if (parentSvg.firstChild) { - parentSvg.insertBefore(this.svgGroup, parentSvg.firstChild); - } else { - parentSvg.appendChild(this.svgGroup); - } - - window.addEventListener('resize', () => void this.update()); - window.addEventListener('load', () => void this.update()); - this.onChangeWrapper = this.onChange.bind(this); - this.primaryWorkspace.addChangeListener(this.onChangeWrapper); - - this.update(); - this.initialized = true; + window.addEventListener('resize', () => void this.update()); + window.addEventListener('load', () => void this.update()); + this.onChangeWrapper = this.onChange.bind(this); + this.primaryWorkspace.addChangeListener(this.onChangeWrapper); + + this.update(); + this.initialized = true; + } + + /** + * Disposes of the focus region. + * Unlinks from all DOM elements and remove all event listeners + * to prevent memory leaks. + */ + dispose() { + if (this.onChangeWrapper) { + this.primaryWorkspace.removeChangeListener(this.onChangeWrapper); + this.onChangeWrapper = null; } - - - /** - * Disposes of the focus region. - * Unlinks from all DOM elements and remove all event listeners - * to prevent memory leaks. - */ - dispose() { - if (this.onChangeWrapper) { - this.primaryWorkspace.removeChangeListener(this.onChangeWrapper); - this.onChangeWrapper = null; - } - if (this.svgGroup) { - Blockly.utils.dom.removeNode(this.svgGroup); - } - this.svgGroup = null; - this.rect = null; - this.background = null; - this.initialized = false; + if (this.svgGroup) { + Blockly.utils.dom.removeNode(this.svgGroup); } - - - /** - * Handles events triggered on the primary workspace. - * @param event The event. - */ - private onChange(event: Blockly.Events.Abstract): void { - if (blockEvents.has(event.type)) { - this.update(); - } + this.svgGroup = null; + this.rect = null; + this.background = null; + this.initialized = false; + } + + /** + * Handles events triggered on the primary workspace. + * @param event The event. + */ + private onChange(event: Blockly.Events.Abstract): void { + if (blockEvents.has(event.type)) { + this.update(); } - - - /** - * Positions and sizes the highlight on the minimap - * based on the primary workspace. - */ - private update(): void { - // Get the metrics. - const primaryMetrics = this.primaryWorkspace.getMetricsManager(); - const minimapMetrics = this.minimapWorkspace.getMetricsManager(); - - const primaryView = primaryMetrics.getViewMetrics(true); - const primaryContent = primaryMetrics.getContentMetrics(true); - const minimapContent = minimapMetrics.getContentMetrics(); - const minimapSvg = minimapMetrics.getSvgMetrics(); - - // Return if there is no content. - if (primaryContent.width === 0) { - return; - } - - // Get the workscape to pixel scale on the minimap. - const scale = minimapContent.width / - minimapMetrics.getContentMetrics(true).width; - - // Get the viewport size on a minimap scale. - const width = primaryView.width * scale; - const height = primaryView.height * scale; - - // Get the viewport position in relation to the content. - let left = (primaryView.left - primaryContent.left) * scale; - let top = (primaryView.top - primaryContent.top) * scale; - - // Account for the padding outside the content on the minimap. - left += (minimapSvg.width - minimapContent.width) / 2; - top += (minimapSvg.height - minimapContent.height) / 2; - - // Set the svg attributes. - this.rect.setAttribute('transform', `translate(${left},${top})`); - this.rect.setAttribute('width', width.toString()); - this.rect.setAttribute('height', height.toString()); + } + + /** + * Positions and sizes the highlight on the minimap + * based on the primary workspace. + */ + private update(): void { + // Get the metrics. + const primaryMetrics = this.primaryWorkspace.getMetricsManager(); + const minimapMetrics = this.minimapWorkspace.getMetricsManager(); + + const primaryView = primaryMetrics.getViewMetrics(true); + const primaryContent = primaryMetrics.getContentMetrics(true); + const minimapContent = minimapMetrics.getContentMetrics(); + const minimapSvg = minimapMetrics.getSvgMetrics(); + + // Return if there is no content. + if (primaryContent.width === 0) { + return; } - - /** - * Returns whether focus region is initialized or not. - * @returns True if focus region is initialized else false. - */ - isEnabled(): boolean { - return this.initialized; - } + // Get the workscape to pixel scale on the minimap. + const scale = + minimapContent.width / minimapMetrics.getContentMetrics(true).width; + + // Get the viewport size on a minimap scale. + const width = primaryView.width * scale; + const height = primaryView.height * scale; + + // Get the viewport position in relation to the content. + let left = (primaryView.left - primaryContent.left) * scale; + let top = (primaryView.top - primaryContent.top) * scale; + + // Account for the padding outside the content on the minimap. + left += (minimapSvg.width - minimapContent.width) / 2; + top += (minimapSvg.height - minimapContent.height) / 2; + + // Set the svg attributes. + this.rect.setAttribute('transform', `translate(${left},${top})`); + this.rect.setAttribute('width', width.toString()); + this.rect.setAttribute('height', height.toString()); + } + + /** + * Returns whether focus region is initialized or not. + * @returns True if focus region is initialized else false. + */ + isEnabled(): boolean { + return this.initialized; + } } Blockly.Css.register(` diff --git a/plugins/workspace-minimap/src/index.ts b/plugins/workspace-minimap/src/index.ts index e5b3ad7397..b9344b9273 100644 --- a/plugins/workspace-minimap/src/index.ts +++ b/plugins/workspace-minimap/src/index.ts @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - /** * @fileoverview A minimap is a miniature version of your blocks that * appears on top of your main workspace. This gives you an overview diff --git a/plugins/workspace-minimap/src/minimap.ts b/plugins/workspace-minimap/src/minimap.ts index 2e32488ed1..1bc8150c48 100644 --- a/plugins/workspace-minimap/src/minimap.ts +++ b/plugins/workspace-minimap/src/minimap.ts @@ -20,7 +20,8 @@ const blockEvents = new Set([ Blockly.Events.BLOCK_CREATE, Blockly.Events.BLOCK_DELETE, Blockly.Events.BLOCK_DRAG, - Blockly.Events.BLOCK_MOVE]); + Blockly.Events.BLOCK_MOVE, +]); /** * A minimap is a miniature version of your blocks that appears on @@ -28,233 +29,237 @@ const blockEvents = new Set([ * your code looks like, and how it is organized. */ export class Minimap { - protected primaryWorkspace: Blockly.WorkspaceSvg; - protected minimapWorkspace: Blockly.WorkspaceSvg; - protected focusRegion: FocusRegion; - protected onMouseMoveWrapper: Blockly.browserEvents.Data; - protected onMouseDownWrapper: Blockly.browserEvents.Data; - protected onMouseUpWrapper: Blockly.browserEvents.Data; - protected minimapWrapper: HTMLDivElement; - - - /** - * Constructor for a minimap. - * @param workspace The workspace to mirror. - */ - constructor(workspace: Blockly.WorkspaceSvg) { - this.primaryWorkspace = workspace; + protected primaryWorkspace: Blockly.WorkspaceSvg; + protected minimapWorkspace: Blockly.WorkspaceSvg; + protected focusRegion: FocusRegion; + protected onMouseMoveWrapper: Blockly.browserEvents.Data; + protected onMouseDownWrapper: Blockly.browserEvents.Data; + protected onMouseUpWrapper: Blockly.browserEvents.Data; + protected minimapWrapper: HTMLDivElement; + + /** + * Constructor for a minimap. + * @param workspace The workspace to mirror. + */ + constructor(workspace: Blockly.WorkspaceSvg) { + this.primaryWorkspace = workspace; + } + + /** + * Initialize. + */ + init(): void { + // Create a wrapper div for the minimap injection. + this.minimapWrapper = document.createElement('div'); + this.minimapWrapper.id = 'minimapWrapper' + this.primaryWorkspace.id; + this.minimapWrapper.className = 'blockly-minimap'; + + // Make the wrapper a sibling to the primary injection div. + const primaryInjectParentDiv = + this.primaryWorkspace.getInjectionDiv().parentNode; + primaryInjectParentDiv.appendChild(this.minimapWrapper); + + // Inject the minimap workspace. + this.minimapWorkspace = Blockly.inject(this.minimapWrapper.id, { + // Inherit the layout of the primary workspace. + rtl: this.primaryWorkspace.RTL, + // Include the scrollbars so that internal scrolling is enabled and + // remove direct interaction with the minimap workspace. + move: { + scrollbars: true, + drag: false, + wheel: false, + }, + // Remove the scale bounds of the minimap so that it can + // correctly zoomToFit. + zoom: { + maxScale: null, + minScale: null, + }, + readOnly: true, + theme: this.primaryWorkspace.getTheme(), + renderer: this.primaryWorkspace.options.renderer, + }); + + this.minimapWorkspace.scrollbar.setContainerVisible(false); + this.primaryWorkspace.addChangeListener((e) => void this.mirror(e)); + window.addEventListener('resize', () => { + this.minimapWorkspace.zoomToFit(); + }); + + // The mouseup binds to the parent container div instead of the minimap + // because if a drag begins on the minimap and ends outside of it the + // mousemove should still unbind. + this.onMouseDownWrapper = Blockly.browserEvents.bind( + this.minimapWorkspace.svgGroup_, + 'mousedown', + this, + this.onClickDown, + ); + this.onMouseUpWrapper = Blockly.browserEvents.bind( + primaryInjectParentDiv, + 'mouseup', + this, + this.onClickUp, + ); + + // Initializes the focus region. + this.focusRegion = new FocusRegion( + this.primaryWorkspace, + this.minimapWorkspace, + ); + this.enableFocusRegion(); + } + + /** + * Disposes the minimap. + * Unlinks from all DOM elements and remove all event listeners + * to prevent memory leaks. + */ + dispose() { + if (this.isFocusEnabled()) { + this.disableFocusRegion(); } - - - /** - * Initialize. - */ - init(): void { - // Create a wrapper div for the minimap injection. - this.minimapWrapper = document.createElement('div'); - this.minimapWrapper.id = 'minimapWrapper' + this.primaryWorkspace.id; - this.minimapWrapper.className = 'blockly-minimap'; - - // Make the wrapper a sibling to the primary injection div. - const primaryInjectParentDiv = - this.primaryWorkspace.getInjectionDiv().parentNode; - primaryInjectParentDiv.appendChild(this.minimapWrapper); - - // Inject the minimap workspace. - this.minimapWorkspace = Blockly.inject(this.minimapWrapper.id, - { - // Inherit the layout of the primary workspace. - rtl: this.primaryWorkspace.RTL, - // Include the scrollbars so that internal scrolling is enabled and - // remove direct interaction with the minimap workspace. - move: { - scrollbars: true, - drag: false, - wheel: false, - }, - // Remove the scale bounds of the minimap so that it can - // correctly zoomToFit. - zoom: { - maxScale: null, - minScale: null, - }, - readOnly: true, - theme: this.primaryWorkspace.getTheme(), - renderer: this.primaryWorkspace.options.renderer, - }); - - this.minimapWorkspace.scrollbar.setContainerVisible(false); - this.primaryWorkspace.addChangeListener((e) => void this.mirror(e)); - window.addEventListener('resize', () => { - this.minimapWorkspace.zoomToFit(); - }); - - // The mouseup binds to the parent container div instead of the minimap - // because if a drag begins on the minimap and ends outside of it the - // mousemove should still unbind. - this.onMouseDownWrapper = Blockly.browserEvents.bind( - this.minimapWorkspace.svgGroup_, 'mousedown', this, this.onClickDown); - this.onMouseUpWrapper = Blockly.browserEvents.bind( - primaryInjectParentDiv, 'mouseup', this, this.onClickUp); - - // Initializes the focus region. - this.focusRegion = new FocusRegion( - this.primaryWorkspace, this.minimapWorkspace); - this.enableFocusRegion(); + this.minimapWorkspace.dispose(); + Blockly.utils.dom.removeNode(this.minimapWrapper); + if (this.onMouseMoveWrapper) { + Blockly.browserEvents.unbind(this.onMouseMoveWrapper); } - - - /** - * Disposes the minimap. - * Unlinks from all DOM elements and remove all event listeners - * to prevent memory leaks. - */ - dispose() { - if (this.isFocusEnabled()) { - this.disableFocusRegion(); - } - this.minimapWorkspace.dispose(); - Blockly.utils.dom.removeNode(this.minimapWrapper); - if (this.onMouseMoveWrapper) { - Blockly.browserEvents.unbind(this.onMouseMoveWrapper); - } - if (this.onMouseDownWrapper) { - Blockly.browserEvents.unbind(this.onMouseDownWrapper); - } - if (this.onMouseUpWrapper) { - Blockly.browserEvents.unbind(this.onMouseUpWrapper); - } + if (this.onMouseDownWrapper) { + Blockly.browserEvents.unbind(this.onMouseDownWrapper); } - - - /** - * Creates the mirroring between workspaces. Passes on all desired events - * to the minimap from the primary workspace. - * @param event The primary workspace event. - */ - private mirror(event: Blockly.Events.Abstract): void { - if (!blockEvents.has(event.type)) { - return; // Filter out events. - } - if (event.type === Blockly.Events.BLOCK_CREATE && - (event as any).xml.tagName === 'shadow') { - return; // Filter out shadow blocks. - } - // Run the event in the minimap. - const json = event.toJson(); - const duplicate = Blockly.Events.fromJson(json, this.minimapWorkspace); - duplicate.run(true); - - // Resize and center the minimap. - // We need to wait for the event to finish rendering to do the zoom. - Blockly.renderManagement.finishQueuedRenders().then(() => { - this.minimapWorkspace.zoomToFit(); - }); + if (this.onMouseUpWrapper) { + Blockly.browserEvents.unbind(this.onMouseUpWrapper); } - - - /** - * Converts the coorindates from a mouse event on the minimap - * into scroll coordinates for the primary viewport. - * @param primaryMetrics The metrics from the primary workspace. - * @param minimapMetrics The metrics from the minimap workspace. - * @param offsetX The x offset of the mouse event. - * @param offsetY The y offset of the mouse event. - * @returns (x, y) primary workspace scroll coordinates. - */ - static minimapToPrimaryCoords( - primaryMetrics: Blockly.utils.Metrics, - minimapMetrics: Blockly.utils.Metrics, - offsetX: number, - offsetY: number): [number, number] { - // Gets the coordinate relative to the top left of the minimap content. - offsetX -= (minimapMetrics.svgWidth - minimapMetrics.contentWidth) / 2; - offsetY -= (minimapMetrics.svgHeight - minimapMetrics.contentHeight) / 2; - - // Scales the coordinate to the primary workspace. - const scale = - primaryMetrics.contentWidth / minimapMetrics.contentWidth; - offsetX *= scale; - offsetY *= scale; - - // Gets the coordinate relative to the top left of the primary content. - let x = -primaryMetrics.contentLeft - offsetX; - let y = -primaryMetrics.contentTop - offsetY; - - // Centers the coordinate in the primary viewport. - x += primaryMetrics.viewWidth / 2; - y += primaryMetrics.viewHeight / 2; - - return [x, y]; + } + + /** + * Creates the mirroring between workspaces. Passes on all desired events + * to the minimap from the primary workspace. + * @param event The primary workspace event. + */ + private mirror(event: Blockly.Events.Abstract): void { + if (!blockEvents.has(event.type)) { + return; // Filter out events. } - - - /** - * Scrolls the primary workspace viewport based on a minimap event. - * @param event The minimap browser event. - */ - private primaryScroll(event: PointerEvent): void { - const [x, y] = Minimap.minimapToPrimaryCoords( - this.primaryWorkspace.getMetrics(), - this.minimapWorkspace.getMetrics(), - event.offsetX, - event.offsetY); - this.primaryWorkspace.scroll(x, y); - } - - - /** - * Updates the primary workspace viewport based on a click in the minimap. - * @param event The minimap browser event. - */ - private onClickDown(event: PointerEvent): void { - this.onMouseMoveWrapper = Blockly.browserEvents.bind( - this.minimapWorkspace.svgGroup_, 'mousemove', this, this.onMouseMove); - this.primaryScroll(event); + if ( + event.type === Blockly.Events.BLOCK_CREATE && + (event as any).xml.tagName === 'shadow' + ) { + return; // Filter out shadow blocks. } - - - /** - * Unbinds the minimap mousemove when the mouse is not clicked. - */ - private onClickUp(): void { - if (this.onMouseMoveWrapper) { - Blockly.browserEvents.unbind(this.onMouseMoveWrapper); - this.onMouseMoveWrapper = null; - } - } - - - /** - * Updates the primary workspace viewport based on a drag in the minimap. - * @param event The minimap browser event. - */ - private onMouseMove(event: PointerEvent): void { - this.primaryScroll(event); - } - - - /** - * Enables the focus region; A highlight of the viewport in the minimap. - */ - enableFocusRegion(): void { - this.focusRegion.init(); - } - - - /** - * Disables the focus region. - */ - disableFocusRegion(): void { - this.focusRegion.dispose(); - } - - - /** - * Returns whether the focus region is enabled. - * @returns True if the focus region is enabled. - */ - isFocusEnabled(): boolean { - return this.focusRegion.isEnabled(); + // Run the event in the minimap. + const json = event.toJson(); + const duplicate = Blockly.Events.fromJson(json, this.minimapWorkspace); + duplicate.run(true); + + // Resize and center the minimap. + // We need to wait for the event to finish rendering to do the zoom. + Blockly.renderManagement.finishQueuedRenders().then(() => { + this.minimapWorkspace.zoomToFit(); + }); + } + + /** + * Converts the coorindates from a mouse event on the minimap + * into scroll coordinates for the primary viewport. + * @param primaryMetrics The metrics from the primary workspace. + * @param minimapMetrics The metrics from the minimap workspace. + * @param offsetX The x offset of the mouse event. + * @param offsetY The y offset of the mouse event. + * @returns (x, y) primary workspace scroll coordinates. + */ + static minimapToPrimaryCoords( + primaryMetrics: Blockly.utils.Metrics, + minimapMetrics: Blockly.utils.Metrics, + offsetX: number, + offsetY: number, + ): [number, number] { + // Gets the coordinate relative to the top left of the minimap content. + offsetX -= (minimapMetrics.svgWidth - minimapMetrics.contentWidth) / 2; + offsetY -= (minimapMetrics.svgHeight - minimapMetrics.contentHeight) / 2; + + // Scales the coordinate to the primary workspace. + const scale = primaryMetrics.contentWidth / minimapMetrics.contentWidth; + offsetX *= scale; + offsetY *= scale; + + // Gets the coordinate relative to the top left of the primary content. + let x = -primaryMetrics.contentLeft - offsetX; + let y = -primaryMetrics.contentTop - offsetY; + + // Centers the coordinate in the primary viewport. + x += primaryMetrics.viewWidth / 2; + y += primaryMetrics.viewHeight / 2; + + return [x, y]; + } + + /** + * Scrolls the primary workspace viewport based on a minimap event. + * @param event The minimap browser event. + */ + private primaryScroll(event: PointerEvent): void { + const [x, y] = Minimap.minimapToPrimaryCoords( + this.primaryWorkspace.getMetrics(), + this.minimapWorkspace.getMetrics(), + event.offsetX, + event.offsetY, + ); + this.primaryWorkspace.scroll(x, y); + } + + /** + * Updates the primary workspace viewport based on a click in the minimap. + * @param event The minimap browser event. + */ + private onClickDown(event: PointerEvent): void { + this.onMouseMoveWrapper = Blockly.browserEvents.bind( + this.minimapWorkspace.svgGroup_, + 'mousemove', + this, + this.onMouseMove, + ); + this.primaryScroll(event); + } + + /** + * Unbinds the minimap mousemove when the mouse is not clicked. + */ + private onClickUp(): void { + if (this.onMouseMoveWrapper) { + Blockly.browserEvents.unbind(this.onMouseMoveWrapper); + this.onMouseMoveWrapper = null; } + } + + /** + * Updates the primary workspace viewport based on a drag in the minimap. + * @param event The minimap browser event. + */ + private onMouseMove(event: PointerEvent): void { + this.primaryScroll(event); + } + + /** + * Enables the focus region; A highlight of the viewport in the minimap. + */ + enableFocusRegion(): void { + this.focusRegion.init(); + } + + /** + * Disables the focus region. + */ + disableFocusRegion(): void { + this.focusRegion.dispose(); + } + + /** + * Returns whether the focus region is enabled. + * @returns True if the focus region is enabled. + */ + isFocusEnabled(): boolean { + return this.focusRegion.isEnabled(); + } } diff --git a/plugins/workspace-minimap/src/positioned_minimap.ts b/plugins/workspace-minimap/src/positioned_minimap.ts index 800b67561c..69f0a19f9e 100644 --- a/plugins/workspace-minimap/src/positioned_minimap.ts +++ b/plugins/workspace-minimap/src/positioned_minimap.ts @@ -17,162 +17,174 @@ const minWidth = 200; /** * A positionable version of minimap that implements IPositionable. */ -export class PositionedMinimap extends Minimap implements Blockly.IPositionable { - protected margin: number; - protected top: number; - protected left: number; - protected width: number; - protected height: number; - id: string; - - - /** - * Constructor for a positionable minimap. - * @param workspace The workspace to mirror. - */ - constructor(workspace: Blockly.WorkspaceSvg) { - super(workspace); - this.id = 'minimap'; - this.margin = 20; - this.top = 0; - this.left = 0; - this.width = 225; - this.height = 150; - } - - - /** - * Initialize. - */ - init(): void { - super.init(); - this.primaryWorkspace.getComponentManager().addComponent({ - component: this, - weight: 3, - capabilities: [Blockly.ComponentManager.Capability.POSITIONABLE], - }); - this.primaryWorkspace.resize(); - } - - - /** - * Returns the bounding rectangle of the UI element in pixel units - * relative to the Blockly injection div. - * @returns The component’s bounding box. - */ - getBoundingRectangle(): Blockly.utils.Rect { - return new Blockly.utils.Rect( - this.top, this.top + this.height, - this.left, this.left + this.width); - } - - - /** - * Positions the minimap. - * @param metrics The workspace metrics. - * @param savedPositions List of rectangles already on the workspace. - */ - position(metrics: Blockly.MetricsManager.UiMetrics, - savedPositions: Blockly.utils.Rect[]): void { - this.setSize(); - this.setPosition(metrics, savedPositions); - this.setAttributes(); - } - - - /** - * Sizes the minimap. - * @internal - */ - setSize(): void { - const viewWidth = this.primaryWorkspace.getMetrics().viewWidth; - this.width = Math.max(minWidth, viewWidth / 5); - this.height = this.width * 2 / 3; - } - - - /** - * Calculates the position of the minimap over the primary workspace. - * @param metrics The workspace metrics. - * @param savedPositions List of rectangles already on the workspace. - * @internal - */ - setPosition(metrics: Blockly.MetricsManager.UiMetrics, - savedPositions: Blockly.utils.Rect[]): void { - // Aliases. - const workspace = this.primaryWorkspace; - const scrollbars = workspace.scrollbar; - - const hasVerticalScrollbars = scrollbars && - scrollbars.isVisible() && scrollbars.canScrollVertically(); - const hasHorizontalScrollbars = scrollbars && - scrollbars.isVisible() && scrollbars.canScrollHorizontally(); - - if (metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT || - (workspace.horizontalLayout && !workspace.RTL)) { - // Right edge placement. - this.left = metrics.absoluteMetrics.left + metrics.viewMetrics.width - - this.width - this.margin; - if (hasVerticalScrollbars && !workspace.RTL) { - this.left -= Blockly.Scrollbar.scrollbarThickness; - } - } else { - // Left edge placement. - this.left = this.margin; - if (hasVerticalScrollbars && workspace.RTL) { - this.left += Blockly.Scrollbar.scrollbarThickness; - } +export class PositionedMinimap + extends Minimap + implements Blockly.IPositionable +{ + protected margin: number; + protected top: number; + protected left: number; + protected width: number; + protected height: number; + id: string; + + /** + * Constructor for a positionable minimap. + * @param workspace The workspace to mirror. + */ + constructor(workspace: Blockly.WorkspaceSvg) { + super(workspace); + this.id = 'minimap'; + this.margin = 20; + this.top = 0; + this.left = 0; + this.width = 225; + this.height = 150; + } + + /** + * Initialize. + */ + init(): void { + super.init(); + this.primaryWorkspace.getComponentManager().addComponent({ + component: this, + weight: 3, + capabilities: [Blockly.ComponentManager.Capability.POSITIONABLE], + }); + this.primaryWorkspace.resize(); + } + + /** + * Returns the bounding rectangle of the UI element in pixel units + * relative to the Blockly injection div. + * @returns The component’s bounding box. + */ + getBoundingRectangle(): Blockly.utils.Rect { + return new Blockly.utils.Rect( + this.top, + this.top + this.height, + this.left, + this.left + this.width, + ); + } + + /** + * Positions the minimap. + * @param metrics The workspace metrics. + * @param savedPositions List of rectangles already on the workspace. + */ + position( + metrics: Blockly.MetricsManager.UiMetrics, + savedPositions: Blockly.utils.Rect[], + ): void { + this.setSize(); + this.setPosition(metrics, savedPositions); + this.setAttributes(); + } + + /** + * Sizes the minimap. + * @internal + */ + setSize(): void { + const viewWidth = this.primaryWorkspace.getMetrics().viewWidth; + this.width = Math.max(minWidth, viewWidth / 5); + this.height = (this.width * 2) / 3; + } + + /** + * Calculates the position of the minimap over the primary workspace. + * @param metrics The workspace metrics. + * @param savedPositions List of rectangles already on the workspace. + * @internal + */ + setPosition( + metrics: Blockly.MetricsManager.UiMetrics, + savedPositions: Blockly.utils.Rect[], + ): void { + // Aliases. + const workspace = this.primaryWorkspace; + const scrollbars = workspace.scrollbar; + + const hasVerticalScrollbars = + scrollbars && scrollbars.isVisible() && scrollbars.canScrollVertically(); + const hasHorizontalScrollbars = + scrollbars && + scrollbars.isVisible() && + scrollbars.canScrollHorizontally(); + + if ( + metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT || + (workspace.horizontalLayout && !workspace.RTL) + ) { + // Right edge placement. + this.left = + metrics.absoluteMetrics.left + + metrics.viewMetrics.width - + this.width - + this.margin; + if (hasVerticalScrollbars && !workspace.RTL) { + this.left -= Blockly.Scrollbar.scrollbarThickness; } - - const startAtBottom = - metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_BOTTOM; - if (startAtBottom) { - // Bottom edge placement. - this.top = metrics.absoluteMetrics.top + metrics.viewMetrics.height - - this.height - this.margin; - if (hasHorizontalScrollbars) { - // The horizontal scrollbars are always positioned on the bottom. - this.top -= Blockly.Scrollbar.scrollbarThickness; - } - } else { - // Upper edge placement. - this.top = metrics.absoluteMetrics.top + this.margin; + } else { + // Left edge placement. + this.left = this.margin; + if (hasVerticalScrollbars && workspace.RTL) { + this.left += Blockly.Scrollbar.scrollbarThickness; } + } - // Check for collision and bump if needed. - let boundingRect = this.getBoundingRectangle(); - for (let i = 0; i < savedPositions.length; i++) { - if (boundingRect.intersects(savedPositions[i])) { - if (startAtBottom) { - this.top = savedPositions[i].top - this.height - this.margin; - } else { - this.top = savedPositions[i].bottom + this.margin; - } - // Recheck other savedPositions. - boundingRect = this.getBoundingRectangle(); - i = -1; - } + const startAtBottom = + metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_BOTTOM; + if (startAtBottom) { + // Bottom edge placement. + this.top = + metrics.absoluteMetrics.top + + metrics.viewMetrics.height - + this.height - + this.margin; + if (hasHorizontalScrollbars) { + // The horizontal scrollbars are always positioned on the bottom. + this.top -= Blockly.Scrollbar.scrollbarThickness; } + } else { + // Upper edge placement. + this.top = metrics.absoluteMetrics.top + this.margin; } - - /** - * Sets the CSS attribute for the minimap. - */ - private setAttributes(): void { - const injectDiv = this.minimapWorkspace.getInjectionDiv(); - const style = injectDiv.parentElement.style; - style.zIndex = '2'; - style.position = 'absolute'; - style.width = `${this.width}px`; - style.height = `${this.height}px`; - style.top = `${this.top}px`; - style.left = `${this.left}px`; - Blockly.svgResize(this.minimapWorkspace); + // Check for collision and bump if needed. + let boundingRect = this.getBoundingRectangle(); + for (let i = 0; i < savedPositions.length; i++) { + if (boundingRect.intersects(savedPositions[i])) { + if (startAtBottom) { + this.top = savedPositions[i].top - this.height - this.margin; + } else { + this.top = savedPositions[i].bottom + this.margin; + } + // Recheck other savedPositions. + boundingRect = this.getBoundingRectangle(); + i = -1; + } } + } + + /** + * Sets the CSS attribute for the minimap. + */ + private setAttributes(): void { + const injectDiv = this.minimapWorkspace.getInjectionDiv(); + const style = injectDiv.parentElement.style; + style.zIndex = '2'; + style.position = 'absolute'; + style.width = `${this.width}px`; + style.height = `${this.height}px`; + style.top = `${this.top}px`; + style.left = `${this.left}px`; + Blockly.svgResize(this.minimapWorkspace); + } } - Blockly.Css.register(` .blockly-minimap { box-shadow: 2px 2px 10px grey; diff --git a/plugins/workspace-minimap/test/index.html b/plugins/workspace-minimap/test/index.html index 9348d11b99..dc96c578f6 100644 --- a/plugins/workspace-minimap/test/index.html +++ b/plugins/workspace-minimap/test/index.html @@ -1,19 +1,18 @@ - + + + + Blockly Plugin Test + + - - - Blockly Plugin Test - - - - -
- - - + +
+ + diff --git a/plugins/workspace-minimap/test/index.ts b/plugins/workspace-minimap/test/index.ts index bfbd66af53..341d4b2039 100644 --- a/plugins/workspace-minimap/test/index.ts +++ b/plugins/workspace-minimap/test/index.ts @@ -21,8 +21,10 @@ let workspace = null; * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { // Creates the primary workspace and adds the minimap. if (minimap) { minimap.dispose(); @@ -34,7 +36,8 @@ function createWorkspace(blocklyDiv: HTMLElement, return workspace; } -document.addEventListener('DOMContentLoaded', function() { - createPlayground(document.getElementById('root'), createWorkspace as any, - {toolbox: toolboxCategories}); +document.addEventListener('DOMContentLoaded', function () { + createPlayground(document.getElementById('root'), createWorkspace as any, { + toolbox: toolboxCategories, + }); }); diff --git a/plugins/workspace-minimap/test/minimap_tests.mocha.js b/plugins/workspace-minimap/test/minimap_tests.mocha.js index 8d91e850e4..8f691591e1 100644 --- a/plugins/workspace-minimap/test/minimap_tests.mocha.js +++ b/plugins/workspace-minimap/test/minimap_tests.mocha.js @@ -4,157 +4,210 @@ * SPDX-License-Identifier: Apache-2.0 */ - const chai = require('chai'); const assert = chai.assert; const Blockly = require('blockly'); const {Minimap} = require('../src/minimap'); const {PositionedMinimap} = require('../src/positioned_minimap'); +suite( + 'Converting click coordinates from minimap to primary workspace', + function () { + suite('Square, medium, and ceentered content', function () { + setup(function () { + this.primaryMetrics = { + contentHeight: 1000, + contentWidth: 1000, + contentTop: -500, + contentLeft: -500, + viewWidth: 500, + viewHeight: 500, + }; + this.minimapMetrics = { + svgWidth: 500, + svgHeight: 500, + contentHeight: 500, + contentWidth: 500, + }; + }); + + test('Top left click', function () { + const click = {x: 0, y: 0}; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); -suite('Converting click coordinates from minimap to primary workspace', - function() { - suite('Square, medium, and ceentered content', function() { - setup(function() { - this.primaryMetrics = { - contentHeight: 1000, contentWidth: 1000, - contentTop: -500, contentLeft: -500, - viewWidth: 500, viewHeight: 500}; - this.minimapMetrics = { - svgWidth: 500, svgHeight: 500, - contentHeight: 500, contentWidth: 500}; - }); - - test('Top left click', function() { - const click = {x: 0, y: 0}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [750, 750], - 'Incorrect top left click'); - }); - - test('Center click', function() { - const click = { - x: this.minimapMetrics.svgWidth / 2, - y: this.minimapMetrics.svgHeight / 2}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [250, 250], - 'Incorrect center click'); - }); - - test('Bottom right click', function() { - const click = { - x: this.minimapMetrics.svgWidth, - y: this.minimapMetrics.svgHeight}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [-250, -250], - 'Incorrect bottom right click'); - }); + assert.deepEqual(converted, [750, 750], 'Incorrect top left click'); }); - suite('Wide, large, and top left shifted content', function() { - setup(function() { - this.primaryMetrics = { - contentHeight: 500, contentWidth: 2000, - contentTop: -1000, contentLeft: -2500, - viewWidth: 500, viewHeight: 500}; - this.minimapMetrics = { - svgWidth: 500, svgHeight: 500, - contentHeight: 125, contentWidth: 500}; - }); - - test('Top left click', function() { - const click = {x: 0, y: 0}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [2750, 2000], - 'Incorrect top left click'); - }); - - test('Center click', function() { - const click = { - x: this.minimapMetrics.svgWidth / 2, - y: this.minimapMetrics.svgHeight / 2}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [1750, 1000], - 'Incorrect center click'); - }); - - test('Bottom right click', function() { - const click = { - x: this.minimapMetrics.svgWidth, - y: this.minimapMetrics.svgHeight}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [750, 0], - 'Incorrect bottom right click'); - }); + test('Center click', function () { + const click = { + x: this.minimapMetrics.svgWidth / 2, + y: this.minimapMetrics.svgHeight / 2, + }; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual(converted, [250, 250], 'Incorrect center click'); }); - suite('Tall, small, and bottom right shifted content', function() { - setup(function() { - this.primaryMetrics = { - contentHeight: 2000, contentWidth: 500, - contentTop: 500, contentLeft: 500, - viewWidth: 500, viewHeight: 500}; - this.minimapMetrics = {svgWidth: 500, svgHeight: 500, - contentHeight: 500, contentWidth: 125}; - }); - - test('Top left click', function() { - const click = {x: 0, y: 0}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [500, -250], - 'Incorrect top left click'); - }); - - test('Center click', function() { - const click = { - x: this.minimapMetrics.svgWidth / 2, - y: this.minimapMetrics.svgHeight / 2}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [-500, -1250], - 'Incorrect center click'); - }); - - test('Bottom right click', function() { - const click = { - x: this.minimapMetrics.svgWidth, - y: this.minimapMetrics.svgHeight}; - const converted = Minimap.minimapToPrimaryCoords( - this.primaryMetrics, this.minimapMetrics, - click.x, click.y); - - assert.deepEqual(converted, [-1500, -2250], - 'Incorrect bottom right click'); - }); + test('Bottom right click', function () { + const click = { + x: this.minimapMetrics.svgWidth, + y: this.minimapMetrics.svgHeight, + }; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual( + converted, + [-250, -250], + 'Incorrect bottom right click', + ); }); }); + suite('Wide, large, and top left shifted content', function () { + setup(function () { + this.primaryMetrics = { + contentHeight: 500, + contentWidth: 2000, + contentTop: -1000, + contentLeft: -2500, + viewWidth: 500, + viewHeight: 500, + }; + this.minimapMetrics = { + svgWidth: 500, + svgHeight: 500, + contentHeight: 125, + contentWidth: 500, + }; + }); + + test('Top left click', function () { + const click = {x: 0, y: 0}; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual(converted, [2750, 2000], 'Incorrect top left click'); + }); + + test('Center click', function () { + const click = { + x: this.minimapMetrics.svgWidth / 2, + y: this.minimapMetrics.svgHeight / 2, + }; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual(converted, [1750, 1000], 'Incorrect center click'); + }); + + test('Bottom right click', function () { + const click = { + x: this.minimapMetrics.svgWidth, + y: this.minimapMetrics.svgHeight, + }; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual(converted, [750, 0], 'Incorrect bottom right click'); + }); + }); -suite('Positioning the minimap in the primary workspace', function() { - setup(function() { + suite('Tall, small, and bottom right shifted content', function () { + setup(function () { + this.primaryMetrics = { + contentHeight: 2000, + contentWidth: 500, + contentTop: 500, + contentLeft: 500, + viewWidth: 500, + viewHeight: 500, + }; + this.minimapMetrics = { + svgWidth: 500, + svgHeight: 500, + contentHeight: 500, + contentWidth: 125, + }; + }); + + test('Top left click', function () { + const click = {x: 0, y: 0}; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual(converted, [500, -250], 'Incorrect top left click'); + }); + + test('Center click', function () { + const click = { + x: this.minimapMetrics.svgWidth / 2, + y: this.minimapMetrics.svgHeight / 2, + }; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual(converted, [-500, -1250], 'Incorrect center click'); + }); + + test('Bottom right click', function () { + const click = { + x: this.minimapMetrics.svgWidth, + y: this.minimapMetrics.svgHeight, + }; + const converted = Minimap.minimapToPrimaryCoords( + this.primaryMetrics, + this.minimapMetrics, + click.x, + click.y, + ); + + assert.deepEqual( + converted, + [-1500, -2250], + 'Incorrect bottom right click', + ); + }); + }); + }, +); + +suite('Positioning the minimap in the primary workspace', function () { + setup(function () { this.mockMetrics = { viewMetrics: { height: 1000, @@ -191,7 +244,7 @@ suite('Positioning the minimap in the primary workspace', function() { }; }); - test('LTR Vertical Start', function() { + test('LTR Vertical Start', function () { Object.assign(this.options, { RTL: false, horizontalLayout: false, @@ -211,7 +264,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 872, 'LTR Vertical Start: Incorrect left'); }); - test('LTR Vertical End', function() { + test('LTR Vertical End', function () { Object.assign(this.options, { RTL: false, horizontalLayout: false, @@ -231,7 +284,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 20, 'LTR Vertical End: Incorrect left'); }); - test('LTR Horizontal Start', function() { + test('LTR Horizontal Start', function () { Object.assign(this.options, { RTL: false, horizontalLayout: true, @@ -251,7 +304,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 765, 'LTR Horizontal Start: Incorrect left'); }); - test('LTR Horizontal End', function() { + test('LTR Horizontal End', function () { Object.assign(this.options, { RTL: false, horizontalLayout: true, @@ -267,12 +320,15 @@ suite('Positioning the minimap in the primary workspace', function() { minimap.setPosition(this.mockMetrics, []); const position = minimap.getBoundingRectangle(); - assert.equal(Math.round(position.top), 832, - 'LTR Horizontal End: Incorrect top'); + assert.equal( + Math.round(position.top), + 832, + 'LTR Horizontal End: Incorrect top', + ); assert.equal(position.left, 765, 'LTR Horizontal End: Incorrect left'); }); - test('LTR Horizontal Start (no scrollbar)', function() { + test('LTR Horizontal Start (no scrollbar)', function () { Object.assign(this.options, { RTL: false, horizontalLayout: true, @@ -293,7 +349,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 780, 'LTR Horizontal Start: Incorrect left'); }); - test('RTL Vertical Start', function() { + test('RTL Vertical Start', function () { Object.assign(this.options, { RTL: true, horizontalLayout: false, @@ -313,7 +369,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 35, 'RTL Vertical Start: Incorrect left'); }); - test('RTL Vertical End', function() { + test('RTL Vertical End', function () { Object.assign(this.options, { RTL: true, horizontalLayout: false, @@ -333,7 +389,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 887, 'RTL Vertical End: Incorrect left'); }); - test('RTL Horizontal Start', function() { + test('RTL Horizontal Start', function () { Object.assign(this.options, { RTL: true, horizontalLayout: true, @@ -353,7 +409,7 @@ suite('Positioning the minimap in the primary workspace', function() { assert.equal(position.left, 35, 'RTL Horizontal Start: Incorrect left'); }); - test('RTL Horizontal End', function() { + test('RTL Horizontal End', function () { Object.assign(this.options, { RTL: true, horizontalLayout: true, @@ -369,9 +425,11 @@ suite('Positioning the minimap in the primary workspace', function() { minimap.setPosition(this.mockMetrics, []); const position = minimap.getBoundingRectangle(); - assert.equal(Math.round(position.top), 832, - 'RTL Horizontal End: Incorrect top'); + assert.equal( + Math.round(position.top), + 832, + 'RTL Horizontal End: Incorrect top', + ); assert.equal(position.left, 35, 'RTL Horizontal End: Incorrect left'); }); }); - diff --git a/plugins/workspace-search/README.md b/plugins/workspace-search/README.md index 313464d304..c1df72e32a 100644 --- a/plugins/workspace-search/README.md +++ b/plugins/workspace-search/README.md @@ -11,16 +11,19 @@ npm install @blockly/plugin-workspace-search --save ## Usage ### ES6 Imports + ```js import * as Blockly from 'blockly'; -import { WorkspaceSearch } from '@blockly/plugin-workspace-search'; +import {WorkspaceSearch} from '@blockly/plugin-workspace-search'; const workspace = Blockly.inject('blocklyDiv'); const workspaceSearch = new WorkspaceSearch(workspace); workspaceSearch.init(); ``` + ### Script Tag + ```js ``` @@ -43,6 +46,7 @@ To open workspace search use either command + f or control + f. To close the sea ## Styling The generated search bar looks like: + ```html
@@ -58,6 +62,7 @@ The generated search bar looks like: ``` Here are additional CSS classes to style your search bar: + - `blockly-ws-search`: Applies to the outer-most div. - Default styling: ```css @@ -79,4 +84,5 @@ Here are additional CSS classes to style your search bar: - `blockly-ws-search-highlight`: Adds highlight to the provided blocks. (Default: `fill: black;`) ## License + Apache 2.0 diff --git a/plugins/workspace-search/package-lock.json b/plugins/workspace-search/package-lock.json index 85b6ba74ac..14181321c4 100644 --- a/plugins/workspace-search/package-lock.json +++ b/plugins/workspace-search/package-lock.json @@ -9,7 +9,6 @@ "version": "8.0.6", "license": "Apache-2.0", "devDependencies": { - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "jsdom": "^19.0.0", "jsdom-global": "3.0.2", @@ -23,147 +22,6 @@ "blockly": "^10.0.0" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -208,107 +66,6 @@ "node": ">= 10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -349,16 +106,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/acorn-walk": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", @@ -380,78 +127,12 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "node_modules/blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -590,82 +271,12 @@ "node": ">=14" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -678,28 +289,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -785,31 +374,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -834,19 +398,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/escodegen": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", @@ -869,344 +420,47 @@ "source-map": "~0.6.1" } }, - "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, "bin": { - "eslint": "bin/eslint.js" + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=4" } }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=4.0" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=0.10.0" } }, - "node_modules/eslint/node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "peer": true, - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "peer": true, - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "dependencies": { "asynckit": "^0.4.0", @@ -1217,90 +471,6 @@ "node": ">= 6" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "peer": true - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1361,100 +531,6 @@ "node": ">=0.10.0" } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -1467,26 +543,6 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsdom": { "version": "19.0.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", @@ -1542,20 +598,6 @@ "jsdom": ">=10.0.0" } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", @@ -1575,69 +617,12 @@ "node": ">= 0.8.0" } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "peer": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", @@ -1659,32 +644,12 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -1704,16 +669,6 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, "node_modules/optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -1731,87 +686,12 @@ "node": ">= 0.8.0" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "peer": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -1821,27 +701,6 @@ "isarray": "0.0.1" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -1872,97 +731,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1970,53 +750,15 @@ "dev": true }, "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", "dev": true, - "peer": true, "dependencies": { - "shebang-regex": "^3.0.0" + "xmlchars": "^2.2.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/sinon": { @@ -2037,15 +779,6 @@ "url": "https://opencollective.com/sinon" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2056,32 +789,6 @@ "node": ">=0.10.0" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2100,25 +807,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -2146,27 +834,6 @@ "node": ">=12" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -2188,19 +855,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", @@ -2223,16 +877,6 @@ "node": ">= 4.0.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -2307,22 +951,6 @@ "node": ">=12" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -2332,13 +960,6 @@ "node": ">=0.10.0" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -2374,129 +995,9 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } }, "dependencies": { - "@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true - }, - "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^3.3.0" - } - }, - "@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", - "dev": true, - "peer": true - }, - "@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", - "dev": true, - "peer": true - }, - "@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "peer": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -2538,59 +1039,6 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - } - }, - "@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - } - }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -2621,14 +1069,6 @@ } } }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, "acorn-walk": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", @@ -2644,62 +1084,12 @@ "debug": "4" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -2808,67 +1198,12 @@ } } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, "browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2878,25 +1213,6 @@ "delayed-stream": "~1.0.0" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -2958,184 +1274,38 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, - "requires": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", - "dev": true, - "peer": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "dependencies": { - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "peer": true, - "requires": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - } - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - } - } - }, - "eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, - "peer": true, "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "webidl-conversions": "^7.0.0" } }, - "eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true }, - "espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "dev": true, - "peer": true, "requires": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" } }, "esprima": { @@ -3144,26 +1314,6 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - } - }, "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", @@ -3176,107 +1326,12 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "peer": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -3288,69 +1343,6 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "peer": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3396,76 +1388,6 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "peer": true - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -3478,23 +1400,6 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^2.0.1" - } - }, "jsdom": { "version": "19.0.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", @@ -3537,20 +1442,6 @@ "dev": true, "requires": {} }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, "just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", @@ -3567,54 +1458,12 @@ "type-check": "~0.3.2" } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "peer": true, - "requires": { - "p-locate": "^5.0.0" - } - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", @@ -3630,29 +1479,12 @@ "mime-db": "1.51.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -3672,16 +1504,6 @@ "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -3696,63 +1518,12 @@ "word-wrap": "~1.2.3" } }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "peer": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, "parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, "path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -3762,18 +1533,6 @@ "isarray": "0.0.1" } }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -3798,56 +1557,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, "rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3863,32 +1584,6 @@ "xmlchars": "^2.2.0" } }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, "sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -3903,12 +1598,6 @@ "supports-color": "^7.1.0" } }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3916,23 +1605,6 @@ "dev": true, "optional": true }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -3948,22 +1620,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -3985,21 +1641,6 @@ "punycode": "^2.1.1" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -4015,13 +1656,6 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, "typescript": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", @@ -4034,16 +1668,6 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -4103,29 +1727,12 @@ "webidl-conversions": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, "word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -4144,19 +1751,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true } } } diff --git a/plugins/workspace-search/package.json b/plugins/workspace-search/package.json index d5fbfaf99c..3a8a5d64b2 100644 --- a/plugins/workspace-search/package.json +++ b/plugins/workspace-search/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start", "test": "blockly-scripts test" @@ -41,7 +41,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "jsdom": "^19.0.0", "jsdom-global": "3.0.2", @@ -55,9 +54,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/workspace-search/src/css.ts b/plugins/workspace-search/src/css.ts index 978d1c50e3..126e13bc08 100644 --- a/plugins/workspace-search/src/css.ts +++ b/plugins/workspace-search/src/css.ts @@ -14,35 +14,34 @@ * Base64 encoded data uri for close icon. */ const closeSvgDataUri = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + - '9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aC' + - 'BkPSJNMTkgNi40MUwxNy41OSA1IDEyIDEwLjU5IDYuNDEgNSA1IDYuNDEgMTAuNTkgMTIgNS' + - 'AxNy41OSA2LjQxIDE5IDEyIDEzLjQxIDE3LjU5IDE5IDE5IDE3LjU5IDEzLjQxIDEyeiIvPj' + - 'xwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4='; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + + '9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aC' + + 'BkPSJNMTkgNi40MUwxNy41OSA1IDEyIDEwLjU5IDYuNDEgNSA1IDYuNDEgMTAuNTkgMTIgNS' + + 'AxNy41OSA2LjQxIDE5IDEyIDEzLjQxIDE3LjU5IDE5IDE5IDE3LjU5IDEzLjQxIDEyeiIvPj' + + 'xwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4='; /** * Base64 encoded data uri for keyboard arrow down icon. */ const arrowDownSvgDataUri = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + - '9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aC' + - 'BkPSJNNy40MSA4LjU5TDEyIDEzLjE3bDQuNTktNC41OEwxOCAxMGwtNiA2LTYtNiAxLjQxLT' + - 'EuNDF6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PC9zdmc+'; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + + '9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aC' + + 'BkPSJNNy40MSA4LjU5TDEyIDEzLjE3bDQuNTktNC41OEwxOCAxMGwtNiA2LTYtNiAxLjQxLT' + + 'EuNDF6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PC9zdmc+'; /** * Base64 encoded data uri for keyboard arrow up icon. */ const arrowUpSvgDataUri = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + - '9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aC' + - 'BkPSJNNy40MSAxNS40MUwxMiAxMC44M2w0LjU5IDQuNThMMTggMTRsLTYtNi02IDZ6Ii8+PH' + - 'BhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg=='; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + + '9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aC' + + 'BkPSJNNy40MSAxNS40MUwxMiAxMC44M2w0LjU5IDQuNThMMTggMTRsLTYtNi02IDZ6Ii8+PH' + + 'BhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg=='; /** * CSS for workspace search. */ -const cssContent = - `path.blocklyPath.blockly-ws-search-highlight { +const cssContent = `path.blocklyPath.blockly-ws-search-highlight { fill: #000; } path.blocklyPath.blockly-ws-search-highlight.blockly-ws-search-current { @@ -85,9 +84,9 @@ const cssContent = /** * Injects CSS for workspace search. */ -export const injectSearchCss = (function() { +export const injectSearchCss = (function () { let executed = false; - return function() { + return function () { // Only inject the CSS once. if (executed) { return; diff --git a/plugins/workspace-search/src/workspace_search.ts b/plugins/workspace-search/src/workspace_search.ts index 7f968f7334..94e89e8ea3 100644 --- a/plugins/workspace-search/src/workspace_search.ts +++ b/plugins/workspace-search/src/workspace_search.ts @@ -20,17 +20,17 @@ export class WorkspaceSearch implements Blockly.IPositionable { /** * HTML container for the search bar. */ - private htmlDiv: HTMLElement|null = null; + private htmlDiv: HTMLElement | null = null; /** * The div that holds the search bar actions. */ - protected actionDiv: HTMLElement|null = null; + protected actionDiv: HTMLElement | null = null; /** * The text input for the search bar. */ - private inputElement: HTMLInputElement|null = null; + private inputElement: HTMLInputElement | null = null; /** * The placeholder text for the search bar input. @@ -132,8 +132,9 @@ export class WorkspaceSearch implements Blockly.IPositionable { *
*/ const injectionDiv = this.workspace.getInjectionDiv(); - this.addEvent(injectionDiv, 'keydown', this, - (evt: KeyboardEvent) => this.onWorkspaceKeyDown(evt)); + this.addEvent(injectionDiv, 'keydown', this, (evt: KeyboardEvent) => + this.onWorkspaceKeyDown(evt), + ); this.htmlDiv = document.createElement('div'); Blockly.utils.dom.addClass(this.htmlDiv, 'blockly-ws-search'); @@ -148,8 +149,9 @@ export class WorkspaceSearch implements Blockly.IPositionable { const inputWrapper = document.createElement('div'); Blockly.utils.dom.addClass(inputWrapper, 'blockly-ws-search-input'); this.inputElement = this.createTextInput(); - this.addEvent(this.inputElement, 'keydown', this, - (evt: KeyboardEvent) => this.onKeyDown(evt)); + this.addEvent(this.inputElement, 'keydown', this, (evt: KeyboardEvent) => + this.onKeyDown(evt), + ); this.addEvent(this.inputElement, 'input', this, () => this.onInput()); this.addEvent(this.inputElement, 'click', this, () => { this.searchAndHighlight(this.searchText, this.preserveSelected); @@ -191,10 +193,18 @@ export class WorkspaceSearch implements Blockly.IPositionable { * @param thisObject The value of 'this' in the function. * @param func Function to call when event is triggered. */ - private addEvent(node: Element, name: string, thisObject: object, - func: (event: Event) => void) { - const event = - Blockly.browserEvents.conditionalBind(node, name, thisObject, func); + private addEvent( + node: Element, + name: string, + thisObject: object, + func: (event: Event) => void, + ) { + const event = Blockly.browserEvents.conditionalBind( + node, + name, + thisObject, + func, + ); this.boundEvents.push(event); } @@ -265,8 +275,10 @@ export class WorkspaceSearch implements Blockly.IPositionable { * @param onClickFn The function to call when the user clicks on * or hits enter on the button. */ - private addBtnListener(btn: HTMLButtonElement, - onClickFn: (e: Event) => void) { + private addBtnListener( + btn: HTMLButtonElement, + onClickFn: (e: Event) => void, + ) { this.addEvent(btn, 'click', this, onClickFn); // TODO: Review Blockly's key handling to see if there is a way to avoid // needing to call stopPropogation(). @@ -288,7 +300,7 @@ export class WorkspaceSearch implements Blockly.IPositionable { * case since we don't need other elements to avoid the workspace search * field. */ - getBoundingRectangle(): Blockly.utils.Rect|null { + getBoundingRectangle(): Blockly.utils.Rect | null { return null; } @@ -300,8 +312,10 @@ export class WorkspaceSearch implements Blockly.IPositionable { * @param savedPositions List of rectangles that * are already on the workspace. */ - position(metrics: Blockly.MetricsManager.UiMetrics, - savedPositions: Blockly.utils.Rect[]) { + position( + metrics: Blockly.MetricsManager.UiMetrics, + savedPositions: Blockly.utils.Rect[], + ) { if (this.workspace.RTL) { this.htmlDiv.style.left = metrics.absoluteMetrics.left + 'px'; } else { @@ -396,7 +410,7 @@ export class WorkspaceSearch implements Blockly.IPositionable { this.unhighlightCurrentSelection(currentBlock); } this.currentBlockIndex = - (index % this.blocks.length + this.blocks.length) % this.blocks.length; + ((index % this.blocks.length) + this.blocks.length) % this.blocks.length; currentBlock = this.blocks[this.currentBlockIndex]; this.highlightCurrentSelection(currentBlock); @@ -442,8 +456,11 @@ export class WorkspaceSearch implements Blockly.IPositionable { const oldCurrentBlock = this.blocks[this.currentBlockIndex]; this.searchText = searchText.trim(); this.clearBlocks(); - this.blocks = this.getMatchingBlocks(this.workspace, this.searchText, - this.caseSensitive); + this.blocks = this.getMatchingBlocks( + this.workspace, + this.searchText, + this.caseSensitive, + ); this.highlightSearchGroup(this.blocks); let currentIdx = 0; if (preserveCurrent) { @@ -475,8 +492,11 @@ export class WorkspaceSearch implements Blockly.IPositionable { * @param caseSensitive Whether the search is caseSensitive. * @returns True if the block is a match, false otherwise. */ - protected isBlockMatch(block: Blockly.BlockSvg, searchText: string, - caseSensitive: boolean): boolean { + protected isBlockMatch( + block: Blockly.BlockSvg, + searchText: string, + caseSensitive: boolean, + ): boolean { let blockText = ''; if (block.isCollapsed()) { // Search the whole string for collapsed blocks. @@ -484,10 +504,9 @@ export class WorkspaceSearch implements Blockly.IPositionable { } else { const topBlockText = []; block.inputList.forEach((input) => { - input.fieldRow.forEach( - (field) => { - topBlockText.push(field.getText()); - }); + input.fieldRow.forEach((field) => { + topBlockText.push(field.getText()); + }); }); blockText = topBlockText.join(' ').trim(); } @@ -505,9 +524,11 @@ export class WorkspaceSearch implements Blockly.IPositionable { * @returns The blocks that match the search * text. */ - protected getMatchingBlocks(workspace: Blockly.WorkspaceSvg, - searchText: string, - caseSensitive: boolean): Blockly.BlockSvg[] { + protected getMatchingBlocks( + workspace: Blockly.WorkspaceSvg, + searchText: string, + caseSensitive: boolean, + ): Blockly.BlockSvg[] { if (!searchText) { return []; } @@ -515,8 +536,9 @@ export class WorkspaceSearch implements Blockly.IPositionable { searchText = searchText.toLowerCase(); } const searchGroup = this.getSearchPool(workspace); - return searchGroup.filter( - (block) => this.isBlockMatch(block, searchText, caseSensitive)); + return searchGroup.filter((block) => + this.isBlockMatch(block, searchText, caseSensitive), + ); } /** diff --git a/plugins/workspace-search/test/.mocharc.js b/plugins/workspace-search/test/.mocharc.js index 85ca3d1002..1fe22b180f 100644 --- a/plugins/workspace-search/test/.mocharc.js +++ b/plugins/workspace-search/test/.mocharc.js @@ -2,5 +2,5 @@ module.exports = { ui: 'tdd', - require: ['jsdom-global/register'] + require: ['jsdom-global/register'], }; diff --git a/plugins/workspace-search/test/index.html b/plugins/workspace-search/test/index.html index f5231bfe60..2521600968 100644 --- a/plugins/workspace-search/test/index.html +++ b/plugins/workspace-search/test/index.html @@ -1,12 +1,12 @@ - + - - - Workspace Search Playground - - + + + Workspace Search Playground + +
- - + + diff --git a/plugins/workspace-search/test/index.ts b/plugins/workspace-search/test/index.ts index 6dcb284a30..fc3020edc7 100644 --- a/plugins/workspace-search/test/index.ts +++ b/plugins/workspace-search/test/index.ts @@ -20,9 +20,10 @@ import {WorkspaceSearch} from '../src/index'; * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): - Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); const workspaceSearch = new WorkspaceSearch(workspace); @@ -31,10 +32,13 @@ function createWorkspace(blocklyDiv: HTMLElement, return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/plugins/workspace-search/test/workspace_search_test.mocha.js b/plugins/workspace-search/test/workspace_search_test.mocha.js index 0fea9dd517..e0c94a31ed 100644 --- a/plugins/workspace-search/test/workspace_search_test.mocha.js +++ b/plugins/workspace-search/test/workspace_search_test.mocha.js @@ -15,7 +15,7 @@ const sinon = require('sinon'); const {WorkspaceSearch} = require('../src/index'); -suite('WorkspaceSearch', function() { +suite('WorkspaceSearch', function () { /** * Check if a block is currently highlighted. * @param {Blockly.BlockSvg} block The block to test. @@ -24,8 +24,9 @@ suite('WorkspaceSearch', function() { function isBlockHighlighted(block) { const path = block.pathObject.svgPath; const classes = path.getAttribute('class'); - return (' ' + classes + ' ') - .indexOf(' blockly-ws-search-highlight ') !== -1; + return ( + (' ' + classes + ' ').indexOf(' blockly-ws-search-highlight ') !== -1 + ); } /** * Check if a block is currently styled. @@ -35,8 +36,7 @@ suite('WorkspaceSearch', function() { function isBlockCurrentStyled(block) { const path = block.pathObject.svgPath; const classes = path.getAttribute('class'); - return (' ' + classes + ' ') - .indexOf(' blockly-ws-search-current ') !== -1; + return (' ' + classes + ' ').indexOf(' blockly-ws-search-current ') !== -1; } /** * Assert that no extra styling is currently added to these blocks. @@ -48,39 +48,43 @@ suite('WorkspaceSearch', function() { for (let block, i = 0; (block = blocks[i]); i++) { const isCurrentStyled = isBlockCurrentStyled(block); if (isCurrentStyled) { - assert.equal(expectedCurrent, block, - 'Unexpected block [' + block.type + - '] found styled as current.'); + assert.equal( + expectedCurrent, + block, + 'Unexpected block [' + block.type + '] found styled as current.', + ); } else { - assert.notEqual(block, expectedCurrent, - 'Expected block [' + block.type + '] to be styled as current.'); + assert.notEqual( + block, + expectedCurrent, + 'Expected block [' + block.type + '] to be styled as current.', + ); } } } - setup(function() { - this.jsdomCleanup = - require('jsdom-global')('
'); + setup(function () { + this.jsdomCleanup = require('jsdom-global')( + '
', + ); this.workspace = Blockly.inject('blocklyDiv'); this.workspaceSearch = new WorkspaceSearch(this.workspace); }); - teardown(function() { + teardown(function () { this.jsdomCleanup(); }); - suite('init()', function() { - test('CSS is injected at init()', function() { - let searchStyle = - document.getElementById('blockly-ws-search-style'); + suite('init()', function () { + test('CSS is injected at init()', function () { + let searchStyle = document.getElementById('blockly-ws-search-style'); assert.equal(!!searchStyle, false); this.workspaceSearch.init(); searchStyle = document.getElementById('blockly-ws-search-style'); assert.equal(!!searchStyle, true); }); - - test('DOM is intialized at init()', function() { + test('DOM is intialized at init()', function () { let dom = document.querySelector('div.blockly-ws-search'); assert.equal(!!dom, false); this.workspaceSearch.init(); @@ -89,8 +93,8 @@ suite('WorkspaceSearch', function() { }); }); - suite('dispose()', function() { - test('DOM is disposed', function() { + suite('dispose()', function () { + test('DOM is disposed', function () { this.workspaceSearch.init(); let dom = document.querySelector('div.blockly-ws-search'); assert.equal(!!dom, true); @@ -100,7 +104,7 @@ suite('WorkspaceSearch', function() { }); }); - suite('searchAndHighlight()', function() { + suite('searchAndHighlight()', function () { /** * Assert blocks are equal to the search group of blocks. * @param {Array.} allBlocks All blocks. @@ -111,19 +115,31 @@ suite('WorkspaceSearch', function() { assert.equal(actualGroup.length, expectedGroup.length); for (let block, i = 0; (block = allBlocks[i]); i++) { if (expectedGroup.indexOf(block) !== -1) { - assert.equal(actualGroup.indexOf(block) !== -1, true, - 'Expected block [' + block.type + '] to be in search results'); - assert.equal(isBlockHighlighted(block), true, - 'Expected block [' + block.type + '] to be highlighted.'); + assert.equal( + actualGroup.indexOf(block) !== -1, + true, + 'Expected block [' + block.type + '] to be in search results', + ); + assert.equal( + isBlockHighlighted(block), + true, + 'Expected block [' + block.type + '] to be highlighted.', + ); } else { - assert.equal(actualGroup.indexOf(block) !== -1, false, - 'Unexpected block [' + block.type + '] in search results'); - assert.equal(isBlockHighlighted(block), false, - 'Unexpected block [' + block.type + '] found highlighted.'); + assert.equal( + actualGroup.indexOf(block) !== -1, + false, + 'Unexpected block [' + block.type + '] in search results', + ); + assert.equal( + isBlockHighlighted(block), + false, + 'Unexpected block [' + block.type + '] found highlighted.', + ); } } } - setup(function() { + setup(function () { Blockly.defineBlocksWithJsonArray([ { 'type': 'test_block', @@ -132,44 +148,52 @@ suite('WorkspaceSearch', function() { { 'type': 'test_statement_block', 'message0': '%test %1', - 'args0': [{ - 'type': 'input_value', - 'name': 'INPUT0', - 'check': 'String', - }], + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT0', + 'check': 'String', + }, + ], 'message1': '%block %1', - 'args1': [{ - 'type': 'input_statement', - 'name': 'INPUT1', - }], + 'args1': [ + { + 'type': 'input_statement', + 'name': 'INPUT1', + }, + ], 'previousStatement': null, 'nextStatement': null, }, { 'type': 'test_text', 'message0': '%1', - 'args0': [{ - 'type': 'field_input', - 'name': 'NAME', - 'text': 'test string', - }], + 'args0': [ + { + 'type': 'field_input', + 'name': 'NAME', + 'text': 'test string', + }, + ], 'output': null, }, ]); this.testBlock = this.workspace.newBlock('test_block'); this.testStatementBlock = this.workspace.newBlock('test_statement_block'); - this.testStatementBlockWithInput = - this.workspace.newBlock('test_statement_block'); - this.fieldWithOutputConnected = - this.workspace.newBlock('test_text'); - this.testStatementBlockWithInput.inputList[0].connection - .connect(this.fieldWithOutputConnected.outputConnection); - this.testStatementBlockWithInputCollapsed = - this.workspace.newBlock('test_statement_block'); - this.fieldWithOutputCollapsed = - this.workspace.newBlock('test_text'); - this.testStatementBlockWithInputCollapsed.inputList[0].connection - .connect(this.fieldWithOutputCollapsed.outputConnection); + this.testStatementBlockWithInput = this.workspace.newBlock( + 'test_statement_block', + ); + this.fieldWithOutputConnected = this.workspace.newBlock('test_text'); + this.testStatementBlockWithInput.inputList[0].connection.connect( + this.fieldWithOutputConnected.outputConnection, + ); + this.testStatementBlockWithInputCollapsed = this.workspace.newBlock( + 'test_statement_block', + ); + this.fieldWithOutputCollapsed = this.workspace.newBlock('test_text'); + this.testStatementBlockWithInputCollapsed.inputList[0].connection.connect( + this.fieldWithOutputCollapsed.outputConnection, + ); this.testStatementBlockWithInputCollapsed.setCollapsed(true); this.fieldWithOutput = this.workspace.newBlock('test_text'); @@ -183,18 +207,19 @@ suite('WorkspaceSearch', function() { this.fieldWithOutput, ]; - sinon.stub(this.workspace, - 'getAllBlocks').returns(Object.values(this.blocks)); + sinon + .stub(this.workspace, 'getAllBlocks') + .returns(Object.values(this.blocks)); }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['test_block']; delete Blockly.Blocks['test_statement_block']; delete Blockly.Blocks['test_text']; sinon.restore(); }); - test('Match all blocks', function() { + test('Match all blocks', function () { this.workspaceSearch.searchAndHighlight('test', false); const expectedBlocks = [ this.testBlock, @@ -205,20 +230,25 @@ suite('WorkspaceSearch', function() { this.fieldWithOutput, ]; assertEqualsSearchGroup( - this.blocks, this.workspaceSearch.blocks, expectedBlocks); + this.blocks, + this.workspaceSearch.blocks, + expectedBlocks, + ); assertNoExtraCurrentStyling(this.blocks, expectedBlocks[0]); - assert.equal(isBlockHighlighted(this.fieldWithOutputCollapsed), - false, - 'Expected field within a collapsed block to not be highlighted.'); + assert.equal( + isBlockHighlighted(this.fieldWithOutputCollapsed), + false, + 'Expected field within a collapsed block to not be highlighted.', + ); }); - test('Match no blocks', function() { + test('Match no blocks', function () { this.workspaceSearch.searchAndHighlight('none', false); assertEqualsSearchGroup(this.blocks, this.workspaceSearch.blocks, []); assertNoExtraCurrentStyling(this.blocks); }); - test('Match all non-fields', function() { + test('Match all non-fields', function () { this.workspaceSearch.searchAndHighlight('block', false); const expectedBlocks = [ this.testBlock, @@ -227,11 +257,14 @@ suite('WorkspaceSearch', function() { this.testStatementBlockWithInputCollapsed, ]; assertEqualsSearchGroup( - this.blocks, this.workspaceSearch.blocks, expectedBlocks); + this.blocks, + this.workspaceSearch.blocks, + expectedBlocks, + ); assertNoExtraCurrentStyling(this.blocks, expectedBlocks[0]); }); - test('Match all field and collapsed blocks', function() { + test('Match all field and collapsed blocks', function () { this.workspaceSearch.searchAndHighlight('string', false); const expectedBlocks = [ this.testStatementBlockWithInputCollapsed, @@ -239,11 +272,14 @@ suite('WorkspaceSearch', function() { this.fieldWithOutput, ]; assertEqualsSearchGroup( - this.blocks, this.workspaceSearch.blocks, expectedBlocks); + this.blocks, + this.workspaceSearch.blocks, + expectedBlocks, + ); assertNoExtraCurrentStyling(this.blocks, expectedBlocks[0]); }); - test('Preserve current, in results', function() { + test('Preserve current, in results', function () { this.workspaceSearch.searchAndHighlight('test'); this.workspaceSearch.setCurrentBlock(1); // this.testStatementBlock should be current. @@ -257,11 +293,14 @@ suite('WorkspaceSearch', function() { ]; this.workspaceSearch.searchAndHighlight('test', true); assertEqualsSearchGroup( - this.blocks, this.workspaceSearch.blocks, expectedBlocks); + this.blocks, + this.workspaceSearch.blocks, + expectedBlocks, + ); assertNoExtraCurrentStyling(this.blocks, expectedBlocks[1]); }); - test('Preserve current, not in results', function() { + test('Preserve current, not in results', function () { this.workspaceSearch.searchAndHighlight('test'); this.workspaceSearch.setCurrentBlock(1); // this.testStatementBlock should be current. @@ -272,13 +311,16 @@ suite('WorkspaceSearch', function() { this.fieldWithOutput, ]; assertEqualsSearchGroup( - this.blocks, this.workspaceSearch.blocks, expectedBlocks); + this.blocks, + this.workspaceSearch.blocks, + expectedBlocks, + ); assertNoExtraCurrentStyling(this.blocks, expectedBlocks[0]); }); }); - suite('next()', function() { - setup(function() { + suite('next()', function () { + setup(function () { Blockly.defineBlocksWithJsonArray([ { 'type': 'test_block', @@ -287,16 +329,20 @@ suite('WorkspaceSearch', function() { { 'type': 'test_statement_block', 'message0': '%test %1', - 'args0': [{ - 'type': 'input_value', - 'name': 'INPUT0', - 'check': 'String', - }], + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT0', + 'check': 'String', + }, + ], 'message1': '%block %1', - 'args1': [{ - 'type': 'input_statement', - 'name': 'INPUT1', - }], + 'args1': [ + { + 'type': 'input_statement', + 'name': 'INPUT1', + }, + ], 'previousStatement': null, 'nextStatement': null, }, @@ -307,20 +353,20 @@ suite('WorkspaceSearch', function() { this.workspaceSearch.blocks = this.blocks; }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['test_block']; delete Blockly.Blocks['test_statement_block']; sinon.restore(); }); - test('next() with unset current', function() { + test('next() with unset current', function () { this.workspaceSearch.next(); const currentIndex = this.workspaceSearch.currentBlockIndex; assert.equal(currentIndex, 0); assertNoExtraCurrentStyling(this.blocks, this.blocks[0]); }); - test('next() wrap around', function() { + test('next() wrap around', function () { this.workspaceSearch.currentBlockIndex = 0; this.workspaceSearch.next(); let currentIndex = this.workspaceSearch.currentBlockIndex; @@ -333,8 +379,8 @@ suite('WorkspaceSearch', function() { }); }); - suite('previous()', function() { - setup(function() { + suite('previous()', function () { + setup(function () { Blockly.defineBlocksWithJsonArray([ { 'type': 'test_block', @@ -343,16 +389,20 @@ suite('WorkspaceSearch', function() { { 'type': 'test_statement_block', 'message0': '%test %1', - 'args0': [{ - 'type': 'input_value', - 'name': 'INPUT0', - 'check': 'String', - }], + 'args0': [ + { + 'type': 'input_value', + 'name': 'INPUT0', + 'check': 'String', + }, + ], 'message1': '%block %1', - 'args1': [{ - 'type': 'input_statement', - 'name': 'INPUT1', - }], + 'args1': [ + { + 'type': 'input_statement', + 'name': 'INPUT1', + }, + ], 'previousStatement': null, 'nextStatement': null, }, @@ -363,18 +413,18 @@ suite('WorkspaceSearch', function() { this.workspaceSearch.blocks = this.blocks; }); - teardown(function() { + teardown(function () { delete Blockly.Blocks['test_block']; delete Blockly.Blocks['test_statement_block']; sinon.restore(); }); - test('previous() with unset current', function() { + test('previous() with unset current', function () { this.workspaceSearch.previous(); // No expected current index, but should not throw. }); - test('previous() wrap around', function() { + test('previous() wrap around', function () { this.workspaceSearch.currentBlockIndex = 1; this.workspaceSearch.previous(); let currentIndex = this.workspaceSearch.currentBlockIndex; diff --git a/plugins/zoom-to-fit/README.md b/plugins/zoom-to-fit/README.md index 9147ab4711..14d63d7390 100644 --- a/plugins/zoom-to-fit/README.md +++ b/plugins/zoom-to-fit/README.md @@ -6,11 +6,13 @@ zoom-to-fit control to the workspace. ## Installation ### Yarn + ``` yarn add @blockly/zoom-to-fit ``` ### npm + ``` npm install @blockly/zoom-to-fit --save ``` @@ -36,8 +38,9 @@ zoomToFit.init(); - `init`: Initializes the zoom-to-fit control. - `dispose`: Disposes of the zoom-to-fit control. - `getBoundingRectangle`: Returns the bounding rectangle of the UI element in -pixel units relative to the Blockly injection div. + pixel units relative to the Blockly injection div. - `position`: Positions the zoom-to-fit control. ## License + Apache 2.0 diff --git a/plugins/zoom-to-fit/package-lock.json b/plugins/zoom-to-fit/package-lock.json index 77d7a22f2e..3e4c08e247 100644 --- a/plugins/zoom-to-fit/package-lock.json +++ b/plugins/zoom-to-fit/package-lock.json @@ -9,7 +9,6 @@ "version": "5.0.6", "license": "Apache-2.0", "devDependencies": { - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "typescript": "^5.1.6" }, @@ -20,147 +19,6 @@ "blockly": "^10.0.0" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "peer": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -170,136 +28,12 @@ "node": ">= 10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -312,78 +46,12 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, "node_modules/blockly": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", @@ -393,76 +61,6 @@ "jsdom": "22.1.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -475,28 +73,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -546,13 +122,6 @@ "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -562,31 +131,6 @@ "node": ">=0.4.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -611,539 +155,69 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/escape-string-regexp": { + "node_modules/form-data": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, - "peer": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">= 6" } }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", "dev": true, - "peer": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "whatwg-encoding": "^2.0.0" }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=12" } }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, - "peer": true, "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">= 6" } }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, - "peer": true, "dependencies": { - "estraverse": "^5.1.0" + "agent-base": "6", + "debug": "4" }, "engines": { - "node": ">=0.10" + "node": ">= 6" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, - "peer": true, "dependencies": { - "estraverse": "^5.2.0" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "peer": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, "node_modules/is-potential-custom-element-name": { @@ -1152,26 +226,6 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -1214,91 +268,6 @@ } } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "peer": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1320,111 +289,18 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "node_modules/nwsapi": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.5.tgz", "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "peer": true, - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "peer": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -1437,67 +313,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -1519,97 +334,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1628,117 +364,12 @@ "node": ">=v12.22.7" } }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -1759,58 +390,11 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "dev": true, - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" + "dependencies": { + "punycode": "^2.3.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=14" } }, "node_modules/typescript": { @@ -1835,16 +419,6 @@ "node": ">= 4.0.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -1910,29 +484,6 @@ "node": ">=14" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -1968,209 +519,21 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } }, "dependencies": { - "@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true - }, - "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^3.3.0" - } - }, - "@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", - "dev": true, - "peer": true - }, - "@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", - "dev": true, - "peer": true - }, - "@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "peer": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, "@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - } - }, - "@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - } - }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, - "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, - "peer": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2180,453 +543,85 @@ "debug": "4" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, - "blockly": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", - "integrity": "sha512-4A+dn2wkY0y44seSCPDYh2UJ4e1ATgfb/qWPS5fQ3+N7nmy+MW21HG/rf7bPWxUsoyfx/Afu75b/DYPWpg6qnQ==", - "dev": true, - "requires": { - "jsdom": "22.1.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", - "dev": true, - "requires": { - "rrweb-cssom": "^0.6.0" - } - }, - "data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "dev": true, - "requires": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", - "dev": true, - "peer": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - } - }, - "eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true - }, - "espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "peer": true, - "requires": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - } - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "blockly": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.0.0.tgz", + "integrity": "sha512-4A+dn2wkY0y44seSCPDYh2UJ4e1ATgfb/qWPS5fQ3+N7nmy+MW21HG/rf7bPWxUsoyfx/Afu75b/DYPWpg6qnQ==", "dev": true, "requires": { - "reusify": "^1.0.4" + "jsdom": "22.1.0" } }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "peer": true, "requires": { - "flat-cache": "^3.0.4" + "delayed-stream": "~1.0.0" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "cssstyle": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "rrweb-cssom": "^0.6.0" } }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, - "peer": true, "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" } }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "peer": true, "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "ms": "2.1.2" } }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, - "peer": true + "requires": { + "webidl-conversions": "^7.0.0" + } + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true }, "form-data": { "version": "4.0.0", @@ -2639,76 +634,6 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "peer": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true - }, "html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -2748,99 +673,12 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "peer": true - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^2.0.1" - } - }, "jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -2872,73 +710,6 @@ "xml-name-validator": "^4.0.0" } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "peer": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -2954,90 +725,18 @@ "mime-db": "1.52.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, "nwsapi": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.5.tgz", "integrity": "sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "peer": true, - "requires": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "peer": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, "parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -3047,46 +746,6 @@ "entities": "^4.4.0" } }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -3105,56 +764,18 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, "rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", "dev": true }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3170,87 +791,12 @@ "xmlchars": "^2.2.0" } }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^4.0.0" - } - }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -3272,38 +818,6 @@ "punycode": "^2.3.0" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, "typescript": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", @@ -3316,16 +830,6 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -3376,23 +880,6 @@ "webidl-conversions": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", @@ -3411,19 +898,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true } } } diff --git a/plugins/zoom-to-fit/package.json b/plugins/zoom-to-fit/package.json index 443d97aed8..fb6f90a2b3 100644 --- a/plugins/zoom-to-fit/package.json +++ b/plugins/zoom-to-fit/package.json @@ -6,7 +6,7 @@ "audit:fix": "blockly-scripts auditFix", "build": "blockly-scripts build", "clean": "blockly-scripts clean", - "lint": "blockly-scripts lint", + "lint": "eslint .", "predeploy": "blockly-scripts predeploy", "start": "blockly-scripts start" }, @@ -40,7 +40,6 @@ "devDependencies": { "@blockly/dev-scripts": "^2.0.1", "@blockly/dev-tools": "^7.1.0", - "@typescript-eslint/parser": "^5.59.5", "blockly": "^10.0.0", "typescript": "^5.1.6" }, @@ -51,9 +50,6 @@ "access": "public", "registry": "https://wombat-dressing-room.appspot.com" }, - "eslintConfig": { - "extends": "@blockly/eslint-config" - }, "engines": { "node": ">=8.17.0" } diff --git a/plugins/zoom-to-fit/src/index.ts b/plugins/zoom-to-fit/src/index.ts index 4fad040d38..50c01a1022 100644 --- a/plugins/zoom-to-fit/src/index.ts +++ b/plugins/zoom-to-fit/src/index.ts @@ -18,7 +18,7 @@ export class ZoomToFitControl implements Blockly.IPositionable { /** * The SVG group containing the zoom-to-fit control. */ - private svgGroup: SVGElement|null = null; + private svgGroup: SVGElement | null = null; /** * Left coordinate of the zoom-to-fit control. @@ -55,7 +55,7 @@ export class ZoomToFitControl implements Blockly.IPositionable { */ private initialized = false; - private onZoomToFitWrapper: Blockly.browserEvents.Data|null = null; + private onZoomToFitWrapper: Blockly.browserEvents.Data | null = null; /** * Constructor for zoom-to-fit control. @@ -96,21 +96,32 @@ export class ZoomToFitControl implements Blockly.IPositionable { * Creates DOM for ui element. */ private createDom() { - this.svgGroup = - Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.IMAGE, { - 'height': `${this.height}px`, - 'width': `${this.width}px`, - 'class': 'zoomToFit', - }); - this.svgGroup.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href', - zoomToFitSvgDataUri); - - Blockly.utils.dom.insertAfter(this.svgGroup, - this.workspace.getBubbleCanvas()); + this.svgGroup = Blockly.utils.dom.createSvgElement( + Blockly.utils.Svg.IMAGE, + { + 'height': `${this.height}px`, + 'width': `${this.width}px`, + 'class': 'zoomToFit', + }, + ); + this.svgGroup.setAttributeNS( + Blockly.utils.dom.XLINK_NS, + 'xlink:href', + zoomToFitSvgDataUri, + ); + + Blockly.utils.dom.insertAfter( + this.svgGroup, + this.workspace.getBubbleCanvas(), + ); // Attach listener. this.onZoomToFitWrapper = Blockly.browserEvents.conditionalBind( - this.svgGroup, 'mousedown', null, this.onClick.bind(this)); + this.svgGroup, + 'mousedown', + null, + this.onClick.bind(this), + ); } /** @@ -119,7 +130,10 @@ export class ZoomToFitControl implements Blockly.IPositionable { private onClick() { this.workspace.zoomToFit(); const uiEvent = new (Blockly.Events.get(Blockly.Events.CLICK))( - null, this.workspace.id, 'zoom_reset_control'); + null, + this.workspace.id, + 'zoom_reset_control', + ); Blockly.Events.fire(uiEvent); } @@ -129,8 +143,12 @@ export class ZoomToFitControl implements Blockly.IPositionable { * @returns The component’s bounding box. */ getBoundingRectangle(): Blockly.utils.Rect { - return new Blockly.utils.Rect(this.top, this.top + this.height, this.left, - this.left + this.width); + return new Blockly.utils.Rect( + this.top, + this.top + this.height, + this.left, + this.left + this.width, + ); } /** @@ -141,23 +159,30 @@ export class ZoomToFitControl implements Blockly.IPositionable { * @param savedPositions List of rectangles that * are already on the workspace. */ - position(metrics: Blockly.MetricsManager.UiMetrics, - savedPositions: Blockly.utils.Rect[]) { + position( + metrics: Blockly.MetricsManager.UiMetrics, + savedPositions: Blockly.utils.Rect[], + ) { if (!this.initialized) { return; } const hasVerticalScrollbars = - this.workspace.scrollbar && - this.workspace.scrollbar.canScrollHorizontally(); + this.workspace.scrollbar && + this.workspace.scrollbar.canScrollHorizontally(); const hasHorizontalScrollbars = - this.workspace.scrollbar && - this.workspace.scrollbar.canScrollVertically(); + this.workspace.scrollbar && + this.workspace.scrollbar.canScrollVertically(); - if (metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT || - (this.workspace.horizontalLayout && !this.workspace.RTL)) { + if ( + metrics.toolboxMetrics.position === Blockly.TOOLBOX_AT_LEFT || + (this.workspace.horizontalLayout && !this.workspace.RTL) + ) { // Right corner placement. - this.left = metrics.absoluteMetrics.left + metrics.viewMetrics.width - - this.width - this.marginHorizontal; + this.left = + metrics.absoluteMetrics.left + + metrics.viewMetrics.width - + this.width - + this.marginHorizontal; if (hasVerticalScrollbars && !this.workspace.RTL) { this.left -= Blockly.Scrollbar.scrollbarThickness; } @@ -170,11 +195,14 @@ export class ZoomToFitControl implements Blockly.IPositionable { } const startAtBottom = - metrics.toolboxMetrics.position !== Blockly.TOOLBOX_AT_BOTTOM; + metrics.toolboxMetrics.position !== Blockly.TOOLBOX_AT_BOTTOM; if (startAtBottom) { // Bottom corner placement - this.top = metrics.absoluteMetrics.top + metrics.viewMetrics.height - - this.height - this.marginVertical; + this.top = + metrics.absoluteMetrics.top + + metrics.viewMetrics.height - + this.height - + this.marginVertical; if (hasHorizontalScrollbars) { // The horizontal scrollbars are always positioned on the bottom. this.top -= Blockly.Scrollbar.scrollbarThickness; @@ -188,9 +216,11 @@ export class ZoomToFitControl implements Blockly.IPositionable { let boundingRect = this.getBoundingRectangle(); for (let i = 0, otherEl; (otherEl = savedPositions[i]); i++) { if (boundingRect.intersects(otherEl)) { - if (startAtBottom) { // Bump up. + if (startAtBottom) { + // Bump up. this.top = otherEl.top - this.height - this.marginVertical; - } else { // Bump down. + } else { + // Bump down. this.top = otherEl.bottom + this.marginVertical; } // Recheck other savedPositions @@ -199,8 +229,10 @@ export class ZoomToFitControl implements Blockly.IPositionable { } } - this.svgGroup.setAttribute('transform', - `translate(${this.left}, ${this.top})`); + this.svgGroup.setAttribute( + 'transform', + `translate(${this.left}, ${this.top})`, + ); } } @@ -208,13 +240,13 @@ export class ZoomToFitControl implements Blockly.IPositionable { * Base64 encoded data uri for zoom to fit icon. */ const zoomToFitSvgDataUri = - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + - '9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZm' + - 'lsbD0iIzU0NkU3QSI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PH' + - 'BhdGggZD0iTTUgNi40Mkw4LjA5IDkuNSA5LjUgOC4wOSA2LjQxIDVIOVYzSDN2Nmgyem0xMC' + - '0zLjQxdjJoMi41N0wxNC41IDguMDlsMS40MSAxLjQxTDE5IDYuNDFWOWgyVjMuMDF6bTQgMT' + - 'QuNTdsLTMuMDktMy4wOC0xLjQxIDEuNDFMMTcuNTkgMTlIMTV2Mmg2di02aC0yek04LjA5ID' + - 'E0LjVMNSAxNy41OVYxNUgzdjZoNnYtMkg2LjQybDMuMDgtMy4wOXoiLz48L3N2Zz4='; + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC' + + '9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZm' + + 'lsbD0iIzU0NkU3QSI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PH' + + 'BhdGggZD0iTTUgNi40Mkw4LjA5IDkuNSA5LjUgOC4wOSA2LjQxIDVIOVYzSDN2Nmgyem0xMC' + + '0zLjQxdjJoMi41N0wxNC41IDguMDlsMS40MSAxLjQxTDE5IDYuNDFWOWgyVjMuMDF6bTQgMT' + + 'QuNTdsLTMuMDktMy4wOC0xLjQxIDEuNDFMMTcuNTkgMTlIMTV2Mmg2di02aC0yek04LjA5ID' + + 'E0LjVMNSAxNy41OVYxNUgzdjZoNnYtMkg2LjQybDMuMDgtMy4wOXoiLz48L3N2Zz4='; Blockly.Css.register(` .zoomToFit { diff --git a/plugins/zoom-to-fit/test/index.html b/plugins/zoom-to-fit/test/index.html index 9f1c6b9da5..2505f95fd1 100644 --- a/plugins/zoom-to-fit/test/index.html +++ b/plugins/zoom-to-fit/test/index.html @@ -1,19 +1,18 @@ - + + + + Zoom-to-fit Control Test + + - - - Zoom-to-fit Control Test - - - - -
- - - + +
+ + diff --git a/plugins/zoom-to-fit/test/index.ts b/plugins/zoom-to-fit/test/index.ts index 525efc6175..d623c7708a 100644 --- a/plugins/zoom-to-fit/test/index.ts +++ b/plugins/zoom-to-fit/test/index.ts @@ -19,9 +19,10 @@ import {ZoomToFitControl} from '../src/index'; * @param options The Blockly options. * @returns The created workspace. */ -function createWorkspace(blocklyDiv: HTMLElement, - options: Blockly.BlocklyOptions): - Blockly.WorkspaceSvg { +function createWorkspace( + blocklyDiv: HTMLElement, + options: Blockly.BlocklyOptions, +): Blockly.WorkspaceSvg { const workspace = Blockly.inject(blocklyDiv, options); const zoomToFit = new ZoomToFitControl(workspace); @@ -30,13 +31,16 @@ function createWorkspace(blocklyDiv: HTMLElement, return workspace; } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { const defaultOptions = { toolbox: toolboxCategories, zoom: { controls: true, }, }; - createPlayground(document.getElementById('root'), createWorkspace, - defaultOptions); + createPlayground( + document.getElementById('root'), + createWorkspace, + defaultOptions, + ); }); diff --git a/scripts.md b/scripts.md index 33597fdbd7..d0316139c5 100644 --- a/scripts.md +++ b/scripts.md @@ -5,57 +5,71 @@ In this directory, you can run: ### `npm run audit:fix` + This script runs `npm audit fix` on each of the Blockly plugins in this repo. ### `npm run boot` + This script runs `lerna bootstrap` which will run `npm install` in each plugin and ensure local plugins are symlinked, ready for development. When developing a plugin, always run `npm run boot` instead of `npm install` directly, as this ensures local plugins (eg: dev-tools) are locally linked. ### `npm run build` + This script builds all of the Blockly plugins in this repo. ### `npm run clean` + This script runs `npm run clean` on each of the Blockly plugins. In general, clean deletes the `/build` and `/dist` folders in these plugins. ### `npm run clean:node` + This script deletes `node_modules/` from each plugin in this repo. This may be useful if you feel your node modules have wound up in a bad state. ### `npm run deploy` + This script packages each of the plugins's test playgrounds and deploys them to gh-pages. You can browse these plugin playgrounds at: https://YOURUSERNAME.github.io/blockly-samples/. ### `npm run deploy:upstream` + This script is similar to `npm run deploy` but it deploys the plugins to `blockly-samples` upstream. You can browse these plugin playgrounds at: https://google.github.io/blockly-samples/. ### `npm run license` + This script runs the `js-green-licenses` checker on all of the Blockly plugins. Run this script before release to make sure none of our plugin dependencies use packages with non-green licenses. ### `npm run lint` + This script runs `npm run lint` on each of the Blockly plugins in this repo. ### `npm run lint:fix` + This script runs lint with the `--fix` option on each of the Blockly plugins in this repo. ### `npm run test` + This script runs `npm run test` on each of the Blockly plugins in this repo. ### `npm run test:ghpages` + This script builds all files needed to deploy plugins and examples to GitHub Pages, then starts a local server with that content. ### `npm run test:ghpages:beta` + This script installs a beta version of Blockly, builds all files needed to deploy plugins and examples to GitHub Pages, then starts a local server with that content. ### `npm run publish:prepare` + This script will clone a copy of blockly-samples to a directory called `dist`, run `npm ci`, build and test all plugins, and then log in to the npm publishing service. It must be run before any of the other manual publishing commands are @@ -66,6 +80,7 @@ nothing has been pushed to npm or github, you can simply correct the error and try again. ### `npm run publish:manual` + This script assumes that you have already run `npm run publish:prepare`. It will publish all of the changed plugins since the last release, using the `dist` directory. It runs the lerna command that uses conventional commits to determine @@ -81,6 +96,7 @@ the error, and then running `npm run publish:prepare` again followed by `npm run publish:unpublishedOnly` or `npm run publish:force`. ### `npm run publish:unpublishedOnly` + This script assumes that you have already run `npm run publish:prepare`. It uses the `dist` directory created in that script. It uses lerna to check each plugin to see if the version in `package.json` matches the version on npm. If a version is not yet on npm, it will publish @@ -92,12 +108,14 @@ If this script fails, correct the error and re-run `npm run publish:prepare` and `npm run publish:unpublishedOnly`. ### `npm run publish:force` + This script assumes you have already run `npm run publish:prepare`. It will use lerna to force publish all packages, even those that have not changed. You can use this if you run into publishing problems to recover from error states, but you should prefer to use `npm run publish:unpublishedOnly` if possible. ### `npm run publish:checkVersions` + This script assumes you have already run `npm run publish:prepare`. It will run `lerna version` to generate the new version numbers using conventional commits that would be created during a full publish action, but it will not actually push the changes nor @@ -108,12 +126,14 @@ latest tags pulled. This is taken care of by the `publish:prepare` script. ## Other Scripts ### `npm run postinstall` + This script runs `npm run boot` after install. This makes sure that `boot` is called after `npm install` is run. There shouldn't be a need for you to run this script directly. ### `npm run deploy:prepare` + This script prepares each of the plugins for deployment. In general, the script cleans and builds the src and test directories of each plugin. diff --git a/scripts/gh-predeploy.js b/scripts/gh-predeploy.js index 91ab835a33..5d34d2bb94 100644 --- a/scripts/gh-predeploy.js +++ b/scripts/gh-predeploy.js @@ -42,11 +42,15 @@ function injectHeader(initialContents, title, isLocal) { // Replace the title with a more descriptive title. let modifiedContents = initialContents.replace( - /.*<\/title>/, `<title>${title}`); + /.*<\/title>/, + `<title>${title}`, + ); // Add some CSS at the beginning of the header. Any CSS the page already // had will be higher priority. modifiedContents = modifiedContents.replace( - /<\s*head\s*>/, `${headerAdditions}`); + /<\s*head\s*>/, + `${headerAdditions}`, + ); return modifiedContents; } @@ -147,13 +151,13 @@ function injectPluginNavBar(inputString, packageJson, pluginDir, isLocal) { // tag, preserving anything else in the tag (such as onload). // Also wrap all page content in a
tag. let modifiedContent = inputString.replace( - /]*)>/, - ` + /]*)>/, + ` ${navBar}
${tabs} - ` + `, ); modifiedContent = modifiedContent.replace(/(<\/body>)/, `
$1`); return modifiedContent; @@ -208,7 +212,10 @@ function createPluginPage(pluginDir, isLocal) { const initialContents = fs.readFileSync(initialPath).toString(); let contents = injectHeader( - initialContents, `${packageJson.name} Demo`, isLocal); + initialContents, + `${packageJson.name} Demo`, + isLocal, + ); contents = injectPluginNavBar(contents, packageJson, pluginDir, isLocal); contents = injectFooter(contents); @@ -221,7 +228,6 @@ function createPluginPage(pluginDir, isLocal) { * Create the README page (in HTML) from the plugin's README.md file. * This includes the same header, nav bar, and footer as the playground page * for a given package. - * * @param {string} pluginDir The directory of the plugin that is currently * being prepared. * @param {boolean} isLocal True if building for a local test. False if @@ -229,8 +235,9 @@ function createPluginPage(pluginDir, isLocal) { */ function createReadmePage(pluginDir, isLocal) { const packageJson = require(resolveApp(`plugins/${pluginDir}/package.json`)); - const initialContents = - fs.readFileSync(`./plugins/${pluginDir}/README.md`).toString(); + const initialContents = fs + .readFileSync(`./plugins/${pluginDir}/README.md`) + .toString(); const converter = new showdown.Converter(); converter.setFlavor('github'); @@ -257,9 +264,16 @@ function createReadmePage(pluginDir, isLocal) { // Add the same header, nav bar, and footer as we used for the playground. let modifiedContents = injectHeader( - initialPage, `${packageJson.name} Demo`, isLocal); + initialPage, + `${packageJson.name} Demo`, + isLocal, + ); modifiedContents = injectPluginNavBar( - modifiedContents, packageJson, pluginDir, isLocal); + modifiedContents, + packageJson, + pluginDir, + isLocal, + ); modifiedContents = injectFooter(modifiedContents); // Make sure the directory exists, then write to it. @@ -280,58 +294,61 @@ function preparePlugin(pluginDir, isLocal) { console.log(`Preparing ${pluginDir} plugin for deployment.`); createPluginPage(pluginDir, isLocal); createReadmePage(pluginDir, isLocal); - return gulp.src( - [ - './plugins/' + pluginDir + '/build/test_bundle.js', - ], - {base: './plugins/', allowEmpty: true}) - .pipe(gulp.dest('./gh-pages/plugins/')); + return gulp + .src(['./plugins/' + pluginDir + '/build/test_bundle.js'], { + base: './plugins/', + allowEmpty: true, + }) + .pipe(gulp.dest('./gh-pages/plugins/')); } /** * Find the folders that contain plugins with test pages. - * * @returns {Array.string} A list of directories that should be processed * for deployment to GitHub Pages. */ function getPluginFolders() { const dir = 'plugins'; - return fs.readdirSync(dir).filter(function(file) { - return fs.statSync(path.join(dir, file)).isDirectory() && + return fs.readdirSync(dir).filter(function (file) { + return ( + fs.statSync(path.join(dir, file)).isDirectory() && fs.existsSync(path.join(dir, file, 'package.json')) && // Only prepare plugins with test pages. - fs.existsSync(path.join(dir, file, '/test/index.html')); + fs.existsSync(path.join(dir, file, '/test/index.html')) + ); }); } /** * Prepare plugins for deployment to gh-pages. - * * @param {Function} done Completed callback. * @returns {Function} Gulp task. */ function prepareToDeployPlugins(done) { const folders = getPluginFolders(); - return gulp.parallel(folders.map(function(folder) { - return function preDeployPlugin() { - return preparePlugin(folder, false); - }; - }))(done); + return gulp.parallel( + folders.map(function (folder) { + return function preDeployPlugin() { + return preparePlugin(folder, false); + }; + }), + )(done); } /** * Prepare plugins for local testing of the GitHub Pages site. - * * @param {Function} done Completed callback. * @returns {Function} Gulp task. */ function prepareLocalPlugins(done) { const folders = getPluginFolders(); - return gulp.parallel(folders.map(function(folder) { - return function preDeployPlugin() { - return preparePlugin(folder, true); - }; - }))(done); + return gulp.parallel( + folders.map(function (folder) { + return function preDeployPlugin() { + return preparePlugin(folder, true); + }; + }), + )(done); } /** @@ -347,8 +364,9 @@ function prepareLocalPlugins(done) { */ function injectExampleNavBar(inputString, demoConfig, pageRoot, isLocal) { // Build up information from package.json. - const descriptionString = demoConfig.description ? - `
${demoConfig.description}
` : ``; + const descriptionString = demoConfig.description + ? `
${demoConfig.description}
` + : ``; const codeLink = `https://github.com/google/blockly-samples/blob/master/${pageRoot}`; const pages = demoConfig.pages; @@ -378,13 +396,13 @@ function injectExampleNavBar(inputString, demoConfig, pageRoot, isLocal) { // tag, preserving anything else in the tag (such as onload). // Also wrap all page content in a
tag. let modifiedContent = inputString.replace( - /]*)>/, - ` + /]*)>/, + ` ${navBar}
${tabString} - ` + `, ); modifiedContent = modifiedContent.replace(/<\/body>/, `
\n `); return modifiedContent; @@ -405,8 +423,9 @@ function injectExampleNavBar(inputString, demoConfig, pageRoot, isLocal) { * building for gh-pages. */ function createExamplePage(pageRoot, pagePath, demoConfig, isLocal) { - const initialContents = - fs.readFileSync(path.join(pageRoot, pagePath)).toString(); + const initialContents = fs + .readFileSync(path.join(pageRoot, pagePath)) + .toString(); let contents = injectHeader(initialContents, demoConfig.title, isLocal); contents = injectExampleNavBar(contents, demoConfig, pageRoot, isLocal); @@ -430,8 +449,9 @@ function createExamplePage(pageRoot, pagePath, demoConfig, isLocal) { */ function prepareExample(exampleDir, isLocal, done) { const baseDir = 'examples'; - const packageJson = - require(resolveApp(path.join(baseDir, exampleDir, 'package.json'))); + const packageJson = require( + resolveApp(path.join(baseDir, exampleDir, 'package.json')), + ); // Cancel early if the package.json says this is not a demo. const {blocklyDemoConfig: demoConfig} = packageJson; @@ -448,10 +468,12 @@ function prepareExample(exampleDir, isLocal, done) { // Special case: do a straight copy for the devsite demo, with no wrappers. if (packageJson.name == 'blockly-devsite-demo') { - return gulp.src( + return gulp + .src( fileList.map((f) => path.join(baseDir, exampleDir, f)), - {base: baseDir, allowEmpty: true}) - .pipe(gulp.dest('./gh-pages/examples/')); + {base: baseDir, allowEmpty: true}, + ) + .pipe(gulp.dest('./gh-pages/examples/')); } // All other examples. @@ -459,7 +481,7 @@ function prepareExample(exampleDir, isLocal, done) { const pages = fileList.filter((f) => pageRegex.test(f)); // Add headers and footers to HTML pages. pages.forEach((page) => - createExamplePage(`${baseDir}/${exampleDir}`, page, demoConfig, isLocal) + createExamplePage(`${baseDir}/${exampleDir}`, page, demoConfig, isLocal), ); // Copy over all other files mentioned in the demoConfig to the @@ -468,8 +490,9 @@ function prepareExample(exampleDir, isLocal, done) { let stream; if (assets.length) { stream = gulp.src( - assets.map((f) => path.join(baseDir, exampleDir, f)), - {base: baseDir, allowEmpty: true}); + assets.map((f) => path.join(baseDir, exampleDir, f)), + {base: baseDir, allowEmpty: true}, + ); } return stream.pipe(gulp.dest('./gh-pages/examples/')); } @@ -481,8 +504,10 @@ function prepareExample(exampleDir, isLocal, done) { function getExampleFolders() { const dir = 'examples'; return fs.readdirSync(dir).filter((file) => { - return fs.statSync(path.join(dir, file)).isDirectory() && - fs.existsSync(path.join(dir, file, 'package.json')); + return ( + fs.statSync(path.join(dir, file)).isDirectory() && + fs.existsSync(path.join(dir, file, 'package.json')) + ); }); } /** @@ -495,33 +520,35 @@ function getExampleFolders() { */ function prepareToDeployExamples(done) { const folders = getExampleFolders(); - return gulp.parallel(folders.map(function(folder) { - return function preDeployExample(done) { - return prepareExample(folder, false, done); - }; - }))(done); + return gulp.parallel( + folders.map(function (folder) { + return function preDeployExample(done) { + return prepareExample(folder, false, done); + }; + }), + )(done); } /** * Prepare examples/demos for local testing of the GitHub Pages site. - * * @param {Function} done Completed callback. * @returns {Function} Gulp task. */ function prepareLocalExamples(done) { const folders = getExampleFolders(); - return gulp.parallel(folders.map(function(folder) { - return function preDeployExample(done) { - return prepareExample(folder, true, done); - }; - }))(done); + return gulp.parallel( + folders.map(function (folder) { + return function preDeployExample(done) { + return prepareExample(folder, true, done); + }; + }), + )(done); } /** * Create the index page for the blockly-samples GitHub Pages site. * This page has some nice wrappers and links to plugins and demos * sourced from _index.html. - * * @param {boolean} isLocal True if building for a local test. False if * building for gh-pages. */