blockly 13.0.0-beta.7 → 13.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +38 -35
- package/blockly_compressed.js +38 -35
- package/blockly_compressed.js.map +1 -1
- package/core/block_aria_composer.d.ts +21 -14
- package/core/inputs/input.d.ts +5 -4
- package/core/zoom_controls.d.ts +1 -1
- package/package.json +1 -1
package/blockly.min.js
CHANGED
|
@@ -60,11 +60,11 @@ showBlockNavigationHint$$module$build$src$core$hints,showWorkspaceNavigationHint
|
|
|
60
60
|
isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item,getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator,isAutoHideable$$module$build$src$core$interfaces$i_autohideable,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,allProcedures$$module$build$src$core$procedures,
|
|
61
61
|
procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures,mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants,
|
|
62
62
|
isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,register$$module$build$src$core$renderers$common$block_rendering,unregister$$module$build$src$core$renderers$common$block_rendering,init$$module$build$src$core$renderers$common$block_rendering,stringButtonClickHandler$$module$build$src$core$variables_dynamic,numberButtonClickHandler$$module$build$src$core$variables_dynamic,colourButtonClickHandler$$module$build$src$core$variables_dynamic,
|
|
63
|
-
flyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,load$$module$build$src$core$serialization$workspaces,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
isBoundedElement$$module$build$src$core$interfaces$i_bounded_element,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,$jscomp;
|
|
63
|
+
flyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,load$$module$build$src$core$serialization$workspaces,isFieldImageConfig$$module$build$src$core$field_image,inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,
|
|
64
|
+
createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,isFullBlockField$$module$build$src$core$contextmenu_items,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,
|
|
65
|
+
registerExpand$$module$build$src$core$contextmenu_items,addDeletableBlocks_$$module$build$src$core$contextmenu_items,getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items,registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,
|
|
66
|
+
registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,registerDisable$$module$build$src$core$contextmenu_items,registerDelete$$module$build$src$core$contextmenu_items,registerHelp$$module$build$src$core$contextmenu_items,registerCommentDelete$$module$build$src$core$contextmenu_items,registerCommentDuplicate$$module$build$src$core$contextmenu_items,registerCommentCreate$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,
|
|
67
|
+
registerDefaultOptions$$module$build$src$core$contextmenu_items,isBoundedElement$$module$build$src$core$interfaces$i_bounded_element,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,$jscomp;
|
|
68
68
|
register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&typeof a!=="string"||`${a}`.trim()==="")throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if(typeof b!=="string"||b.trim()==="")throw Error('Invalid name "'+b+'". The name must be a non-empty string.');var e=b.toLowerCase();if(!c)throw Error("Can not register a null value");var f=typeMap$$module$build$src$core$registry[a],
|
|
69
69
|
g=nameMap$$module$build$src$core$registry[a];f||(f=typeMap$$module$build$src$core$registry[a]=Object.create(null),g=nameMap$$module$build$src$core$registry[a]=Object.create(null));validate$$module$build$src$core$registry(a,c);if(!d&&f[e]&&f[e]!==c)throw Error('Name "'+e+'" with type "'+a+'" already registered.');f[e]=c;g[e]=b};
|
|
70
70
|
validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if(typeof b.fromJson!=="function")throw Error('Type "'+a+'" must have a fromJson function');}};
|
|
@@ -402,18 +402,19 @@ lineOnAxis$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+" "+
|
|
|
402
402
|
getSingleConnection$$module$build$src$core$connection=function(a,b){var c=null;b=b.outputConnection;var d=b==null?void 0:b.getConnectionChecker();for(let e=0,f;f=a.inputList[e];e++){let g=f.connection;if(g&&(d==null?0:d.canConnect(b,g,!1))){if(c)return null;c=g}}return c};getConnectionForOrphanedOutput$$module$build$src$core$connection=function(a,b){for(var c;c=getSingleConnection$$module$build$src$core$connection(a,b);)if(a=c.targetBlock(),!a||a.isShadow())return c;return null};
|
|
403
403
|
isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item=function(a){return a&&typeof a.init==="function"&&typeof a.getDiv==="function"&&typeof a.getId==="function"&&typeof a.getParent==="function"&&typeof a.getLevel==="function"&&typeof a.isSelectable==="function"&&typeof a.isCollapsible==="function"&&typeof a.dispose==="function"&&typeof a.getClickTarget==="function"&&typeof a.setVisible_==="function"&&typeof a.getParentToolbox==="function"};
|
|
404
404
|
isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item=function(a){return typeof a.getName==="function"&&typeof a.getContents==="function"&&typeof a.setSelected==="function"&&typeof a.onClick==="function"&&isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item(a)&&a.isSelectable()};
|
|
405
|
-
computeAriaLabel$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD
|
|
406
|
-
b
|
|
407
|
-
b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getInputCountLabel$$module$build$src$core$block_aria_composer(a)].filter(
|
|
405
|
+
computeAriaLabel$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD){if(a.isSimpleReporter()){let c=a.getFullBlockField();if(c)return c.computeAriaLabel(b>=Verbosity$$module$build$src$core$utils$aria.STANDARD)}return[b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getBeginStackLabel$$module$build$src$core$block_aria_composer(a),getParentInputLabel$$module$build$src$core$block_aria_composer(a),...getInputLabels$$module$build$src$core$block_aria_composer(a,
|
|
406
|
+
b),b===Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS&&getParentToolboxCategoryLabel$$module$build$src$core$block_aria_composer(a),b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getDisabledLabel$$module$build$src$core$block_aria_composer(a),b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getCollapsedLabel$$module$build$src$core$block_aria_composer(a),b>=Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS&&getShadowBlockLabel$$module$build$src$core$block_aria_composer(a),
|
|
407
|
+
b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getInputCountLabel$$module$build$src$core$block_aria_composer(a)].filter(c=>!!c).join(", ")};
|
|
408
408
|
configureAriaRole$$module$build$src$core$block_aria_composer=function(a){setRole$$module$build$src$core$utils$aria(a.getSvgRoot(),Role$$module$build$src$core$utils$aria.PRESENTATION);var b=a.getFocusableElement();a.isInFlyout||setRole$$module$build$src$core$utils$aria(b,Role$$module$build$src$core$utils$aria.FIGURE);var c=a.getAriaRoleDescription();setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,c?c:a.statementInputCount?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_CONTAINER:
|
|
409
409
|
a.outputConnection?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_VALUE:$.Msg$$module$build$src$core$msg.BLOCK_LABEL_STATEMENT)};
|
|
410
410
|
computeFieldRowLabel$$module$build$src$core$block_aria_composer=function(a,b,c=Verbosity$$module$build$src$core$utils$aria.STANDARD){var d=c>=Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS,e=[],f=a.fieldRow.filter(g=>g.isVisible()).flatMap((g,h,k)=>{if(g instanceof FieldLabel$$module$build$src$core$field_label){if(h<k.length-1&&k[h+1]instanceof FieldLabel$$module$build$src$core$field_label)return e.push(g.computeAriaLabel(d)),[];if(e.length>=1)return e.push(g.computeAriaLabel(d)),g=e.join(" "),
|
|
411
411
|
e=[],g}return g.computeAriaLabel(d)});if(!f.length&&b){let g=a.getSourceBlock().inputList;a=g.indexOf(a);if(a>0)return computeFieldRowLabel$$module$build$src$core$block_aria_composer(g[a-1],b,c)}return f.filter(g=>!!g)};
|
|
412
|
-
getParentInputLabel$$module$build$src$core$block_aria_composer=function(a){var b,c,d,e=(b=(d=a.outputConnection)!=null?d:a.previousConnection)==null?void 0:(c=b.targetConnection)==null?void 0:c.getParentInput();if(e&&(a=e.getSourceBlock(),!a.isInsertionMarker())){if(b=e.getAriaLabelText())a=b;else{if(!a.statementInputCount)return;
|
|
413
|
-
!
|
|
414
|
-
getInputLabels$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD
|
|
415
|
-
getInputLabelsSubset$$module$build$src$core$block_aria_composer=function(a,b
|
|
416
|
-
|
|
412
|
+
getParentInputLabel$$module$build$src$core$block_aria_composer=function(a){var b,c,d,e=(b=(d=a.outputConnection)!=null?d:a.previousConnection)==null?void 0:(c=b.targetConnection)==null?void 0:c.getParentInput();if(e&&(a=e.getSourceBlock(),!a.isInsertionMarker())){if(b=e.getAriaLabelText())a=b;else{if(!a.statementInputCount)return;b=a.inputList.find(f=>f.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT);if(e===b)return;a=getInputLabelsSubset$$module$build$src$core$block_aria_composer(a,
|
|
413
|
+
e);if(!a.length)return;a=a.join(", ")}return e.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT?(e=Array.isArray(a)?a.join(" "):a,$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_PREFIX.replace("%1",e)):a}};getBeginStackLabel$$module$build$src$core$block_aria_composer=function(a){if(!a.isInFlyout&&!a.isDragging())return a.getRootBlock()===a?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_STACK:void 0};
|
|
414
|
+
getInputLabels$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD){var c=a=a.inputList.filter(d=>d.isVisible());if(b<=Verbosity$$module$build$src$core$utils$aria.STANDARD){let d=a.filter(e=>e.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT);d.length>1&&(c=a.slice(0,a.indexOf(d[0])+1))}return c.map(d=>d.getLabel(b))};
|
|
415
|
+
getInputLabelsSubset$$module$build$src$core$block_aria_composer=function(a,b){var c=a.inputList.indexOf(b);if(c===-1)throw Error(`Input with name "${b.name}" not found on block with id "${a.id}".`);var d=b.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;b=d?findStartOfStatementSection$$module$build$src$core$block_aria_composer(a.inputList,c):c;var e=a.inputList.slice(b,c+1).filter(h=>h.isVisible()),f=e.map(h=>h.getLabel(Verbosity$$module$build$src$core$utils$aria.TERSE)),g=
|
|
416
|
+
d&&f.slice(0,-1).some(h=>!!h);return f.map((h,k)=>{if(h)return h;h=e[k];if(!(h.type===$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY||h.type===$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW||d&&k===f.length-1&&g))return $.Msg$$module$build$src$core$msg.INPUT_LABEL_INDEX.replace("%1",(h.getIndex()+1).toString())}).filter(h=>h!==void 0)};
|
|
417
|
+
findStartOfStatementSection$$module$build$src$core$block_aria_composer=function(a,b){for(--b;b>=0;b--)if(a[b].type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT)return b+1;return 0};
|
|
417
418
|
getParentToolboxCategoryLabel$$module$build$src$core$block_aria_composer=function(a){var b=a.workspace.getToolbox();if(b){var c=void 0;for(let d of b.getToolboxItems()){if(!isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(d))continue;b=d.getContents();if(Array.isArray(b)&&b.some(e=>e.kind.toLowerCase()==="block"&&"type"in e&&e.type===a.type)){c=d;break}"getColour"in d&&typeof d.getColour==="function"&&d.getColour()===a.getColour()&&(c=d)}if(c)return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_TOOLBOX_CATEGORY.replace("%1",
|
|
418
419
|
c.getName())}};
|
|
419
420
|
getAnnouncementTemplate$$module$build$src$core$block_aria_composer=function(a){switch(a){case ConnectionPreposition$$module$build$src$core$block_aria_composer.BEFORE:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_BEFORE;case ConnectionPreposition$$module$build$src$core$block_aria_composer.AFTER:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_AFTER;case ConnectionPreposition$$module$build$src$core$block_aria_composer.INSIDE:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_INSIDE;case ConnectionPreposition$$module$build$src$core$block_aria_composer.AROUND:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_AROUND;
|
|
@@ -494,12 +495,12 @@ registerFocusWorkspace$$module$build$src$core$shortcut_items=function(){Shortcut
|
|
|
494
495
|
displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_WORKSPACE})};
|
|
495
496
|
registerFocusToolbox$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.FOCUS_TOOLBOX,preconditionFn:a=>!a.isDragging(),callback:(a,b)=>{var c=a.getToolbox();if(c)keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0),$.getFocusManager$$module$build$src$core$focus_manager().focusTree(c);else{a=a.getFlyout();if(!a)return!1;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
496
497
|
$.getFocusManager$$module$build$src$core$focus_manager().focusTree(a.getWorkspace())}b.preventDefault();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.T],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_TOOLBOX})};
|
|
497
|
-
registerReadInformation$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.INFORMATION,preconditionFn:()=>!0,callback:a=>{var b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),c=a.getNavigator().getSourceBlockFromNode(b);if(c)return a=computeAriaLabel$$module$build$src$core$block_aria_composer(c,Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS,
|
|
498
|
-
|
|
498
|
+
registerReadInformation$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.INFORMATION,preconditionFn:()=>!0,callback:a=>{var b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),c=a.getNavigator().getSourceBlockFromNode(b);if(c)return a=computeAriaLabel$$module$build$src$core$block_aria_composer(c,Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS),
|
|
499
|
+
announceDynamicAriaState$$module$build$src$core$utils$aria(a),!0;if(b===a){b=resolveWorkspace$$module$build$src$core$shortcut_items(a);a=b.getTopBlocks().length;b=b.getTopComments().length;c=a===0?"WORKSPACE_CONTENTS_BLOCKS_ZERO":a===1?"WORKSPACE_CONTENTS_BLOCKS_ONE":"WORKSPACE_CONTENTS_BLOCKS_MANY";let d="";b>0&&(d=$.Msg$$module$build$src$core$msg[b===1?"WORKSPACE_CONTENTS_COMMENTS_ONE":"WORKSPACE_CONTENTS_COMMENTS_MANY"].replace("%1",String(b)));a=$.Msg$$module$build$src$core$msg[c].replace("%1",
|
|
499
500
|
String(a)).replace("%2",d);announceDynamicAriaState$$module$build$src$core$utils$aria(a);return!0}return!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.I],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_INFORMATION})};
|
|
500
501
|
registerReadExtendedInformation$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.I,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.EXTENDED_INFORMATION,preconditionFn:()=>!0,callback:b=>{b=b.getNavigator().getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());
|
|
501
|
-
if(!b)return!1;for(var c=[],d=b,e;(e=d.outputConnection)==null?0:e.isConnected();)d=d.getParent();d!==b&&c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(d,Verbosity$$module$build$src$core$utils$aria.TERSE
|
|
502
|
-
computeAriaLabel$$module$build$src$core$block_aria_composer(b,Verbosity$$module$build$src$core$utils$aria.TERSE
|
|
502
|
+
if(!b)return!1;for(var c=[],d=b,e;(e=d.outputConnection)==null?0:e.isConnected();)d=d.getParent();d!==b&&c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(d,Verbosity$$module$build$src$core$utils$aria.TERSE));for(e=d.getParent();e;)c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(e,Verbosity$$module$build$src$core$utils$aria.TERSE)),e=e.getParent();if(c.length){c.reverse();let f;((f=b.outputConnection)==null?0:f.isConnected())||c.push($.Msg$$module$build$src$core$msg.CURRENT_BLOCK_ANNOUNCEMENT.replace("%1",
|
|
503
|
+
computeAriaLabel$$module$build$src$core$block_aria_composer(b,Verbosity$$module$build$src$core$utils$aria.TERSE)));announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.PARENT_BLOCKS_ANNOUNCEMENT.replace("%1",c.join(",")))}else announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.NO_PARENT_ANNOUNCEMENT);return!0},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_EXTENDED_INFORMATION})};
|
|
503
504
|
registerDisconnectBlock$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DISCONNECT,preconditionFn:(b,c)=>{(c=!b.isDragging()&&!b.isReadOnly()&&c.focusedNode instanceof BlockSvg$$module$build$src$core$block_svg)||
|
|
504
505
|
b.getAudioManager().playErrorBeep();return c},callback:(b,c)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;c=!(c instanceof KeyboardEvent&&c.shiftKey);$.setGroup$$module$build$src$core$events$utils(!0);b.unplug(c);$.setGroup$$module$build$src$core$events$utils(!1);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.X,
|
|
505
506
|
a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DISCONNECT})};
|
|
@@ -573,7 +574,7 @@ saveProcedure$$module$build$src$core$serialization$procedures=function(a){var b=
|
|
|
573
574
|
save$$module$build$src$core$serialization$workspaces=function(a){var b=Object.create(null),c=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);for(let d in c){let e,f=(e=c[d])==null?void 0:e.save(a);f&&(b[d]=f)}return b};
|
|
574
575
|
load$$module$build$src$core$serialization$workspaces=function(a,b,{recordUndo:c=!1}={}){var d=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);if(d){d=Object.entries(d).sort((f,g)=>g[1].priority-f[1].priority);var e=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(c);(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);startTextWidthCache$$module$build$src$core$utils$dom();
|
|
575
576
|
b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!1);for(let [,f]of d.reverse()){let g;(g=f)==null||g.clear(b)}for(let [f,g]of d.reverse())if(a[f]){let h;(h=g)==null||h.load(a[f],b)}b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!0);stopTextWidthCache$$module$build$src$core$utils$dom();fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.FINISHED_LOADING))(b));
|
|
576
|
-
$.setGroup$$module$build$src$core$events$utils(c);$.setRecordUndo$$module$build$src$core$events$utils(e)}};
|
|
577
|
+
$.setGroup$$module$build$src$core$events$utils(c);$.setRecordUndo$$module$build$src$core$events$utils(e)}};isFieldImageConfig$$module$build$src$core$field_image=function(a){return typeof a==="object"&&a!==null&&!Array.isArray(a)&&("alt"in a||"flipRtl"in a)};
|
|
577
578
|
inject$$module$build$src$core$inject=function(a,b){var c=null;c=typeof a==="string"?document.getElementById(a)||document.querySelector(a):a;var d;if(!document.contains(c)&&document!==((d=c)==null?void 0:d.ownerDocument))throw Error("Error: container is not in current document");a=new Options$$module$build$src$core$options(b||{});d=document.createElement("div");addClass$$module$build$src$core$utils$dom(d,"injectionDiv");(b==null?0:b.rtl)&&addClass$$module$build$src$core$utils$dom(d,"blocklyRTL");setRole$$module$build$src$core$utils$aria(d,
|
|
578
579
|
Role$$module$build$src$core$utils$aria.APPLICATION);c.appendChild(d);b=createDom$$module$build$src$core$inject(d,a);var e=createMainWorkspace$$module$build$src$core$inject(d,b,a);init$$module$build$src$core$inject(e);setMainWorkspace$$module$build$src$core$common(e);svgResize$$module$build$src$core$common(e);d.addEventListener("focusin",function(){setMainWorkspace$$module$build$src$core$common(e)});conditionalBind$$module$build$src$core$browser_events(d,"keydown",null,globalShortcutHandler$$module$build$src$core$common);
|
|
579
580
|
initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria(d);return e};
|
|
@@ -1826,7 +1827,7 @@ a*a)}bumpAwayFrom(a,b=!1){if(!this.sourceBlock_.workspace.isDragging()){var c=$.
|
|
|
1826
1827
|
else if(e.isMovable())g=!1,c=-c,d=-d;else return;b=g?a:this;a=g?this:a;e=g?f:e;e.RTL&&(c=-c);e.moveBy(b.x+c-a.x,b.y+d-a.y,["bump"])}}}moveTo(a,b){var c=!1;this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.WILL_TRACK?(this.db.addConnection(this,b),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED,c=!0):this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED&&
|
|
1827
1828
|
(this.db.removeConnection(this,this.y),this.db.addConnection(this,b),c=!0);this.x=a;this.y=b;return c}moveBy(a,b){return this.moveTo(this.x+a,this.y+b)}moveToOffset(a){return this.moveTo(a.x+this.offsetInBlock.x,a.y+this.offsetInBlock.y)}setOffsetInBlock(a,b){this.offsetInBlock.x=a;this.offsetInBlock.y=b}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var a=this.targetConnection,b=this.targetBlock();a&&b&&(a=Coordinate$$module$build$src$core$utils$coordinate.difference(this.offsetInBlock,
|
|
1828
1829
|
a.offsetInBlock),b.translate(a.x,a.y))}closest(a,b){return this.dbOpposite.searchForClosest(this,a,b)}recomputeAriaContext(a){var b=this.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?$.Msg$$module$build$src$core$msg.INPUT_LABEL_VALUE:$.Msg$$module$build$src$core$msg.INPUT_LABEL_STATEMENT;setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.FIGURE);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,
|
|
1829
|
-
b);var c,d,e;if(b=(e=this.getParentInput())!=null?e:(c=this.getSourceBlock().getTopStackBlock().previousConnection)==null?void 0:(d=c.targetConnection)==null?void 0:d.getParentInput()){var f;c=(f=b==null?void 0:b.getAriaLabelText())!=null?f:getInputLabelsSubset$$module$build$src$core$block_aria_composer(b.getSourceBlock(),b
|
|
1830
|
+
b);var c,d,e;if(b=(e=this.getParentInput())!=null?e:(c=this.getSourceBlock().getTopStackBlock().previousConnection)==null?void 0:(d=c.targetConnection)==null?void 0:d.getParentInput()){var f;c=(f=b==null?void 0:b.getAriaLabelText())!=null?f:getInputLabelsSubset$$module$build$src$core$block_aria_composer(b.getSourceBlock(),b).join(", ");this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,
|
|
1830
1831
|
$.Msg$$module$build$src$core$msg.INPUT_LABEL_END_STATEMENT.replace("%1",c)):setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,c)}else setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.INPUT_LABEL_EMPTY)}highlight(){this.highlighted=!0;var a=this.findHighlightSvg();if(a){a.style.display="";let b;(b=a.parentElement)==null||b.appendChild(a);this.recomputeAriaContext(a)}}unhighlight(){this.highlighted=
|
|
1831
1832
|
!1;var a=this.findHighlightSvg();a&&(a.style.display="none")}isHighlighted(){return this.highlighted}setTracking(a){a&&this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED||!a&&this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(a?(this.db.addConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED):
|
|
1832
1833
|
(this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.UNTRACKED))}stopTrackingAll(){this.setTracking(!1);if(this.targetConnection){let a=this.targetBlock().getDescendants(!1);for(let b=0;b<a.length;b++){let c=a[b],d=c.getConnections_(!0);for(let e=0;e<d.length;e++)d[e].setTracking(!1);for(let e of c.getIcons())hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&
|
|
@@ -1843,7 +1844,7 @@ a+" out of bounds.");if(!(b||b===""&&c))return a;typeof b==="string"&&(b=$.fromJ
|
|
|
1843
1844
|
this.connection.stopTrackingAll();let c=this.connection.targetBlock();c&&(c.getSvgRoot().style.display=a?"block":"none")}return b}markDirty(){for(let a=0,b;b=this.fieldRow[a];a++)b.markDirty()}setCheck(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this}setAlign(a){this.align=a;this.sourceBlock.rendered&&this.sourceBlock.queueRender();return this}setShadowDom(a){if(!this.connection)throw Error("This input does not have a connection.");
|
|
1844
1845
|
this.connection.setShadowDom(a);return this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(let a of this.fieldRow)a.init()}setAriaLabelProvider(a){this.ariaLabelProvider=a;return this}getAriaLabelText(){return this.ariaLabelProvider?typeof this.ariaLabelProvider==="string"?replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaLabelProvider):this.ariaLabelProvider(this):null}initModel(){for(let a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?
|
|
1845
1846
|
a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}getRowId(){var a=this.getSourceBlock().inputList;if(this===a[0])return this.getSourceBlock().getRowId();var b=a.indexOf(this),c,d=((c=a[b-1].connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,e;return((e=this.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||
|
|
1846
|
-
d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}getLabel(a=Verbosity$$module$build$src$core$utils$aria.STANDARD
|
|
1847
|
+
d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}getLabel(a=Verbosity$$module$build$src$core$utils$aria.STANDARD){if(!this.isVisible())return"";var b=computeFieldRowLabel$$module$build$src$core$block_aria_composer(this,!1,a),c;((c=this.connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&(c=this.connection.targetBlock())&&!c.isInsertionMarker()&&b.push(getInputLabels$$module$build$src$core$block_aria_composer(c,a).join(", "));return b.join(", ")}getIndex(){var a=
|
|
1847
1848
|
[$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY,$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW];return this.getSourceBlock().inputList.filter(b=>!a.includes(b.type)).indexOf(this)}},module$build$src$core$inputs$input={};module$build$src$core$inputs$input.Input=Input$$module$build$src$core$inputs$input;var DummyInput$$module$build$src$core$inputs$dummy_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},module$build$src$core$inputs$dummy_input={};module$build$src$core$inputs$dummy_input.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;var EndRowInput$$module$build$src$core$inputs$end_row_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},module$build$src$core$inputs$end_row_input={};module$build$src$core$inputs$end_row_input.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;var StatementInput$$module$build$src$core$inputs$statement_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Statement inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)}},module$build$src$core$inputs$statement_input={};
|
|
1848
1849
|
module$build$src$core$inputs$statement_input.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;var module$build$src$core$inputs$value_input;$.ValueInput$$module$build$src$core$inputs$value_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Value inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.VALUE;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE)}};module$build$src$core$inputs$value_input={};
|
|
1849
1850
|
module$build$src$core$inputs$value_input.ValueInput=$.ValueInput$$module$build$src$core$inputs$value_input;var module$build$src$core$interfaces$i_icon={};module$build$src$core$interfaces$i_icon.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;var module$build$src$core$interfaces$i_comment_icon={};module$build$src$core$interfaces$i_comment_icon.isCommentIcon=isCommentIcon$$module$build$src$core$interfaces$i_comment_icon;var Block$$module$build$src$core$block=class{constructor(a,b,c){this.data=null;this.disposed=!1;this.hue=null;this.colour_="#000000";this.styleName_="";this.suppressPrefixSuffix=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.inputList=[];this.icons=[];this.disabledReasons=new Set;this.tooltip="";this.contextMenu=!0;this.parentBlock_=null;this.childBlocks_=[];this.editable=this.movable=this.deletable=!0;this.collapsed_=this.shadow=!1;this.outputShape_=null;this.rendered=
|
|
@@ -1956,9 +1957,10 @@ b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,e=c.findIn
|
|
|
1956
1957
|
0&&e<c.length;e+=b){let f=c[e];for(let g of d){let h=this.getAllConnections(f);for(let k of h)if(a.workspace.connectionChecker.canConnect(g,k,!0,Infinity))return!1}}return!0}pairToCandidate(a){return Object.assign({},a,{distance:0})}getDirectionToNewLocation(a){var b=this.block.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,b);var {x:c,y:d}=a;return c<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:c>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:
|
|
1957
1958
|
d<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:d>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE}getAllConnections(a){if(a.isShadow())return[];var b=[];a.outputConnection&&b.push(a.outputConnection);a.previousConnection&&b.push(a.previousConnection);if(!a.isCollapsed())for(let c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);let d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&
|
|
1958
1959
|
(b.push(a.nextConnection),(a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));return b}getInitialCandidate(){var a=this.workspace.getSvgGroup().querySelector(`.${FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME}`);if(!a||!a.id||a===this.block.getFocusableElement())return null;a=this.workspace.lookUpFocusableNode(a.id);if(!a)return null;var b=this.workspace.getNavigator().getSourceBlockFromNode(a);if(!b)return null;var c=null;if(b.getConnections_(!1).includes(a)){c=
|
|
1959
|
-
a;let
|
|
1960
|
-
MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED}enableAllDraggedBlocks(a){var b=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(!1);this.lastBlockDisabledReasons.clear();a.getDescendants(!1).forEach(c=>
|
|
1961
|
-
var b=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(!1);a.getDescendants(!1).forEach(c=>{var d;(d=this.lastBlockDisabledReasons.get(c.id))==null||d.forEach(e=>{c.setDisabledReason(!0,e)})});$.setRecordUndo$$module$build$src$core$events$utils(b)}},
|
|
1960
|
+
a;let g=this.block.workspace.connectionChecker;if(a=this.block.getConnections_(!1).find(h=>g.canConnect(h,c,!0,Infinity)))return{local:a,neighbour:c,distance:0}}if(a=this.allConnectionPairs.find(g=>g.neighbour.getSourceBlock()===b))return this.pairToCandidate(a);var d,e=(d=b.outputConnection)==null?void 0:d.targetConnection;if(d=this.allConnectionPairs.find(g=>g.neighbour===e))return this.pairToCandidate(d);for(var f=b.getSurroundParent();f;){if(d=this.allConnectionPairs.find(g=>g.neighbour.getSourceBlock()===
|
|
1961
|
+
f))return this.pairToCandidate(d);f=f.getSurroundParent()}return null}updateMoveMode(a){this.moveMode=a instanceof KeyboardEvent&&!a.ctrlKey&&!a.metaKey?MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED:MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED}enableAllDraggedBlocks(a){var b=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(!1);this.lastBlockDisabledReasons.clear();a.getDescendants(!1).forEach(c=>
|
|
1962
|
+
{var d=new Set(c.getDisabledReasons());this.lastBlockDisabledReasons.set(c.id,d);d.forEach(e=>c.setDisabledReason(!1,e))});$.setRecordUndo$$module$build$src$core$events$utils(b)}redisableAllDraggedBlocks(a){var b=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(!1);a.getDescendants(!1).forEach(c=>{var d;(d=this.lastBlockDisabledReasons.get(c.id))==null||d.forEach(e=>{c.setDisabledReason(!0,e)})});$.setRecordUndo$$module$build$src$core$events$utils(b)}},
|
|
1963
|
+
module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var TextBubble$$module$build$src$core$bubbles$text_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d,e){super(b,c,d,void 0,e);this.text=a;this.workspace=b;this.anchor=c;this.ownerRect=d;this.owner=e;this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize();addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextBubble")}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);
|
|
1962
1964
|
this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize()}stringToSvg(a,b){b=this.createParagraph(b);a=this.createTextFragments(b,a);this.workspace.RTL&&this.rightAlignTextFragments(b.getBBox().width,a);return b}createParagraph(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?
|
|
1963
1965
|
"rtl":"ltr"}`},a)}createTextFragments(a,b){var c=1;return b.split("\n").map(d=>{var e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{y:`${c}em`,x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);d=document.createTextNode(d);e.appendChild(d);c+=1;return e})}rightAlignTextFragments(a,b){for(let c of b)c.setAttribute("text-anchor","start"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){var a=
|
|
1964
1966
|
this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size(a.width+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2,a.height+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2),!0)}},module$build$src$core$bubbles$text_bubble={};module$build$src$core$bubbles$text_bubble.TextBubble=TextBubble$$module$build$src$core$bubbles$text_bubble;var SIZE$$module$build$src$core$icons$warning_icon=17,WarningIcon$$module$build$src$core$icons$warning_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textMap=new Map;this.textBubble=null}getType(){return WarningIcon$$module$build$src$core$icons$warning_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$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"},
|
|
@@ -2006,7 +2008,7 @@ Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks
|
|
|
2006
2008
|
this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.recomputeAriaContext();this.select();var a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();a&&a!==this&&finishQueuedRenders$$module$build$src$core$render_management().then(()=>{this.workspace.scrollBoundsIntoView(this.getBoundingRectangleWithoutChildren())})}onNodeBlur(){this.unselect()}canBeFocused(){return!0}performAction(a){if(this.workspace.isFlyout)KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.startMove(this,
|
|
2007
2009
|
a);else{if(this.isSimpleReporter())for(let b of this.inputList)for(let c of b.fieldRow)if(c.isClickable()&&c.isFullBlockField()){c.showEditor();return}this.workspace.getNavigator().getInNode(this)?showBlockNavigationHint$$module$build$src$core$hints(this.workspace):showHelpHint$$module$build$src$core$hints(this.workspace)}}getParents(){for(var a=new Set,b=this.getParent();b;)a.add(b),b=b.getParent();return a}getOutputParents(){var a=new Set;a.add(this);for(var b,c=(b=this.outputConnection)==null?
|
|
2008
2010
|
void 0:b.targetBlock();c;){a.add(c);let d;c=(d=c.outputConnection)==null?void 0:d.targetBlock()}return a}getRowId(){var a,b,c=(a=this.outputConnection)==null?void 0:(b=a.targetConnection)==null?void 0:b.getParentInput();return c?c.getRowId():this.id}recomputeAriaContext(){this.getFullBlockField()||(setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.LABEL,this.getAriaLabel(Verbosity$$module$build$src$core$utils$aria.STANDARD)),configureAriaRole$$module$build$src$core$block_aria_composer(this))}getAriaLabel(a){return computeAriaLabel$$module$build$src$core$block_aria_composer(this,
|
|
2009
|
-
a
|
|
2011
|
+
a)}getStackBlocksCountLabel(){for(var a=1,b=this.getNextBlock();b;)a++,b=b.getNextBlock();return a<=1?computeAriaLabel$$module$build$src$core$block_aria_composer(this,Verbosity$$module$build$src$core$utils$aria.TERSE):$.Msg$$module$build$src$core$msg.BLOCK_LABEL_STACK_BLOCKS.replace("%1",a.toString())}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};
|
|
2010
2012
|
module$build$src$core$block_svg.BlockSvg=BlockSvg$$module$build$src$core$block_svg;var DragTarget$$module$build$src$core$drag_target=class{constructor(){}onDragEnter(a){}onDragOver(a){}onDragExit(a){}onDrop(a){}getClientRect(){return null}shouldPreventMove(a){return!1}},module$build$src$core$drag_target={};module$build$src$core$drag_target.DragTarget=DragTarget$$module$build$src$core$drag_target;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()?this.updateWouldDelete_(!1):a instanceof BlockSvg$$module$build$src$core$block_svg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a)):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}updateWouldDelete_(a){this.wouldDelete_=
|
|
2011
2013
|
a}},module$build$src$core$delete_area={};module$build$src$core$delete_area.DeleteArea=DeleteArea$$module$build$src$core$delete_area;var FlyoutItem$$module$build$src$core$flyout_item=class{constructor(a,b){this.element=a;this.type=b}getElement(){return this.element}getType(){return this.type}},module$build$src$core$flyout_item={};module$build$src$core$flyout_item.FlyoutItem=FlyoutItem$$module$build$src$core$flyout_item;var MetricsManager$$module$build$src$core$metrics_manager=class{constructor(a){this.workspace_=a}getDimensionsPx_(a){var b=0,c=0;a&&(b=a.getWidth(),c=a.getHeight());return new Size$$module$build$src$core$utils$size(b,c)}getFlyoutMetrics(a){a=this.getDimensionsPx_(this.workspace_.getFlyout(a));return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){var a=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){var a=
|
|
2012
2014
|
0,b=0,c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox(),f,g=!((f=this.workspace_.getFlyout())==null?0:f.autoClose);f=e?c.position:d.position;var h=f===Position$$module$build$src$core$utils$toolbox.TOP;f===Position$$module$build$src$core$utils$toolbox.LEFT&&(e&&(a+=c.width),g&&(a+=d.width));h&&(e&&(b+=c.height),g&&(b+=d.height));return{top:b,left:a}}getViewMetrics(a){a=a?this.workspace_.scale:1;var b=this.getSvgMetrics(),c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),
|
|
@@ -2264,10 +2266,10 @@ b[b.length-1].group;){let f=b.pop();f&&e.push(f)}for(b=0;b<e.length;b++)c.push(e
|
|
|
2264
2266
|
a)}fireChangeListener(a){if(a.recordUndo)for(this.undoStack_.push(a),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&this.MAX_UNDO>=0;)this.undoStack_.shift();for(let b=0;b<this.listeners.length;b++)(0,this.listeners[b])(a)}getBlockById(a){return this.blockDB.get(a)||null}setBlockById(a,b){this.blockDB.set(a,b)}removeBlockById(a){this.blockDB.delete(a)}getCommentById(a){var b;return(b=this.commentDB.get(a))!=null?b:null}allInputsFilled(a){var b=this.getTopBlocks(!1);for(let c=0;c<b.length;c++)if(!b[c].allInputsFilled(a))return!1;
|
|
2265
2267
|
return!0}getPotentialVariableMap(){return this.potentialVariableMap}createPotentialVariableMap(){this.potentialVariableMap=new (this.getVariableMapClass())(this,!0)}getVariableMap(){return this.variableMap}setVariableMap(a){this.variableMap=a}getProcedureMap(){return this.procedureMap}getRootWorkspace(){var a=null,b=this.options.parentWorkspace;this.isFlyout?b&&b.options&&(a=b.options.parentWorkspace):b&&(a=b);return a}static getById(a){return getWorkspaceById$$module$build$src$core$common(a)}static getAll(){return getAllWorkspaces$$module$build$src$core$common()}getVariableMapClass(){var a=
|
|
2266
2268
|
getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,this.options,!0);if(!a)throw Error("No variable map is registered.");return a}isReadOnly(){return this.readOnly}setIsReadOnly(a){this.readOnly=a;this.options.readOnly=a}};Workspace$$module$build$src$core$workspace.SCAN_ANGLE=3;var module$build$src$core$workspace={};module$build$src$core$workspace.Workspace=Workspace$$module$build$src$core$workspace;var SOUND_LIMIT$$module$build$src$core$workspace_audio=100,WorkspaceAudio$$module$build$src$core$workspace_audio=class{constructor(a){this.parentWorkspace=a;this.sounds=new Map;this.lastSound=null;this.muted=!1;window.AudioContext&&(this.context=new AudioContext)}dispose(){this.sounds.clear();var a;(a=this.context)==null||a.close()}load(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(a.length){var d=yield(yield fetch(a[0])).arrayBuffer(),e;(e=c.context)==null||
|
|
2267
|
-
e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()&&b!==0){var d=c.sounds.get(a);if(d){yield c.prepareToPlay();let e=c.context.createBufferSource(),f=c.context.createGain();f.gain.value=b!=null?b:1;f.connect(c.context.destination);e.buffer=d;e.connect(f);e.addEventListener("ended",()=>{e.disconnect();f.disconnect()});e.start()}else c.parentWorkspace&&c.parentWorkspace.getAudioManager()
|
|
2268
|
-
b)}})}beep(a,b=.2){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()){yield c.prepareToPlay();var d=c.context.createOscillator();d.type="sine";d.frequency.setValueAtTime(a,c.context.currentTime);var e=c.context.createGain();e.gain.setValueAtTime(0,c.context.currentTime);e.gain.linearRampToValueAtTime(.5,c.context.currentTime+.01);e.gain.linearRampToValueAtTime(0,c.context.currentTime+b);d.connect(e);e.connect(c.context.destination);
|
|
2269
|
-
d.stop(c.context.currentTime+b)}})}playErrorBeep(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){return a.beep(260)})}maybePlayScopeChangeAudioCue(a){if(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.getScopeChangeAudioCuesEnabled()){var b=this.parentWorkspace.getNavigator(),c=b.getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());a=b.getSourceBlockFromNode(a);
|
|
2270
|
-
(b=a.getNestingLevel())&&this.beep(400+b*60)}}isPlayingAllowed(){var a=new Date;return this.getMuted()||!this.context||this.lastSound!==null&&a.getTime()-this.lastSound.getTime()<SOUND_LIMIT$$module$build$src$core$workspace_audio?!1:!0}prepareToPlay(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){a.lastSound=new Date;a.context.state==="suspended"&&(yield a.context.resume())})}setMuted(a){this.muted=a}getMuted(){return this.muted}},module$build$src$core$workspace_audio=
|
|
2269
|
+
e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()&&b!==0){var d=c.sounds.get(a);if(d){yield c.prepareToPlay();let e=c.context.createBufferSource(),f=c.context.createGain();f.gain.value=b!=null?b:1;f.connect(c.context.destination);e.buffer=d;e.connect(f);e.addEventListener("ended",()=>{e.disconnect();f.disconnect()});e.start()}else c.parentWorkspace&&(d=c.parentWorkspace.getAudioManager(),d!==
|
|
2270
|
+
c&&d.play(a,b))}})}beep(a,b=.2){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()){yield c.prepareToPlay();var d=c.context.createOscillator();d.type="sine";d.frequency.setValueAtTime(a,c.context.currentTime);var e=c.context.createGain();e.gain.setValueAtTime(0,c.context.currentTime);e.gain.linearRampToValueAtTime(.5,c.context.currentTime+.01);e.gain.linearRampToValueAtTime(0,c.context.currentTime+b);d.connect(e);e.connect(c.context.destination);
|
|
2271
|
+
d.start(c.context.currentTime);d.stop(c.context.currentTime+b)}})}playErrorBeep(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){return a.beep(260)})}maybePlayScopeChangeAudioCue(a){if(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.getScopeChangeAudioCuesEnabled()){var b=this.parentWorkspace.getNavigator(),c=b.getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());a=b.getSourceBlockFromNode(a);
|
|
2272
|
+
b=0;c&&a&&c.getNestingLevel()!==(b=a.getNestingLevel())&&this.beep(400+b*60)}}isPlayingAllowed(){var a=new Date;return this.getMuted()||!this.context||this.lastSound!==null&&a.getTime()-this.lastSound.getTime()<SOUND_LIMIT$$module$build$src$core$workspace_audio?!1:!0}prepareToPlay(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){a.lastSound=new Date;a.context.state==="suspended"&&(yield a.context.resume())})}setMuted(a){this.muted=a}getMuted(){return this.muted}},module$build$src$core$workspace_audio=
|
|
2271
2273
|
{};module$build$src$core$workspace_audio.WorkspaceAudio=WorkspaceAudio$$module$build$src$core$workspace_audio;var ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg=20,WorkspaceSvg$$module$build$src$core$workspace_svg=class extends Workspace$$module$build$src$core$workspace{constructor(a){super(a);this.resizeHandlerWrapper=null;this.resizesEnabled=this.visible=this.rendered=!0;this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0;this.oldScale=this.scale=1;this.oldLeft=this.oldTop=0;this.inverseScreenCTM=this.targetWorkspace=this.dummyWheelListener=this.configureContextMenu=this.lastRecordedPageScroll=
|
|
2272
2274
|
this.injectionDiv=this.currentGesture_=this.toolbox=this.flyout=this.scrollbar=this.trashcan=null;this.inverseScreenCTMDirty=!0;this.highlightedBlocks=[];this.toolboxCategoryCallbacks=new Map;this.flyoutButtonCallbacks=new Map;this.cachedParentSvg=null;this.topBoundedElements=[];this.dragTargetAreas=[];this.workspaceSelectionRing=this.workspaceFocusRing=this.zoomControls_=this.layerManager=null;this.navigator=new Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;this.metricsManager=
|
|
2273
2275
|
new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,a,!0))(this);this.getMetrics=a.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager);this.setMetrics=a.setMetrics||WorkspaceSvg$$module$build$src$core$workspace_svg.setTopLevelWorkspaceMetrics;this.componentManager=new ComponentManager$$module$build$src$core$component_manager;this.connectionDBList=ConnectionDB$$module$build$src$core$connection_db.init(this.connectionChecker);
|
|
@@ -2394,12 +2396,13 @@ a.connectionWidth,a.centerline-a.height/2)+this.getInlineInputPath(a),this.block
|
|
|
2394
2396
|
-(b.notchOffset-d.width))+d.pathTop,f=a.height-2*d.height;b=d.pathBottom+lineOnAxis$$module$build$src$core$utils$svg_paths("h",b.notchOffset-d.width)+(b.connectedBottomNextConnection?"":b.shape.pathLeft);this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",c)+e+lineOnAxis$$module$build$src$core$utils$svg_paths("v",f)+b+lineOnAxis$$module$build$src$core$utils$svg_paths("H",a.xPos+a.width);this.positionStatementInputConnection_(a)}drawConnectionHighlightPath(a){var b=a.connectionModel;
|
|
2395
2397
|
if(b.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||b.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE&&!a.isDynamicShape)return super.drawConnectionHighlightPath(a);a=b.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?moveTo$$module$build$src$core$utils$svg_paths(a.connectionWidth,-a.height/2)+this.getInlineInputPath(a):moveTo$$module$build$src$core$utils$svg_paths(a.width,
|
|
2396
2398
|
-a.height/2)+a.shape.pathDown(a.height);var c=b.getSourceBlock(),d,e;return(e=(d=c.pathObject).addConnectionHighlight)==null?void 0:e.call(d,b,a,b.getOffsetInBlock(),c.RTL)}},module$build$src$core$renderers$zelos$drawer={};module$build$src$core$renderers$zelos$drawer.Drawer=Drawer$$module$build$src$core$renderers$zelos$drawer;var FieldImage$$module$build$src$core$field_image=class extends Field$$module$build$src$core$field{constructor(a,b,c,d,e,f,g){super(Field$$module$build$src$core$field.SKIP_SETUP);this.imageElement=this.clickHandler=null;this.flipRtl=this.isDirty_=this.EDITABLE=!1;this.altText="";c=Number(replaceMessageReferences$$module$build$src$core$utils$parsing(c));b=Number(replaceMessageReferences$$module$build$src$core$utils$parsing(b));if(isNaN(c)||isNaN(b))throw Error("Height and width values of an image field must cast to numbers.");
|
|
2397
|
-
if(c<=0||b<=0)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Size$$module$build$src$core$utils$size(b,c+FieldImage$$module$build$src$core$field_image.Y_PADDING);this.imageHeight=c;typeof e==="function"&&(this.clickHandler=e);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(g?this.configure_(g):
|
|
2398
|
-
a.flipRtl&&(this.flipRtl=a.flipRtl);a.alt&&(this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(a.alt))}initView(){this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_);this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,
|
|
2399
|
-
"blocklyImageField");this.clickHandler&&(this.imageElement.style.cursor="pointer");this.recomputeAriaContext()}updateSize_(){}doClassValidation_(a){return typeof a!=="string"?null:a}doValueUpdate_(a){this.value_=a;this.imageElement&&this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_);this.recomputeAriaContext()}getFlipRtl(){return this.flipRtl}setAlt(a){a!==
|
|
2400
|
-
|
|
2401
|
-
null}computeAriaLabel(a){return this.isClickable()?"":super.computeAriaLabel(a)}recomputeAriaContext(){if(!super.recomputeAriaContext())return!1;var a=this.getFocusableElement();if(!this.isClickable())return setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.PRESENTATION),clearState$$module$build$src$core$utils$aria(a,
|
|
2402
|
-
|
|
2399
|
+
if(c<=0||b<=0)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Size$$module$build$src$core$utils$size(b,c+FieldImage$$module$build$src$core$field_image.Y_PADDING);this.imageHeight=c;typeof e==="function"&&(this.clickHandler=e);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(g?this.configure_(g):isFieldImageConfig$$module$build$src$core$field_image(d)?this.configure_(d):(this.flipRtl=!!f,this.altText=typeof d==="string"?replaceMessageReferences$$module$build$src$core$utils$parsing(d)||
|
|
2400
|
+
"":""),this.setValue(replaceMessageReferences$$module$build$src$core$utils$parsing(a)))}configure_(a){super.configure_(a);a.flipRtl&&(this.flipRtl=a.flipRtl);a.alt&&(this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(a.alt))}initView(){this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_);this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,
|
|
2401
|
+
"xlink:href",this.value_);this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyImageField");this.clickHandler&&(this.imageElement.style.cursor="pointer");this.recomputeAriaContext()}updateSize_(){}doClassValidation_(a){return typeof a!=="string"?null:a}doValueUpdate_(a){this.value_=a;this.imageElement&&this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_);this.recomputeAriaContext()}getFlipRtl(){return this.flipRtl}setAlt(a){a!==
|
|
2402
|
+
this.altText&&(this.altText=a||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}isClickable(){return super.isClickable()&&!!this.clickHandler}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(a){this.clickHandler=a}getText_(){return this.altText}static fromJson(a){if(!a.src||!a.width||!a.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(a.src,a.width,a.height,
|
|
2403
|
+
void 0,void 0,void 0,a)}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_IMAGE}getAriaValue(){return this.altText||null}computeAriaLabel(a){return this.isClickable()?"":super.computeAriaLabel(a)}recomputeAriaContext(){if(!super.recomputeAriaContext())return!1;var a=this.getFocusableElement();if(!this.isClickable())return setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.PRESENTATION),clearState$$module$build$src$core$utils$aria(a,
|
|
2404
|
+
State$$module$build$src$core$utils$aria.LABEL),!1;var b=this.getAriaValue()||"";setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,b);return!0}};FieldImage$$module$build$src$core$field_image.Y_PADDING=1;register$$module$build$src$core$field_registry("field_image",FieldImage$$module$build$src$core$field_image);FieldImage$$module$build$src$core$field_image.prototype.DEFAULT_VALUE="";var module$build$src$core$field_image={};
|
|
2405
|
+
module$build$src$core$field_image.FieldImage=FieldImage$$module$build$src$core$field_image;var MINIMUM_WIDTH$$module$build$src$core$field_input=14,FieldInput$$module$build$src$core$field_input=class extends Field$$module$build$src$core$field{set size_(a){super.size_=a}get size_(){var a=super.size_;a.width<MINIMUM_WIDTH$$module$build$src$core$field_input&&(a.width=MINIMUM_WIDTH$$module$build$src$core$field_input);return a}constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.spellcheck_=!0;this.htmlInput_=null;this.isTextValid_=this.isBeingEdited_=!1;this.onInputWrapper=
|
|
2403
2406
|
this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.spellcheck!==void 0&&(this.spellcheck_=a.spellcheck)}initView(){if(!this.getSourceBlock())throw new UnattachedFieldError$$module$build$src$core$field;this.isFullBlockField()||this.createBorderRect_();this.createTextElement_();
|
|
2404
2407
|
this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField");this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot());this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyInputField");this.recomputeAriaContext()}isFullBlockField(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;var b;return this.fullBlockClickTarget_=!((b=this.getConstants())==null||!b.FULL_BLOCK_FIELDS)&&
|
|
2405
2408
|
a.isSimpleReporter()}doValueInvalid_(a,b=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,a=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&b&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,a,this.value_)));this.recomputeAriaContext()}doValueUpdate_(a){this.isTextValid_=
|
|
@@ -2630,7 +2633,7 @@ null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEv
|
|
|
2630
2633
|
b.isCollapsible())&&((c=this.selectedItem_)==null?void 0:c.isExpanded())!==a?(this.selectedItem_.toggleExpanded(),!0):!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");var a;(a=this.flyout)==null||a.dispose();this.contents.forEach(b=>b.dispose());for(a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));
|
|
2631
2634
|
$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return(b=this.getToolboxItems().find(c=>c.isSelectable()))!=null?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,
|
|
2632
2635
|
b){a!==this?this.getSelectedItem()===a||this.mouseDown||this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){var b;a&&a===((b=this.flyout)==null?void 0:b.getWorkspace())||this.autoHide(!1)}getNavigator(){return this.navigator}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n box-sizing: border-box;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
|
|
2633
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="13.0.0-beta.
|
|
2636
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="13.0.0-beta.8",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
|
|
2634
2637
|
TOOLBOX_AT_TOP$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.TOP,TOOLBOX_AT_BOTTOM$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.BOTTOM,TOOLBOX_AT_LEFT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.LEFT,TOOLBOX_AT_RIGHT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.RIGHT,svgResize$$module$build$src$core$blockly=svgResize$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$blockly=
|
|
2635
2638
|
getMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$blockly=getSelected$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$blockly=defineBlocksWithJsonArray$$module$build$src$core$common,setParentContainer$$module$build$src$core$blockly=setParentContainer$$module$build$src$core$common,COLLAPSE_CHARS$$module$build$src$core$blockly=COLLAPSE_CHARS$$module$build$src$core$internal_constants,OPPOSITE_TYPE$$module$build$src$core$blockly=OPPOSITE_TYPE$$module$build$src$core$internal_constants,
|
|
2636
2639
|
RENAME_VARIABLE_ID$$module$build$src$core$blockly=RENAME_VARIABLE_ID$$module$build$src$core$internal_constants,DELETE_VARIABLE_ID$$module$build$src$core$blockly=DELETE_VARIABLE_ID$$module$build$src$core$internal_constants,COLLAPSED_INPUT_NAME$$module$build$src$core$blockly=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,COLLAPSED_FIELD_NAME$$module$build$src$core$blockly=COLLAPSED_FIELD_NAME$$module$build$src$core$constants,VARIABLE_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$variables,
|