8.1.6 • Published 14 days ago

@blockly/plugin-workspace-search v8.1.6

Weekly downloads
65
License
Apache-2.0
Repository
github
Last release
14 days ago

@blockly/plugin-workspace-search Built on Blockly

A Blockly plugin that adds workspace search support.

Installation

npm install @blockly/plugin-workspace-search --save

Usage

ES6 Imports

import * as Blockly from 'blockly';
import {WorkspaceSearch} from '@blockly/plugin-workspace-search';

const workspace = Blockly.inject('blocklyDiv');
const workspaceSearch = new WorkspaceSearch(workspace);

workspaceSearch.init();

Script Tag

<script src="./node_modules/@blockly/plugin-workspace-search/dist/index.js"></script>

To open workspace search use either command + f or control + f. To close the search bar hit escape or the 'x' in the top right corner.

API

  • init: Initializes the workspace search bar.
  • dispose: Disposes of workspace search.
  • open: Opens the search bar.
  • close: Closes the search bar.
  • previous: Selects the previous block.
  • next: Selects the next block.
  • setSearchPlaceholder: Sets the placeholder text for the search bar text input.
  • addActionBtn: Add a button to the action div. This must be called after the init function has been called.
  • clearBlocks: Clears the selection group and current block.
  • searchAndHighlight: Searches the workspace for the current search term and highlights matching blocks.

Styling

The generated search bar looks like:

<div class="ws-search'>
  <div class="ws-search-container'>
    <div class="ws-search-content'>
      <div class="ws-search-input'>
        [... text input goes here ...]
      </div>
      [... actions div goes here ...]
    </div>
    [... close button goes here ...]
  </div>
</div>

Here are additional CSS classes to style your search bar:

  • blockly-ws-search: Applies to the outer-most div.
    • Default styling:
      '.blockly-ws-search {',
        'background: white;',
        'border: solid lightgrey 0.5px;',
        'box-shadow: 0px 10px 20px grey;',
        'justify-content: center;',
        'padding: 0.25em;',
        'position: absolute;',
        'z-index: 70;',
      '}'
  • blockly-ws-search-container: Applies to the search container.
  • blockly-ws-search-content: Applies to the search content.
  • blockly-ws-search-input: Applies to the input wrapper. (Default: border: none;)
  • blockly-ws-search-actions: Applies to the action div.
  • blockly-ws-search-current: Highlights the provided block as the "current selection". (Default: fill: grey;)
  • blockly-ws-search-highlight: Adds highlight to the provided blocks. (Default: fill: black;)

License

Apache 2.0

8.1.6

14 days ago

8.1.5

1 month ago

8.1.4

1 month ago

8.1.3

3 months ago

8.1.2

5 months ago

8.1.1

5 months ago

8.1.0

6 months ago

7.0.1

10 months ago

8.0.9

6 months ago

8.0.8

6 months ago

8.0.5

8 months ago

8.0.4

9 months ago

8.0.7

6 months ago

8.0.6

8 months ago

8.0.1

10 months ago

8.0.0

10 months ago

8.0.3

9 months ago

8.0.2

10 months ago

7.0.0

11 months ago

6.0.17

11 months ago

6.0.16

12 months ago

6.0.15

12 months ago

6.0.14

1 year ago

6.0.13

1 year ago

6.0.7

1 year ago

6.0.9

1 year ago

6.0.8

1 year ago

6.0.12

1 year ago

6.0.11

1 year ago

6.0.10

1 year ago

6.0.6

1 year ago

6.0.5

1 year ago

6.0.4

1 year ago

6.0.3

1 year ago

6.0.2

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

5.0.20

2 years ago

5.0.21

2 years ago

5.0.22

2 years ago

5.0.14

2 years ago

5.0.15

2 years ago

5.0.16

2 years ago

5.0.17

2 years ago

5.0.18

2 years ago

5.0.19

2 years ago

5.0.9

2 years ago

5.0.8

2 years ago

5.0.10

2 years ago

5.0.13

2 years ago

5.0.7

2 years ago

5.0.6

2 years ago

5.0.5

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

4.0.10

2 years ago

4.0.9

3 years ago

4.0.8

3 years ago

4.0.7

3 years ago

4.0.6

3 years ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

3.0.10

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

3.0.9

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.1.11

3 years ago

2.1.10

3 years ago

2.1.8

3 years ago

2.1.7

3 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.0

4 years ago

1.20200312.11

4 years ago

1.20200312.10

4 years ago

1.20200312.8

4 years ago

1.20200312.7

4 years ago

1.20200312.6

4 years ago

1.20200312.5

4 years ago

1.20200312.3

4 years ago

1.20200312.4

4 years ago

1.20200312.2

4 years ago

1.20200312.1

4 years ago

1.20200312.0

4 years ago