diff --git a/blockly_uncompressed.js b/blockly_uncompressed.js index 06e0b1621..cdb9c4057 100644 --- a/blockly_uncompressed.js +++ b/blockly_uncompressed.js @@ -21,17 +21,17 @@ this.BLOCKLY_DIR = (function(root) { this.BLOCKLY_BOOT = function(root) { // Execute after Closure has loaded. -goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Workspace', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.deprecation', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es5'}); -goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.dom'], {}); -goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.Workspace', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.deprecation', 'Blockly.utils.object', 'Blockly.utils.string'], {'lang': 'es5'}); +goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.Svg', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/block_events.js', ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Procedures', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.constants', 'Blockly.inject', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour'], {}); goog.addDependency('../../core/blocks.js', ['Blockly.Blocks'], [], {}); -goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/components/component.js', ['Blockly.Component', 'Blockly.Component.Error'], ['Blockly.utils.IdGenerator', 'Blockly.utils.dom', 'Blockly.utils.style'], {}); goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml', 'Blockly.utils.deprecation'], {}); goog.addDependency('../../core/connection_checker.js', ['Blockly.ConnectionChecker'], ['Blockly.registry'], {}); @@ -45,29 +45,29 @@ goog.addDependency('../../core/dropdowndiv.js', ['Blockly.DropDownDiv'], ['Block goog.addDependency('../../core/events.js', ['Blockly.Events'], ['Blockly.registry', 'Blockly.utils'], {}); goog.addDependency('../../core/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events'], {}); goog.addDependency('../../core/extensions.js', ['Blockly.Extensions'], ['Blockly.utils'], {}); -goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {'lang': 'es5'}); -goog.addDependency('../../core/field_angle.js', ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.Tooltip', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/field_angle.js', ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/field_checkbox.js', ['Blockly.FieldCheckbox'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/field_colour.js', ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils.IdGenerator', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_dropdown.js', ['Blockly.FieldDropdown'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/field_image.js', ['Blockly.FieldImage'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_dropdown.js', ['Blockly.FieldDropdown'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/field_image.js', ['Blockly.FieldImage'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/field_label.js', ['Blockly.FieldLabel'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/field_label_serializable.js', ['Blockly.FieldLabelSerializable'], ['Blockly.FieldLabel', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_multilineinput.js', ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/field_multilineinput.js', ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es5'}); goog.addDependency('../../core/field_number.js', ['Blockly.FieldNumber'], ['Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.aria', 'Blockly.utils.object'], {}); goog.addDependency('../../core/field_registry.js', ['Blockly.fieldRegistry'], ['Blockly.registry'], {}); goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/field_variable.js', ['Blockly.FieldVariable'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutCursor', 'Blockly.Gesture', 'Blockly.Marker', 'Blockly.Scrollbar', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.toolbox'], {}); -goog.addDependency('../../core/flyout_button.js', ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {'lang': 'es5'}); +goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutCursor', 'Blockly.Gesture', 'Blockly.Marker', 'Blockly.Scrollbar', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.toolbox'], {}); +goog.addDependency('../../core/flyout_button.js', ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency('../../core/flyout_dragger.js', ['Blockly.FlyoutDragger'], ['Blockly.WorkspaceDragger', 'Blockly.utils.object'], {}); goog.addDependency('../../core/flyout_horizontal.js', ['Blockly.HorizontalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.object'], {}); goog.addDependency('../../core/flyout_vertical.js', ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/generator.js', ['Blockly.Generator'], ['Blockly.Block'], {}); goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.ASTNode', 'Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FlyoutDragger', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.constants', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.user.keyMap', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.user.keyMap', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.Connection', 'Blockly.FieldLabel'], {}); goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.Events', 'Blockly.blockAnimations'], {'lang': 'es5'}); goog.addDependency('../../core/interfaces/i_accessibility.js', ['Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IBlocklyActionable'], [], {}); @@ -81,6 +81,7 @@ goog.addDependency('../../core/interfaces/i_deletearea.js', ['Blockly.IDeleteAre goog.addDependency('../../core/interfaces/i_flyout.js', ['Blockly.IFlyout'], [], {}); goog.addDependency('../../core/interfaces/i_movable.js', ['Blockly.IMovable'], [], {}); goog.addDependency('../../core/interfaces/i_registrable.js', ['Blockly.IRegistrable'], [], {}); +goog.addDependency('../../core/interfaces/i_registrable_field.js', ['Blockly.IRegistrableField'], [], {}); goog.addDependency('../../core/interfaces/i_selectable.js', ['Blockly.ISelectable'], [], {}); goog.addDependency('../../core/interfaces/i_styleable.js', ['Blockly.IStyleable'], [], {}); goog.addDependency('../../core/interfaces/i_toolbox.js', ['Blockly.IToolbox'], [], {}); @@ -98,20 +99,20 @@ goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], [' goog.addDependency('../../core/menu.js', ['Blockly.Menu'], ['Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.style'], {}); goog.addDependency('../../core/menuitem.js', ['Blockly.MenuItem'], ['Blockly.utils.IdGenerator', 'Blockly.utils.aria', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {}); -goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg'], {}); goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.Xml', 'Blockly.registry', 'Blockly.user.keyMap', 'Blockly.utils.IdGenerator', 'Blockly.utils.Metrics', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.constants', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/registry.js', ['Blockly.registry'], [], {}); -goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.registry', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es5'}); -goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], [], {}); goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types'], {}); -goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode'], {}); -goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo'], {}); goog.addDependency('../../core/renderers/geras/constants.js', ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/geras/drawer.js', ['Blockly.geras.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.geras.Highlighter', 'Blockly.geras.RenderInfo', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {}); @@ -119,7 +120,7 @@ goog.addDependency('../../core/renderers/geras/highlight_constants.js', ['Blockl goog.addDependency('../../core/renderers/geras/highlighter.js', ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); goog.addDependency('../../core/renderers/geras/info.js', ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/geras/measurables/inputs.js', ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/geras/path_object.js', ['Blockly.geras.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/geras/path_object.js', ['Blockly.geras.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/geras/renderer.js', ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/measurables/base.js', ['Blockly.blockRendering.Measurable'], ['Blockly.blockRendering.Types'], {}); goog.addDependency('../../core/renderers/measurables/connections.js', ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); @@ -133,17 +134,17 @@ goog.addDependency('../../core/renderers/minimalist/info.js', ['Blockly.minimali goog.addDependency('../../core/renderers/minimalist/renderer.js', ['Blockly.minimalist.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.minimalist.ConstantProvider', 'Blockly.minimalist.Drawer', 'Blockly.minimalist.RenderInfo', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/thrasos/info.js', ['Blockly.thrasos', 'Blockly.thrasos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/thrasos/renderer.js', ['Blockly.thrasos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.thrasos.RenderInfo', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/zelos/drawer.js', ['Blockly.zelos.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.RenderInfo'], {}); goog.addDependency('../../core/renderers/zelos/info.js', ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {}); -goog.addDependency('../../core/renderers/zelos/marker_svg.js', ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg'], {}); +goog.addDependency('../../core/renderers/zelos/marker_svg.js', ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/renderers/zelos/measurables/inputs.js', ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/zelos/measurables/row_elements.js', ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); goog.addDependency('../../core/renderers/zelos/measurables/rows.js', ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/path_object.js', ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider'], {}); +goog.addDependency('../../core/renderers/zelos/path_object.js', ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider'], {}); goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo'], {}); goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.Themes.Classic', 'Blockly.Themes.Dark', 'Blockly.Themes.Deuteranopia', 'Blockly.Themes.HighContrast', 'Blockly.Themes.Tritanopia', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer'], {}); -goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/theme.js', ['Blockly.Theme'], ['Blockly.registry', 'Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.object'], {}); goog.addDependency('../../core/theme/classic.js', ['Blockly.Themes.Classic'], ['Blockly.Theme'], {}); goog.addDependency('../../core/theme/dark.js', ['Blockly.Themes.Dark'], ['Blockly.Theme'], {}); @@ -154,21 +155,21 @@ goog.addDependency('../../core/theme/tritanopia.js', ['Blockly.Themes.Tritanopia goog.addDependency('../../core/theme/zelos.js', ['Blockly.Themes.Zelos'], ['Blockly.Theme'], {}); goog.addDependency('../../core/theme_manager.js', ['Blockly.ThemeManager'], ['Blockly.Theme'], {}); goog.addDependency('../../core/toolbox/category.js', ['Blockly.ToolboxCategory'], ['Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es5'}); -goog.addDependency('../../core/toolbox/collapsible_category.js', ['Blockly.CollapsibleToolboxCategory'], ['Blockly.ToolboxCategory', 'Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {}); +goog.addDependency('../../core/toolbox/collapsible_category.js', ['Blockly.CollapsibleToolboxCategory'], ['Blockly.ToolboxCategory', 'Blockly.ToolboxItem', 'Blockly.ToolboxSeparator', 'Blockly.registry', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {}); goog.addDependency('../../core/toolbox/separator.js', ['Blockly.ToolboxSeparator'], ['Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils.dom'], {'lang': 'es5'}); -goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.CollapsibleToolboxCategory', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.ToolboxCategory', 'Blockly.ToolboxSeparator', 'Blockly.Touch', 'Blockly.navigation', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom'], {'lang': 'es5'}); +goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.CollapsibleToolboxCategory', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Touch', 'Blockly.navigation', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.toolbox'], {'lang': 'es5'}); goog.addDependency('../../core/toolbox/toolbox_item.js', ['Blockly.ToolboxItem'], [], {}); goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.utils.string'], {}); goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string'], {}); goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.Scrollbar', 'Blockly.Xml', 'Blockly.utils.Rect', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.Scrollbar', 'Blockly.Xml', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.toolbox'], {}); goog.addDependency('../../core/ui_events.js', ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.registry', 'Blockly.utils.object'], {}); goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.constants', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.colour', 'Blockly.utils.global', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {}); goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], [], {}); goog.addDependency('../../core/utils/coordinate.js', ['Blockly.utils.Coordinate'], [], {}); goog.addDependency('../../core/utils/deprecation.js', ['Blockly.utils.deprecation'], [], {}); -goog.addDependency('../../core/utils/dom.js', ['Blockly.utils.dom'], ['Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/utils/dom.js', ['Blockly.utils.dom'], ['Blockly.utils.Svg', 'Blockly.utils.userAgent'], {}); goog.addDependency('../../core/utils/global.js', ['Blockly.utils.global'], [], {}); goog.addDependency('../../core/utils/idgenerator.js', ['Blockly.utils.IdGenerator'], [], {}); goog.addDependency('../../core/utils/keycodes.js', ['Blockly.utils.KeyCodes'], [], {}); @@ -179,6 +180,7 @@ goog.addDependency('../../core/utils/rect.js', ['Blockly.utils.Rect'], [], {}); goog.addDependency('../../core/utils/size.js', ['Blockly.utils.Size'], [], {}); goog.addDependency('../../core/utils/string.js', ['Blockly.utils.string'], [], {}); goog.addDependency('../../core/utils/style.js', ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size'], {}); +goog.addDependency('../../core/utils/svg.js', ['Blockly.utils.Svg'], [], {}); goog.addDependency('../../core/utils/svg_paths.js', ['Blockly.utils.svgPaths'], [], {}); goog.addDependency('../../core/utils/toolbox.js', ['Blockly.utils.toolbox'], [], {}); goog.addDependency('../../core/utils/useragent.js', ['Blockly.utils.userAgent'], ['Blockly.utils.global'], {}); @@ -188,20 +190,20 @@ goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Bloc goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils'], {}); goog.addDependency('../../core/variables.js', ['Blockly.Variables'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Xml', 'Blockly.utils', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/variables_dynamic.js', ['Blockly.VariablesDynamic'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); goog.addDependency('../../core/widgetdiv.js', ['Blockly.WidgetDiv'], ['Blockly.utils.style'], {}); goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.ConnectionChecker', 'Blockly.Events', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.utils', 'Blockly.utils.math'], {}); goog.addDependency('../../core/workspace_audio.js', ['Blockly.WorkspaceAudio'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es5'}); goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/workspace_comment_render_svg.js', ['Blockly.WorkspaceCommentSvg.render'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Ui', 'Blockly.WorkspaceComment', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/workspace_comment_render_svg.js', ['Blockly.WorkspaceCommentSvg.render'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Ui', 'Blockly.WorkspaceComment', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {}); goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate'], {}); goog.addDependency('../../core/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es5'}); -goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ConnectionDB', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.constants', 'Blockly.navigation', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {}); +goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ConnectionDB', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.constants', 'Blockly.navigation', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {}); goog.addDependency('../../core/ws_comment_events.js', ['Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.VarCreate', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils.dom'], {'lang': 'es5'}); +goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency("base.js", [], []); // Load Blockly. diff --git a/core/block_animations.js b/core/block_animations.js index 856b444fb..edf599d2e 100644 --- a/core/block_animations.js +++ b/core/block_animations.js @@ -13,6 +13,7 @@ goog.provide('Blockly.blockAnimations'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -103,7 +104,7 @@ Blockly.blockAnimations.connectionUiEffect = function(block) { xy.y += 3 * scale; } var ripple = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, + Blockly.utils.Svg.CIRCLE, { 'cx': xy.x, 'cy': xy.y, diff --git a/core/block_drag_surface.js b/core/block_drag_surface.js index ed01b72fc..f8c47a6b2 100644 --- a/core/block_drag_surface.js +++ b/core/block_drag_surface.js @@ -19,6 +19,7 @@ goog.provide('Blockly.BlockDragSurfaceSvg'); goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -83,7 +84,7 @@ Blockly.BlockDragSurfaceSvg.prototype.createDom = function() { return; // Already created. } this.SVG_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.SVG, { + Blockly.utils.Svg.SVG, { 'xmlns': Blockly.utils.dom.SVG_NS, 'xmlns:html': Blockly.utils.dom.HTML_NS, 'xmlns:xlink': Blockly.utils.dom.XLINK_NS, @@ -91,7 +92,7 @@ Blockly.BlockDragSurfaceSvg.prototype.createDom = function() { 'class': 'blocklyBlockDragSurface' }, this.container_); this.dragGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, this.SVG_); + Blockly.utils.Svg.G, {}, this.SVG_); }; /** diff --git a/core/block_svg.js b/core/block_svg.js index b3ebab4fc..929f7d0bb 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -60,7 +60,7 @@ Blockly.BlockSvg = function(workspace, prototypeName, opt_id) { * @private */ this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); this.svgGroup_.translate_ = ''; /** diff --git a/core/bubble.js b/core/bubble.js index c994db96b..4fcda64e7 100644 --- a/core/bubble.js +++ b/core/bubble.js @@ -18,6 +18,7 @@ goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.math'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); goog.require('Blockly.Workspace'); @@ -237,7 +238,7 @@ Blockly.Bubble.prototype.createDom_ = function(content, hasResize) { */ this.bubbleGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); var filter = { 'filter': 'url(#' + this.workspace_.getRenderer().getConstants().embossFilterId + ')' @@ -248,11 +249,11 @@ Blockly.Bubble.prototype.createDom_ = function(content, hasResize) { filter = {}; } var bubbleEmboss = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, filter, this.bubbleGroup_); + Blockly.utils.Svg.G, filter, this.bubbleGroup_); this.bubbleArrow_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, {}, bubbleEmboss); + Blockly.utils.Svg.PATH, {}, bubbleEmboss); this.bubbleBack_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, { + Blockly.utils.Svg.RECT, { 'class': 'blocklyDraggable', 'x': 0, 'y': 0, @@ -262,16 +263,16 @@ Blockly.Bubble.prototype.createDom_ = function(content, hasResize) { bubbleEmboss); if (hasResize) { this.resizeGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': this.workspace_.RTL ? 'blocklyResizeSW' : 'blocklyResizeSE'}, this.bubbleGroup_); var resizeSize = 2 * Blockly.Bubble.BORDER_WIDTH; Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.POLYGON, + Blockly.utils.Svg.POLYGON, {'points': '0,x x,x x,0'.replace(/x/g, resizeSize.toString())}, this.resizeGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, { + Blockly.utils.Svg.LINE, { 'class': 'blocklyResizeLine', 'x1': resizeSize / 3, 'y1': resizeSize - 1, @@ -280,7 +281,7 @@ Blockly.Bubble.prototype.createDom_ = function(content, hasResize) { }, this.resizeGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, { + Blockly.utils.Svg.LINE, { 'class': 'blocklyResizeLine', 'x1': resizeSize * 2 / 3, 'y1': resizeSize - 1, diff --git a/core/comment.js b/core/comment.js index 4c00a92e7..cc8b5a681 100644 --- a/core/comment.js +++ b/core/comment.js @@ -21,6 +21,7 @@ goog.require('Blockly.Icon'); goog.require('Blockly.utils.deprecation'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); goog.require('Blockly.Warning'); @@ -92,14 +93,14 @@ Blockly.utils.object.inherits(Blockly.Comment, Blockly.Icon); Blockly.Comment.prototype.drawIcon_ = function(group) { // Circle. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, + Blockly.utils.Svg.CIRCLE, {'class': 'blocklyIconShape', 'r': '8', 'cx': '8', 'cy': '8'}, group); // Can't use a real '?' text character since different browsers and operating // systems render it differently. // Body of question mark. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'class': 'blocklyIconSymbol', 'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405' + @@ -108,7 +109,7 @@ Blockly.Comment.prototype.drawIcon_ = function(group) { group); // Dot of question mark. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyIconSymbol', 'x': '6.8', @@ -138,7 +139,7 @@ Blockly.Comment.prototype.createEditor_ = function() { */ this.foreignObject_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FOREIGNOBJECT, + Blockly.utils.Svg.FOREIGNOBJECT, {'x': Blockly.Bubble.BORDER_WIDTH, 'y': Blockly.Bubble.BORDER_WIDTH}, null); diff --git a/core/field.js b/core/field.js index cbe668120..897cd4718 100644 --- a/core/field.js +++ b/core/field.js @@ -24,6 +24,7 @@ goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Rect'); goog.require('Blockly.utils.Size'); goog.require('Blockly.utils.style'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); goog.requireType('Blockly.blockRendering.ConstantProvider'); @@ -301,7 +302,7 @@ Blockly.Field.prototype.init = function() { return; } this.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); if (!this.isVisible()) { this.fieldGroup_.style.display = 'none'; } @@ -339,7 +340,7 @@ Blockly.Field.prototype.initModel = function() { */ Blockly.Field.prototype.createBorderRect_ = function() { this.borderRect_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, { + Blockly.utils.Svg.RECT, { 'rx': this.getConstants().FIELD_BORDER_RECT_RADIUS, 'ry': this.getConstants().FIELD_BORDER_RECT_RADIUS, 'x': 0, @@ -358,7 +359,7 @@ Blockly.Field.prototype.createBorderRect_ = function() { */ Blockly.Field.prototype.createTextElement_ = function() { this.textElement_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TEXT, { + Blockly.utils.Svg.TEXT, { 'class': 'blocklyText', }, this.fieldGroup_); if (this.getConstants().FIELD_TEXT_BASELINE_CENTER) { diff --git a/core/field_angle.js b/core/field_angle.js index bc7260051..cbafe10c6 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -19,6 +19,7 @@ goog.require('Blockly.FieldTextInput'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.math'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); @@ -237,7 +238,7 @@ Blockly.FieldAngle.prototype.initView = function() { Blockly.FieldAngle.superClass_.initView.call(this); // Add the degree symbol to the left of the number, even in RTL (issue #2380) this.symbol_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TSPAN, {}, null); + Blockly.utils.Svg.TSPAN, {}, null); this.symbol_.appendChild(document.createTextNode('\u00B0')); this.textElement_.appendChild(this.symbol_); }; @@ -285,7 +286,7 @@ Blockly.FieldAngle.prototype.showEditor_ = function(opt_e) { */ Blockly.FieldAngle.prototype.dropdownCreate_ = function() { var svg = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.SVG, { + Blockly.utils.Svg.SVG, { 'xmlns': Blockly.utils.dom.SVG_NS, 'xmlns:html': Blockly.utils.dom.HTML_NS, 'xmlns:xlink': Blockly.utils.dom.XLINK_NS, @@ -295,18 +296,18 @@ Blockly.FieldAngle.prototype.dropdownCreate_ = function() { 'style': 'touch-action: none' }, null); var circle = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, { + Blockly.utils.Svg.CIRCLE, { 'cx': Blockly.FieldAngle.HALF, 'cy': Blockly.FieldAngle.HALF, 'r': Blockly.FieldAngle.RADIUS, 'class': 'blocklyAngleCircle' }, svg); this.gauge_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, { + Blockly.utils.Svg.PATH, { 'class': 'blocklyAngleGauge' }, svg); this.line_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, { + Blockly.utils.Svg.LINE, { 'x1': Blockly.FieldAngle.HALF, 'y1': Blockly.FieldAngle.HALF, 'class': 'blocklyAngleLine' @@ -314,7 +315,7 @@ Blockly.FieldAngle.prototype.dropdownCreate_ = function() { // Draw markers around the edge. for (var angle = 0; angle < 360; angle += 15) { Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, { + Blockly.utils.Svg.LINE, { 'x1': Blockly.FieldAngle.HALF + Blockly.FieldAngle.RADIUS, 'y1': Blockly.FieldAngle.HALF, 'x2': Blockly.FieldAngle.HALF + Blockly.FieldAngle.RADIUS - diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 73d106e63..474b15281 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -28,6 +28,7 @@ goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); goog.require('Blockly.utils.Size'); goog.require('Blockly.utils.string'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); @@ -213,7 +214,7 @@ Blockly.FieldDropdown.prototype.initView = function() { this.createTextElement_(); this.imageElement_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, {}, this.fieldGroup_); + Blockly.utils.Svg.IMAGE, {}, this.fieldGroup_); if (this.getConstants().FIELD_DROPDOWN_SVG_ARROW) { this.createSVGArrow_(); @@ -243,7 +244,7 @@ Blockly.FieldDropdown.prototype.shouldAddBorderRect_ = function() { */ Blockly.FieldDropdown.prototype.createTextArrow_ = function() { this.arrow_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TSPAN, {}, this.textElement_); + Blockly.utils.Svg.TSPAN, {}, this.textElement_); this.arrow_.appendChild(document.createTextNode( this.sourceBlock_.RTL ? Blockly.FieldDropdown.ARROW_CHAR + ' ' : @@ -261,7 +262,7 @@ Blockly.FieldDropdown.prototype.createTextArrow_ = function() { */ Blockly.FieldDropdown.prototype.createSVGArrow_ = function() { this.svgArrow_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, { + Blockly.utils.Svg.IMAGE, { 'height': this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE + 'px', 'width': this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE + 'px' }, this.fieldGroup_); diff --git a/core/field_image.js b/core/field_image.js index d0ec555cb..60400de98 100644 --- a/core/field_image.js +++ b/core/field_image.js @@ -18,6 +18,7 @@ goog.require('Blockly.utils'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); goog.require('Blockly.utils.Size'); +goog.require('Blockly.utils.Svg'); /** @@ -177,7 +178,7 @@ Blockly.FieldImage.prototype.configure_ = function(config) { */ Blockly.FieldImage.prototype.initView = function() { this.imageElement_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, + Blockly.utils.Svg.IMAGE, { 'height': this.imageHeight_ + 'px', 'width': this.size_.width + 'px', diff --git a/core/field_multilineinput.js b/core/field_multilineinput.js index d87c3e3ad..2205cb03f 100644 --- a/core/field_multilineinput.js +++ b/core/field_multilineinput.js @@ -23,6 +23,7 @@ goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.KeyCodes'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); @@ -103,7 +104,7 @@ Blockly.FieldMultilineInput.prototype.fromXml = function(fieldElement) { Blockly.FieldMultilineInput.prototype.initView = function() { this.createBorderRect_(); this.textGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, { + Blockly.utils.Svg.G, { 'class': 'blocklyEditableText', }, this.fieldGroup_); }; @@ -161,7 +162,7 @@ Blockly.FieldMultilineInput.prototype.render_ = function() { var lineHeight = this.getConstants().FIELD_TEXT_HEIGHT + this.getConstants().FIELD_BORDER_RECT_Y_PADDING; var span = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TEXT, { + Blockly.utils.Svg.TEXT, { 'class': 'blocklyText blocklyMultilineText', x: this.getConstants().FIELD_BORDER_RECT_X_PADDING, y: y + this.getConstants().FIELD_BORDER_RECT_Y_PADDING, diff --git a/core/flyout_base.js b/core/flyout_base.js index 25333d41f..e1361460d 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -26,6 +26,7 @@ goog.require('Blockly.Touch'); goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.toolbox'); goog.require('Blockly.WorkspaceSvg'); goog.require('Blockly.Xml'); @@ -227,8 +228,8 @@ Blockly.Flyout.prototype.dragAngleRange_ = 70; * either exist as its own svg element or be a g element nested inside a * separate svg element. * @param {string| - * !Blockly.utils.dom.SvgElementType| - * !Blockly.utils.dom.SvgElementType} tagName The type of tag to + * !Blockly.utils.Svg| + * !Blockly.utils.Svg} tagName The type of tag to * put the flyout in. This should be or . * @return {!SVGElement} The flyout's SVG group. */ @@ -244,7 +245,7 @@ Blockly.Flyout.prototype.createDom = function(tagName) { this.svgGroup_ = Blockly.utils.dom.createSvgElement(tagName, {'class': 'blocklyFlyout', 'style': 'display: none'}, null); this.svgBackground_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, {'class': 'blocklyFlyoutBackground'}, this.svgGroup_); this.svgGroup_.appendChild(this.workspace_.createDom()); this.workspace_.getThemeManager().subscribe( @@ -857,7 +858,7 @@ Blockly.Flyout.prototype.createRect_ = function(block, x, y, blockHW, index) { // Create an invisible rectangle under the block to act as a button. Just // using the block as a button is poor, since blocks have holes in them. var rect = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'fill-opacity': 0, 'x': x, diff --git a/core/flyout_button.js b/core/flyout_button.js index 7e0e84f1d..f0a154291 100644 --- a/core/flyout_button.js +++ b/core/flyout_button.js @@ -16,6 +16,7 @@ goog.require('Blockly.Css'); goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -126,13 +127,13 @@ Blockly.FlyoutButton.prototype.createDom = function() { } this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {'class': cssClass}, + Blockly.utils.Svg.G, {'class': cssClass}, this.workspace_.getCanvas()); if (!this.isLabel_) { // Shadow rectangle (light source does not mirror in RTL). var shadow = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyFlyoutButtonShadow', 'rx': 4, 'ry': 4, 'x': 1, 'y': 1 @@ -141,7 +142,7 @@ Blockly.FlyoutButton.prototype.createDom = function() { } // Background rectangle. var rect = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': this.isLabel_ ? 'blocklyFlyoutLabelBackground' : 'blocklyFlyoutButtonBackground', @@ -150,7 +151,7 @@ Blockly.FlyoutButton.prototype.createDom = function() { this.svgGroup_); var svgText = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TEXT, + Blockly.utils.Svg.TEXT, { 'class': this.isLabel_ ? 'blocklyFlyoutLabelText' : 'blocklyText', 'x': 0, diff --git a/core/grid.js b/core/grid.js index afa48991d..e1b9c5d88 100644 --- a/core/grid.js +++ b/core/grid.js @@ -14,6 +14,7 @@ goog.provide('Blockly.Grid'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); @@ -197,25 +198,25 @@ Blockly.Grid.createDom = function(rnd, gridOptions, defs) { */ var gridPattern = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATTERN, + Blockly.utils.Svg.PATTERN, { 'id': 'blocklyGridPattern' + rnd, 'patternUnits': 'userSpaceOnUse' }, defs); if (gridOptions['length'] > 0 && gridOptions['spacing'] > 0) { Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, + Blockly.utils.Svg.LINE, {'stroke': gridOptions['colour']}, gridPattern); if (gridOptions['length'] > 1) { Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, + Blockly.utils.Svg.LINE, {'stroke': gridOptions['colour']}, gridPattern); } // x1, y1, x1, x2 properties will be set later in update. } else { // Edge 16 doesn't handle empty patterns Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, {}, gridPattern); + Blockly.utils.Svg.LINE, {}, gridPattern); } return gridPattern; }; diff --git a/core/icon.js b/core/icon.js index 0721d0e9c..506915fcd 100644 --- a/core/icon.js +++ b/core/icon.js @@ -16,6 +16,7 @@ goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Size'); +goog.require('Blockly.utils.Svg'); /** @@ -77,7 +78,7 @@ Blockly.Icon.prototype.createIcon = function() { */ this.iconGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyIconGroup'}, null); if (this.block_.isInFlyout) { Blockly.utils.dom.addClass( diff --git a/core/inject.js b/core/inject.js index 4ef336f5e..0278f924e 100644 --- a/core/inject.js +++ b/core/inject.js @@ -25,6 +25,7 @@ goog.require('Blockly.Tooltip'); goog.require('Blockly.user.keyMap'); goog.require('Blockly.utils'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); goog.require('Blockly.WorkspaceDragSurfaceSvg'); goog.require('Blockly.WorkspaceSvg'); @@ -114,7 +115,7 @@ Blockly.createDom_ = function(container, options) { */ var svg = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.SVG, { + Blockly.utils.Svg.SVG, { 'xmlns': Blockly.utils.dom.SVG_NS, 'xmlns:html': Blockly.utils.dom.HTML_NS, 'xmlns:xlink': Blockly.utils.dom.XLINK_NS, @@ -128,7 +129,7 @@ Blockly.createDom_ = function(container, options) { */ var defs = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.DEFS, {}, svg); + Blockly.utils.Svg.DEFS, {}, svg); // Each filter/pattern needs a unique ID for the case of multiple Blockly // instances on a page. Browser behaviour becomes undefined otherwise. // https://neil.fraser.name/news/2015/11/01/ @@ -166,7 +167,7 @@ Blockly.createMainWorkspace_ = function(svg, options, blockDragSurface, if (!wsOptions.hasCategories && wsOptions.languageTree) { // Add flyout as an that is a sibling of the workspace svg. - var flyout = mainWorkspace.addFlyout(Blockly.utils.dom.SvgElementType.SVG); + var flyout = mainWorkspace.addFlyout(Blockly.utils.Svg.SVG); Blockly.utils.dom.insertAfter(flyout, svg); } if (wsOptions.hasTrashcan) { diff --git a/core/interfaces/i_flyout.js b/core/interfaces/i_flyout.js index a63b8f485..37ffeaba3 100644 --- a/core/interfaces/i_flyout.js +++ b/core/interfaces/i_flyout.js @@ -17,6 +17,7 @@ goog.requireType('Blockly.BlockSvg'); goog.requireType('Blockly.IRegistrable'); goog.requireType('Blockly.utils.dom'); goog.requireType('Blockly.utils.Coordinate'); +goog.requireType('Blockly.utils.Svg'); goog.requireType('Blockly.utils.toolbox'); goog.requireType('Blockly.WorkspaceSvg'); @@ -71,8 +72,8 @@ Blockly.IFlyout.prototype.CORNER_RADIUS; * either exist as its own svg element or be a g element nested inside a * separate svg element. * @param {string| - * !Blockly.utils.dom.SvgElementType| - * !Blockly.utils.dom.SvgElementType} tagName The type of tag to + * !Blockly.utils.Svg| + * !Blockly.utils.Svg} tagName The type of tag to * put the flyout in. This should be or . * @return {!SVGElement} The flyout's SVG group. */ diff --git a/core/mutator.js b/core/mutator.js index 4cdda5e34..462a78b04 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -23,6 +23,7 @@ goog.require('Blockly.utils'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.global'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.toolbox'); goog.require('Blockly.utils.xml'); goog.require('Blockly.WorkspaceSvg'); @@ -82,7 +83,7 @@ Blockly.Mutator.prototype.getWorkspace = function() { Blockly.Mutator.prototype.drawIcon_ = function(group) { // Square with rounded corners. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyIconShape', 'rx': '4', @@ -93,7 +94,7 @@ Blockly.Mutator.prototype.drawIcon_ = function(group) { group); // Gear teeth. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'class': 'blocklyIconSymbol', 'd': 'm4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,' + @@ -107,7 +108,7 @@ Blockly.Mutator.prototype.drawIcon_ = function(group) { group); // Axle hole. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, + Blockly.utils.Svg.CIRCLE, { 'class': 'blocklyIconShape', 'r': '2.7', @@ -142,7 +143,7 @@ Blockly.Mutator.prototype.createEditor_ = function() { */ this.svgDialog_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.SVG, + Blockly.utils.Svg.SVG, {'x': Blockly.Bubble.BORDER_WIDTH, 'y': Blockly.Bubble.BORDER_WIDTH}, null); // Convert the list of names into a list of XML objects for the flyout. @@ -187,7 +188,7 @@ Blockly.Mutator.prototype.createEditor_ = function() { // inherit scale from the parent workspace. // To fix this, scale needs to be applied at a different level in the dom. var flyoutSvg = hasFlyout ? - this.workspace_.addFlyout(Blockly.utils.dom.SvgElementType.G) : null; + this.workspace_.addFlyout(Blockly.utils.Svg.G) : null; var background = this.workspace_.createDom('blocklyMutatorBackground'); if (flyoutSvg) { diff --git a/core/rendered_connection.js b/core/rendered_connection.js index cfb06580f..5188d5504 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -19,6 +19,7 @@ goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.deprecation'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); /** @@ -302,7 +303,7 @@ Blockly.RenderedConnection.prototype.highlight = function() { var x = this.x - xy.x; var y = this.y - xy.y; Blockly.Connection.highlightedPath_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'class': 'blocklyHighlightedConnectionPath', 'd': steps, diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index d353dc1fc..791499abc 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -15,6 +15,7 @@ goog.provide('Blockly.blockRendering.ConstantProvider'); goog.require('Blockly.utils'); goog.require('Blockly.utils.colour'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.svgPaths'); goog.require('Blockly.utils.userAgent'); @@ -1020,7 +1021,7 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, */ var defs = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.DEFS, {}, svg); + Blockly.utils.Svg.DEFS, {}, svg); /* @@ -1036,13 +1037,13 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, */ var embossFilter = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FILTER, + Blockly.utils.Svg.FILTER, {'id': 'blocklyEmbossFilter' + this.randomIdentifier}, defs); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEGAUSSIANBLUR, + Blockly.utils.Svg.FEGAUSSIANBLUR, {'in': 'SourceAlpha', 'stdDeviation': 1, 'result': 'blur'}, embossFilter); var feSpecularLighting = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FESPECULARLIGHTING, + Blockly.utils.Svg.FESPECULARLIGHTING, { 'in': 'blur', 'surfaceScale': 1, @@ -1053,10 +1054,10 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, }, embossFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEPOINTLIGHT, + Blockly.utils.Svg.FEPOINTLIGHT, {'x': -5000, 'y': -10000, 'z': 20000}, feSpecularLighting); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPOSITE, + Blockly.utils.Svg.FECOMPOSITE, { 'in': 'specOut', 'in2': 'SourceAlpha', @@ -1064,7 +1065,7 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, 'result': 'specOut' }, embossFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPOSITE, + Blockly.utils.Svg.FECOMPOSITE, { 'in': 'SourceGraphic', 'in2': 'specOut', @@ -1085,7 +1086,7 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, */ var disabledPattern = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATTERN, + Blockly.utils.Svg.PATTERN, { 'id': 'blocklyDisabledPattern' + this.randomIdentifier, 'patternUnits': 'userSpaceOnUse', @@ -1093,17 +1094,17 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, 'height': 10 }, defs); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, {'width': 10, 'height': 10, 'fill': '#aaa'}, disabledPattern); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, {'d': 'M 0 0 L 10 10 M 10 0 L 0 10', 'stroke': '#cc0'}, disabledPattern); this.disabledPatternId = disabledPattern.id; this.disabledPattern_ = disabledPattern; if (Blockly.blockRendering.Debug) { var debugFilter = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FILTER, + Blockly.utils.Svg.FILTER, { 'id': 'blocklyDebugFilter' + this.randomIdentifier, 'height': '160%', @@ -1114,18 +1115,18 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, defs); // Set all gaussian blur pixels to 1 opacity before applying flood var debugComponentTransfer = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPONENTTRANSFER, { + Blockly.utils.Svg.FECOMPONENTTRANSFER, { 'result': 'outBlur' }, debugFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEFUNCA, + Blockly.utils.Svg.FEFUNCA, { 'type': 'table', 'tableValues': '0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1' }, debugComponentTransfer); // Color the highlight Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEFLOOD, + Blockly.utils.Svg.FEFLOOD, { 'flood-color': '#ff0000', 'flood-opacity': 0.5, @@ -1133,7 +1134,7 @@ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg, }, debugFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPOSITE, + Blockly.utils.Svg.FECOMPOSITE, { 'in': 'outColor', 'in2': 'outBlur', 'operator': 'in', 'result': 'outGlow' diff --git a/core/renderers/common/debugger.js b/core/renderers/common/debugger.js index 0d3c0e46e..adaa3b0d7 100644 --- a/core/renderers/common/debugger.js +++ b/core/renderers/common/debugger.js @@ -20,6 +20,8 @@ goog.require('Blockly.blockRendering.Row'); goog.require('Blockly.blockRendering.SpacerRow'); goog.require('Blockly.blockRendering.TopRow'); goog.require('Blockly.blockRendering.Types'); +goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -100,7 +102,7 @@ Blockly.blockRendering.Debug.prototype.drawSpacerRow = function(row, cursorY, is } this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'rowSpacerRect blockRenderDebug', 'x': isRtl ? -(row.xPos + row.width) : row.xPos, @@ -135,7 +137,7 @@ Blockly.blockRendering.Debug.prototype.drawSpacerElem = function(elem, rowHeight } var yPos = elem.centerline - elem.height / 2; this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'elemSpacerRect blockRenderDebug', 'x': xPos, @@ -164,7 +166,7 @@ Blockly.blockRendering.Debug.prototype.drawRenderedElem = function(elem, isRtl) } var yPos = elem.centerline - elem.height / 2; this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'rowRenderingRect blockRenderDebug', 'x': xPos, @@ -181,7 +183,7 @@ Blockly.blockRendering.Debug.prototype.drawRenderedElem = function(elem, isRtl) elem.field instanceof Blockly.FieldLabel) { var baseline = this.constants_.FIELD_TEXT_BASELINE; this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'rowRenderingRect blockRenderDebug', 'x': xPos, @@ -238,7 +240,7 @@ Blockly.blockRendering.Debug.prototype.drawConnection = function(conn) { fill = colour; } this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, + Blockly.utils.Svg.CIRCLE, { 'class': 'blockRenderDebug', 'cx': conn.offsetInBlock_.x, @@ -262,7 +264,7 @@ Blockly.blockRendering.Debug.prototype.drawRenderedRow = function(row, cursorY, return; } this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'elemRenderingRect blockRenderDebug', 'x': isRtl ? -(row.xPos + row.width) : row.xPos, @@ -281,7 +283,7 @@ Blockly.blockRendering.Debug.prototype.drawRenderedRow = function(row, cursorY, if (Blockly.blockRendering.Debug.config.connectedBlockBounds) { this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'connectedBlockWidth blockRenderDebug', 'x': isRtl ? -(row.xPos + row.widthWithConnectedBlocks) : row.xPos, @@ -336,7 +338,7 @@ Blockly.blockRendering.Debug.prototype.drawBoundingBox = function(info) { var xPos = info.RTL ? -info.width : 0; var yPos = 0; this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blockBoundingBox blockRenderDebug', 'x': xPos, @@ -354,7 +356,7 @@ Blockly.blockRendering.Debug.prototype.drawBoundingBox = function(info) { // Bounding box with children. xPos = info.RTL ? -info.widthWithChildren : 0; this.debugElements_.push(Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blockRenderDebug', 'x': xPos, diff --git a/core/renderers/common/marker_svg.js b/core/renderers/common/marker_svg.js index 9f8414c13..079dcecbf 100644 --- a/core/renderers/common/marker_svg.js +++ b/core/renderers/common/marker_svg.js @@ -14,6 +14,8 @@ goog.provide('Blockly.blockRendering.MarkerSvg'); goog.require('Blockly.ASTNode'); +goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -125,7 +127,7 @@ Blockly.blockRendering.MarkerSvg.prototype.createDom = function() { Blockly.blockRendering.MarkerSvg.MARKER_CLASS; this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, { + Blockly.utils.Svg.G, { 'class': className }, null); @@ -589,7 +591,7 @@ Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_ = function() { */ this.markerSvg_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, { 'width': this.constants_.CURSOR_WS_WIDTH, 'height': this.constants_.WS_CURSOR_HEIGHT @@ -598,7 +600,7 @@ Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_ = function() { // A horizontal line used to represent a workspace coordinate or next // connection. this.markerSvgLine_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'width': this.constants_.CURSOR_WS_WIDTH, 'height': this.constants_.WS_CURSOR_HEIGHT, @@ -608,7 +610,7 @@ Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_ = function() { // A filled in rectangle used to represent a stack. this.markerSvgRect_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyVerticalMarker', 'rx': 10, 'ry': 10, @@ -618,7 +620,7 @@ Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_ = function() { // A filled in puzzle piece used to represent an input value. this.markerInput_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'transform': '', 'style': 'display: none' @@ -628,7 +630,7 @@ Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_ = function() { // A path used to represent a previous connection and a block, an output // connection and a block, or a block. this.markerBlock_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'transform': '', 'style': 'display: none', @@ -641,14 +643,14 @@ Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_ = function() { if (this.isCursor()) { var blinkProperties = this.getBlinkProperties_(); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.ANIMATE, blinkProperties, + Blockly.utils.Svg.ANIMATE, blinkProperties, this.markerSvgLine_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.ANIMATE, blinkProperties, + Blockly.utils.Svg.ANIMATE, blinkProperties, this.markerInput_); blinkProperties['attributeName'] = 'stroke'; Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.ANIMATE, blinkProperties, + Blockly.utils.Svg.ANIMATE, blinkProperties, this.markerBlock_); } diff --git a/core/renderers/common/path_object.js b/core/renderers/common/path_object.js index f3dc86beb..c3a283329 100644 --- a/core/renderers/common/path_object.js +++ b/core/renderers/common/path_object.js @@ -17,6 +17,7 @@ goog.require('Blockly.blockRendering.ConstantProvider'); goog.require('Blockly.blockRendering.IPathObject'); goog.require('Blockly.Theme'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -47,7 +48,7 @@ Blockly.blockRendering.PathObject = function(root, style, constants) { * @package */ this.svgPath = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, {'class': 'blocklyPath'}, this.svgRoot); /** diff --git a/core/renderers/geras/path_object.js b/core/renderers/geras/path_object.js index 6fbc8165d..fd39c9ffd 100644 --- a/core/renderers/geras/path_object.js +++ b/core/renderers/geras/path_object.js @@ -18,6 +18,7 @@ goog.require('Blockly.geras.ConstantProvider'); goog.require('Blockly.Theme'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); /** @@ -49,7 +50,7 @@ Blockly.geras.PathObject = function(root, style, constants) { * @package */ this.svgPathDark = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, {'class': 'blocklyPathDark', 'transform': 'translate(1,1)'}, this.svgRoot); @@ -59,7 +60,7 @@ Blockly.geras.PathObject = function(root, style, constants) { * @package */ this.svgPath = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, {'class': 'blocklyPath'}, this.svgRoot); /** @@ -68,7 +69,7 @@ Blockly.geras.PathObject = function(root, style, constants) { * @package */ this.svgPathLight = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, {'class': 'blocklyPathLight'}, this.svgRoot); /** diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index 518e36daa..151a7b1b5 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -16,6 +16,7 @@ goog.provide('Blockly.zelos.ConstantProvider'); goog.require('Blockly.blockRendering.ConstantProvider'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.svgPaths'); @@ -807,11 +808,11 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, */ var defs = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.DEFS, {}, svg); + Blockly.utils.Svg.DEFS, {}, svg); // Using a dilate distorts the block shape. // Instead use a gaussian blur, and then set all alpha to 1 with a transfer. var selectedGlowFilter = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FILTER, + Blockly.utils.Svg.FILTER, { 'id': 'blocklySelectedGlowFilter' + this.randomIdentifier, 'height': '160%', @@ -821,7 +822,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, }, defs); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEGAUSSIANBLUR, + Blockly.utils.Svg.FEGAUSSIANBLUR, { 'in': 'SourceGraphic', 'stdDeviation': this.SELECTED_GLOW_SIZE @@ -829,18 +830,18 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, selectedGlowFilter); // Set all gaussian blur pixels to 1 opacity before applying flood var selectedComponentTransfer = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPONENTTRANSFER, { + Blockly.utils.Svg.FECOMPONENTTRANSFER, { 'result': 'outBlur' }, selectedGlowFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEFUNCA, + Blockly.utils.Svg.FEFUNCA, { 'type': 'table', 'tableValues': '0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1' }, selectedComponentTransfer); // Color the highlight Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEFLOOD, + Blockly.utils.Svg.FEFLOOD, { 'flood-color': this.SELECTED_GLOW_COLOUR, 'flood-opacity': 1, @@ -848,7 +849,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, }, selectedGlowFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPOSITE, + Blockly.utils.Svg.FECOMPOSITE, { 'in': 'outColor', 'in2': 'outBlur', 'operator': 'in', 'result': 'outGlow' @@ -860,7 +861,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, // Using a dilate distorts the block shape. // Instead use a gaussian blur, and then set all alpha to 1 with a transfer. var replacementGlowFilter = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FILTER, + Blockly.utils.Svg.FILTER, { 'id': 'blocklyReplacementGlowFilter' + this.randomIdentifier, 'height': '160%', @@ -870,7 +871,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, }, defs); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEGAUSSIANBLUR, + Blockly.utils.Svg.FEGAUSSIANBLUR, { 'in': 'SourceGraphic', 'stdDeviation': this.REPLACEMENT_GLOW_SIZE @@ -878,18 +879,18 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, replacementGlowFilter); // Set all gaussian blur pixels to 1 opacity before applying flood var replacementComponentTransfer = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPONENTTRANSFER, { + Blockly.utils.Svg.FECOMPONENTTRANSFER, { 'result': 'outBlur' }, replacementGlowFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEFUNCA, + Blockly.utils.Svg.FEFUNCA, { 'type': 'table', 'tableValues': '0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1' }, replacementComponentTransfer); // Color the highlight Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FEFLOOD, + Blockly.utils.Svg.FEFLOOD, { 'flood-color': this.REPLACEMENT_GLOW_COLOUR, 'flood-opacity': 1, @@ -897,14 +898,14 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, }, replacementGlowFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPOSITE, + Blockly.utils.Svg.FECOMPOSITE, { 'in': 'outColor', 'in2': 'outBlur', 'operator': 'in', 'result': 'outGlow' }, replacementGlowFilter); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FECOMPOSITE, + Blockly.utils.Svg.FECOMPOSITE, { 'in': 'SourceGraphic', 'in2': 'outGlow', 'operator': 'over', diff --git a/core/renderers/zelos/marker_svg.js b/core/renderers/zelos/marker_svg.js index 6b29d9b8d..ddb6472a7 100644 --- a/core/renderers/zelos/marker_svg.js +++ b/core/renderers/zelos/marker_svg.js @@ -13,6 +13,8 @@ goog.provide('Blockly.zelos.MarkerSvg'); goog.require('Blockly.blockRendering.MarkerSvg'); +goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -112,7 +114,7 @@ Blockly.zelos.MarkerSvg.prototype.createDomInternal_ = function() { Blockly.zelos.MarkerSvg.superClass_.createDomInternal_.call(this); this.markerCircle_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, { + Blockly.utils.Svg.CIRCLE, { 'r': this.constants_.CURSOR_RADIUS, 'style': 'display: none', 'stroke-width': this.constants_.CURSOR_STROKE_WIDTH @@ -123,7 +125,7 @@ Blockly.zelos.MarkerSvg.prototype.createDomInternal_ = function() { if (this.isCursor()) { var blinkProperties = this.getBlinkProperties_(); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.ANIMATE, blinkProperties, + Blockly.utils.Svg.ANIMATE, blinkProperties, this.markerCircle_); } diff --git a/core/renderers/zelos/path_object.js b/core/renderers/zelos/path_object.js index a4d63c301..89e629208 100644 --- a/core/renderers/zelos/path_object.js +++ b/core/renderers/zelos/path_object.js @@ -17,6 +17,7 @@ goog.require('Blockly.blockRendering.PathObject'); goog.require('Blockly.zelos.ConstantProvider'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); /** @@ -219,7 +220,7 @@ Blockly.zelos.PathObject.prototype.setOutlinePath = function(name, pathString) { Blockly.zelos.PathObject.prototype.getOutlinePath_ = function(name) { if (!this.outlines_[name]) { this.outlines_[name] = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, { + Blockly.utils.Svg.PATH, { 'class': 'blocklyOutlinePath', // IE doesn't like paths without the data definition, set empty default 'd': '' diff --git a/core/scrollbar.js b/core/scrollbar.js index 37a353b23..2f0fc22ba 100644 --- a/core/scrollbar.js +++ b/core/scrollbar.js @@ -18,6 +18,7 @@ goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Metrics'); +goog.require('Blockly.utils.Svg'); /** @@ -37,7 +38,7 @@ Blockly.ScrollbarPair = function(workspace) { this.vScroll = new Blockly.Scrollbar( workspace, false, true, 'blocklyMainWorkspaceScrollbar'); this.corner_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'height': Blockly.Scrollbar.scrollbarThickness, 'width': Blockly.Scrollbar.scrollbarThickness, @@ -618,16 +619,16 @@ Blockly.Scrollbar.prototype.createDom_ = function(opt_class) { className += ' ' + opt_class; } this.outerSvg_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.SVG, {'class': className}, null); + Blockly.utils.Svg.SVG, {'class': className}, null); this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, this.outerSvg_); + Blockly.utils.Svg.G, {}, this.outerSvg_); this.svgBackground_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, { + Blockly.utils.Svg.RECT, { 'class': 'blocklyScrollbarBackground' }, this.svgGroup_); var radius = Math.floor((Blockly.Scrollbar.scrollbarThickness - 5) / 2); this.svgHandle_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyScrollbarHandle', 'rx': radius, diff --git a/core/trashcan.js b/core/trashcan.js index d8686ae8c..0d5cc03ea 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -15,6 +15,7 @@ goog.provide('Blockly.Trashcan'); goog.require('Blockly.Scrollbar'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Rect'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.toolbox'); goog.require('Blockly.Xml'); @@ -261,16 +262,16 @@ Blockly.Trashcan.prototype.createDom = function() { */ this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyTrash'}, null); var clip; var rnd = String(Math.random()).substring(2); clip = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CLIPPATH, + Blockly.utils.Svg.CLIPPATH, {'id': 'blocklyTrashBodyClipPath' + rnd}, this.svgGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'width': this.WIDTH_, 'height': this.BODY_HEIGHT_, @@ -278,7 +279,7 @@ Blockly.Trashcan.prototype.createDom = function() { }, clip); var body = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, + Blockly.utils.Svg.IMAGE, { 'width': Blockly.SPRITE.width, 'x': -this.SPRITE_LEFT_, @@ -291,14 +292,14 @@ Blockly.Trashcan.prototype.createDom = function() { this.workspace_.options.pathToMedia + Blockly.SPRITE.url); clip = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CLIPPATH, + Blockly.utils.Svg.CLIPPATH, {'id': 'blocklyTrashLidClipPath' + rnd}, this.svgGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, {'width': this.WIDTH_, 'height': this.LID_HEIGHT_}, clip); this.svgLid_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, + Blockly.utils.Svg.IMAGE, { 'width': Blockly.SPRITE.width, 'x': -this.SPRITE_LEFT_, @@ -332,7 +333,7 @@ Blockly.Trashcan.prototype.createDom = function() { Blockly.Trashcan.prototype.init = function(verticalSpacing) { if (this.workspace_.options.maxTrashcanContents > 0) { Blockly.utils.dom.insertAfter( - this.flyout.createDom(Blockly.utils.dom.SvgElementType.SVG), + this.flyout.createDom(Blockly.utils.Svg.SVG), this.workspace_.getParentSvg()); this.flyout.init(this.workspace_); } diff --git a/core/utils/dom.js b/core/utils/dom.js index ac0cffdcc..3762297fa 100644 --- a/core/utils/dom.js +++ b/core/utils/dom.js @@ -18,6 +18,7 @@ */ goog.provide('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.userAgent'); @@ -72,130 +73,14 @@ Blockly.utils.dom.cacheReference_ = 0; */ Blockly.utils.dom.canvasContext_ = null; -/** - * A name with the type of the SVG element stored in the generic. - * @param {string} tagName The SVG element tag name. - * @constructor - * @template T - */ -Blockly.utils.dom.SvgElementType = function(tagName) { - /** - * @type {string} - * @private - */ - this.tagName_ = tagName; -}; - -/** - * Returns the SVG element tag name. - * @return {string} The name. - * @override - */ -Blockly.utils.dom.SvgElementType.prototype.toString = function() { - return this.tagName_; -}; - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.ANIMATE = - new Blockly.utils.dom.SvgElementType('animate'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.CIRCLE = - new Blockly.utils.dom.SvgElementType('circle'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.CLIPPATH = - new Blockly.utils.dom.SvgElementType('clipPath'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.DEFS = - new Blockly.utils.dom.SvgElementType('defs'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FECOMPOSITE = - new Blockly.utils.dom.SvgElementType('feComposite'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FECOMPONENTTRANSFER = - new Blockly.utils.dom.SvgElementType('feComponentTransfer'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FEFLOOD = - new Blockly.utils.dom.SvgElementType('feFlood'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FEFUNCA = - new Blockly.utils.dom.SvgElementType('feFuncA'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FEGAUSSIANBLUR = - new Blockly.utils.dom.SvgElementType('feGaussianBlur'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FEPOINTLIGHT = - new Blockly.utils.dom.SvgElementType('fePointLight'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FESPECULARLIGHTING = - new Blockly.utils.dom.SvgElementType('feSpecularLighting'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FILTER = - new Blockly.utils.dom.SvgElementType('filter'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.FOREIGNOBJECT = - new Blockly.utils.dom.SvgElementType('foreignObject'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.G = - new Blockly.utils.dom.SvgElementType('g'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.IMAGE = - new Blockly.utils.dom.SvgElementType('image'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.LINE = - new Blockly.utils.dom.SvgElementType('line'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.PATH = - new Blockly.utils.dom.SvgElementType('path'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.PATTERN = - new Blockly.utils.dom.SvgElementType('pattern'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.POLYGON = - new Blockly.utils.dom.SvgElementType('polygon'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.RECT = - new Blockly.utils.dom.SvgElementType('rect'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.SVG = - new Blockly.utils.dom.SvgElementType('svg'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.TEXT = - new Blockly.utils.dom.SvgElementType('text'); - -/** @type {!Blockly.utils.dom.SvgElementType} */ -Blockly.utils.dom.SvgElementType.TSPAN = - new Blockly.utils.dom.SvgElementType('tspan'); - - /** * Helper method for creating SVG elements. - * @param {string|Blockly.utils.dom.SvgElementType} name Element's tag name. + * @param {string|Blockly.utils.Svg} name Element's tag name. * @param {!Object} attrs Dictionary of attribute names and values. * @param {Element=} opt_parent Optional parent on which to append the element. * @return {T} Newly created SVG element. The return type is {!SVGElement} if * name is a string or a more specific type if it a member of - * Blockly.utils.dom.SvgElementType + * Blockly.utils.Svg * @template T */ Blockly.utils.dom.createSvgElement = function(name, attrs, opt_parent) { diff --git a/core/utils/svg.js b/core/utils/svg.js new file mode 100644 index 000000000..e38bb08cf --- /dev/null +++ b/core/utils/svg.js @@ -0,0 +1,135 @@ +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Defines the Blockly.utils.Svg class. Its constants enumerate + * all SVG tag names used by Blockly. + * @author samelh@google.com (Sam El-Husseini) + */ +'use strict'; + +/** + * @name Blockly.utils.Svg + * @namespace + */ +goog.provide('Blockly.utils.Svg'); + + +/** + * A name with the type of the SVG element stored in the generic. + * @param {string} tagName The SVG element tag name. + * @constructor + * @template T + * @private + */ +Blockly.utils.Svg = function(tagName) { + /** + * @type {string} + * @private + */ + this.tagName_ = tagName; +}; + +/** + * Returns the SVG element tag name. + * @return {string} The name. + * @override + */ +Blockly.utils.Svg.prototype.toString = function() { + return this.tagName_; +}; + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.ANIMATE = + new Blockly.utils.Svg('animate'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.CIRCLE = + new Blockly.utils.Svg('circle'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.CLIPPATH = + new Blockly.utils.Svg('clipPath'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.DEFS = + new Blockly.utils.Svg('defs'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FECOMPOSITE = + new Blockly.utils.Svg('feComposite'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FECOMPONENTTRANSFER = + new Blockly.utils.Svg('feComponentTransfer'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FEFLOOD = + new Blockly.utils.Svg('feFlood'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FEFUNCA = + new Blockly.utils.Svg('feFuncA'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FEGAUSSIANBLUR = + new Blockly.utils.Svg('feGaussianBlur'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FEPOINTLIGHT = + new Blockly.utils.Svg('fePointLight'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FESPECULARLIGHTING = + new Blockly.utils.Svg('feSpecularLighting'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FILTER = + new Blockly.utils.Svg('filter'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.FOREIGNOBJECT = + new Blockly.utils.Svg('foreignObject'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.G = + new Blockly.utils.Svg('g'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.IMAGE = + new Blockly.utils.Svg('image'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.LINE = + new Blockly.utils.Svg('line'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.PATH = + new Blockly.utils.Svg('path'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.PATTERN = + new Blockly.utils.Svg('pattern'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.POLYGON = + new Blockly.utils.Svg('polygon'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.RECT = + new Blockly.utils.Svg('rect'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.SVG = + new Blockly.utils.Svg('svg'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.TEXT = + new Blockly.utils.Svg('text'); + +/** @type {!Blockly.utils.Svg} @package */ +Blockly.utils.Svg.TSPAN = + new Blockly.utils.Svg('tspan'); diff --git a/core/warning.js b/core/warning.js index 474f15e24..dc8f83666 100644 --- a/core/warning.js +++ b/core/warning.js @@ -18,6 +18,7 @@ goog.require('Blockly.Events.Ui'); goog.require('Blockly.Icon'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); +goog.require('Blockly.utils.Svg'); /** @@ -47,7 +48,7 @@ Blockly.Warning.prototype.collapseHidden = false; Blockly.Warning.prototype.drawIcon_ = function(group) { // Triangle with rounded corners. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'class': 'blocklyIconShape', 'd': 'M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z' @@ -57,7 +58,7 @@ Blockly.Warning.prototype.drawIcon_ = function(group) { // systems render it differently. // Body of exclamation point. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, + Blockly.utils.Svg.PATH, { 'class': 'blocklyIconSymbol', 'd': 'm7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z' @@ -65,7 +66,7 @@ Blockly.Warning.prototype.drawIcon_ = function(group) { group); // Dot of exclamation point. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyIconSymbol', 'x': '7', 'y': '11', 'height': '2', 'width': '2' @@ -81,7 +82,7 @@ Blockly.Warning.prototype.drawIcon_ = function(group) { */ Blockly.Warning.textToDom_ = function(text) { var paragraph = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TEXT, + Blockly.utils.Svg.TEXT, { 'class': 'blocklyText blocklyBubbleText blocklyNoPointerEvents', 'y': Blockly.Bubble.BORDER_WIDTH @@ -90,7 +91,7 @@ Blockly.Warning.textToDom_ = function(text) { var lines = text.split('\n'); for (var i = 0; i < lines.length; i++) { var tspanElement = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.TSPAN, + Blockly.utils.Svg.TSPAN, {'dy': '1em', 'x': Blockly.Bubble.BORDER_WIDTH}, paragraph); var textNode = document.createTextNode(lines[i]); tspanElement.appendChild(textNode); diff --git a/core/workspace_comment_render_svg.js b/core/workspace_comment_render_svg.js index 2480cbc56..9e6aea698 100644 --- a/core/workspace_comment_render_svg.js +++ b/core/workspace_comment_render_svg.js @@ -15,6 +15,7 @@ goog.provide('Blockly.WorkspaceCommentSvg.render'); goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -75,7 +76,7 @@ Blockly.WorkspaceCommentSvg.prototype.render = function() { this.svgGroup_.appendChild(this.foreignObject_); this.svgHandleTarget_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyCommentHandleTarget', 'x': 0, @@ -83,7 +84,7 @@ Blockly.WorkspaceCommentSvg.prototype.render = function() { }); this.svgGroup_.appendChild(this.svgHandleTarget_); this.svgRectTarget_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'class': 'blocklyCommentTarget', 'x': 0, @@ -138,7 +139,7 @@ Blockly.WorkspaceCommentSvg.prototype.createEditor_ = function() { */ this.foreignObject_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.FOREIGNOBJECT, + Blockly.utils.Svg.FOREIGNOBJECT, { 'x': 0, 'y': Blockly.WorkspaceCommentSvg.TOP_OFFSET, @@ -173,25 +174,25 @@ Blockly.WorkspaceCommentSvg.prototype.createEditor_ = function() { */ Blockly.WorkspaceCommentSvg.prototype.addResizeDom_ = function() { this.resizeGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, { 'class': this.RTL ? 'blocklyResizeSW' : 'blocklyResizeSE' }, this.svgGroup_); var resizeSize = Blockly.WorkspaceCommentSvg.RESIZE_SIZE; Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.POLYGON, + Blockly.utils.Svg.POLYGON, {'points': '0,x x,x x,0'.replace(/x/g, resizeSize.toString())}, this.resizeGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, + Blockly.utils.Svg.LINE, { 'class': 'blocklyResizeLine', 'x1': resizeSize / 3, 'y1': resizeSize - 1, 'x2': resizeSize - 1, 'y2': resizeSize / 3 }, this.resizeGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, + Blockly.utils.Svg.LINE, { 'class': 'blocklyResizeLine', 'x1': resizeSize * 2 / 3, 'y1': resizeSize - 1, @@ -205,13 +206,13 @@ Blockly.WorkspaceCommentSvg.prototype.addResizeDom_ = function() { */ Blockly.WorkspaceCommentSvg.prototype.addDeleteDom_ = function() { this.deleteGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, { 'class': 'blocklyCommentDeleteIcon' }, this.svgGroup_); this.deleteIconBorder_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CIRCLE, + Blockly.utils.Svg.CIRCLE, { 'class': 'blocklyDeleteIconShape', 'r': '7', @@ -221,7 +222,7 @@ Blockly.WorkspaceCommentSvg.prototype.addDeleteDom_ = function() { this.deleteGroup_); // x icon. Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, + Blockly.utils.Svg.LINE, { 'x1': '5', 'y1': '10', 'x2': '10', 'y2': '5', @@ -230,7 +231,7 @@ Blockly.WorkspaceCommentSvg.prototype.addDeleteDom_ = function() { }, this.deleteGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.LINE, + Blockly.utils.Svg.LINE, { 'x1': '5', 'y1': '5', 'x2': '10', 'y2': '10', diff --git a/core/workspace_comment_svg.js b/core/workspace_comment_svg.js index da6623890..53604bfa9 100644 --- a/core/workspace_comment_svg.js +++ b/core/workspace_comment_svg.js @@ -23,6 +23,7 @@ goog.require('Blockly.utils.Coordinate'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); goog.require('Blockly.utils.Rect'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.WorkspaceComment'); goog.requireType('Blockly.IBoundedElement'); @@ -65,11 +66,11 @@ Blockly.WorkspaceCommentSvg = function( * @private */ this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {'class': 'blocklyComment'}, null); + Blockly.utils.Svg.G, {'class': 'blocklyComment'}, null); this.svgGroup_.translate_ = ''; this.svgRect_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, { + Blockly.utils.Svg.RECT, { 'class': 'blocklyCommentRect', 'x': 0, 'y': 0, diff --git a/core/workspace_drag_surface_svg.js b/core/workspace_drag_surface_svg.js index 11a27c6af..57e989be9 100644 --- a/core/workspace_drag_surface_svg.js +++ b/core/workspace_drag_surface_svg.js @@ -18,6 +18,7 @@ goog.provide('Blockly.WorkspaceDragSurfaceSvg'); goog.require('Blockly.utils'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -63,7 +64,7 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.createDom = function() { * */ this.SVG_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.SVG, + Blockly.utils.Svg.SVG, { 'xmlns': Blockly.utils.dom.SVG_NS, 'xmlns:html': Blockly.utils.dom.HTML_NS, diff --git a/core/workspace_svg.js b/core/workspace_svg.js index feba580ae..0b8628211 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -35,6 +35,7 @@ goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Metrics'); goog.require('Blockly.utils.object'); goog.require('Blockly.utils.Rect'); +goog.require('Blockly.utils.Svg'); goog.require('Blockly.utils.toolbox'); goog.require('Blockly.Workspace'); goog.require('Blockly.WorkspaceAudio'); @@ -736,7 +737,7 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { * @type {SVGElement} */ this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyWorkspace'}, null); // Note that a alone does not receive mouse events--it must have a @@ -745,7 +746,7 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { if (opt_backgroundClass) { /** @type {SVGElement} */ this.svgBackground_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, {'height': '100%', 'width': '100%', 'class': opt_backgroundClass}, this.svgGroup_); @@ -759,11 +760,11 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { } /** @type {SVGElement} */ this.svgBlockCanvas_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyBlockCanvas'}, this.svgGroup_); /** @type {SVGElement} */ this.svgBubbleCanvas_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyBubbleCanvas'}, this.svgGroup_); if (!this.isFlyout) { @@ -930,8 +931,8 @@ Blockly.WorkspaceSvg.prototype.addZoomControls = function() { /** * Add a flyout element in an element with the given tag name. * @param {string| - * !Blockly.utils.dom.SvgElementType| - * !Blockly.utils.dom.SvgElementType} tagName What type of tag the + * !Blockly.utils.Svg| + * !Blockly.utils.Svg} tagName What type of tag the * flyout belongs in. * @return {!Element} The element containing the flyout DOM. * @package diff --git a/core/zoom_controls.js b/core/zoom_controls.js index f5b507508..867fead0d 100644 --- a/core/zoom_controls.js +++ b/core/zoom_controls.js @@ -16,6 +16,7 @@ goog.require('Blockly.Css'); goog.require('Blockly.Scrollbar'); goog.require('Blockly.Touch'); goog.require('Blockly.utils.dom'); +goog.require('Blockly.utils.Svg'); /** @@ -140,7 +141,7 @@ Blockly.ZoomControls.prototype.top_ = 0; */ Blockly.ZoomControls.prototype.createDom = function() { this.svgGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); // Each filter/pattern needs a unique ID for the case of multiple Blockly // instances on a page. Browser behaviour becomes undefined otherwise. @@ -247,23 +248,23 @@ Blockly.ZoomControls.prototype.createZoomOutSvg_ = function(rnd) { */ this.zoomOutGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyZoom'}, this.svgGroup_); var clip = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CLIPPATH, + Blockly.utils.Svg.CLIPPATH, { 'id': 'blocklyZoomoutClipPath' + rnd }, this.zoomOutGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'width': 32, 'height': 32, }, clip); var zoomoutSvg = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, + Blockly.utils.Svg.IMAGE, { 'width': Blockly.SPRITE.width, 'height': Blockly.SPRITE.height, @@ -298,23 +299,23 @@ Blockly.ZoomControls.prototype.createZoomInSvg_ = function(rnd) { */ this.zoomInGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyZoom'}, this.svgGroup_); var clip = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CLIPPATH, + Blockly.utils.Svg.CLIPPATH, { 'id': 'blocklyZoominClipPath' + rnd }, this.zoomInGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'width': 32, 'height': 32, }, clip); var zoominSvg = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, + Blockly.utils.Svg.IMAGE, { 'width': Blockly.SPRITE.width, 'height': Blockly.SPRITE.height, @@ -367,23 +368,23 @@ Blockly.ZoomControls.prototype.createZoomResetSvg_ = function(rnd) { */ this.zoomResetGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, {'class': 'blocklyZoom'}, this.svgGroup_); var clip = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.CLIPPATH, + Blockly.utils.Svg.CLIPPATH, { 'id': 'blocklyZoomresetClipPath' + rnd }, this.zoomResetGroup_); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.RECT, + Blockly.utils.Svg.RECT, { 'width': 32, 'height': 32 }, clip); var zoomresetSvg = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.IMAGE, + Blockly.utils.Svg.IMAGE, { 'width': Blockly.SPRITE.width, 'height': Blockly.SPRITE.height, diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 8307ab18b..ba3760e2b 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -166,7 +166,7 @@ suite('Checkbox Fields', function() { suite('Check Character', function() { function assertCharacter(field, char) { field.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); field.sourceBlock_ = { RTL: false, rendered: true, diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index 0f644e39e..c32ae444d 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -98,7 +98,7 @@ suite('Label Serializable Fields', function() { suite('Customizations', function() { function assertHasClass(labelField, cssClass) { labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); labelField.constants_ = { FIELD_TEXT_BASELINE_Y: 13 }; @@ -108,7 +108,7 @@ suite('Label Serializable Fields', function() { } function assertDoesNotHaveClass(labelField, cssClass) { labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); labelField.constants_ = { FIELD_TEXT_BASELINE_Y: 13 }; @@ -155,7 +155,7 @@ suite('Label Serializable Fields', function() { test('setClass', function() { var field = new Blockly.FieldLabelSerializable(); field.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); field.constants_ = { FIELD_TEXT_BASELINE_Y: 13 }; diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index f692b2def..c9a0a480e 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -98,7 +98,7 @@ suite('Label Fields', function() { suite('Customizations', function() { function assertHasClass(labelField, cssClass) { labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); labelField.constants_ = { FIELD_TEXT_BASELINE_Y: 13 }; @@ -108,7 +108,7 @@ suite('Label Fields', function() { } function assertDoesNotHaveClass(labelField, cssClass) { labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); labelField.constants_ = { FIELD_TEXT_BASELINE_Y: 13 }; @@ -156,7 +156,7 @@ suite('Label Fields', function() { test('setClass', function() { var field = new Blockly.FieldLabel(); field.fieldGroup_ = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, {}, null); + Blockly.utils.Svg.G, {}, null); field.constants_ = { FIELD_TEXT_BASELINE_Y: 13 }; diff --git a/tests/rendering/svg_paths.html b/tests/rendering/svg_paths.html index 128eb6be5..fe415c2f6 100644 --- a/tests/rendering/svg_paths.html +++ b/tests/rendering/svg_paths.html @@ -46,12 +46,12 @@ var svgSpace; function addPathAt(path, x, y) { var group = Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.G, + Blockly.utils.Svg.G, { 'transform': 'translate(' + (x + 50) + ', ' + y + ')' }, svgSpace); Blockly.utils.dom.createSvgElement( - Blockly.utils.dom.SvgElementType.PATH, { + Blockly.utils.Svg.PATH, { 'd': 'M 0,0 ' + path, 'marker-start': 'url(#startDot)', 'marker-end': 'url(#endDot)',