Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The outline of the block is a single [SVG path](https://developer.mozilla.org/en

Each sub-path is a string of [path commands](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#path_commands) that describe the appropriate shape. These commands must use relative (rather than absolute) coordinates.

SVG path commands can be written as strings, but Blockly provides a set of [utility functions](/reference/blockly.utils.svgpaths) to make writing and reading paths easier.
SVG path commands can be written as strings, but Blockly provides a set of [utility functions](/reference/blockly.utils_namespace.svgpaths_namespace) to make writing and reading paths easier.

### `init()`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ see [Colour formats](/guides/configure/appearance/colour-formats).
Note the British spelling. Failure to set the colour results in a black block.

You can also set the block color using the
[`Block.setColour(..)`](/reference/blockly.block.setcolour)
[`Block.setColour(..)`](/reference/blockly.block_class.setcolour_method)
function, or by using [themes](/guides/configure/appearance/themes)
and defining a block style.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ toolbox categories, plus a distinct colour for dynamic variables:
```

These string values can be used in both the JSON definitions and
[`block.setColour(..)`](/reference/blockly.block.setcolour).
[`block.setColour(..)`](/reference/blockly.block_class.setcolour_method).

You can add your own colour constants by adding to `Blockly.Msg`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ directly.
## Configuration options \{#the-options-dictionary\}

The configuration object implements
[`Blockly.BlocklyOptions`](/reference/blockly.blocklyoptions)
[`Blockly.BlocklyOptions`](/reference/blockly.blocklyoptions_interface)
and has the following options. Note that several of these options change their
default value based on whether the provided toolbox has categories or not.

Expand Down Expand Up @@ -70,8 +70,8 @@ default value based on whether the provided toolbox has categories or not.
[Grid]: /guides/configure/grid
[media]: /guides/configure/media
[Move]: /guides/configure/move
[setIsReadOnly]: /reference/blockly.workspace.setisreadonly
[isReadOnly]: /reference/blockly.workspace.isreadonly
[setIsReadOnly]: /reference/blockly.workspace_class.setisreadonly_method
[isReadOnly]: /reference/blockly.workspace_class.isreadonly_method
[renderer]: /guides/create-custom-blocks/renderers/create-custom-renderers/basic-implementation
[RTL demo]: https://raspberrypifoundation.github.io/blockly-samples/examples/rtl-demo/
[Themes]: /guides/configure/appearance/themes
Expand Down
14 changes: 7 additions & 7 deletions packages/docs/docs/guides/configure/context-menus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,15 @@ steps:

[block-default-menu-image]: /images/context-menus/block-default-menu.png
[context-menu-items-source]: https://github.com/RaspberryPiFoundation/blockly/blob/main/packages/blockly/core/contextmenu_items.ts
[i-context-menu]: /reference/blockly.icontextmenu
[i-focusable-node]: /reference/blockly.ifocusablenode
[RegistryItem]: /reference/blockly.contextmenuregistry.registryitem
[i-context-menu]: /reference/blockly.icontextmenu_interface
[i-focusable-node]: /reference/blockly.ifocusablenode_interface
[RegistryItem]: /reference/blockly.contextmenuregistry_namespace.registryitem_typealias
[Scope]: #scope
[enabled-image]: /images/context-menus/enabled-option.png
[disabled-image]: /images/context-menus/disabled-option.png
[customContextMenu]: /reference/blockly.blocksvg.customcontextmenu
[configureContextMenu]: /reference/blockly.workspacesvg.configurecontextmenu
[ContextMenuOption]: /reference/blockly.contextmenuregistry.contextmenuoption
[LegacyContextMenuOption]: /reference/blockly.contextmenuregistry.legacycontextmenuoption
[customContextMenu]: /reference/blockly.blocksvg_class.customcontextmenu_property
[configureContextMenu]: /reference/blockly.workspacesvg_class.configurecontextmenu_property
[ContextMenuOption]: /reference/blockly.contextmenuregistry_namespace.contextmenuoption_typealias
[LegacyContextMenuOption]: /reference/blockly.contextmenuregistry_namespace.legacycontextmenuoption_interface
[coordinate-systems]: /guides/configure/metrics_manager#coordinate-systems
[keyboard-navigation-plugin]: /guides/configure/keyboard-nav
14 changes: 7 additions & 7 deletions packages/docs/docs/guides/configure/copy-paste.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ Blockly.clipboard.registry.register('MY_PASTER', new MyPaster());
```

[implement-paster]: /guides/configure/copy-paste#implement-a-paster
[ICopyable]: /reference/blockly.icopyable
[IDeletable]: /reference/blockly.ideletable
[IDraggable]: /reference/blockly.idraggable
[ICopyData]: /reference/blockly.icopyable.icopydata
[IPaster]: /reference/blockly.ipaster
[ISelectable]: /reference/blockly.iselectable
[ICopyable]: /reference/blockly.icopyable_interface
[IDeletable]: /reference/blockly.ideletable_interface
[IDraggable]: /reference/blockly.idraggable_interface
[ICopyData]: /reference/blockly.icopyable_namespace.icopydata_interface
[IPaster]: /reference/blockly.ipaster_interface
[ISelectable]: /reference/blockly.iselectable_interface
[default-keyboard-shortcuts]: /guides/configure/keyboard-shortcuts#default-shortcuts
[context-menu-option]: /guides/configure/context-menus
[custom-draggables]: /guides/configure/dragging/draggable
[multiselect-plugin]: https://www.npmjs.com/package/@mit-app-inventor/blockly-plugin-workspace-multiselect
[cross-tab-copy-paste-plugin]: https://www.npmjs.com/package/@blockly/plugin-cross-tab-copy-paste
[clipboard-namespace]: /reference/blockly.clipboard
[clipboard-namespace]: /reference/blockly.clipboard_namespace
34 changes: 17 additions & 17 deletions packages/docs/docs/guides/configure/customization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ The following Blockly classes can be replaced:
For information about how to replace a renderer, see [Create custom
renderers](/guides/create-custom-blocks/renderers/create-custom-renderers/basic-implementation).

[`Blockly.dragging.Dragger`]: /reference/blockly.dragging.dragger
[`Blockly.IDragger`]: /reference/blockly.idragger
[`Blockly.ConnectionChecker`]: /reference/blockly.connectionchecker
[`Blockly.IConnectionChecker`]: /reference/blockly.iconnectionchecker
[`Blockly.InsertionMarkerPreviewer`]: /reference/blockly.insertionmarkerpreviewer
[`Blockly.IConnectionPreviewer`]: /reference/blockly.iconnectionpreviewer
[`Blockly.HorizontalFlyout`]: /reference/blockly.horizontalflyout
[`Blockly.VerticalFlyout`]: /reference/blockly.verticalflyout
[`Blockly.IFlyout`]: /reference/blockly.iflyout
[`Blockly.MetricsManager`]: /reference/blockly.metricsmanager
[`Blockly.IMetricsManager`]: /reference/blockly.imetricsmanager
[`Blockly.Toolbox`]: /reference/blockly.toolbox
[`Blockly.IToolbox`]: /reference/blockly.itoolbox
[`Blockly.VariableMap`]: /reference/blockly.variablemap
[`Blockly.IVariableMap`]: /reference/blockly.ivariablemap
[`Blockly.VariableModel`]: /reference/blockly.variablemodel
[`Blockly.IVariableModel`]: /reference/blockly.ivariablemodel
[`Blockly.dragging.Dragger`]: /reference/blockly.dragging_namespace.dragger_class
[`Blockly.IDragger`]: /reference/blockly.idragger_interface
[`Blockly.ConnectionChecker`]: /reference/blockly.connectionchecker_class
[`Blockly.IConnectionChecker`]: /reference/blockly.iconnectionchecker_interface
[`Blockly.InsertionMarkerPreviewer`]: /reference/blockly.insertionmarkerpreviewer_class
[`Blockly.IConnectionPreviewer`]: /reference/blockly.iconnectionpreviewer_interface
[`Blockly.HorizontalFlyout`]: /reference/blockly.horizontalflyout_class
[`Blockly.VerticalFlyout`]: /reference/blockly.verticalflyout_class
[`Blockly.IFlyout`]: /reference/blockly.iflyout_interface
[`Blockly.MetricsManager`]: /reference/blockly.metricsmanager_class
[`Blockly.IMetricsManager`]: /reference/blockly.imetricsmanager_interface
[`Blockly.Toolbox`]: /reference/blockly.toolbox_class
[`Blockly.IToolbox`]: /reference/blockly.itoolbox_interface
[`Blockly.VariableMap`]: /reference/blockly.variablemap_class
[`Blockly.IVariableMap`]: /reference/blockly.ivariablemap_interface
[`Blockly.VariableModel`]: /reference/blockly.variablemodel_class
[`Blockly.IVariableModel`]: /reference/blockly.ivariablemodel_interface

## Create a replacement class

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ Blockly.Blocks['my_block'] = {

[draggable]: /guides/configure/dragging/draggable
[draggable-implementation]: /guides/configure/dragging/draggable#implementation
[setDragStrategy]: /reference/blockly.blocksvg.setdragstrategy
[IDraggable]: /reference/blockly.idraggable
[IDragStrategy]: /reference/blockly.idragstrategy
[setDragStrategy]: /reference/blockly.blocksvg_class.setdragstrategy_method
[IDraggable]: /reference/blockly.idraggable_interface
[IDragStrategy]: /reference/blockly.idragstrategy_interface
14 changes: 7 additions & 7 deletions packages/docs/docs/guides/configure/dragging/draggable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ For more information about copying pasting see [Copy paste][copy-paste].

{/* This doesn't exist yet */}
[events]: /guides/configure/events
[IRenderedElement]: /reference/blockly.irenderedelement
[IDraggable]: /reference/blockly.idraggable
[IDeletable]: /reference/blockly.ideletable
[ISelectable]: /reference/blockly.iselectable
[setSelected]: /reference/blockly.common
[IRenderedElement]: /reference/blockly.irenderedelement_interface
[IDraggable]: /reference/blockly.idraggable_interface
[IDeletable]: /reference/blockly.ideletable_interface
[ISelectable]: /reference/blockly.iselectable_interface
[setSelected]: /reference/blockly.common_namespace
[svg-group]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g
[Coordinate]: /reference/blockly.utils.coordinate
[drag-target]: /reference/blockly.dragtarget
[Coordinate]: /reference/blockly.utils_namespace.coordinate_class
[drag-target]: /reference/blockly.dragtarget_class
[copy-paste]: /guides/configure/copy-paste
4 changes: 2 additions & 2 deletions packages/docs/docs/guides/configure/dragging/dragger.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,6 @@ const myWorkspace = Blockly.inject('blocklyDiv', {
```

[draggable]: /guides/configure/dragging/draggable
[drag-target]: /reference/blockly.dragtarget
[drag-target]: /reference/blockly.dragtarget_class
[scroll-options-plugin]: https://www.npmjs.com/package/@blockly/plugin-scroll-options
[IDragger]: /reference/blockly.idragger
[IDragger]: /reference/blockly.idragger_interface
6 changes: 3 additions & 3 deletions packages/docs/docs/guides/configure/focus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ in an exception.

If you write a custom component from scratch, you'll need to implement the focus
interfaces yourself. See the reference documentation for
[`IFocusableTree`](/reference/blockly.ifocusabletree) and
[`IFocusableNode`](/reference/blockly.ifocusablenode) more
[`IFocusableTree`](/reference/blockly.ifocusabletree_interface) and
[`IFocusableNode`](/reference/blockly.ifocusablenode_interface) more
information.

After you have implemented your class, test it against the keyboard navigation
Expand Down Expand Up @@ -367,7 +367,7 @@ manager just changes the actively focused node to passive focus.)

Positionables are components that are positioned on top of the workspace and
implement
[`IPositionable`](/reference/blockly.ipositionable).
[`IPositionable`](/reference/blockly.ipositionable_interface).
Examples are the trashcan and the backpack in the [backpack
plugin](https://www.npmjs.com/package/@blockly/workspace-backpack).
Built-in positionables are integrated with the focus system, but if you create
Expand Down
10 changes: 5 additions & 5 deletions packages/docs/docs/guides/configure/keyboard-shortcuts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ user presses a key (or combination of keys), Blockly:
## Scope

A
[`Scope`](/reference/blockly.contextmenuregistry.scope)
[`Scope`](/reference/blockly.contextmenuregistry_namespace.scope_interface)
object identifies the Blockly component that currently has focus. Scope objects
are passed to `preconditionFn` and `callback`, which use them to decide whether
a shortcut applies to a particular component and, if so, how to apply it.

To use a `Scope` object, use its `focusedNode` property. This is an object that
implements
[`IFocusableNode`](/reference/blockly.ifocusablenode). This
[`IFocusableNode`](/reference/blockly.ifocusablenode_interface). This
interface is implemented by all Blockly components that the user can focus on,
including workspaces, blocks, fields, comments, and your own custom components;
for more information, see the documentation on the
Expand All @@ -58,7 +58,7 @@ preconditionFn(workspace, scope) {
## The KeyboardShortcut interface

Objects in the shortcut registry implement the
[`KeyboardShortcut`](/reference/blockly.shortcutregistry.keyboardshortcut)
[`KeyboardShortcut`](/reference/blockly.shortcutregistry_namespace.keyboardshortcut_interface)
interface. This contains the following properties.

### name (required)
Expand Down Expand Up @@ -138,7 +138,7 @@ not do anything.

An array of keys (or combinations of keys) that activate this shortcut. To
identify keys, use the keycodes in
[`Blockly.utils.KeyCodes`](/reference/blockly.utils.keycodes).
[`Blockly.utils.KeyCodes`](/reference/blockly.utils_namespace.keycodes_enum).
For example:

```js
Expand All @@ -151,7 +151,7 @@ const logFieldsShortcut = {

If you want map additional keys to an existing shortcut -- for example, you want
to add keys to a [default shortcut](#default-shortcuts) -- you can call
[`Blockly.ShortcutRegistry.registry.addKeyMapping`](/reference/blockly.shortcutregistry.addkeymapping).
[`Blockly.ShortcutRegistry.registry.addKeyMapping`](/reference/blockly.shortcutregistry_class.addkeymapping_method).
This is not common.

#### Key combinations
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/guides/configure/metrics_manager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ the bounding box around any blocks or workspace comments.

:::note
Content metrics do not take into account block comments, only [workspace
comments](/reference/blockly.comments.workspacecomment).
comments](/reference/blockly.comments_namespace.workspacecomment_class).
:::

<Image
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/guides/configure/serialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ When you register a serializer you must provide several things:
order](/guides/configure/serialization#deserialization-order).

You can base the priority of your serializer on the [built-in
priorities](/reference/blockly.serialization.priorities)
priorities](/reference/blockly.serialization_namespace.priorities_namespace)

When `Blockly.serialization.workspaces.save` is called, each serializer's `save`
function will be called, and its data will be added to the final JSON output:
Expand Down Expand Up @@ -218,7 +218,7 @@ For information on how to migrate to JSON, see the [migration guide].
### APIs

For information about the XML system's APIs see the [reference
documentation](/reference/blockly.xml).
documentation](/reference/blockly.xml_namespace).

### Block hooks

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/guides/configure/toolboxes/preset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ out.](/images/toolbox-disabled.png)
</TabItem>
</Tabs>
You can also programmatically disable or enable a block by using
[`setDisabledReason`](/reference/blockly.block.setdisabledreason).
[`setDisabledReason`](/reference/blockly.block_class.setdisabledreason_method).

## Configure your blocks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ Because the definition functions are mixed in to the block object:

- The `this` keyword in definition functions refers to the block object. That
is, it can be used to access the public methods and properties in the
[`Block`](/reference/blockly.block) (or
[`BlockSvg`](/reference/blockly.blocksvg)) class.
[`Block`](/reference/blockly.block_class) (or
[`BlockSvg`](/reference/blockly.blocksvg_class)) class.

Blockly defines a small number of functions you can use to customize blocks. The
most common of these is `init`, which Blockly calls to initialize a block and
which is used to define the block's look and feel. For a complete list, see the
function-valued properties in the
[`Block`](/reference/blockly.block) and
[`BlockSvg`](/reference/blockly.blocksvg#properties) classes.
[`Block`](/reference/blockly.block_class#properties) and
[`BlockSvg`](/reference/blockly.blocksvg_class#properties) classes.
These properties effectively form an interface for block definitions to
implement; all of them are optional.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ This section summarizes the objects and functions used to define custom blocks.

### Blockly.Blocks

[`Blockly.Blocks`](/reference/blockly.blocks) is an object
[`Blockly.Blocks`](/reference/blockly.blocks_variable) is an object
that stores block definitions. Its keys are block type names and its values are
block definition objects. Use `Blockly.Blocks` when defining blocks with
JavaScript:
Expand Down Expand Up @@ -184,7 +184,7 @@ Blockly.Blocks['my_block'].setColour(150);

### defineBlocksWithJsonArray

[`defineBlocksWithJsonArray`](/reference/blockly.common.defineblockswithjsonarray)
[`defineBlocksWithJsonArray`](/reference/blockly.common_namespace.defineblockswithjsonarray_function)
accepts an array of JSON objects, creates block definitions from them, and adds
them to `Blockly.Blocks`.

Expand All @@ -207,7 +207,7 @@ Blockly.common.defineBlocksWithJsonArray([

### createBlockDefinitionsFromJsonArray and defineBlocks

[`createBlockDefinitionsFromJsonArray`](/reference/blockly.common.createblockdefinitionsfromjsonarray)
[`createBlockDefinitionsFromJsonArray`](/reference/blockly.common_namespace.createblockdefinitionsfromjsonarray_function)
accepts an array of JSON objects and returns an object that maps block type
names to block definitions. This is generally used with `defineBlocks`, which
adds the block definitions to `Blockly.Blocks`.
Expand All @@ -233,7 +233,7 @@ Blockly.common.defineBlocks(myBlockDefinitions);

### Block.jsonInit

[`jsonInit`](/reference/blockly.block.jsoninit)
[`jsonInit`](/reference/blockly.block_class.jsoninit_method)
accepts a JSON object and calls the corresponding methods on `Block`. For
example, a JSON object with the key-value pair `colour: 150` results in a call
to `this.setColour(150)`. Use `jsonInit` in an `init` function to load a JSON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ can act like buttons that exist on blocks.

The on click handler can be set in the [JavaScript Constructor](#creation) or
using the
[`setOnClickHandler`](/reference/blockly.fieldimage.setonclickhandler)
[`setOnClickHandler`](/reference/blockly.fieldimage_class.setonclickhandler_method)
function.

Here is an example of an on click handler that collapses the block when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ collapsed.](/images/fields/label/collapsed.png)
```
</TabItem>
</Tabs>
The [`appendField`](/reference/blockly.input.appendfield)
The [`appendField`](/reference/blockly.input_class.appendfield_method)
function accepts both `FieldLabel` objects and, more commonly, strings to create
labels.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ feedback about what they're doing wrong.”
## Constraints

Constraints can be set in the field definition, or by using the
[setConstraints](/reference/blockly.fieldnumber.setconstraints)
[setConstraints](/reference/blockly.fieldnumber_class.setconstraints_method)
function.

### Minimum value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ return a string, `null`, or `undefined`.

Here's an example of a validator that only accepts some predefined variables as
options. These variables would need to be defined with the
[`Workspace.getVariableMap().createVariable`](/reference/blockly.ivariablemap.createvariable)
[`Workspace.getVariableMap().createVariable`](/reference/blockly.ivariablemap_interface.createvariable_methodsignature)
function when the workspace is loaded.

```js
Expand Down
Loading
Loading