blockly 12.0.1-beta.1 → 12.1.0
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 +250 -242
- package/blockly.mjs +4 -0
- package/blockly_compressed.js +250 -242
- package/blockly_compressed.js.map +1 -1
- package/core/blockly.d.ts +2 -1
- package/core/bubbles/bubble.d.ts +2 -2
- package/core/common.d.ts +8 -0
- package/core/flyout_base.d.ts +36 -8
- package/core/focus_manager.d.ts +27 -1
- package/core/interfaces/i_focusable_node.d.ts +10 -8
- package/core/keyboard_nav/block_navigation_policy.d.ts +24 -0
- package/core/keyboard_navigation_controller.d.ts +48 -0
- package/core/toolbox/toolbox.d.ts +2 -2
- package/index.mjs +4 -0
- package/package.json +1 -1
package/blockly.min.js
CHANGED
|
@@ -11,68 +11,79 @@
|
|
|
11
11
|
}
|
|
12
12
|
}(this, function() {
|
|
13
13
|
var $={};
|
|
14
|
-
var register$$module$build$src$core$registry,validate$$module$build$src$core$registry,unregister$$module$build$src$core$registry,getItem$$module$build$src$core$registry,hasItem$$module$build$src$core$registry,getClass$$module$build$src$core$registry,getObject$$module$build$src$core$registry,getAllItems$$module$build$src$core$registry,getClassFromOptions$$module$build$src$core$registry,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
14
|
+
var register$$module$build$src$core$registry,validate$$module$build$src$core$registry,unregister$$module$build$src$core$registry,getItem$$module$build$src$core$registry,hasItem$$module$build$src$core$registry,getClass$$module$build$src$core$registry,getObject$$module$build$src$core$registry,getAllItems$$module$build$src$core$registry,getClassFromOptions$$module$build$src$core$registry,longStart$$module$build$src$core$touch,longStop$$module$build$src$core$touch,clearTouchIdentifier$$module$build$src$core$touch,
|
|
15
|
+
shouldHandleEvent$$module$build$src$core$touch,getTouchIdentifierFromEvent$$module$build$src$core$touch,checkTouchIdentifier$$module$build$src$core$touch,conditionalBind$$module$build$src$core$browser_events,bind$$module$build$src$core$browser_events,unbind$$module$build$src$core$browser_events,isTargetInput$$module$build$src$core$browser_events,isRightButton$$module$build$src$core$browser_events,mouseToSvg$$module$build$src$core$browser_events,getScrollDeltaPixels$$module$build$src$core$browser_events,
|
|
16
|
+
getNextUniqueId$$module$build$src$core$utils$idgenerator,genUid$$module$build$src$core$utils$idgenerator,isBlockCreate$$module$build$src$core$events$predicates,isBlockDelete$$module$build$src$core$events$predicates,isBlockChange$$module$build$src$core$events$predicates,isBlockFieldIntermediateChange$$module$build$src$core$events$predicates,isBlockMove$$module$build$src$core$events$predicates,isVarCreate$$module$build$src$core$events$predicates,isVarDelete$$module$build$src$core$events$predicates,
|
|
17
|
+
isVarRename$$module$build$src$core$events$predicates,isBlockDrag$$module$build$src$core$events$predicates,isSelected$$module$build$src$core$events$predicates,isClick$$module$build$src$core$events$predicates,isBubbleOpen$$module$build$src$core$events$predicates,isTrashcanOpen$$module$build$src$core$events$predicates,isToolboxItemSelect$$module$build$src$core$events$predicates,isThemeChange$$module$build$src$core$events$predicates,isViewportChange$$module$build$src$core$events$predicates,isCommentCreate$$module$build$src$core$events$predicates,
|
|
18
|
+
isCommentDelete$$module$build$src$core$events$predicates,isCommentChange$$module$build$src$core$events$predicates,isCommentMove$$module$build$src$core$events$predicates,isCommentResize$$module$build$src$core$events$predicates,isCommentDrag$$module$build$src$core$events$predicates,isCommentCollapse$$module$build$src$core$events$predicates,isFinishedLoading$$module$build$src$core$events$predicates,getRecordUndo$$module$build$src$core$events$utils,fire$$module$build$src$core$events$utils,fireInternal$$module$build$src$core$events$utils,
|
|
19
|
+
fireNow$$module$build$src$core$events$utils,enqueueEvent$$module$build$src$core$events$utils,filter$$module$build$src$core$events$utils,clearPendingUndo$$module$build$src$core$events$utils,isEnabled$$module$build$src$core$events$utils,setGroupInternal$$module$build$src$core$events$utils,getDescendantIds$$module$build$src$core$events$utils,fromJson$$module$build$src$core$events$utils,get$$module$build$src$core$events$utils,disableOrphans$$module$build$src$core$events$utils,createSvgElement$$module$build$src$core$utils$dom,
|
|
20
|
+
addClass$$module$build$src$core$utils$dom,removeClasses$$module$build$src$core$utils$dom,removeClass$$module$build$src$core$utils$dom,hasClass$$module$build$src$core$utils$dom,removeNode$$module$build$src$core$utils$dom,insertAfter$$module$build$src$core$utils$dom,setCssTransform$$module$build$src$core$utils$dom,startTextWidthCache$$module$build$src$core$utils$dom,stopTextWidthCache$$module$build$src$core$utils$dom,getTextWidth$$module$build$src$core$utils$dom,getFastTextWidth$$module$build$src$core$utils$dom,
|
|
21
|
+
getFastTextWidthWithSizeString$$module$build$src$core$utils$dom,measureFontMetrics$$module$build$src$core$utils$dom,isFocusableNode$$module$build$src$core$interfaces$i_focusable_node,isSelectable$$module$build$src$core$interfaces$i_selectable,deepMerge$$module$build$src$core$utils$object,getWorkspaceById$$module$build$src$core$common,getAllWorkspaces$$module$build$src$core$common,registerWorkspace$$module$build$src$core$common,unregisterWorkpace$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$common,
|
|
22
|
+
setMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$common,setSelected$$module$build$src$core$common,fireSelectedEvent$$module$build$src$core$common,getParentContainer$$module$build$src$core$common,setParentContainer$$module$build$src$core$common,svgResize$$module$build$src$core$common,getBlockTypeCounts$$module$build$src$core$common,jsonInitFactory$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$common,defineBlocksWithJsonArrayInternal$$module$build$src$core$common,
|
|
23
|
+
globalShortcutHandler$$module$build$src$core$common,removeElem$$module$build$src$core$utils$array,register$$module$build$src$core$css,inject$$module$build$src$core$css,getSize$$module$build$src$core$utils$style,getSizeInternal$$module$build$src$core$utils$style,getSizeWithDisplay$$module$build$src$core$utils$style,getComputedStyle$$module$build$src$core$utils$style,getPageOffset$$module$build$src$core$utils$style,getViewportPageOffset$$module$build$src$core$utils$style,getBorderBox$$module$build$src$core$utils$style,
|
|
24
|
+
scrollIntoContainerView$$module$build$src$core$utils$style,getContainerOffsetToScrollInto$$module$build$src$core$utils$style,getRelativeXY$$module$build$src$core$utils$svg_math,getInjectionDivXY$$module$build$src$core$utils$svg_math,getViewportBBox$$module$build$src$core$utils$svg_math,getDocumentScroll$$module$build$src$core$utils$svg_math,screenToWsCoordinates$$module$build$src$core$utils$svg_math,wsToScreenCoordinates$$module$build$src$core$utils$svg_math,injectDependencies$$module$build$src$core$utils$xml,
|
|
25
|
+
domToText$$module$build$src$core$utils$xml,sanitizeText$$module$build$src$core$utils$xml,convertToolboxDefToJson$$module$build$src$core$utils$toolbox,validateToolbox$$module$build$src$core$utils$toolbox,convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox,hasCategories$$module$build$src$core$utils$toolbox,hasCategoriesInternal$$module$build$src$core$utils$toolbox,isCategoryCollapsible$$module$build$src$core$utils$toolbox,convertToToolboxJson$$module$build$src$core$utils$toolbox,xmlToJsonArray$$module$build$src$core$utils$toolbox,
|
|
26
|
+
addAttributes$$module$build$src$core$utils$toolbox,parseToolboxTree$$module$build$src$core$utils$toolbox,getStartPositionRect$$module$build$src$core$positionable_helpers,getCornerOppositeToolbox$$module$build$src$core$positionable_helpers,bumpPositionRect$$module$build$src$core$positionable_helpers,register$$module$build$src$core$serialization$registry,unregister$$module$build$src$core$serialization$registry,save$$module$build$src$core$serialization$workspace_comments,append$$module$build$src$core$serialization$workspace_comments,
|
|
27
|
+
register$$module$build$src$core$clipboard$registry,unregister$$module$build$src$core$clipboard$registry,moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster,commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster,setRole$$module$build$src$core$utils$aria,setState$$module$build$src$core$utils$aria,isSerializable$$module$build$src$core$interfaces$i_serializable,queueRender$$module$build$src$core$render_management,finishQueuedRenders$$module$build$src$core$render_management,
|
|
28
|
+
triggerQueuedRenders$$module$build$src$core$render_management,alwaysImmediatelyRender$$module$build$src$core$render_management,queueBlock$$module$build$src$core$render_management,doRenders$$module$build$src$core$render_management,dequeueBlock$$module$build$src$core$render_management,shouldRenderRootBlock$$module$build$src$core$render_management,renderBlock$$module$build$src$core$render_management,alert$$module$build$src$core$dialog,setAlert$$module$build$src$core$dialog,confirm$$module$build$src$core$dialog,
|
|
29
|
+
setConfirm$$module$build$src$core$dialog,prompt$$module$build$src$core$dialog,setPrompt$$module$build$src$core$dialog,toast$$module$build$src$core$dialog,setToast$$module$build$src$core$dialog,isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model,warn$$module$build$src$core$utils$deprecation,
|
|
30
|
+
internalFlyoutCategory$$module$build$src$core$variables,flyoutCategory$$module$build$src$core$variables,generateVariableFieldJson$$module$build$src$core$variables,jsonFlyoutCategoryBlocks$$module$build$src$core$variables,xmlFlyoutCategory$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,generateUniqueName$$module$build$src$core$variables,generateUniqueNameInternal$$module$build$src$core$variables,generateUniqueNameFromOptions$$module$build$src$core$variables,
|
|
31
|
+
createVariableButtonHandler$$module$build$src$core$variables,promptName$$module$build$src$core$variables,nameUsedWithOtherType$$module$build$src$core$variables,nameUsedWithAnyType$$module$build$src$core$variables,nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables,generateVariableFieldDom$$module$build$src$core$variables,createVariable$$module$build$src$core$variables,
|
|
32
|
+
getAddedVariables$$module$build$src$core$variables,compareByName$$module$build$src$core$variables,getVariableUsesById$$module$build$src$core$variables,save$$module$build$src$core$serialization$blocks,saveAttributes$$module$build$src$core$serialization$blocks,saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,saveIcons$$module$build$src$core$serialization$blocks,saveFields$$module$build$src$core$serialization$blocks,saveInputBlocks$$module$build$src$core$serialization$blocks,
|
|
33
|
+
saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,append$$module$build$src$core$serialization$blocks,appendInternal$$module$build$src$core$serialization$blocks,appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,loadCoords$$module$build$src$core$serialization$blocks,loadAttributes$$module$build$src$core$serialization$blocks,loadExtraState$$module$build$src$core$serialization$blocks,
|
|
34
|
+
tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,loadFields$$module$build$src$core$serialization$blocks,loadInputBlocks$$module$build$src$core$serialization$blocks,loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,initBlock$$module$build$src$core$serialization$blocks,hasBubble$$module$build$src$core$interfaces$i_has_bubble,toRadians$$module$build$src$core$utils$math,
|
|
35
|
+
toDegrees$$module$build$src$core$utils$math,clamp$$module$build$src$core$utils$math,createDom$$module$build$src$core$dropdowndiv,setBoundsElement$$module$build$src$core$dropdowndiv,getOwner$$module$build$src$core$dropdowndiv,getContentDiv$$module$build$src$core$dropdowndiv,clearContent$$module$build$src$core$dropdowndiv,setColour$$module$build$src$core$dropdowndiv,showPositionedByBlock$$module$build$src$core$dropdowndiv,showPositionedByField$$module$build$src$core$dropdowndiv,getScaledBboxOfBlock$$module$build$src$core$dropdowndiv,
|
|
36
|
+
getScaledBboxOfField$$module$build$src$core$dropdowndiv,showPositionedByRect$$module$build$src$core$dropdowndiv,show$$module$build$src$core$dropdowndiv,getPositionBelowMetrics$$module$build$src$core$dropdowndiv,getPositionAboveMetrics$$module$build$src$core$dropdowndiv,getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv,getPositionX$$module$build$src$core$dropdowndiv,isVisible$$module$build$src$core$dropdowndiv,hideIfOwner$$module$build$src$core$dropdowndiv,hide$$module$build$src$core$dropdowndiv,
|
|
37
|
+
hideWithoutAnimation$$module$build$src$core$dropdowndiv,positionInternal$$module$build$src$core$dropdowndiv,repositionForWindowResize$$module$build$src$core$dropdowndiv,shortestStringLength$$module$build$src$core$utils$string,commonWordPrefix$$module$build$src$core$utils$string,commonWordSuffix$$module$build$src$core$utils$string,wrapLine$$module$build$src$core$utils$string,wrapScore$$module$build$src$core$utils$string,wrapMutate$$module$build$src$core$utils$string,wrapToText$$module$build$src$core$utils$string,
|
|
38
|
+
setCustomTooltip$$module$build$src$core$tooltip,getCustomTooltip$$module$build$src$core$tooltip,isVisible$$module$build$src$core$tooltip,getDiv$$module$build$src$core$tooltip,getTooltipOfObject$$module$build$src$core$tooltip,getTargetObject$$module$build$src$core$tooltip,createDom$$module$build$src$core$tooltip,bindMouseEvents$$module$build$src$core$tooltip,unbindMouseEvents$$module$build$src$core$tooltip,onMouseOver$$module$build$src$core$tooltip,onMouseOut$$module$build$src$core$tooltip,onMouseMove$$module$build$src$core$tooltip,
|
|
39
|
+
dispose$$module$build$src$core$tooltip,hide$$module$build$src$core$tooltip,block$$module$build$src$core$tooltip,unblock$$module$build$src$core$tooltip,renderContent$$module$build$src$core$tooltip,renderDefaultContent$$module$build$src$core$tooltip,getPosition$$module$build$src$core$tooltip,show$$module$build$src$core$tooltip,getHsvSaturation$$module$build$src$core$utils$colour,setHsvSaturation$$module$build$src$core$utils$colour,getHsvValue$$module$build$src$core$utils$colour,setHsvValue$$module$build$src$core$utils$colour,
|
|
40
|
+
parse$$module$build$src$core$utils$colour,rgbToHex$$module$build$src$core$utils$colour,hexToRgb$$module$build$src$core$utils$colour,hsvToHex$$module$build$src$core$utils$colour,blend$$module$build$src$core$utils$colour,hueToHex$$module$build$src$core$utils$colour,tokenizeInterpolationInternal$$module$build$src$core$utils$parsing,tokenizeInterpolation$$module$build$src$core$utils$parsing,replaceMessageReferences$$module$build$src$core$utils$parsing,checkMessageReferences$$module$build$src$core$utils$parsing,
|
|
41
|
+
parseBlockColour$$module$build$src$core$utils$parsing,getDiv$$module$build$src$core$widgetdiv,testOnly_setDiv$$module$build$src$core$widgetdiv,createDom$$module$build$src$core$widgetdiv,show$$module$build$src$core$widgetdiv,hide$$module$build$src$core$widgetdiv,isVisible$$module$build$src$core$widgetdiv,hideIfOwner$$module$build$src$core$widgetdiv,hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv,positionInternal$$module$build$src$core$widgetdiv,positionWithAnchor$$module$build$src$core$widgetdiv,
|
|
42
|
+
calculateX$$module$build$src$core$widgetdiv,calculateY$$module$build$src$core$widgetdiv,isRepositionable$$module$build$src$core$widgetdiv,repositionForWindowResize$$module$build$src$core$widgetdiv,getCurrentBlock$$module$build$src$core$contextmenu,setCurrentBlock$$module$build$src$core$contextmenu,show$$module$build$src$core$contextmenu,populate_$$module$build$src$core$contextmenu,position_$$module$build$src$core$contextmenu,createWidget_$$module$build$src$core$contextmenu,haltPropagation$$module$build$src$core$contextmenu,
|
|
43
|
+
hide$$module$build$src$core$contextmenu,dispose$$module$build$src$core$contextmenu,mouseToWorkspacePoint$$module$build$src$core$utils$drag,start$$module$build$src$core$utils$drag,move$$module$build$src$core$utils$drag,workspaceToDom$$module$build$src$core$xml,saveWorkspaceComment$$module$build$src$core$xml,variablesToDom$$module$build$src$core$xml,blockToDomWithXY$$module$build$src$core$xml,fieldToDom$$module$build$src$core$xml,allFieldsToDom$$module$build$src$core$xml,blockToDom$$module$build$src$core$xml,
|
|
44
|
+
cloneShadow$$module$build$src$core$xml,domToText$$module$build$src$core$xml,domToPrettyText$$module$build$src$core$xml,clearWorkspaceAndLoadFromXml$$module$build$src$core$xml,loadWorkspaceComment$$module$build$src$core$xml,appendDomToWorkspace$$module$build$src$core$xml,domToBlockInternal$$module$build$src$core$xml,domToVariables$$module$build$src$core$xml,mapSupportedXmlTags$$module$build$src$core$xml,applyMutationTagNodes$$module$build$src$core$xml,applyCommentTagNodes$$module$build$src$core$xml,
|
|
45
|
+
applyDataTagNodes$$module$build$src$core$xml,applyFieldTagNodes$$module$build$src$core$xml,findChildBlocks$$module$build$src$core$xml,applyInputTagNodes$$module$build$src$core$xml,applyNextTagNodes$$module$build$src$core$xml,domToBlockHeadless$$module$build$src$core$xml,domToField$$module$build$src$core$xml,deleteNext$$module$build$src$core$xml,isElement$$module$build$src$core$xml,register$$module$build$src$core$field_registry,unregister$$module$build$src$core$field_registry,fromJsonInternal$$module$build$src$core$field_registry,
|
|
46
|
+
isImageProperties$$module$build$src$core$field_dropdown,unregister$$module$build$src$core$extensions,isRegistered$$module$build$src$core$extensions,apply$$module$build$src$core$extensions,checkNoMutatorProperties$$module$build$src$core$extensions,checkXmlHooks$$module$build$src$core$extensions,checkJsonHooks$$module$build$src$core$extensions,checkMutatorDialog$$module$build$src$core$extensions,checkHasFunctionPair$$module$build$src$core$extensions,checkHasMutatorProperties$$module$build$src$core$extensions,
|
|
47
|
+
getMutatorProperties$$module$build$src$core$extensions,mutatorPropertiesMatch$$module$build$src$core$extensions,runAfterPageLoad$$module$build$src$core$extensions,checkDropdownOptionsInTable$$module$build$src$core$extensions,extensionParentTooltip$$module$build$src$core$extensions,point$$module$build$src$core$utils$svg_paths,curve$$module$build$src$core$utils$svg_paths,moveTo$$module$build$src$core$utils$svg_paths,moveBy$$module$build$src$core$utils$svg_paths,lineTo$$module$build$src$core$utils$svg_paths,
|
|
48
|
+
line$$module$build$src$core$utils$svg_paths,lineOnAxis$$module$build$src$core$utils$svg_paths,arc$$module$build$src$core$utils$svg_paths,connectReciprocally$$module$build$src$core$connection,getSingleConnection$$module$build$src$core$connection,getConnectionForOrphanedOutput$$module$build$src$core$connection,isIcon$$module$build$src$core$interfaces$i_icon,isCommentIcon$$module$build$src$core$interfaces$i_comment_icon,disposeUiEffect$$module$build$src$core$block_animations,disposeUiStep$$module$build$src$core$block_animations,
|
|
49
|
+
connectionUiEffect$$module$build$src$core$block_animations,disconnectUiEffect$$module$build$src$core$block_animations,disconnectUiStep$$module$build$src$core$block_animations,disconnectUiStop$$module$build$src$core$block_animations,moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster,blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster,blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster,bumpObjectIntoBounds$$module$build$src$core$bump_objects,bumpIntoBoundsHandler$$module$build$src$core$bump_objects,
|
|
50
|
+
extractObjectFromEvent$$module$build$src$core$bump_objects,bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects,isDeletable$$module$build$src$core$interfaces$i_deletable,getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy,navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy,navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy,isDraggable$$module$build$src$core$interfaces$i_draggable,isAutoHideable$$module$build$src$core$interfaces$i_autohideable,
|
|
51
|
+
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,procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,xmlFlyoutCategory$$module$build$src$core$procedures,internalFlyoutCategory$$module$build$src$core$procedures,
|
|
52
|
+
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,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,
|
|
52
53
|
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,internalFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategory$$module$build$src$core$variables_dynamic,xmlFlyoutCategory$$module$build$src$core$variables_dynamic,
|
|
53
|
-
flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,copyInternal$$module$build$src$core$clipboard,paste$$module$build$src$core$clipboard,pasteFromData$$module$build$src$core$clipboard,duplicateInternal$$module$build$src$core$clipboard,isCopyable$$module$build$src$core$interfaces$i_copyable,registerEscape$$module$build$src$core$shortcut_items,registerDelete$$module$build$src$core$shortcut_items,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,copyInternal$$module$build$src$core$clipboard,paste$$module$build$src$core$clipboard,pasteFromData$$module$build$src$core$clipboard,duplicateInternal$$module$build$src$core$clipboard,isCopyable$$module$build$src$core$interfaces$i_copyable,registerEscape$$module$build$src$core$shortcut_items,registerDelete$$module$build$src$core$shortcut_items,isCopyable$$module$build$src$core$shortcut_items,
|
|
55
|
+
isCuttable$$module$build$src$core$shortcut_items,registerCopy$$module$build$src$core$shortcut_items,registerCut$$module$build$src$core$shortcut_items,registerPaste$$module$build$src$core$shortcut_items,registerUndo$$module$build$src$core$shortcut_items,registerRedo$$module$build$src$core$shortcut_items,registerDefaultShortcuts$$module$build$src$core$shortcut_items,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,
|
|
56
|
+
load$$module$build$src$core$serialization$workspaces,inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,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,
|
|
57
|
+
registerCollapse$$module$build$src$core$contextmenu_items,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,
|
|
58
|
+
registerInline$$module$build$src$core$contextmenu_items,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,pixelsToWorkspaceCoords$$module$build$src$core$contextmenu_items,
|
|
59
|
+
registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,
|
|
60
|
+
$jscomp;
|
|
61
|
+
register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&"string"!==typeof a||""===`${a}`.trim())throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if("string"!==typeof b||""===b.trim())throw Error('Invalid name "'+b+'". The name must be a non-empty string.');const e=b.toLowerCase();if(!c)throw Error("Can not register a null value");let f=typeMap$$module$build$src$core$registry[a],g=
|
|
62
|
+
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};
|
|
61
63
|
validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if("function"!==typeof b.fromJson)throw Error('Type "'+a+'" must have a fromJson function');}};
|
|
62
64
|
unregister$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();const c=typeMap$$module$build$src$core$registry[a];c&&c[b]?(delete typeMap$$module$build$src$core$registry[a][b],delete nameMap$$module$build$src$core$registry[a][b]):console.warn("Unable to unregister ["+b+"]["+a+"] from the registry.")};
|
|
63
65
|
getItem$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();b=b.toLowerCase();const d=typeMap$$module$build$src$core$registry[a];if(!d||!d[b]){b="Unable to find ["+b+"]["+a+"] in the registry.";if(c)throw Error(b+" You must require or register a "+a+" plugin.");console.warn(b);return null}return d[b]};hasItem$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();return(a=typeMap$$module$build$src$core$registry[a])?!!a[b]:!1};
|
|
64
66
|
getClass$$module$build$src$core$registry=function(a,b,c){return getItem$$module$build$src$core$registry(a,b,c)};getObject$$module$build$src$core$registry=function(a,b,c){return getItem$$module$build$src$core$registry(a,b,c)};
|
|
65
67
|
getAllItems$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();var d=typeMap$$module$build$src$core$registry[a];if(!d){d=`Unable to find [${a}] in the registry.`;if(c)throw Error(`${d} You must require or register a ${a} plugin.`);console.warn(d);return null}if(!b)return d;a=nameMap$$module$build$src$core$registry[a];c=Object.create(null);for(const e of Object.keys(d))c[a[e]]=d[e];return c};
|
|
66
|
-
getClassFromOptions$$module$build$src$core$registry=function(a,b,c){b=b.plugins[String(a)]||DEFAULT$$module$build$src$core$registry;return"function"===typeof b?b:getClass$$module$build$src$core$registry(a,b,c)};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
getClassFromOptions$$module$build$src$core$registry=function(a,b,c){b=b.plugins[String(a)]||DEFAULT$$module$build$src$core$registry;return"function"===typeof b?b:getClass$$module$build$src$core$registry(a,b,c)};longStart$$module$build$src$core$touch=function(a,b){longStop$$module$build$src$core$touch();longPid_$$module$build$src$core$touch=setTimeout(function(){b&&b.handleRightClick(a)},LONGPRESS$$module$build$src$core$touch)};
|
|
69
|
+
longStop$$module$build$src$core$touch=function(){longPid_$$module$build$src$core$touch&&(clearTimeout(longPid_$$module$build$src$core$touch),longPid_$$module$build$src$core$touch=0)};clearTouchIdentifier$$module$build$src$core$touch=function(){touchIdentifier_$$module$build$src$core$touch=null};shouldHandleEvent$$module$build$src$core$touch=function(a){return!a.type.startsWith("pointer")||a instanceof PointerEvent&&checkTouchIdentifier$$module$build$src$core$touch(a)};
|
|
70
|
+
getTouchIdentifierFromEvent$$module$build$src$core$touch=function(a){return`${a.pointerId}`};checkTouchIdentifier$$module$build$src$core$touch=function(a){const b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);return touchIdentifier_$$module$build$src$core$touch?touchIdentifier_$$module$build$src$core$touch===b:"pointerdown"===a.type?(touchIdentifier_$$module$build$src$core$touch=b,!0):!1};
|
|
71
|
+
conditionalBind$$module$build$src$core$browser_events=function(a,b,c,d,e){function f(h){if(e||shouldHandleEvent$$module$build$src$core$touch(h))c?d.call(c,h):d(h)}const g=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let h=0;h<TOUCH_MAP$$module$build$src$core$touch[b].length;h++){const k=TOUCH_MAP$$module$build$src$core$touch[b][h];a.addEventListener(k,f,!1);g.push([a,k,f])}else a.addEventListener(b,f,!1),g.push([a,b,f]);return g};
|
|
72
|
+
bind$$module$build$src$core$browser_events=function(a,b,c,d){function e(g){c?d.call(c,g):d(g)}const f=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let g=0;g<TOUCH_MAP$$module$build$src$core$touch[b].length;g++){const h=TOUCH_MAP$$module$build$src$core$touch[b][g];a.addEventListener(h,e,!1);f.push([a,h,e])}else a.addEventListener(b,e,!1),f.push([a,b,e]);return f};
|
|
73
|
+
unbind$$module$build$src$core$browser_events=function(a){const b=a[a.length-1][2];for(;a.length;){const [c,d,e]=a.pop();c.removeEventListener(d,e,!1)}return b};
|
|
74
|
+
isTargetInput$$module$build$src$core$browser_events=function(a){if(a.target instanceof HTMLElement){if(a.target.isContentEditable||"true"===a.target.getAttribute("data-is-text-input"))return!0;if(a.target instanceof HTMLInputElement)return a=a.target,"text"===a.type||"number"===a.type||"email"===a.type||"password"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type;if(a.target instanceof HTMLTextAreaElement)return!0}return!1};
|
|
75
|
+
isRightButton$$module$build$src$core$browser_events=function(a){return a.ctrlKey&&MAC$$module$build$src$core$utils$useragent?!0:2===a.button};mouseToSvg$$module$build$src$core$browser_events=function(a,b,c){const d=b.createSVGPoint();d.x=a.clientX;d.y=a.clientY;c||(c=b.getScreenCTM().inverse());return d.matrixTransform(c)};
|
|
76
|
+
getScrollDeltaPixels$$module$build$src$core$browser_events=function(a){switch(a.deltaMode){default:return{x:a.deltaX,y:a.deltaY};case 1:return{x:a.deltaX*LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events,y:a.deltaY*LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events};case 2:return{x:a.deltaX*PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events,y:a.deltaY*PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events}}};
|
|
77
|
+
getNextUniqueId$$module$build$src$core$utils$idgenerator=function(){return"blockly-"+(nextId$$module$build$src$core$utils$idgenerator++).toString(36)};genUid$$module$build$src$core$utils$idgenerator=function(){return internal$$module$build$src$core$utils$idgenerator.genUid()};isBlockCreate$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BLOCK_CREATE};
|
|
78
|
+
isBlockDelete$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BLOCK_DELETE};isBlockChange$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BLOCK_CHANGE};isBlockFieldIntermediateChange$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE};
|
|
79
|
+
isBlockMove$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BLOCK_MOVE};isVarCreate$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.VAR_CREATE};isVarDelete$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.VAR_DELETE};isVarRename$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.VAR_RENAME};
|
|
80
|
+
isBlockDrag$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BLOCK_DRAG};isSelected$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.SELECTED};isClick$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.CLICK};isBubbleOpen$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.BUBBLE_OPEN};
|
|
81
|
+
isTrashcanOpen$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.TRASHCAN_OPEN};isToolboxItemSelect$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT};isThemeChange$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.THEME_CHANGE};
|
|
82
|
+
isViewportChange$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE};isCommentCreate$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_CREATE};isCommentDelete$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_DELETE};
|
|
83
|
+
isCommentChange$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_CHANGE};isCommentMove$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_MOVE};isCommentResize$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_RESIZE};
|
|
84
|
+
isCommentDrag$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_DRAG};isCommentCollapse$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE};isFinishedLoading$$module$build$src$core$events$predicates=function(a){return a.type===EventType$$module$build$src$core$events$type.FINISHED_LOADING};
|
|
85
|
+
$.setRecordUndo$$module$build$src$core$events$utils=function(a){recordUndo$$module$build$src$core$events$utils=a};getRecordUndo$$module$build$src$core$events$utils=function(){return recordUndo$$module$build$src$core$events$utils};fire$$module$build$src$core$events$utils=function(a){TEST_ONLY$$module$build$src$core$events$utils.fireInternal(a)};
|
|
86
|
+
fireInternal$$module$build$src$core$events$utils=function(a){if(isEnabled$$module$build$src$core$events$utils()){if(!FIRE_QUEUE$$module$build$src$core$events$utils.length)try{requestAnimationFrame(()=>{setTimeout(fireNow$$module$build$src$core$events$utils,0)})}catch(b){setTimeout(fireNow$$module$build$src$core$events$utils,0)}enqueueEvent$$module$build$src$core$events$utils(a)}};
|
|
76
87
|
fireNow$$module$build$src$core$events$utils=function(){const a=filter$$module$build$src$core$events$utils(FIRE_QUEUE$$module$build$src$core$events$utils);FIRE_QUEUE$$module$build$src$core$events$utils.length=0;for(const b of a){if(!b.workspaceId)continue;let c;null==(c=getWorkspaceById$$module$build$src$core$common(b.workspaceId))||c.fireChangeListener(b)}};
|
|
77
88
|
enqueueEvent$$module$build$src$core$events$utils=function(a){if(isBlockChange$$module$build$src$core$events$predicates(a)&&"mutation"===a.element){let b;for(b=FIRE_QUEUE$$module$build$src$core$events$utils.length;0<b;b--){const c=FIRE_QUEUE$$module$build$src$core$events$utils[b-1];if(c.group!==a.group||c.workspaceId!==a.workspaceId||!isBlockMove$$module$build$src$core$events$predicates(c)||c.newParentId!==a.blockId)break}FIRE_QUEUE$$module$build$src$core$events$utils.splice(b,0,a)}else FIRE_QUEUE$$module$build$src$core$events$utils.push(a)};
|
|
78
89
|
filter$$module$build$src$core$events$utils=function(a){const b=[];for(const c of a)if(a=b[b.length-1],!c.isNull())if(a&&a.workspaceId===c.workspaceId&&a.group===c.group)if(isBlockMove$$module$build$src$core$events$predicates(c)&&isBlockMove$$module$build$src$core$events$predicates(a)&&c.blockId===a.blockId){if(a.newParentId=c.newParentId,a.newInputName=c.newInputName,a.newCoordinate=c.newCoordinate,a.reason||c.reason){let d,e;a.reason=Array.from(new Set((null!=(d=a.reason)?d:[]).concat(null!=(e=c.reason)?
|
|
@@ -93,7 +104,8 @@ getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d
|
|
|
93
104
|
(canvasContext$$module$build$src$core$utils$dom.font=c+" "+b+" "+d,f=canvasContext$$module$build$src$core$utils$dom.measureText(e).width):f=0;cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[a]=f);return f};
|
|
94
105
|
measureFontMetrics$$module$build$src$core$utils$dom=function(a,b,c,d){const e=document.createElement("span");e.style.font=c+" "+b+" "+d;e.textContent=a;a=document.createElement("div");a.style.width="1px";a.style.height="0";b=document.createElement("div");b.style.display="flex";b.style.position="fixed";b.style.top="0";b.style.left="0";b.appendChild(e);b.appendChild(a);document.body.appendChild(b);c={height:0,baseline:0};try{b.style.alignItems="baseline",c.baseline=a.offsetTop-e.offsetTop,b.style.alignItems=
|
|
95
106
|
"flex-end",c.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(b)}return c};$.getFocusManager$$module$build$src$core$focus_manager=function(){return FocusManager$$module$build$src$core$focus_manager.getFocusManager()};isFocusableNode$$module$build$src$core$interfaces$i_focusable_node=function(a){return a&&"getFocusableElement"in a&&"getFocusableTree"in a&&"onNodeFocus"in a&&"onNodeBlur"in a&&"canBeFocused"in a};
|
|
96
|
-
isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return"string"===typeof a.id&&void 0!==a.workspace&&void 0!==a.select&&void 0!==a.unselect&&isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)};
|
|
107
|
+
isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return"string"===typeof a.id&&void 0!==a.workspace&&void 0!==a.select&&void 0!==a.unselect&&isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)};
|
|
108
|
+
deepMerge$$module$build$src$core$utils$object=function(a,b){for(const c in b)null!==b[c]&&Array.isArray(b[c])?a[c]=deepMerge$$module$build$src$core$utils$object(a[c]||[],b[c]):a[c]=null!==b[c]&&"object"===typeof b[c]?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};
|
|
97
109
|
getAllWorkspaces$$module$build$src$core$common=function(){const a=[];for(const b in WorkspaceDB_$$module$build$src$core$common)a.push(WorkspaceDB_$$module$build$src$core$common[b]);return a};registerWorkspace$$module$build$src$core$common=function(a){WorkspaceDB_$$module$build$src$core$common[a.id]=a};unregisterWorkpace$$module$build$src$core$common=function(a){delete WorkspaceDB_$$module$build$src$core$common[a.id]};getMainWorkspace$$module$build$src$core$common=function(){return mainWorkspace$$module$build$src$core$common};
|
|
98
110
|
setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a};getSelected$$module$build$src$core$common=function(){const a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();return a&&isSelectable$$module$build$src$core$interfaces$i_selectable(a)?a:null};setSelected$$module$build$src$core$common=function(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)};
|
|
99
111
|
fireSelectedEvent$$module$build$src$core$common=function(a){const b=getSelected$$module$build$src$core$common();let c,d,e,f;const g=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.SELECTED))(null!=(c=null==b?void 0:b.id)?c:null,null!=(d=null==a?void 0:a.id)?d:null,null!=(f=null!=(e=null==a?void 0:a.workspace.id)?e:null==b?void 0:b.workspace.id)?f:"");fire$$module$build$src$core$events$utils(g)};getParentContainer$$module$build$src$core$common=function(){return parentContainer$$module$build$src$core$common};
|
|
@@ -102,16 +114,9 @@ svgResize$$module$build$src$core$common=function(a){for(;a.options.parentWorkspa
|
|
|
102
114
|
getBlockTypeCounts$$module$build$src$core$common=function(a,b){const c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(let e=0,f;f=d[e];e++)c[f.type]?c[f.type]++:c[f.type]=1;return c};jsonInitFactory$$module$build$src$core$common=function(a){return function(){this.jsonInit(a)}};defineBlocksWithJsonArray$$module$build$src$core$common=function(a){TEST_ONLY$$module$build$src$core$common.defineBlocksWithJsonArrayInternal(a)};
|
|
103
115
|
defineBlocksWithJsonArrayInternal$$module$build$src$core$common=function(a){$.defineBlocks$$module$build$src$core$common($.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(a))};
|
|
104
116
|
$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(a){const b={};for(let c=0;c<a.length;c++){const d=a[c];if(!d){console.warn(`Block definition #${c} in JSON array is ${d}. Skipping`);continue}const e=d.type;e?b[e]={init:jsonInitFactory$$module$build$src$core$common(d)}:console.warn(`Block definition #${c} in JSON array is missing a type attribute. `+"Skipping.")}return b};
|
|
105
|
-
$.defineBlocks$$module$build$src$core$common=function(a){for(const b of Object.keys(a)){const c=a[b];b in Blocks$$module$build$src$core$blocks&&console.warn(`Block definition "${b}" overwrites previous definition.`);Blocks$$module$build$src$core$blocks[b]=c}};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
conditionalBind$$module$build$src$core$browser_events=function(a,b,c,d,e){function f(h){if(e||shouldHandleEvent$$module$build$src$core$touch(h))c?d.call(c,h):d(h)}const g=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let h=0;h<TOUCH_MAP$$module$build$src$core$touch[b].length;h++){const k=TOUCH_MAP$$module$build$src$core$touch[b][h];a.addEventListener(k,f,!1);g.push([a,k,f])}else a.addEventListener(b,f,!1),g.push([a,b,f]);return g};
|
|
109
|
-
bind$$module$build$src$core$browser_events=function(a,b,c,d){function e(g){c?d.call(c,g):d(g)}const f=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let g=0;g<TOUCH_MAP$$module$build$src$core$touch[b].length;g++){const h=TOUCH_MAP$$module$build$src$core$touch[b][g];a.addEventListener(h,e,!1);f.push([a,h,e])}else a.addEventListener(b,e,!1),f.push([a,b,e]);return f};
|
|
110
|
-
unbind$$module$build$src$core$browser_events=function(a){const b=a[a.length-1][2];for(;a.length;){const [c,d,e]=a.pop();c.removeEventListener(d,e,!1)}return b};
|
|
111
|
-
isTargetInput$$module$build$src$core$browser_events=function(a){if(a.target instanceof HTMLElement){if(a.target.isContentEditable||"true"===a.target.getAttribute("data-is-text-input"))return!0;if(a.target instanceof HTMLInputElement)return a=a.target,"text"===a.type||"number"===a.type||"email"===a.type||"password"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type;if(a.target instanceof HTMLTextAreaElement)return!0}return!1};
|
|
112
|
-
isRightButton$$module$build$src$core$browser_events=function(a){return a.ctrlKey&&MAC$$module$build$src$core$utils$useragent?!0:2===a.button};mouseToSvg$$module$build$src$core$browser_events=function(a,b,c){const d=b.createSVGPoint();d.x=a.clientX;d.y=a.clientY;c||(c=b.getScreenCTM().inverse());return d.matrixTransform(c)};
|
|
113
|
-
getScrollDeltaPixels$$module$build$src$core$browser_events=function(a){switch(a.deltaMode){default:return{x:a.deltaX,y:a.deltaY};case 1:return{x:a.deltaX*LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events,y:a.deltaY*LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events};case 2:return{x:a.deltaX*PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events,y:a.deltaY*PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events}}};
|
|
114
|
-
removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(-1===b)return!1;a.splice(b,1);return!0};register$$module$build$src$core$css=function(a){if(injected$$module$build$src$core$css)throw Error("CSS already injected");content$$module$build$src$core$css+="\n"+a};
|
|
117
|
+
$.defineBlocks$$module$build$src$core$common=function(a){for(const b of Object.keys(a)){const c=a[b];b in Blocks$$module$build$src$core$blocks&&console.warn(`Block definition "${b}" overwrites previous definition.`);Blocks$$module$build$src$core$blocks[b]=c}};
|
|
118
|
+
globalShortcutHandler$$module$build$src$core$common=function(a){const b=getMainWorkspace$$module$build$src$core$common();if(b&&!(isTargetInput$$module$build$src$core$browser_events(a)||b.rendered&&!b.isVisible()))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.onKeyDown(b,a)};removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(-1===b)return!1;a.splice(b,1);return!0};
|
|
119
|
+
register$$module$build$src$core$css=function(a){if(injected$$module$build$src$core$css)throw Error("CSS already injected");content$$module$build$src$core$css+="\n"+a};
|
|
115
120
|
inject$$module$build$src$core$css=function(a,b){injected$$module$build$src$core$css||(injected$$module$build$src$core$css=!0,a&&(a=b.replace(/[\\/]$/,""),b=content$$module$build$src$core$css.replace(/<<<PATH>>>/g,a),content$$module$build$src$core$css="",a=document.createElement("style"),a.id="blockly-common-style",b=document.createTextNode(b),a.appendChild(b),document.head.insertBefore(a,document.head.firstChild)))};getSize$$module$build$src$core$utils$style=function(a){return TEST_ONLY$$module$build$src$core$utils$style.getSizeInternal(a)};
|
|
116
121
|
getSizeInternal$$module$build$src$core$utils$style=function(a){if("none"!==getComputedStyle$$module$build$src$core$utils$style(a,"display"))return getSizeWithDisplay$$module$build$src$core$utils$style(a);const b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";const f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new Size$$module$build$src$core$utils$size(f,a)};
|
|
117
122
|
getSizeWithDisplay$$module$build$src$core$utils$style=function(a){return new Size$$module$build$src$core$utils$size(a.offsetWidth,a.offsetHeight)};getComputedStyle$$module$build$src$core$utils$style=function(a,b){a=window.getComputedStyle(a);return a[b]||a.getPropertyValue(b)};
|
|
@@ -215,10 +220,11 @@ loadNextBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.ne
|
|
|
215
220
|
initBlock$$module$build$src$core$serialization$blocks=function(a,b){if(b){a.setConnectionTracking(!1);a.initSvg();a.queueRender();for(const c of a.getIcons())c.onLocationChange(a.getRelativeToSurfaceXY())}else a.initModel()};hasBubble$$module$build$src$core$interfaces$i_has_bubble=function(a){return void 0!==a.bubbleIsVisible&&void 0!==a.setBubbleVisible};toRadians$$module$build$src$core$utils$math=function(a){return a*Math.PI/180};
|
|
216
221
|
toDegrees$$module$build$src$core$utils$math=function(a){return 180*a/Math.PI};clamp$$module$build$src$core$utils$math=function(a,b,c){if(c<a){const d=c;c=a;a=d}return Math.max(a,Math.min(b,c))};
|
|
217
222
|
createDom$$module$build$src$core$dropdowndiv=function(){document.querySelector(".blocklyDropDownDiv")||(div$$module$build$src$core$dropdowndiv=document.createElement("div"),div$$module$build$src$core$dropdowndiv.className="blocklyDropDownDiv",div$$module$build$src$core$dropdowndiv.tabIndex=-1,(getParentContainer$$module$build$src$core$common()||document.body).appendChild(div$$module$build$src$core$dropdowndiv),content$$module$build$src$core$dropdowndiv=document.createElement("div"),content$$module$build$src$core$dropdowndiv.className=
|
|
218
|
-
"blocklyDropDownContent",div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$core$dropdowndiv),
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
223
|
+
"blocklyDropDownContent",div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$core$dropdowndiv),keydownListener$$module$build$src$core$dropdowndiv=conditionalBind$$module$build$src$core$browser_events(content$$module$build$src$core$dropdowndiv,"keydown",null,globalShortcutHandler$$module$build$src$core$common),arrow$$module$build$src$core$dropdowndiv=document.createElement("div"),arrow$$module$build$src$core$dropdowndiv.className="blocklyDropDownArrow",div$$module$build$src$core$dropdowndiv.appendChild(arrow$$module$build$src$core$dropdowndiv),
|
|
224
|
+
div$$module$build$src$core$dropdowndiv.style.opacity="0",div$$module$build$src$core$dropdowndiv.style.transition="transform "+ANIMATION_TIME$$module$build$src$core$dropdowndiv+"s, opacity "+ANIMATION_TIME$$module$build$src$core$dropdowndiv+"s")};setBoundsElement$$module$build$src$core$dropdowndiv=function(a){boundsElement$$module$build$src$core$dropdowndiv=a};getOwner$$module$build$src$core$dropdowndiv=function(){return owner$$module$build$src$core$dropdowndiv};
|
|
225
|
+
getContentDiv$$module$build$src$core$dropdowndiv=function(){return content$$module$build$src$core$dropdowndiv};clearContent$$module$build$src$core$dropdowndiv=function(){keydownListener$$module$build$src$core$dropdowndiv&&(unbind$$module$build$src$core$browser_events(keydownListener$$module$build$src$core$dropdowndiv),keydownListener$$module$build$src$core$dropdowndiv=null);div$$module$build$src$core$dropdowndiv.remove();createDom$$module$build$src$core$dropdowndiv()};
|
|
226
|
+
setColour$$module$build$src$core$dropdowndiv=function(a,b){div$$module$build$src$core$dropdowndiv.style.backgroundColor=a;div$$module$build$src$core$dropdowndiv.style.borderColor=b};showPositionedByBlock$$module$build$src$core$dropdowndiv=function(a,b,c,d,e=!0){return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfBlock$$module$build$src$core$dropdowndiv(b),a,e,c,d)};
|
|
227
|
+
showPositionedByField$$module$build$src$core$dropdowndiv=function(a,b,c,d=!0){positionToField$$module$build$src$core$dropdowndiv=!0;return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfField$$module$build$src$core$dropdowndiv(a),a,d,b,c)};
|
|
222
228
|
getScaledBboxOfBlock$$module$build$src$core$dropdowndiv=function(a){var b=a.getSvgRoot();const c=a.workspace.scale,d=a.height*c;a=a.width*c;b=getPageOffset$$module$build$src$core$utils$style(b);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)};getScaledBboxOfField$$module$build$src$core$dropdowndiv=function(a){a=a.getScaledBBox();return new Rect$$module$build$src$core$utils$rect(a.top,a.bottom,a.left,a.right)};
|
|
223
229
|
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e){const f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;e&&(a+=e);e=b.getSourceBlock();let h=e.workspace;for(;h.options.parentWorkspace;)h=h.options.parentWorkspace;setBoundsElement$$module$build$src$core$dropdowndiv(h.getParentSvg().parentNode);return show$$module$build$src$core$dropdowndiv(b,e.RTL,f,g,f,a,c,d)};
|
|
224
230
|
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=h||null;div$$module$build$src$core$dropdowndiv.style.direction=b?"rtl":"ltr";a=getMainWorkspace$$module$build$src$core$common();renderedClassName$$module$build$src$core$dropdowndiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$dropdowndiv=a.getTheme().getClassName();addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,
|
|
@@ -271,8 +277,8 @@ replaceMessageReferences$$module$build$src$core$utils$parsing=function(a){if("st
|
|
|
271
277
|
checkMessageReferences$$module$build$src$core$utils$parsing=function(a){let b=!0;const c=$.Msg$$module$build$src$core$msg,d=a.match(/%{BKY_[A-Z]\w*}/gi);if(d)for(let e=0;e<d.length;e++){const f=d[e].toUpperCase();void 0===c[f.slice(6,-1)]&&(console.warn("No message string for "+d[e]+" in "+a),b=!1)}return b};
|
|
272
278
|
parseBlockColour$$module$build$src$core$utils$parsing=function(a){const b="string"===typeof a?replaceMessageReferences$$module$build$src$core$utils$parsing(a):a;var c=Number(b);if(!isNaN(c)&&0<=c&&360>=c)return{hue:c,hex:hsvToHex$$module$build$src$core$utils$colour(c,getHsvSaturation$$module$build$src$core$utils$colour(),255*getHsvValue$$module$build$src$core$utils$colour())};if(c=parse$$module$build$src$core$utils$colour(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!==b&&(c+=' (from "'+
|
|
273
279
|
a+'")');throw Error(c);};getDiv$$module$build$src$core$widgetdiv=function(){return containerDiv$$module$build$src$core$widgetdiv};testOnly_setDiv$$module$build$src$core$widgetdiv=function(a){containerDiv$$module$build$src$core$widgetdiv=a;if(null===a){let b;null==(b=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv))||b.remove()}};
|
|
274
|
-
createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body
|
|
275
|
-
containerDiv$$module$build$src$core$widgetdiv
|
|
280
|
+
createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body,b=document.querySelector("div."+containerClassName$$module$build$src$core$widgetdiv);b?containerDiv$$module$build$src$core$widgetdiv=b:(containerDiv$$module$build$src$core$widgetdiv=document.createElement("div"),containerDiv$$module$build$src$core$widgetdiv.className=containerClassName$$module$build$src$core$widgetdiv,containerDiv$$module$build$src$core$widgetdiv.tabIndex=
|
|
281
|
+
-1);conditionalBind$$module$build$src$core$browser_events(containerDiv$$module$build$src$core$widgetdiv,"keydown",null,globalShortcutHandler$$module$build$src$core$common);a.appendChild(containerDiv$$module$build$src$core$widgetdiv)};
|
|
276
282
|
show$$module$build$src$core$widgetdiv=function(a,b,c,d,e=!0){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let h;d=null==(h=a.getSourceBlock())?void 0:h.workspace}var f;ownerWorkspace$$module$build$src$core$widgetdiv=null!=(f=d)?f:null;var g;a=null!=(g=d)?g:getMainWorkspace$$module$build$src$core$common();
|
|
277
283
|
rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);e&&(returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
278
284
|
$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c))}};
|
|
@@ -335,7 +341,6 @@ deleteNext$$module$build$src$core$xml=function(a){for(let b=0;b<a.childNodes.len
|
|
|
335
341
|
unregister$$module$build$src$core$field_registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a)};$.fromJson$$module$build$src$core$field_registry=function(a){return TEST_ONLY$$module$build$src$core$field_registry.fromJsonInternal(a)};
|
|
336
342
|
fromJsonInternal$$module$build$src$core$field_registry=function(a){const b=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a.type);return b?b.fromJson(a):(console.warn("Blockly could not create a field of type "+a.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)};
|
|
337
343
|
isImageProperties$$module$build$src$core$field_dropdown=function(a){return a&&"object"===typeof a&&"src"in a&&"string"===typeof a.src&&"alt"in a&&"string"===typeof a.alt&&"width"in a&&"number"===typeof a.width&&"height"in a&&"number"===typeof a.height};
|
|
338
|
-
deepMerge$$module$build$src$core$utils$object=function(a,b){for(const c in b)null!==b[c]&&Array.isArray(b[c])?a[c]=deepMerge$$module$build$src$core$utils$object(a[c]||[],b[c]):a[c]=null!==b[c]&&"object"===typeof b[c]?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a};
|
|
339
344
|
$.register$$module$build$src$core$extensions=function(a,b){if("string"!==typeof a||""===a.trim())throw Error('Error: Invalid extension name "'+a+'"');if(allExtensions$$module$build$src$core$extensions[a])throw Error('Error: Extension "'+a+'" is already registered.');if("function"!==typeof b)throw Error('Error: Extension "'+a+'" must be a function');allExtensions$$module$build$src$core$extensions[a]=b};
|
|
340
345
|
$.registerMixin$$module$build$src$core$extensions=function(a,b){if(!b||"object"!==typeof b)throw Error('Error: Mixin "'+a+'" must be a object');$.register$$module$build$src$core$extensions(a,function(){this.mixin(b)})};
|
|
341
346
|
$.registerMutator$$module$build$src$core$extensions=function(a,b,c,d){const e='Error when registering mutator "'+a+'": ';checkHasMutatorProperties$$module$build$src$core$extensions(e,b);const f=checkMutatorDialog$$module$build$src$core$extensions(b,e);if(c&&"function"!==typeof c)throw Error(e+'Extension "'+a+'" is not a function');$.register$$module$build$src$core$extensions(a,function(){f&&this.setMutator(new $.MutatorIcon$$module$build$src$core$icons$mutator_icon(d||[],this));this.mixin(b);c&&c.apply(this)})};
|
|
@@ -372,6 +377,9 @@ bumpIntoBoundsHandler$$module$build$src$core$bump_objects=function(a){return b=>
|
|
|
372
377
|
d,e)&&!b.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),$.setGroup$$module$build$src$core$events$utils(c))}else isViewportChange$$module$build$src$core$events$predicates(b)&&b.scale&&b.oldScale&&b.scale>b.oldScale&&bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)}}};
|
|
373
378
|
extractObjectFromEvent$$module$build$src$core$bump_objects=function(a,b){let c=null;switch(b.type){case EventType$$module$build$src$core$events$type.BLOCK_CREATE:case EventType$$module$build$src$core$events$type.BLOCK_MOVE:(c=a.getBlockById(b.blockId))&&(c=c.getRootBlock());break;case EventType$$module$build$src$core$events$type.COMMENT_CREATE:case EventType$$module$build$src$core$events$type.COMMENT_MOVE:case EventType$$module$build$src$core$events$type.COMMENT_RESIZE:c=a.getCommentById(b.commentId)}return c};
|
|
374
379
|
bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);var c=a.getTopBoundedElements();for(let d=0,e;e=c[d];d++)bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,b,e)}};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return void 0!==a.isDeletable&&void 0!==a.dispose&&void 0!==a.setDeleteStyle};
|
|
380
|
+
getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a){const b=a.getIcons();for(const c of a.inputList){if(!c.isVisible())continue;b.push(...c.fieldRow);let d;if(null==(d=c.connection)?0:d.targetBlock())b.push(c.connection.targetBlock());else{let e;(null==(e=c.connection)?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&b.push(c.connection)}}return b};
|
|
381
|
+
navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){const c=a.workspace.getTopBlocks(!0);a=c.indexOf(a.getRootBlock())+b;let d=null;0<=a&&a<c.length?d=c[a]:0>a?d=c[c.length-1]:a>=c.length&&(d=c[0]);if(0>b&&d){let e,f;return null!=(f=null==(e=d.lastConnectionInStack(!1))?void 0:e.getSourceBlock())?f:d}return d};
|
|
382
|
+
navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){var c=a instanceof BlockSvg$$module$build$src$core$block_svg?a.outputConnection.targetBlock():a.getSourceBlock();if(!(c instanceof BlockSvg$$module$build$src$core$block_svg))return null;c=getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(c);a=c.indexOf(a);if(-1===a)return null;b=a+b;return 0<=b&&b<c.length?c[b]:null};
|
|
375
383
|
isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return void 0!==a.getRelativeToSurfaceXY&&void 0!==a.isMovable&&void 0!==a.startDrag&&void 0!==a.drag&&void 0!==a.endDrag&&void 0!==a.revertDrag};isAutoHideable$$module$build$src$core$interfaces$i_autohideable=function(a){return void 0!==a.autoHide};register$$module$build$src$core$icons$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a.toString(),b)};
|
|
376
384
|
unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)};isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return void 0!==a.getProcedureModel&&void 0!==a.doProcedureUpdate&&void 0!==a.isProcedureDef};isObservable$$module$build$src$core$interfaces$i_observable=function(a){return void 0!==a.startPublishing&&void 0!==a.stopPublishing};
|
|
377
385
|
allProcedures$$module$build$src$core$procedures=function(a){const b=a.getProcedureMap().getProcedures().filter(d=>!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!1]);a.getBlocksByType("procedures_defnoreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&b.push(d.getProcedureDef())});const c=a.getProcedureMap().getProcedures().filter(d=>
|
|
@@ -413,32 +421,33 @@ copyInternal$$module$build$src$core$clipboard=function(a){const b=a.toCopyData()
|
|
|
413
421
|
paste$$module$build$src$core$clipboard=function(a,b,c){return a&&b?pasteFromData$$module$build$src$core$clipboard(a,b,c):stashedCopyData$$module$build$src$core$clipboard&&stashedWorkspace$$module$build$src$core$clipboard?pasteFromData$$module$build$src$core$clipboard(stashedCopyData$$module$build$src$core$clipboard,stashedWorkspace$$module$build$src$core$clipboard):null};
|
|
414
422
|
pasteFromData$$module$build$src$core$clipboard=function(a,b,c){let d;b=b.isMutator?b:null!=(d=b.getRootWorkspace())?d:b;let e,f;return null!=(f=null==(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a.paster,!1))?void 0:e.paste(a,b,c))?f:null};duplicateInternal$$module$build$src$core$clipboard=function(a){const b=a.toCopyData();return b?paste$$module$build$src$core$clipboard(b,a.workspace):null};
|
|
415
423
|
isCopyable$$module$build$src$core$interfaces$i_copyable=function(a){return void 0!==a.toCopyData};registerEscape$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.ESCAPE,preconditionFn(a){return!a.isReadOnly()},callback(a){a.hideChaff();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ESC]})};
|
|
416
|
-
registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;return!a.isReadOnly()&&null!=b&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!Gesture$$module$build$src$core$gesture.inProgress()},callback(a,b,c,d){b.preventDefault();
|
|
417
|
-
a.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),a.dispose(),$.setGroup$$module$build$src$core$events$utils(!1));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE]})};
|
|
424
|
+
registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;return!a.isReadOnly()&&null!=b&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!Gesture$$module$build$src$core$gesture.inProgress()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(a,b,c,d){b.preventDefault();
|
|
425
|
+
a=d.focusedNode;a instanceof BlockSvg$$module$build$src$core$block_svg?a.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),a.dispose(),$.setGroup$$module$build$src$core$events$utils(!1));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE]})};
|
|
426
|
+
isCopyable$$module$build$src$core$shortcut_items=function(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isOwnDeletable()&&isDraggable$$module$build$src$core$interfaces$i_draggable(a)&&a.isOwnMovable():!1};
|
|
427
|
+
isCuttable$$module$build$src$core$shortcut_items=function(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()&&isDraggable$$module$build$src$core$interfaces$i_draggable(a)&&a.isMovable():!1};
|
|
418
428
|
registerCopy$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.COPY,
|
|
419
|
-
preconditionFn(c,d){d=d.focusedNode;
|
|
420
|
-
d.
|
|
429
|
+
preconditionFn(c,d){d=d.focusedNode;if(!(d instanceof BlockSvg$$module$build$src$core$block_svg))return!1;c=c.isFlyout?c.targetWorkspace:c;return!!d&&!!c&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&isCopyable$$module$build$src$core$shortcut_items(d)},callback(c,d,e,f){d.preventDefault();d=f.focusedNode;if(!d||!isCopyable$$module$build$src$core$shortcut_items(d))return!1;c=d.workspace instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?
|
|
430
|
+
d.workspace:c;c=c.isFlyout?c.targetWorkspace:c;if(!c)return!1;d.workspace.isFlyout||c.hideChaff();copyData$$module$build$src$core$shortcut_items=d.toCopyData();copyWorkspace$$module$build$src$core$shortcut_items=c;copyCoords$$module$build$src$core$shortcut_items=isDraggable$$module$build$src$core$interfaces$i_draggable(d)&&d.workspace==c?d.getRelativeToSurfaceXY():null;return!!copyData$$module$build$src$core$shortcut_items},keyCodes:[a,b]})};
|
|
421
431
|
registerCut$$module$build$src$core$shortcut_items=function(){const 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.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CUT,
|
|
422
|
-
preconditionFn(c,d){d=d.focusedNode;return
|
|
423
|
-
d.
|
|
424
|
-
d.getRelativeToSurfaceXY():null,d.dispose(),!0):!1},keyCodes:[a,b]})};
|
|
432
|
+
preconditionFn(c,d){d=d.focusedNode;return!!d&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&isCuttable$$module$build$src$core$shortcut_items(d)},callback(c,d,e,f){d=f.focusedNode;return d instanceof BlockSvg$$module$build$src$core$block_svg?(copyData$$module$build$src$core$shortcut_items=d.toCopyData(),copyWorkspace$$module$build$src$core$shortcut_items=c,copyCoords$$module$build$src$core$shortcut_items=d.getRelativeToSurfaceXY(),
|
|
433
|
+
d.checkAndDelete(),!0):isDeletable$$module$build$src$core$interfaces$i_deletable(d)&&d.isDeletable()&&isCopyable$$module$build$src$core$interfaces$i_copyable(d)?(copyData$$module$build$src$core$shortcut_items=d.toCopyData(),copyWorkspace$$module$build$src$core$shortcut_items=c,copyCoords$$module$build$src$core$shortcut_items=isDraggable$$module$build$src$core$interfaces$i_draggable(d)?d.getRelativeToSurfaceXY():null,d.dispose(),!0):!1},keyCodes:[a,b]})};
|
|
425
434
|
registerPaste$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PASTE,
|
|
426
|
-
preconditionFn(c){return
|
|
427
|
-
|
|
428
|
-
g)
|
|
435
|
+
preconditionFn(c){c=c.isFlyout?c.targetWorkspace:c;return!!copyData$$module$build$src$core$shortcut_items&&!!c&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){if(!copyData$$module$build$src$core$shortcut_items||!copyWorkspace$$module$build$src$core$shortcut_items)return!1;if(d instanceof PointerEvent)return c=screenToWsCoordinates$$module$build$src$core$utils$svg_math(copyWorkspace$$module$build$src$core$shortcut_items,
|
|
436
|
+
new Coordinate$$module$build$src$core$utils$coordinate(d.clientX,d.clientY)),!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,copyWorkspace$$module$build$src$core$shortcut_items,c);if(!copyCoords$$module$build$src$core$shortcut_items)return!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,copyWorkspace$$module$build$src$core$shortcut_items);const {left:e,top:f,width:g,height:h}=copyWorkspace$$module$build$src$core$shortcut_items.getMetricsManager().getViewMetrics(!0);
|
|
437
|
+
if((new Rect$$module$build$src$core$utils$rect(f,f+h,e,e+g)).contains(copyCoords$$module$build$src$core$shortcut_items.x,copyCoords$$module$build$src$core$shortcut_items.y))return!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,copyWorkspace$$module$build$src$core$shortcut_items);c=new Coordinate$$module$build$src$core$utils$coordinate(e+g/2,f+h/2);return!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,copyWorkspace$$module$build$src$core$shortcut_items,
|
|
438
|
+
c)},keyCodes:[a,b]})};
|
|
429
439
|
registerUndo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.UNDO,preconditionFn(c){return!c.isReadOnly()&&
|
|
430
|
-
!Gesture$$module$build$src$core$gesture.inProgress()},callback(c,d){c.hideChaff();c.undo(!1);d.preventDefault();return!0},keyCodes:[a,b]})};
|
|
440
|
+
!Gesture$$module$build$src$core$gesture.inProgress()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){c.hideChaff();c.undo(!1);d.preventDefault();return!0},keyCodes:[a,b]})};
|
|
431
441
|
registerRedo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT,KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT,
|
|
432
|
-
KeyCodes$$module$build$src$core$utils$keycodes.META]),c=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Y,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.REDO,preconditionFn(d){return!Gesture$$module$build$src$core$gesture.inProgress()&&!d.isReadOnly()
|
|
433
|
-
d.undo(!0);e.preventDefault();return!0},keyCodes:[a,b,c]})};registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){registerEscape$$module$build$src$core$shortcut_items();registerDelete$$module$build$src$core$shortcut_items();registerCopy$$module$build$src$core$shortcut_items();registerCut$$module$build$src$core$shortcut_items();registerPaste$$module$build$src$core$shortcut_items();registerUndo$$module$build$src$core$shortcut_items();registerRedo$$module$build$src$core$shortcut_items()};
|
|
442
|
+
KeyCodes$$module$build$src$core$utils$keycodes.META]),c=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Y,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.REDO,preconditionFn(d){return!Gesture$$module$build$src$core$gesture.inProgress()&&!d.isReadOnly()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},
|
|
443
|
+
callback(d,e){d.hideChaff();d.undo(!0);e.preventDefault();return!0},keyCodes:[a,b,c]})};registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){registerEscape$$module$build$src$core$shortcut_items();registerDelete$$module$build$src$core$shortcut_items();registerCopy$$module$build$src$core$shortcut_items();registerCut$$module$build$src$core$shortcut_items();registerPaste$$module$build$src$core$shortcut_items();registerUndo$$module$build$src$core$shortcut_items();registerRedo$$module$build$src$core$shortcut_items()};
|
|
434
444
|
saveProcedure$$module$build$src$core$serialization$procedures=function(a){const b=a.saveState();if(!a.getParameters().length)return b;b.parameters=a.getParameters().map(c=>c.saveState());return b};loadProcedure$$module$build$src$core$serialization$procedures=function(a,b,c,d){a=a.loadState(c,d);if(!c.parameters)return a;for(const [e,f]of c.parameters.entries())a.insertParameter(b.loadState(f,d),e);return a};
|
|
435
445
|
save$$module$build$src$core$serialization$workspaces=function(a){const b=Object.create(null),c=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);for(const d in c){let e;const f=null==(e=c[d])?void 0:e.save(a);f&&(b[d]=f)}return b};
|
|
436
446
|
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();
|
|
437
447
|
b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!1);for(const [,f]of d.reverse()){let g;null==(g=f)||g.clear(b)}for(const [f,g]of d.reverse())if(a[f]){let h;null==(h=g)||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));
|
|
438
448
|
$.setGroup$$module$build$src$core$events$utils(c);$.setRecordUndo$$module$build$src$core$events$utils(e)}};
|
|
439
449
|
inject$$module$build$src$core$inject=function(a,b){let c=null;c="string"===typeof a?document.getElementById(a)||document.querySelector(a):a;var d;if(!document.contains(c)&&document!==(null==(d=c)?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");(null==b?0:b.rtl)&&addClass$$module$build$src$core$utils$dom(d,"blocklyRTL");c.appendChild(d);
|
|
440
|
-
b=createDom$$module$build$src$core$inject(d,a);const 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,
|
|
441
|
-
"keydown",null,onKeyDown$$module$build$src$core$inject);(b=getDiv$$module$build$src$core$widgetdiv())&&conditionalBind$$module$build$src$core$browser_events(b,"keydown",null,onKeyDown$$module$build$src$core$inject);return e};
|
|
450
|
+
b=createDom$$module$build$src$core$inject(d,a);const 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);return e};
|
|
442
451
|
createDom$$module$build$src$core$inject=function(a,b){a.setAttribute("dir","LTR");inject$$module$build$src$core$css(b.hasCss,b.pathToMedia);const c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{xmlns:SVG_NS$$module$build$src$core$utils$dom,"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1","class":"blocklySvg"},a),d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.DEFS,
|
|
443
452
|
{},c),e=String(Math.random()).substring(2);b.gridPattern=Grid$$module$build$src$core$grid.createDom(e,b.gridOptions,d,a);return c};
|
|
444
453
|
createMainWorkspace$$module$build$src$core$inject=function(a,b,c){c.parentWorkspace=null;c=new WorkspaceSvg$$module$build$src$core$workspace_svg(c);const d=c.options;c.scale=d.zoomOptions.startScale;b.appendChild(c.createDom("blocklyMainBackground",a));var e=c.getRenderer().getClassName();e&&addClass$$module$build$src$core$utils$dom(a,e);(e=c.getTheme().getClassName())&&addClass$$module$build$src$core$utils$dom(a,e);!d.hasCategories&&d.languageTree&&(a=c.addFlyout(Svg$$module$build$src$core$utils$svg.SVG),
|
|
@@ -446,7 +455,6 @@ insertAfter$$module$build$src$core$utils$dom(a,b));d.hasTrashcan&&c.addTrashcan(
|
|
|
446
455
|
init$$module$build$src$core$inject=function(a){const b=a.options;var c=a.getParentSvg();conditionalBind$$module$build$src$core$browser_events(c.parentNode,"contextmenu",null,function(d){isTargetInput$$module$build$src$core$browser_events(d)||d.preventDefault()});c=conditionalBind$$module$build$src$core$browser_events(window,"resize",null,function(){hide$$module$build$src$core$tooltip();a.hideComponents(!0);repositionForWindowResize$$module$build$src$core$dropdowndiv();repositionForWindowResize$$module$build$src$core$widgetdiv();
|
|
447
456
|
svgResize$$module$build$src$core$common(a);bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)});a.setResizeHandlerWrapper(c);bindDocumentEvents$$module$build$src$core$inject();if(b.languageTree){c=a.getToolbox();const d=a.getFlyout(!0);c?c.init():d&&(d.init(a),d.show(b.languageTree),"function"===typeof d.scrollToStart&&d.scrollToStart())}b.hasTrashcan&&a.trashcan.init();b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init();b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=
|
|
448
457
|
new ScrollbarPair$$module$build$src$core$scrollbar_pair(a,!0===b.moveOptions.scrollbars||!!b.moveOptions.scrollbars.horizontal,!0===b.moveOptions.scrollbars||!!b.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),a.scrollbar.resize()):a.setMetrics({x:.5,y:.5});b.hasSounds&&loadSounds$$module$build$src$core$inject(b.pathToMedia,a)};
|
|
449
|
-
onKeyDown$$module$build$src$core$inject=function(a){const b=getMainWorkspace$$module$build$src$core$common();if(b&&!(isTargetInput$$module$build$src$core$browser_events(a)||b.rendered&&!b.isVisible()))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.onKeyDown(b,a)};
|
|
450
458
|
bindDocumentEvents$$module$build$src$core$inject=function(){documentEventsBound$$module$build$src$core$inject||(conditionalBind$$module$build$src$core$browser_events(document,"scroll",null,function(){const a=getAllWorkspaces$$module$build$src$core$common();for(let b=0,c;c=a[b];b++)c instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&c.updateInverseScreenCTM()}),bind$$module$build$src$core$browser_events(document,"touchend",null,longStop$$module$build$src$core$touch),bind$$module$build$src$core$browser_events(document,
|
|
451
459
|
"touchcancel",null,longStop$$module$build$src$core$touch));documentEventsBound$$module$build$src$core$inject=!0};
|
|
452
460
|
loadSounds$$module$build$src$core$inject=function(a,b){function c(){for(;e.length;){const f=e.pop();f&&unbind$$module$build$src$core$browser_events(f)}d.preload()}const d=b.getAudioManager();d.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");d.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");d.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");const e=[];e.push(conditionalBind$$module$build$src$core$browser_events(document,"pointermove",null,c,!0));
|
|
@@ -521,7 +529,16 @@ Type$$module$build$src$core$registry.RENDERER=new Type$$module$build$src$core$re
|
|
|
521
529
|
Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX=new Type$$module$build$src$core$registry("flyoutsHorizontalToolbox");Type$$module$build$src$core$registry.FLYOUT_INFLATER=new Type$$module$build$src$core$registry("flyoutInflater");Type$$module$build$src$core$registry.METRICS_MANAGER=new Type$$module$build$src$core$registry("metricsManager");Type$$module$build$src$core$registry.BLOCK_DRAGGER=new Type$$module$build$src$core$registry("blockDragger");
|
|
522
530
|
Type$$module$build$src$core$registry.SERIALIZER=new Type$$module$build$src$core$registry("serializer");Type$$module$build$src$core$registry.ICON=new Type$$module$build$src$core$registry("icon");Type$$module$build$src$core$registry.PASTER=new Type$$module$build$src$core$registry("paster");Type$$module$build$src$core$registry.VARIABLE_MODEL=new Type$$module$build$src$core$registry("variableModel");Type$$module$build$src$core$registry.VARIABLE_MAP=new Type$$module$build$src$core$registry("variableMap");
|
|
523
531
|
var module$build$src$core$registry={DEFAULT:DEFAULT$$module$build$src$core$registry,TEST_ONLY:TEST_ONLY$$module$build$src$core$registry};module$build$src$core$registry.Type=Type$$module$build$src$core$registry;module$build$src$core$registry.getAllItems=getAllItems$$module$build$src$core$registry;module$build$src$core$registry.getClass=getClass$$module$build$src$core$registry;module$build$src$core$registry.getClassFromOptions=getClassFromOptions$$module$build$src$core$registry;
|
|
524
|
-
module$build$src$core$registry.getObject=getObject$$module$build$src$core$registry;module$build$src$core$registry.hasItem=hasItem$$module$build$src$core$registry;module$build$src$core$registry.register=register$$module$build$src$core$registry;module$build$src$core$registry.unregister=unregister$$module$build$src$core$registry;var Blocks$$module$build$src$core$blocks=Object.create(null),module$build$src$core$blocks={Blocks:Blocks$$module$build$src$core$blocks};var
|
|
532
|
+
module$build$src$core$registry.getObject=getObject$$module$build$src$core$registry;module$build$src$core$registry.hasItem=hasItem$$module$build$src$core$registry;module$build$src$core$registry.register=register$$module$build$src$core$registry;module$build$src$core$registry.unregister=unregister$$module$build$src$core$registry;var Blocks$$module$build$src$core$blocks=Object.create(null),module$build$src$core$blocks={Blocks:Blocks$$module$build$src$core$blocks};var LONGPRESS$$module$build$src$core$touch=750,TOUCH_ENABLED$$module$build$src$core$touch="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),touchIdentifier_$$module$build$src$core$touch=null,TOUCH_MAP$$module$build$src$core$touch={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],
|
|
533
|
+
mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},longPid_$$module$build$src$core$touch=0,module$build$src$core$touch={TOUCH_ENABLED:TOUCH_ENABLED$$module$build$src$core$touch,TOUCH_MAP:TOUCH_MAP$$module$build$src$core$touch};module$build$src$core$touch.checkTouchIdentifier=checkTouchIdentifier$$module$build$src$core$touch;module$build$src$core$touch.clearTouchIdentifier=clearTouchIdentifier$$module$build$src$core$touch;
|
|
534
|
+
module$build$src$core$touch.getTouchIdentifierFromEvent=getTouchIdentifierFromEvent$$module$build$src$core$touch;module$build$src$core$touch.longStart=longStart$$module$build$src$core$touch;module$build$src$core$touch.longStop=longStop$$module$build$src$core$touch;module$build$src$core$touch.shouldHandleEvent=shouldHandleEvent$$module$build$src$core$touch;var rawUserAgent$$module$build$src$core$utils$useragent,isJavaFx$$module$build$src$core$utils$useragent,isWebKit$$module$build$src$core$utils$useragent,isGecko$$module$build$src$core$utils$useragent,isAndroid$$module$build$src$core$utils$useragent,isIPad$$module$build$src$core$utils$useragent,isIPhone$$module$build$src$core$utils$useragent,isMac$$module$build$src$core$utils$useragent,isTablet$$module$build$src$core$utils$useragent,isMobile$$module$build$src$core$utils$useragent;
|
|
535
|
+
(function(a){function b(d){return c.includes(d.toUpperCase())}rawUserAgent$$module$build$src$core$utils$useragent=a;const c=rawUserAgent$$module$build$src$core$utils$useragent.toUpperCase();isJavaFx$$module$build$src$core$utils$useragent=b("JavaFX");isWebKit$$module$build$src$core$utils$useragent=b("WebKit");isGecko$$module$build$src$core$utils$useragent=b("Gecko")&&!isWebKit$$module$build$src$core$utils$useragent;isAndroid$$module$build$src$core$utils$useragent=b("Android");a=globalThis.navigator&&
|
|
536
|
+
globalThis.navigator.maxTouchPoints;isIPad$$module$build$src$core$utils$useragent=b("iPad")||b("Macintosh")&&0<a;isIPhone$$module$build$src$core$utils$useragent=b("iPhone")&&!isIPad$$module$build$src$core$utils$useragent;isMac$$module$build$src$core$utils$useragent=b("Macintosh");isTablet$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent&&!b("Mobile")||b("Silk");isMobile$$module$build$src$core$utils$useragent=!isTablet$$module$build$src$core$utils$useragent&&
|
|
537
|
+
(isIPhone$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent)})(globalThis.navigator&&globalThis.navigator.userAgent||"");
|
|
538
|
+
var raw$$module$build$src$core$utils$useragent=rawUserAgent$$module$build$src$core$utils$useragent,JavaFx$$module$build$src$core$utils$useragent=isJavaFx$$module$build$src$core$utils$useragent,GECKO$$module$build$src$core$utils$useragent=isGecko$$module$build$src$core$utils$useragent,ANDROID$$module$build$src$core$utils$useragent=isAndroid$$module$build$src$core$utils$useragent,IPAD$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent,IPHONE$$module$build$src$core$utils$useragent=
|
|
539
|
+
isIPhone$$module$build$src$core$utils$useragent,MAC$$module$build$src$core$utils$useragent=isMac$$module$build$src$core$utils$useragent,MOBILE$$module$build$src$core$utils$useragent=isMobile$$module$build$src$core$utils$useragent,module$build$src$core$utils$useragent={ANDROID:ANDROID$$module$build$src$core$utils$useragent,GECKO:GECKO$$module$build$src$core$utils$useragent,IPAD:IPAD$$module$build$src$core$utils$useragent,IPHONE:IPHONE$$module$build$src$core$utils$useragent,JavaFx:JavaFx$$module$build$src$core$utils$useragent,
|
|
540
|
+
MAC:MAC$$module$build$src$core$utils$useragent,MOBILE:MOBILE$$module$build$src$core$utils$useragent,raw:raw$$module$build$src$core$utils$useragent};var LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events=40,PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events=125,module$build$src$core$browser_events={};module$build$src$core$browser_events.bind=bind$$module$build$src$core$browser_events;module$build$src$core$browser_events.conditionalBind=conditionalBind$$module$build$src$core$browser_events;module$build$src$core$browser_events.getScrollDeltaPixels=getScrollDeltaPixels$$module$build$src$core$browser_events;
|
|
541
|
+
module$build$src$core$browser_events.isRightButton=isRightButton$$module$build$src$core$browser_events;module$build$src$core$browser_events.isTargetInput=isTargetInput$$module$build$src$core$browser_events;module$build$src$core$browser_events.mouseToSvg=mouseToSvg$$module$build$src$core$browser_events;module$build$src$core$browser_events.unbind=unbind$$module$build$src$core$browser_events;var EventType$$module$build$src$core$events$type;
|
|
525
542
|
(function(a){a.BLOCK_CREATE="create";a.BLOCK_DELETE="delete";a.BLOCK_CHANGE="change";a.BLOCK_FIELD_INTERMEDIATE_CHANGE="block_field_intermediate_change";a.BLOCK_MOVE="move";a.VAR_CREATE="var_create";a.VAR_DELETE="var_delete";a.VAR_RENAME="var_rename";a.VAR_TYPE_CHANGE="var_type_change";a.UI="ui";a.BLOCK_DRAG="drag";a.SELECTED="selected";a.CLICK="click";a.MARKER_MOVE="marker_move";a.BUBBLE_OPEN="bubble_open";a.TRASHCAN_OPEN="trashcan_open";a.TOOLBOX_ITEM_SELECT="toolbox_item_select";a.THEME_CHANGE=
|
|
526
543
|
"theme_change";a.VIEWPORT_CHANGE="viewport_change";a.COMMENT_CREATE="comment_create";a.COMMENT_DELETE="comment_delete";a.COMMENT_CHANGE="comment_change";a.COMMENT_MOVE="comment_move";a.COMMENT_RESIZE="comment_resize";a.COMMENT_DRAG="comment_drag";a.COMMENT_COLLAPSE="comment_collapse";a.FINISHED_LOADING="finished_loading"})(EventType$$module$build$src$core$events$type||(EventType$$module$build$src$core$events$type={}));
|
|
527
544
|
var BUMP_EVENTS$$module$build$src$core$events$type=[EventType$$module$build$src$core$events$type.BLOCK_CREATE,EventType$$module$build$src$core$events$type.BLOCK_MOVE,EventType$$module$build$src$core$events$type.COMMENT_CREATE,EventType$$module$build$src$core$events$type.COMMENT_MOVE],module$build$src$core$events$type={BUMP_EVENTS:BUMP_EVENTS$$module$build$src$core$events$type};module$build$src$core$events$type.EventType=EventType$$module$build$src$core$events$type;var soup$$module$build$src$core$utils$idgenerator="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",internal$$module$build$src$core$utils$idgenerator={genUid:()=>{const a=soup$$module$build$src$core$utils$idgenerator.length,b=[];for(let c=0;20>c;c++)b[c]=soup$$module$build$src$core$utils$idgenerator.charAt(Math.random()*a);return b.join("")}},TEST_ONLY$$module$build$src$core$utils$idgenerator=internal$$module$build$src$core$utils$idgenerator,nextId$$module$build$src$core$utils$idgenerator=
|
|
@@ -541,34 +558,33 @@ module$build$src$core$utils$dom.setCssTransform=setCssTransform$$module$build$sr
|
|
|
541
558
|
b=c.querySelector(this.ACTIVE_FOCUS_NODE_CSS_SELECTOR);if(b instanceof HTMLElement||b instanceof SVGElement)if(b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(b,a))return b;c=c.querySelector(this.PASSIVE_FOCUS_NODE_CSS_SELECTOR);if(c instanceof HTMLElement||c instanceof SVGElement)if(a=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,a))return a;return null}static findFocusableNodeFor(a,b){if(-1!==
|
|
542
559
|
b.getNestedTrees().map(e=>FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a,e)).findIndex(e=>!!e))return null;var c=b.getRootFocusableNode();if(c.canBeFocused()&&a===c.getFocusableElement())return c;var d;if(c=null!=(d=b.lookUpFocusableNode(a.id))?d:null)return c;d=a.parentElement;return!c&&d?FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(d,b):null}};
|
|
543
560
|
FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME="blocklyActiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME}`;
|
|
544
|
-
FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME}`;var module$build$src$core$utils$focusable_tree_traverser={};module$build$src$core$utils$focusable_tree_traverser.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;var FocusManager$$module$build$src$core$focus_manager=class{constructor(a){this.previouslyFocusedNode=this.focusedNode=null;this.registeredTrees=[];this.isUpdatingFocusedNode=this.recentlyLostAllFocus=this.lockFocusStateChanges=this.currentlyHoldsEphemeralFocus=!1;const b=c=>{if(!this.isUpdatingFocusedNode){this.recentlyLostAllFocus=!c;var d=null;if(c instanceof HTMLElement||
|
|
545
|
-
e))break;if(d&&d.canBeFocused()){c=d.getFocusableTree();let f;e=null==(f=this.focusedNode)?void 0:f.getFocusableTree();d===c.getRootFocusableNode()&&c!==e?this.focusTree(c):this.focusNode(d)}else this.defocusCurrentFocusedNode()}};a("focusin",c=>{c instanceof FocusEvent&&b(document.activeElement)});a("focusout",c=>{c instanceof FocusEvent&&
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
!this.
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
561
|
+
FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME}`;var module$build$src$core$utils$focusable_tree_traverser={};module$build$src$core$utils$focusable_tree_traverser.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;var TreeRegistration$$module$build$src$core$focus_manager=class{constructor(a,b){this.tree=a;this.rootShouldBeAutoTabbable=b}},FocusManager$$module$build$src$core$focus_manager=class{constructor(a){this.previouslyFocusedNode=this.focusedNode=null;this.registeredTrees=[];this.isUpdatingFocusedNode=this.recentlyLostAllFocus=this.lockFocusStateChanges=this.currentlyHoldsEphemeralFocus=!1;const b=c=>{if(!this.isUpdatingFocusedNode){this.recentlyLostAllFocus=!c;var d=null;if(c instanceof HTMLElement||
|
|
562
|
+
c instanceof SVGElement)for(var e of this.registeredTrees)if(d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,e.tree))break;if(d&&d.canBeFocused()){c=d.getFocusableTree();let f;e=null==(f=this.focusedNode)?void 0:f.getFocusableTree();d===c.getRootFocusableNode()&&c!==e?this.focusTree(c):this.focusNode(d)}else this.defocusCurrentFocusedNode()}};a("focusin",c=>{c instanceof FocusEvent&&b(document.activeElement)});a("focusout",c=>{c instanceof FocusEvent&&
|
|
563
|
+
b(c.relatedTarget)})}registerTree(a,b=!1){this.ensureManagerIsUnlocked();if(this.isRegistered(a))throw Error(`Attempted to re-register already registered tree: ${a}.`);this.registeredTrees.push(new TreeRegistration$$module$build$src$core$focus_manager(a,b));b&&(a.getRootFocusableNode().getFocusableElement().tabIndex=0)}isRegistered(a){return!!this.lookUpRegistration(a)}lookUpRegistration(a){let b;return null!=(b=this.registeredTrees.find(c=>c.tree===a))?b:null}unregisterTree(a){this.ensureManagerIsUnlocked();
|
|
564
|
+
if(!this.isRegistered(a))throw Error(`Attempted to unregister not registered tree: ${a}.`);var b=this.registeredTrees.findIndex(e=>e.tree===a);const c=this.registeredTrees[b];this.registeredTrees.splice(b,1);b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a);const d=a.getRootFocusableNode();b&&this.removeHighlight(b);this.focusedNode!==b&&this.focusedNode!==d||this.updateFocusedNode(null);this.removeHighlight(d);c.rootShouldBeAutoTabbable&&a.getRootFocusableNode().getFocusableElement().removeAttribute("tabindex")}getFocusedTree(){let a,
|
|
565
|
+
b;return null!=(b=null==(a=this.focusedNode)?void 0:a.getFocusableTree())?b:null}getFocusedNode(){return this.focusedNode}focusTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to focus unregistered tree: ${a}.`);const b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a),c=a.getRestoredFocusableNode(b);a=a.getRootFocusableNode();let d;this.focusNode(null!=(d=null!=c?c:b)?d:a)}focusNode(a){this.ensureManagerIsUnlocked();
|
|
566
|
+
const b=!this.currentlyHoldsEphemeralFocus;b&&(this.isUpdatingFocusedNode=!0);var c,d=(null==(c=this.focusedNode)?void 0:c.getFocusableElement())!==document.activeElement;if(this.focusedNode!==a||d)if(a.canBeFocused()){d=a.getFocusableTree();if(!this.isRegistered(d))throw Error(`Attempted to focus unregistered node: ${a}.`);var e=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a.getFocusableElement(),d);c=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(d);
|
|
567
|
+
var f=a;if(e!==a){f=d.getRestoredFocusableNode(c);a=d.getRootFocusableNode();var g;f=null!=(g=null!=f?f:c)?g:a}a=this.focusedNode;g=null==a?void 0:a.getFocusableTree();a&&this.passivelyFocusNode(a,d);d=d.getRootFocusableNode();c&&this.removeHighlight(c);d!==f&&this.removeHighlight(d);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(f,null!=g?g:null);this.updateFocusedNode(f)}else console.warn("Trying to focus a node that can't be focused.");b&&(this.isUpdatingFocusedNode=!1)}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();
|
|
568
|
+
if(this.currentlyHoldsEphemeralFocus)throw Error("Attempted to take ephemeral focus when it's already held, "+`with new element: ${a}.`);this.currentlyHoldsEphemeralFocus=!0;this.focusedNode&&this.passivelyFocusNode(this.focusedNode,null);a.focus();let b=!1;return()=>{if(b)throw Error("Attempted to finish ephemeral focus twice for element: "+`${a}.`);b=!0;this.currentlyHoldsEphemeralFocus=!1;if(this.focusedNode){this.activelyFocusNode(this.focusedNode,null);const c=this.focusedNode;setTimeout(()=>
|
|
569
|
+
{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ephemeralFocusTaken(){return this.currentlyHoldsEphemeralFocus}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback.");}updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&!this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,
|
|
570
|
+
null),this.updateFocusedNode(null))}activelyFocusNode(a,b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree(),d=a.getFocusableElement();let e;const f=null==(e=this.lookUpRegistration(c))?void 0:e.rootShouldBeAutoTabbable;c!==b&&(c.onTreeFocus(a,b),f&&(c.getRootFocusableNode().getFocusableElement().tabIndex=-1));a.onNodeFocus();this.lockFocusStateChanges=!1;f&&a===c.getRootFocusableNode()||d.hasAttribute("tabindex")||(d.tabIndex=-1);this.setNodeToVisualActiveFocus(a);d.focus()}passivelyFocusNode(a,
|
|
571
|
+
b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree();if(c!==b){c.onTreeBlur(b);let d;if(null==(d=this.lookUpRegistration(c))?0:d.rootShouldBeAutoTabbable)c.getRootFocusableNode().getFocusableElement().tabIndex=0}a.onNodeBlur();this.lockFocusStateChanges=!1;c!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a=a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,
|
|
572
|
+
FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}setNodeToVisualPassiveFocus(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}removeHighlight(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);
|
|
573
|
+
removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}static getFocusManager(){FocusManager$$module$build$src$core$focus_manager.focusManager||(FocusManager$$module$build$src$core$focus_manager.focusManager=new FocusManager$$module$build$src$core$focus_manager(document.addEventListener));return FocusManager$$module$build$src$core$focus_manager.focusManager}};
|
|
574
|
+
FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyActiveFocus";FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusManager$$module$build$src$core$focus_manager.focusManager=null;var module$build$src$core$focus_manager={};module$build$src$core$focus_manager.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$focus_manager.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;var module$build$src$core$interfaces$i_focusable_node={};module$build$src$core$interfaces$i_focusable_node.isFocusableNode=isFocusableNode$$module$build$src$core$interfaces$i_focusable_node;var module$build$src$core$interfaces$i_selectable={};module$build$src$core$interfaces$i_selectable.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;var ShortcutRegistry$$module$build$src$core$shortcut_registry=class{constructor(){this.shortcuts=new Map;this.keyMap=new Map;this.reset()}reset(){this.shortcuts.clear();this.keyMap.clear()}register(a,b){if(this.shortcuts.get(a.name)&&!b)throw Error(`Shortcut named "${a.name}" already exists.`);this.shortcuts.set(a.name,a);b=a.keyCodes;if(null==b?0:b.length)for(const c of b)this.addKeyMapping(c,a.name,!!a.allowCollision)}unregister(a){if(!this.shortcuts.get(a))return console.warn(`Keyboard shortcut named "${a}" not found.`),
|
|
575
|
+
!1;this.removeAllKeyMappings(a);this.shortcuts.delete(a);return!0}addKeyMapping(a,b,c){a=`${a}`;const d=this.keyMap.get(a);if(d&&!c)throw Error(`Shortcut named "${b}" collides with shortcuts "${d}"`);d&&c?d.unshift(b):this.keyMap.set(a,[b])}removeKeyMapping(a,b,c){const d=this.keyMap.get(a);if(!d)return c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`),!1;const e=d.indexOf(b);if(-1<e)return d.splice(e,1),0===d.length&&this.keyMap.delete(a),!0;c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`);
|
|
576
|
+
return!1}removeAllKeyMappings(a){for(const b of this.keyMap.keys())this.removeKeyMapping(b,a,!0)}setKeyMap(a){this.keyMap.clear();for(const b in a)this.keyMap.set(b,a[b])}getKeyMap(){const a=Object.create(null);for(const [b,c]of this.keyMap)a[b]=c;return a}getRegistry(){const a=Object.create(null);for(const [b,c]of this.shortcuts)a[b]=c;return deepMerge$$module$build$src$core$utils$object(Object.create(null),a)}onKeyDown(a,b){var c=this.serializeKeyEvent(b);c=this.getShortcutNamesByKeyCode(c);if(!c)return!1;
|
|
577
|
+
for(const d of c){c=this.shortcuts.get(d);let e;if(!c||c.preconditionFn&&!c.preconditionFn(a,{focusedNode:null!=(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())?e:void 0}))continue;let f,g,h;if(null==(g=(f=c).callback)?0:g.call(f,a,b,c,{focusedNode:null!=(h=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())?h:void 0}))return!0}return!1}getShortcutNamesByKeyCode(a){let b;return(null==(b=this.keyMap.get(a))?void 0:b.slice())||[]}getKeyCodesByShortcutName(a){const b=
|
|
578
|
+
[];for(const [c,d]of this.keyMap)-1<d.indexOf(a)&&b.push(c);return b}serializeKeyEvent(a){let b="";for(const c in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)a.getModifierState(c)&&(""!==b&&(b+="+"),b+=c);""!==b&&a.keyCode?b+="+"+a.keyCode:a.keyCode&&(b=String(a.keyCode));return b}checkModifiers(a){for(const b of a)if(!(b in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys))throw Error(b+" is not a valid modifier key.");}createSerializedKey(a,b){let c=
|
|
579
|
+
"";if(b){this.checkModifiers(b);for(const d in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)b.includes(ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys[d])&&(""!==c&&(c+="+"),c+=d)}""!==c&&a?c+="+"+a:a&&(c=`${a}`);return c}};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry=new ShortcutRegistry$$module$build$src$core$shortcut_registry;
|
|
580
|
+
(function(a){a=a.modifierKeys||(a.modifierKeys={});a[a.Shift=16]="Shift";a[a.Control=17]="Control";a[a.Alt=18]="Alt";a[a.Meta=91]="Meta"})(ShortcutRegistry$$module$build$src$core$shortcut_registry||(ShortcutRegistry$$module$build$src$core$shortcut_registry={}));var module$build$src$core$shortcut_registry={};module$build$src$core$shortcut_registry.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common};module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common;
|
|
557
581
|
module$build$src$core$common.defineBlocks=$.defineBlocks$$module$build$src$core$common;module$build$src$core$common.defineBlocksWithJsonArray=defineBlocksWithJsonArray$$module$build$src$core$common;module$build$src$core$common.draggingConnections=draggingConnections$$module$build$src$core$common;module$build$src$core$common.fireSelectedEvent=fireSelectedEvent$$module$build$src$core$common;module$build$src$core$common.getAllWorkspaces=getAllWorkspaces$$module$build$src$core$common;
|
|
558
582
|
module$build$src$core$common.getBlockTypeCounts=getBlockTypeCounts$$module$build$src$core$common;module$build$src$core$common.getMainWorkspace=getMainWorkspace$$module$build$src$core$common;module$build$src$core$common.getParentContainer=getParentContainer$$module$build$src$core$common;module$build$src$core$common.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$common.getWorkspaceById=getWorkspaceById$$module$build$src$core$common;
|
|
559
|
-
module$build$src$core$common.
|
|
583
|
+
module$build$src$core$common.globalShortcutHandler=globalShortcutHandler$$module$build$src$core$common;module$build$src$core$common.registerWorkspace=registerWorkspace$$module$build$src$core$common;module$build$src$core$common.setMainWorkspace=setMainWorkspace$$module$build$src$core$common;module$build$src$core$common.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$common.setSelected=setSelected$$module$build$src$core$common;
|
|
584
|
+
module$build$src$core$common.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$common.unregisterWorkpace=unregisterWorkpace$$module$build$src$core$common;var Abstract$$module$build$src$core$events$events_abstract=class{constructor(){this.workspaceId=void 0;this.isUiEvent=!1;this.type="";this.group=$.getGroup$$module$build$src$core$events$utils();this.recordUndo=getRecordUndo$$module$build$src$core$events$utils()}toJson(){return{type:this.type,group:this.group}}static fromJson(a,b,c){c.isBlank=!1;c.group=a.group||"";c.workspaceId=b.id;return c}isNull(){return!1}run(a){}getEventWorkspace_(){let a;this.workspaceId&&(a=getWorkspaceById$$module$build$src$core$common(this.workspaceId));
|
|
560
585
|
if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a}},module$build$src$core$events$events_abstract={};module$build$src$core$events$events_abstract.Abstract=Abstract$$module$build$src$core$events$events_abstract;var UiBase$$module$build$src$core$events$events_ui_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.recordUndo=!1;this.isUiEvent=!0;this.isBlank="undefined"===typeof a;this.workspaceId=a?a:""}},module$build$src$core$events$events_ui_base={};module$build$src$core$events$events_ui_base.UiBase=UiBase$$module$build$src$core$events$events_ui_base;var Click$$module$build$src$core$events$events_click=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){b=a?a.workspace.id:b;null===b&&(b=void 0);super(b);this.type=EventType$$module$build$src$core$events$type.CLICK;this.blockId=a?a.id:void 0;this.targetType=c}toJson(){const a=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");a.targetType=this.targetType;a.blockId=this.blockId;
|
|
561
586
|
return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new Click$$module$build$src$core$events$events_click);b.targetType=a.targetType;b.blockId=a.blockId;return b}},ClickTarget$$module$build$src$core$events$events_click;(function(a){a.BLOCK="block";a.WORKSPACE="workspace";a.ZOOM_CONTROLS="zoom_controls"})(ClickTarget$$module$build$src$core$events$events_click||(ClickTarget$$module$build$src$core$events$events_click={}));
|
|
562
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.CLICK,Click$$module$build$src$core$events$events_click);var module$build$src$core$events$events_click={};module$build$src$core$events$events_click.Click=Click$$module$build$src$core$events$events_click;module$build$src$core$events$events_click.ClickTarget=ClickTarget$$module$build$src$core$events$events_click;var
|
|
563
|
-
mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},longPid_$$module$build$src$core$touch=0,module$build$src$core$touch={TOUCH_ENABLED:TOUCH_ENABLED$$module$build$src$core$touch,TOUCH_MAP:TOUCH_MAP$$module$build$src$core$touch};module$build$src$core$touch.checkTouchIdentifier=checkTouchIdentifier$$module$build$src$core$touch;module$build$src$core$touch.clearTouchIdentifier=clearTouchIdentifier$$module$build$src$core$touch;
|
|
564
|
-
module$build$src$core$touch.getTouchIdentifierFromEvent=getTouchIdentifierFromEvent$$module$build$src$core$touch;module$build$src$core$touch.longStart=longStart$$module$build$src$core$touch;module$build$src$core$touch.longStop=longStop$$module$build$src$core$touch;module$build$src$core$touch.shouldHandleEvent=shouldHandleEvent$$module$build$src$core$touch;var rawUserAgent$$module$build$src$core$utils$useragent,isJavaFx$$module$build$src$core$utils$useragent,isWebKit$$module$build$src$core$utils$useragent,isGecko$$module$build$src$core$utils$useragent,isAndroid$$module$build$src$core$utils$useragent,isIPad$$module$build$src$core$utils$useragent,isIPhone$$module$build$src$core$utils$useragent,isMac$$module$build$src$core$utils$useragent,isTablet$$module$build$src$core$utils$useragent,isMobile$$module$build$src$core$utils$useragent;
|
|
565
|
-
(function(a){function b(d){return c.includes(d.toUpperCase())}rawUserAgent$$module$build$src$core$utils$useragent=a;const c=rawUserAgent$$module$build$src$core$utils$useragent.toUpperCase();isJavaFx$$module$build$src$core$utils$useragent=b("JavaFX");isWebKit$$module$build$src$core$utils$useragent=b("WebKit");isGecko$$module$build$src$core$utils$useragent=b("Gecko")&&!isWebKit$$module$build$src$core$utils$useragent;isAndroid$$module$build$src$core$utils$useragent=b("Android");a=globalThis.navigator&&
|
|
566
|
-
globalThis.navigator.maxTouchPoints;isIPad$$module$build$src$core$utils$useragent=b("iPad")||b("Macintosh")&&0<a;isIPhone$$module$build$src$core$utils$useragent=b("iPhone")&&!isIPad$$module$build$src$core$utils$useragent;isMac$$module$build$src$core$utils$useragent=b("Macintosh");isTablet$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent&&!b("Mobile")||b("Silk");isMobile$$module$build$src$core$utils$useragent=!isTablet$$module$build$src$core$utils$useragent&&
|
|
567
|
-
(isIPhone$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent)})(globalThis.navigator&&globalThis.navigator.userAgent||"");
|
|
568
|
-
var raw$$module$build$src$core$utils$useragent=rawUserAgent$$module$build$src$core$utils$useragent,JavaFx$$module$build$src$core$utils$useragent=isJavaFx$$module$build$src$core$utils$useragent,GECKO$$module$build$src$core$utils$useragent=isGecko$$module$build$src$core$utils$useragent,ANDROID$$module$build$src$core$utils$useragent=isAndroid$$module$build$src$core$utils$useragent,IPAD$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent,IPHONE$$module$build$src$core$utils$useragent=
|
|
569
|
-
isIPhone$$module$build$src$core$utils$useragent,MAC$$module$build$src$core$utils$useragent=isMac$$module$build$src$core$utils$useragent,MOBILE$$module$build$src$core$utils$useragent=isMobile$$module$build$src$core$utils$useragent,module$build$src$core$utils$useragent={ANDROID:ANDROID$$module$build$src$core$utils$useragent,GECKO:GECKO$$module$build$src$core$utils$useragent,IPAD:IPAD$$module$build$src$core$utils$useragent,IPHONE:IPHONE$$module$build$src$core$utils$useragent,JavaFx:JavaFx$$module$build$src$core$utils$useragent,
|
|
570
|
-
MAC:MAC$$module$build$src$core$utils$useragent,MOBILE:MOBILE$$module$build$src$core$utils$useragent,raw:raw$$module$build$src$core$utils$useragent};var LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events=40,PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events=125,module$build$src$core$browser_events={};module$build$src$core$browser_events.bind=bind$$module$build$src$core$browser_events;module$build$src$core$browser_events.conditionalBind=conditionalBind$$module$build$src$core$browser_events;module$build$src$core$browser_events.getScrollDeltaPixels=getScrollDeltaPixels$$module$build$src$core$browser_events;
|
|
571
|
-
module$build$src$core$browser_events.isRightButton=isRightButton$$module$build$src$core$browser_events;module$build$src$core$browser_events.isTargetInput=isTargetInput$$module$build$src$core$browser_events;module$build$src$core$browser_events.mouseToSvg=mouseToSvg$$module$build$src$core$browser_events;module$build$src$core$browser_events.unbind=unbind$$module$build$src$core$browser_events;var module$build$src$core$utils$array={};module$build$src$core$utils$array.removeElem=removeElem$$module$build$src$core$utils$array;var Capability$$module$build$src$core$component_manager=class{constructor(a){this.name=a}toString(){return this.name}};Capability$$module$build$src$core$component_manager.POSITIONABLE=new Capability$$module$build$src$core$component_manager("positionable");Capability$$module$build$src$core$component_manager.DRAG_TARGET=new Capability$$module$build$src$core$component_manager("drag_target");Capability$$module$build$src$core$component_manager.DELETE_AREA=new Capability$$module$build$src$core$component_manager("delete_area");
|
|
587
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.CLICK,Click$$module$build$src$core$events$events_click);var module$build$src$core$events$events_click={};module$build$src$core$events$events_click.Click=Click$$module$build$src$core$events$events_click;module$build$src$core$events$events_click.ClickTarget=ClickTarget$$module$build$src$core$events$events_click;var module$build$src$core$utils$array={};module$build$src$core$utils$array.removeElem=removeElem$$module$build$src$core$utils$array;var Capability$$module$build$src$core$component_manager=class{constructor(a){this.name=a}toString(){return this.name}};Capability$$module$build$src$core$component_manager.POSITIONABLE=new Capability$$module$build$src$core$component_manager("positionable");Capability$$module$build$src$core$component_manager.DRAG_TARGET=new Capability$$module$build$src$core$component_manager("drag_target");Capability$$module$build$src$core$component_manager.DELETE_AREA=new Capability$$module$build$src$core$component_manager("delete_area");
|
|
572
588
|
Capability$$module$build$src$core$component_manager.AUTOHIDEABLE=new Capability$$module$build$src$core$component_manager("autohideable");
|
|
573
589
|
var ComponentManager$$module$build$src$core$component_manager=class{constructor(){this.componentData=new Map;this.capabilityToComponentIds=new Map}addComponent(a,b){const c=a.component.id;if(!b&&this.componentData.has(c)){var d;throw Error('Plugin "'+c+'" with capabilities "'+(null==(d=this.componentData.get(c))?void 0:d.capabilities)+'" already added.');}this.componentData.set(c,a);b=[];for(d=0;d<a.capabilities.length;d++){const e=String(a.capabilities[d]).toLowerCase();b.push(e);if(this.capabilityToComponentIds.has(e)){let f;
|
|
574
590
|
null==(f=this.capabilityToComponentIds.get(e))||f.push(c)}else this.capabilityToComponentIds.set(e,[c])}this.componentData.get(c).capabilities=b}removeComponent(a){const b=this.componentData.get(a);if(b){for(let c=0;c<b.capabilities.length;c++){const d=String(b.capabilities[c]).toLowerCase();removeElem$$module$build$src$core$utils$array(this.capabilityToComponentIds.get(d),a)}this.componentData.delete(a)}}addCapability(a,b){if(!this.getComponent(a))throw Error('Cannot add capability, "'+b+'". Plugin "'+
|
|
@@ -576,7 +592,7 @@ a+'" has not been added to the ComponentManager');if(this.hasCapability(a,b))con
|
|
|
576
592
|
b),removeElem$$module$build$src$core$utils$array(this.capabilityToComponentIds.get(b),a)):console.warn('Plugin "'+a+"doesn't have capability \""+b+'" to remove')}hasCapability(a,b){b=`${b}`.toLowerCase();return this.componentData.has(a)&&this.componentData.get(a).capabilities.includes(b)}getComponent(a){let b;return null==(b=this.componentData.get(a))?void 0:b.component}getComponents(a,b){a=`${a}`.toLowerCase();a=this.capabilityToComponentIds.get(a);if(!a)return[];const c=[];if(b){const d=[];a.forEach(e=>
|
|
577
593
|
{d.push(this.componentData.get(e))});d.sort(function(e,f){return e.weight-f.weight});d.forEach(function(e){c.push(e.component)})}else a.forEach(d=>{c.push(this.componentData.get(d).component)});return c}};ComponentManager$$module$build$src$core$component_manager.Capability=Capability$$module$build$src$core$component_manager;
|
|
578
594
|
(function(a){a=a.ComponentWeight||(a.ComponentWeight={});a[a.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT";a[a.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT";a[a.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT";a[a.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(ComponentManager$$module$build$src$core$component_manager||(ComponentManager$$module$build$src$core$component_manager={}));
|
|
579
|
-
var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injected$$module$build$src$core$css=!1,content$$module$build$src$core$css='\n.blocklySvg {\n background-color: #fff;\n outline: none;\n overflow: hidden; /* IE overflows by default. */\n position: absolute;\n display: block;\n}\n\n.blocklyWidgetDiv {\n display: none;\n position: absolute;\n z-index: 99999; /* big value for bootstrap3 compatibility */\n}\n\n.injectionDiv {\n height: 100%;\n position: relative;\n overflow: hidden; /* So blocks in drag surface disappear at edges */\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\n}\n\n.blocklyEmboss {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyTooltipDiv {\n background-color: #ffffc7;\n border: 1px solid #ddc;\n box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);\n color: #000;\n display: none;\n font: 9pt sans-serif;\n opacity: .9;\n padding: 2px;\n position: absolute;\n z-index: 100000; /* big value for bootstrap3 compatibility */\n}\n\n.blocklyDropDownDiv {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownContent {\n max-height: 300px; /* @todo: spec for maximum height. */\n}\n\n.blocklyDropDownArrow {\n position: absolute;\n left: 0;\n top: 0;\n width: 16px;\n height: 16px;\n z-index: -1;\n background-color: inherit;\n border-color: inherit;\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyHighlighted>.blocklyPath {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyHighlightedConnectionPath {\n fill: none;\n stroke: #fc3;\n stroke-width: 4px;\n}\n\n.blocklyPathLight {\n fill: none;\n stroke-linecap: round;\n stroke-width: 1;\n}\n\n.blocklySelected>.blocklyPathLight {\n display: none;\n}\n\n.blocklyDraggable {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.blocklyDragging {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n /* Drag surface disables events to not block the toolbox, so we have to\n * reenable them here for the cursor values to work. */\n pointer-events: auto;\n}\n\n /* Changes cursor on mouse down. Not effective in Firefox because of\n https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */\n.blocklyDraggable:active {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n.blocklyDragging.blocklyDraggingDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyDragging>.blocklyPath,\n.blocklyDragging>.blocklyPathLight {\n fill-opacity: .8;\n stroke-opacity: .8;\n}\n\n.blocklyDragging>.blocklyPathDark {\n display: none;\n}\n\n.blocklyDisabledPattern>.blocklyPath {\n fill: var(--blocklyDisabledPattern);\n fill-opacity: .5;\n stroke-opacity: .5;\n}\n\n.blocklyDisabled>.blocklyPathLight,\n.blocklyDisabled>.blocklyPathDark {\n display: none;\n}\n\n.blocklyInsertionMarker>.blocklyPath,\n.blocklyInsertionMarker>.blocklyPathLight,\n.blocklyInsertionMarker>.blocklyPathDark {\n fill-opacity: .2;\n stroke: none;\n}\n\n.blocklyNonEditableField>text {\n pointer-events: none;\n}\n\n.blocklyFlyout {\n position: absolute;\n z-index: 20;\n}\n\n.blocklyText text {\n cursor: default;\n}\n\n/*\n Don\'t allow users to select text. It gets annoying when trying to\n drag a block and selected text moves instead.\n*/\n.blocklySvg text {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n cursor: inherit;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover),\n.blocklyIconGroupReadonly {\n opacity: .6;\n}\n\n.blocklyIconShape {\n fill: #00f;\n stroke: #fff;\n stroke-width: 1px;\n}\n\n.blocklyIconSymbol {\n fill: #fff;\n}\n\n.blocklyMinimalBody {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\n.blocklyHtmlInput {\n border: none;\n border-radius: 4px;\n height: 100%;\n margin: 0;\n outline: none;\n padding: 0;\n width: 100%;\n text-align: center;\n display: block;\n box-sizing: border-box;\n}\n\n/* Remove the increase and decrease arrows on the field number editor */\ninput.blocklyHtmlInput[type=number]::-webkit-inner-spin-button,\ninput.blocklyHtmlInput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[type=number] {\n -moz-appearance: textfield;\n}\n\n.blocklyMainBackground {\n stroke-width: 1;\n stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */\n}\n\n.blocklyMutatorBackground {\n fill: #fff;\n stroke: #ddd;\n stroke-width: 1;\n}\n\n.blocklyFlyoutBackground {\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyMainWorkspaceScrollbar {\n z-index: 20;\n}\n\n.blocklyFlyoutScrollbar {\n z-index: 30;\n}\n\n.blocklyScrollbarHorizontal,\n.blocklyScrollbarVertical {\n position: absolute;\n outline: none;\n}\n\n.blocklyScrollbarBackground {\n opacity: 0;\n pointer-events: none;\n}\n\n.blocklyScrollbarHandle {\n fill: #ccc;\n}\n\n.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyScrollbarHandle:hover {\n fill: #bbb;\n}\n\n/* Darken flyout scrollbars due to being on a grey background. */\n/* By contrast, workspace scrollbars are on a white background. */\n.blocklyFlyout .blocklyScrollbarHandle {\n fill: #bbb;\n}\n\n.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyFlyout .blocklyScrollbarHandle:hover {\n fill: #aaa;\n}\n\n.blocklyInvalidInput {\n background: #faa;\n}\n\n.blocklyVerticalMarker {\n stroke-width: 3px;\n fill: rgba(255,255,255,.5);\n pointer-events: none;\n}\n\n.blocklyComputeCanvas {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n.blocklyNoPointerEvents {\n pointer-events: none;\n}\n\n.blocklyContextMenu {\n border-radius: 4px;\n max-height: 100%;\n}\n\n.blocklyDropdownMenu {\n border-radius: 2px;\n padding: 0 !important;\n}\n\n.blocklyDropdownMenu .blocklyMenuItem {\n /* 28px on the left for icon or checkbox. */\n padding-left: 28px;\n}\n\n/* BiDi override for the resting state. */\n.blocklyDropdownMenu .blocklyMenuItemRtl {\n /* Flip left/right padding for BiDi. */\n padding-left: 5px;\n padding-right: 28px;\n}\n\n.blocklyWidgetDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: #fff;\n border: 1px solid transparent;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n font: normal 13px Arial, sans-serif;\n margin: 0;\n outline: none;\n padding: 4px 0;\n position: absolute;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n.blocklyWidgetDiv .blocklyMenu:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: inherit; /* Compatibility with gapi, reset from goog-menu */\n border: inherit; /* Compatibility with gapi, reset from goog-menu */\n font: normal 13px "Helvetica Neue", Helvetica, sans-serif;\n outline: none;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n/* State: resting. */\n.blocklyMenuItem {\n border: none;\n color: #000;\n cursor: pointer;\n list-style: none;\n margin: 0;\n /* 7em on the right for shortcut. */\n min-width: 7em;\n padding: 6px 15px;\n white-space: nowrap;\n}\n\n/* State: disabled. */\n.blocklyMenuItemDisabled {\n color: #ccc;\n cursor: inherit;\n}\n\n/* State: hover. */\n.blocklyMenuItemHighlight {\n background-color: rgba(0,0,0,.1);\n}\n\n/* State: selected/checked. */\n.blocklyMenuItemCheckbox {\n height: 16px;\n position: absolute;\n width: 16px;\n}\n\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n position: static; /* Scroll with the menu. */\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\n}\n\n.blocklyMenuSeparator {\n background-color: #ccc;\n height: 1px;\n border: 0;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.blocklyBlockDragSurface, .blocklyAnimationLayer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 80;\n pointer-events: none;\n}\n\n.blocklyField {\n cursor: default;\n}\n\n.blocklyInputField {\n cursor: text;\n}\n\n.blocklyDragging .blocklyField,\n.blocklyDragging .blocklyIconGroup {\n cursor: grabbing;\n}\n\n.blocklyActiveFocus:is(\n .blocklyFlyout,\n .blocklyWorkspace,\n .blocklyField,\n .blocklyPath,\n .blocklyHighlightedConnectionPath,\n .blocklyComment,\n .blocklyBubble,\n .blocklyIconGroup,\n .blocklyTextarea\n) {\n outline
|
|
595
|
+
var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injected$$module$build$src$core$css=!1,content$$module$build$src$core$css='\n.blocklySvg {\n background-color: #fff;\n outline: none;\n overflow: hidden; /* IE overflows by default. */\n position: absolute;\n display: block;\n}\n\n.blocklyWidgetDiv {\n display: none;\n position: absolute;\n z-index: 99999; /* big value for bootstrap3 compatibility */\n}\n\n.injectionDiv {\n height: 100%;\n position: relative;\n overflow: hidden; /* So blocks in drag surface disappear at edges */\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\n}\n\n.blocklyEmboss {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyTooltipDiv {\n background-color: #ffffc7;\n border: 1px solid #ddc;\n box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);\n color: #000;\n display: none;\n font: 9pt sans-serif;\n opacity: .9;\n padding: 2px;\n position: absolute;\n z-index: 100000; /* big value for bootstrap3 compatibility */\n}\n\n.blocklyDropDownDiv {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownContent {\n max-height: 300px; /* @todo: spec for maximum height. */\n}\n\n.blocklyDropDownArrow {\n position: absolute;\n left: 0;\n top: 0;\n width: 16px;\n height: 16px;\n z-index: -1;\n background-color: inherit;\n border-color: inherit;\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyHighlighted>.blocklyPath {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyHighlightedConnectionPath {\n fill: none;\n stroke: #fc3;\n stroke-width: 4px;\n}\n\n.blocklyPathLight {\n fill: none;\n stroke-linecap: round;\n stroke-width: 1;\n}\n\n.blocklySelected>.blocklyPathLight {\n display: none;\n}\n\n.blocklyDraggable {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.blocklyDragging {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n /* Drag surface disables events to not block the toolbox, so we have to\n * reenable them here for the cursor values to work. */\n pointer-events: auto;\n}\n\n /* Changes cursor on mouse down. Not effective in Firefox because of\n https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */\n.blocklyDraggable:active {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n.blocklyDragging.blocklyDraggingDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyDragging>.blocklyPath,\n.blocklyDragging>.blocklyPathLight {\n fill-opacity: .8;\n stroke-opacity: .8;\n}\n\n.blocklyDragging>.blocklyPathDark {\n display: none;\n}\n\n.blocklyDisabledPattern>.blocklyPath {\n fill: var(--blocklyDisabledPattern);\n fill-opacity: .5;\n stroke-opacity: .5;\n}\n\n.blocklyDisabled>.blocklyPathLight,\n.blocklyDisabled>.blocklyPathDark {\n display: none;\n}\n\n.blocklyInsertionMarker>.blocklyPath,\n.blocklyInsertionMarker>.blocklyPathLight,\n.blocklyInsertionMarker>.blocklyPathDark {\n fill-opacity: .2;\n stroke: none;\n}\n\n.blocklyNonEditableField>text {\n pointer-events: none;\n}\n\n.blocklyFlyout {\n position: absolute;\n z-index: 20;\n}\n\n.blocklyText text {\n cursor: default;\n}\n\n/*\n Don\'t allow users to select text. It gets annoying when trying to\n drag a block and selected text moves instead.\n*/\n.blocklySvg text {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n cursor: inherit;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover),\n.blocklyIconGroupReadonly {\n opacity: .6;\n}\n\n.blocklyIconShape {\n fill: #00f;\n stroke: #fff;\n stroke-width: 1px;\n}\n\n.blocklyIconSymbol {\n fill: #fff;\n}\n\n.blocklyMinimalBody {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\n.blocklyHtmlInput {\n border: none;\n border-radius: 4px;\n height: 100%;\n margin: 0;\n outline: none;\n padding: 0;\n width: 100%;\n text-align: center;\n display: block;\n box-sizing: border-box;\n}\n\n/* Remove the increase and decrease arrows on the field number editor */\ninput.blocklyHtmlInput[type=number]::-webkit-inner-spin-button,\ninput.blocklyHtmlInput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[type=number] {\n -moz-appearance: textfield;\n}\n\n.blocklyMainBackground {\n stroke-width: 1;\n stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */\n}\n\n.blocklyMutatorBackground {\n fill: #fff;\n stroke: #ddd;\n stroke-width: 1;\n}\n\n.blocklyFlyoutBackground {\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyMainWorkspaceScrollbar {\n z-index: 20;\n}\n\n.blocklyFlyoutScrollbar {\n z-index: 30;\n}\n\n.blocklyScrollbarHorizontal,\n.blocklyScrollbarVertical {\n position: absolute;\n outline: none;\n}\n\n.blocklyScrollbarBackground {\n opacity: 0;\n pointer-events: none;\n}\n\n.blocklyScrollbarHandle {\n fill: #ccc;\n}\n\n.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyScrollbarHandle:hover {\n fill: #bbb;\n}\n\n/* Darken flyout scrollbars due to being on a grey background. */\n/* By contrast, workspace scrollbars are on a white background. */\n.blocklyFlyout .blocklyScrollbarHandle {\n fill: #bbb;\n}\n\n.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyFlyout .blocklyScrollbarHandle:hover {\n fill: #aaa;\n}\n\n.blocklyInvalidInput {\n background: #faa;\n}\n\n.blocklyVerticalMarker {\n stroke-width: 3px;\n fill: rgba(255,255,255,.5);\n pointer-events: none;\n}\n\n.blocklyComputeCanvas {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n.blocklyNoPointerEvents {\n pointer-events: none;\n}\n\n.blocklyContextMenu {\n border-radius: 4px;\n max-height: 100%;\n}\n\n.blocklyDropdownMenu {\n border-radius: 2px;\n padding: 0 !important;\n}\n\n.blocklyDropdownMenu .blocklyMenuItem {\n /* 28px on the left for icon or checkbox. */\n padding-left: 28px;\n}\n\n/* BiDi override for the resting state. */\n.blocklyDropdownMenu .blocklyMenuItemRtl {\n /* Flip left/right padding for BiDi. */\n padding-left: 5px;\n padding-right: 28px;\n}\n\n.blocklyWidgetDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: #fff;\n border: 1px solid transparent;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n font: normal 13px Arial, sans-serif;\n margin: 0;\n outline: none;\n padding: 4px 0;\n position: absolute;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n.blocklyWidgetDiv .blocklyMenu:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: inherit; /* Compatibility with gapi, reset from goog-menu */\n border: inherit; /* Compatibility with gapi, reset from goog-menu */\n font: normal 13px "Helvetica Neue", Helvetica, sans-serif;\n outline: none;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n/* State: resting. */\n.blocklyMenuItem {\n border: none;\n color: #000;\n cursor: pointer;\n list-style: none;\n margin: 0;\n /* 7em on the right for shortcut. */\n min-width: 7em;\n padding: 6px 15px;\n white-space: nowrap;\n}\n\n/* State: disabled. */\n.blocklyMenuItemDisabled {\n color: #ccc;\n cursor: inherit;\n}\n\n/* State: hover. */\n.blocklyMenuItemHighlight {\n background-color: rgba(0,0,0,.1);\n}\n\n/* State: selected/checked. */\n.blocklyMenuItemCheckbox {\n height: 16px;\n position: absolute;\n width: 16px;\n}\n\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n position: static; /* Scroll with the menu. */\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\n}\n\n.blocklyMenuSeparator {\n background-color: #ccc;\n height: 1px;\n border: 0;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.blocklyBlockDragSurface, .blocklyAnimationLayer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 80;\n pointer-events: none;\n}\n\n.blocklyField {\n cursor: default;\n}\n\n.blocklyInputField {\n cursor: text;\n}\n\n.blocklyDragging .blocklyField,\n.blocklyDragging .blocklyIconGroup {\n cursor: grabbing;\n}\n\n.blocklyActiveFocus:is(\n .blocklyFlyout,\n .blocklyWorkspace,\n .blocklyField,\n .blocklyPath,\n .blocklyHighlightedConnectionPath,\n .blocklyComment,\n .blocklyBubble,\n .blocklyIconGroup,\n .blocklyTextarea\n) {\n outline: none;\n}\n',
|
|
580
596
|
module$build$src$core$css={};module$build$src$core$css.inject=inject$$module$build$src$core$css;module$build$src$core$css.register=register$$module$build$src$core$css;var Coordinate$$module$build$src$core$utils$coordinate=class{constructor(a,b){this.x=a;this.y=b}clone(){return new Coordinate$$module$build$src$core$utils$coordinate(this.x,this.y)}scale(a){this.x*=a;this.y*=a;return this}translate(a,b){this.x+=a;this.y+=b;return this}static equals(a,b){return a===b?!0:a&&b?a.x===b.x&&a.y===b.y:!1}static distance(a,b){const c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)}static magnitude(a){return Math.sqrt(a.x*a.x+a.y*a.y)}static difference(a,b){return new Coordinate$$module$build$src$core$utils$coordinate(a.x-
|
|
581
597
|
b.x,a.y-b.y)}static sum(a,b){return new Coordinate$$module$build$src$core$utils$coordinate(a.x+b.x,a.y+b.y)}},module$build$src$core$utils$coordinate={};module$build$src$core$utils$coordinate.Coordinate=Coordinate$$module$build$src$core$utils$coordinate;var Svg$$module$build$src$core$utils$svg=class{constructor(a){this.tagName=a}toString(){return this.tagName}};Svg$$module$build$src$core$utils$svg.ANIMATE=new Svg$$module$build$src$core$utils$svg("animate");Svg$$module$build$src$core$utils$svg.CIRCLE=new Svg$$module$build$src$core$utils$svg("circle");Svg$$module$build$src$core$utils$svg.CLIPPATH=new Svg$$module$build$src$core$utils$svg("clipPath");Svg$$module$build$src$core$utils$svg.DEFS=new Svg$$module$build$src$core$utils$svg("defs");
|
|
582
598
|
Svg$$module$build$src$core$utils$svg.FECOMPOSITE=new Svg$$module$build$src$core$utils$svg("feComposite");Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER=new Svg$$module$build$src$core$utils$svg("feComponentTransfer");Svg$$module$build$src$core$utils$svg.FEFLOOD=new Svg$$module$build$src$core$utils$svg("feFlood");Svg$$module$build$src$core$utils$svg.FEFUNCA=new Svg$$module$build$src$core$utils$svg("feFuncA");Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR=new Svg$$module$build$src$core$utils$svg("feGaussianBlur");
|
|
@@ -700,9 +716,9 @@ this.disabledReason=a}isNull(){return this.oldValue===this.newValue}run(a){var b
|
|
|
700
716
|
c.bubbleIsVisible()&&c.setBubbleVisible(!1);a=a?this.newValue:this.oldValue;switch(this.element){case "field":(b=b.getField(this.name))?b.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(!!a);break;case "disabled":var d;b.setDisabledReason(!!a,null!=(d=this.disabledReason)?d:MANUALLY_DISABLED$$module$build$src$core$constants);break;case "inline":b.setInputsInline(!!a);break;case "mutation":d=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(b);
|
|
701
717
|
b.loadExtraState?b.loadExtraState(JSON.parse(a||"{}")):b.domToMutation&&b.domToMutation($.textToDom$$module$build$src$core$utils$xml(a||"<mutation/>"));fire$$module$build$src$core$events$utils(new BlockChange$$module$build$src$core$events$events_block_change(b,"mutation",null,d,a));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(a){return a.saveExtraState?(a=a.saveExtraState(!0))?JSON.stringify(a):"":a.mutationToDom?(a=a.mutationToDom())?domToText$$module$build$src$core$xml(a):
|
|
702
718
|
"":""}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_CHANGE,BlockChange$$module$build$src$core$events$events_block_change);var module$build$src$core$events$events_block_change={};module$build$src$core$events$events_block_change.BlockChange=BlockChange$$module$build$src$core$events$events_block_change;var module$build$src$core$utils$math={};module$build$src$core$utils$math.clamp=clamp$$module$build$src$core$utils$math;module$build$src$core$utils$math.toDegrees=toDegrees$$module$build$src$core$utils$math;module$build$src$core$utils$math.toRadians=toRadians$$module$build$src$core$utils$math;var ARROW_SIZE$$module$build$src$core$dropdowndiv=16,BORDER_SIZE$$module$build$src$core$dropdowndiv=1,ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv=12,PADDING_Y$$module$build$src$core$dropdowndiv=16,ANIMATION_TIME$$module$build$src$core$dropdowndiv=.25,animateOutTimer$$module$build$src$core$dropdowndiv=null,onHide$$module$build$src$core$dropdowndiv=null,renderedClassName$$module$build$src$core$dropdowndiv="",themeClassName$$module$build$src$core$dropdowndiv="",div$$module$build$src$core$dropdowndiv,
|
|
703
|
-
content$$module$build$src$core$dropdowndiv,arrow$$module$build$src$core$dropdowndiv,boundsElement$$module$build$src$core$dropdowndiv=null,owner$$module$build$src$core$dropdowndiv=null,positionToField$$module$build$src$core$dropdowndiv=null,returnEphemeralFocus$$module$build$src$core$dropdowndiv=null,internal$$module$build$src$core$dropdowndiv={getBoundsInfo:function(){const a=getPageOffset$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv),
|
|
704
|
-
return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}},getPositionMetrics:function(a,b,c,d){const e=internal$$module$build$src$core$dropdowndiv.getBoundsInfo(),f=getSize$$module$build$src$core$utils$style(div$$module$build$src$core$dropdowndiv);return b+f.height<e.bottom?getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>e.top?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,
|
|
705
|
-
getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>document.documentElement.clientTop?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,d,e,f):getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv(a,e,f)}},TEST_ONLY$$module$build$src$core$dropdowndiv=internal$$module$build$src$core$dropdowndiv,module$build$src$core$dropdowndiv={ANIMATION_TIME:ANIMATION_TIME$$module$build$src$core$dropdowndiv,ARROW_HORIZONTAL_PADDING:ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv,
|
|
719
|
+
content$$module$build$src$core$dropdowndiv,arrow$$module$build$src$core$dropdowndiv,boundsElement$$module$build$src$core$dropdowndiv=null,owner$$module$build$src$core$dropdowndiv=null,positionToField$$module$build$src$core$dropdowndiv=null,returnEphemeralFocus$$module$build$src$core$dropdowndiv=null,keydownListener$$module$build$src$core$dropdowndiv=null,internal$$module$build$src$core$dropdowndiv={getBoundsInfo:function(){const a=getPageOffset$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv),
|
|
720
|
+
b=getSize$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv);return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}},getPositionMetrics:function(a,b,c,d){const e=internal$$module$build$src$core$dropdowndiv.getBoundsInfo(),f=getSize$$module$build$src$core$utils$style(div$$module$build$src$core$dropdowndiv);return b+f.height<e.bottom?getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>e.top?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,
|
|
721
|
+
d,e,f):b+f.height<document.documentElement.clientHeight?getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>document.documentElement.clientTop?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,d,e,f):getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv(a,e,f)}},TEST_ONLY$$module$build$src$core$dropdowndiv=internal$$module$build$src$core$dropdowndiv,module$build$src$core$dropdowndiv={ANIMATION_TIME:ANIMATION_TIME$$module$build$src$core$dropdowndiv,ARROW_HORIZONTAL_PADDING:ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv,
|
|
706
722
|
ARROW_SIZE:ARROW_SIZE$$module$build$src$core$dropdowndiv,BORDER_SIZE:BORDER_SIZE$$module$build$src$core$dropdowndiv,PADDING_Y:PADDING_Y$$module$build$src$core$dropdowndiv,TEST_ONLY:internal$$module$build$src$core$dropdowndiv};module$build$src$core$dropdowndiv.clearContent=clearContent$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.createDom=createDom$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.getContentDiv=getContentDiv$$module$build$src$core$dropdowndiv;
|
|
707
723
|
module$build$src$core$dropdowndiv.getOwner=getOwner$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.getPositionX=getPositionX$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.hide=hide$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.hideIfOwner=hideIfOwner$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.hideWithoutAnimation=hideWithoutAnimation$$module$build$src$core$dropdowndiv;
|
|
708
724
|
module$build$src$core$dropdowndiv.isVisible=isVisible$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.repositionForWindowResize=repositionForWindowResize$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.setBoundsElement=setBoundsElement$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.setColour=setColour$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.show=show$$module$build$src$core$dropdowndiv;
|
|
@@ -714,24 +730,24 @@ module$build$src$core$utils$colour.getHsvSaturation=getHsvSaturation$$module$bui
|
|
|
714
730
|
module$build$src$core$utils$colour.names=names$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.parse=parse$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.rgbToHex=rgbToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvSaturation=setHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvValue=setHsvValue$$module$build$src$core$utils$colour;var module$build$src$core$utils$parsing={};module$build$src$core$utils$parsing.checkMessageReferences=checkMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.parseBlockColour=parseBlockColour$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.replaceMessageReferences=replaceMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.tokenizeInterpolation=tokenizeInterpolation$$module$build$src$core$utils$parsing;var Field$$module$build$src$core$field=class{get size_(){return this.size}set size_(a){this.size=a}constructor(a,b,c){this.DEFAULT_VALUE=null;this.name=void 0;this.tooltip=this.validator_=null;this.size=new Size$$module$build$src$core$utils$size(0,0);this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=null;this.disposed=!1;this.maxDisplayLength=50;this.sourceBlock_=null;this.enabled_=this.visible_=this.isDirty_=!0;this.suffixField=this.prefixField=
|
|
715
731
|
this.clickTarget_=null;this.EDITABLE=!0;this.SERIALIZABLE=!1;this.id_=null;this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE;this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){a.tooltip&&this.setTooltip(replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip))}setSourceBlock(a){if(this.sourceBlock_)throw Error("Field already bound to a block");
|
|
716
732
|
this.sourceBlock_=a;this.id_=`${a.id}_field_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`}getConstants(){!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_}getSourceBlock(){return this.sourceBlock_}init(){if(!this.fieldGroup_){var a=this.id_;if(!a)throw Error("Expected ID to be defined prior to init.");this.fieldGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
717
|
-
{
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
return
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
this.
|
|
724
|
-
a
|
|
725
|
-
|
|
726
|
-
c
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
a
|
|
733
|
-
|
|
734
|
-
return
|
|
733
|
+
{id:a});this.isVisible()||(this.fieldGroup_.style.display="none");this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_);this.initView();this.updateEditable();this.setTooltip(this.tooltip);this.bindEvents_();this.initModel();this.applyColour()}}initView(){this.createBorderRect_();this.createTextElement_();this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField")}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
734
|
+
{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText blocklyFieldText"},this.fieldGroup_);this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=
|
|
735
|
+
document.createTextNode("");this.textElement_.appendChild(this.textContent_)}bindEvents_(){const a=this.getClickTarget_();if(!a)throw Error("A click target has not been set.");bindMouseEvents$$module$build$src$core$tooltip(a);this.mouseDownWrapper=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown_)}fromXml(a){this.setValue(a.textContent)}toXml(a){a.textContent=this.getValue();return a}saveState(a){a=this.saveLegacyState(Field$$module$build$src$core$field);
|
|
736
|
+
return null!==a?a:this.getValue()}loadState(a){this.loadLegacyState(Field$$module$build$src$core$field,a)||this.setValue(a)}saveLegacyState(a){return a.prototype.saveState===this.saveState&&a.prototype.toXml!==this.toXml?(a=$.createElement$$module$build$src$core$utils$xml("field"),a.setAttribute("name",this.name||""),domToText$$module$build$src$core$utils$xml(this.toXml(a)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(a,b){return a.prototype.loadState===this.loadState&&
|
|
737
|
+
a.prototype.fromXml!==this.fromXml?(this.fromXml($.textToDom$$module$build$src$core$utils$xml(b)),!0):!1}dispose(){hideIfOwner$$module$build$src$core$dropdowndiv(this);hideIfOwner$$module$build$src$core$widgetdiv(this);let a;(null==(a=this.getSourceBlock())?0:a.isDeadOrDying())||removeNode$$module$build$src$core$utils$dom(this.fieldGroup_);this.disposed=!0}updateEditable(){const a=this.fieldGroup_,b=this.getSourceBlock();this.EDITABLE&&a&&b&&(this.enabled_&&b.isEditable()?(addClass$$module$build$src$core$utils$dom(a,
|
|
738
|
+
"blocklyEditableField"),removeClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableField")):(addClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableField"),removeClass$$module$build$src$core$utils$dom(a,"blocklyEditableField")))}setEnabled(a){this.enabled_=a;this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Field$$module$build$src$core$field.prototype.showEditor_}isClickableInFlyout(a){return!a}isCurrentlyEditable(){return this.enabled_&&
|
|
739
|
+
this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let a=!1;this.name&&(this.SERIALIZABLE?a=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),a=!0));return a}isVisible(){return this.visible_}setVisible(a){if(this.visible_!==a){this.visible_=a;var b=this.fieldGroup_;b&&(b.style.display=a?"block":"none")}}setValidator(a){this.validator_=
|
|
740
|
+
a}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=
|
|
741
|
+
this.getDisplayText_());this.updateSize_()}showEditor(a){this.isClickable()&&this.showEditor_(a)}showEditor_(a){}repositionForWindowResize(){return!1}updateSize_(a){const b=this.getConstants();a=void 0!==a?a:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let c=2*a,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=getTextWidth$$module$build$src$core$utils$dom(this.textElement_),c+=e);this.isFullBlockField()||(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_.height=d;this.size_.width=
|
|
742
|
+
c;this.positionTextElement_(a,e);this.positionBorderRect_()}positionTextElement_(a,b){if(this.textElement_){var c=this.getConstants(),d=this.size_.height/2,e;this.textElement_.setAttribute("x",String((null==(e=this.getSourceBlock())?0:e.RTL)?this.size_.width-b-a:a));this.textElement_.setAttribute("y",String(c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",
|
|
743
|
+
String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){if(!this.isVisible())return new Size$$module$build$src$core$utils$size(0,0);this.isDirty_&&(this.render_(),this.isDirty_=!1);return this.size_}getScaledBBox(){let a;var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;if(this.isFullBlockField()){var c=
|
|
744
|
+
this.sourceBlock_.getHeightWidth();const d=b.workspace.scale;a=this.getAbsoluteXY_();b=(c.width+1)*d;c=(c.height+1)*d;GECKO$$module$build$src$core$utils$useragent?(a.x+=1.5*d,a.y+=1.5*d):(a.x-=.5*d,a.y-=.5*d)}else c=this.borderRect_.getBoundingClientRect(),a=getPageOffset$$module$build$src$core$utils$style(this.borderRect_),b=c.width,c=c.height;return new Rect$$module$build$src$core$utils$rect(a.y,a.y+c,a.x,a.x+b)}onLocationChange(a){}getDisplayText_(){let a=this.getText();a.length>this.maxDisplayLength&&
|
|
745
|
+
(a=a.substring(0,this.maxDisplayLength-2)+"\u2026");a=a.replace(/\s/g,Field$$module$build$src$core$field.NBSP);this.sourceBlock_&&this.sourceBlock_.RTL&&(a+="\u200f");return a}getText(){const a=this.getText_();return null!==a?String(a):String(this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0;this.constants_=null}forceRerender(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(a,b=!0){if(null!==a){var c=$.getGroup$$module$build$src$core$events$utils();
|
|
746
|
+
c||$.setGroup$$module$build$src$core$events$utils(!0);try{const k=this.doClassValidation_(a),l=this.processValidation(a,k,b);if(!(l instanceof Error)){var d,e=null==(d=this.getValidator())?void 0:d.call(this,l),f=this.processValidation(l,e,b);if(!(f instanceof Error)){var g=this.sourceBlock_;if(!g||!g.disposed){var h=this.getValue();h===f?this.doValueUpdate_(f):(this.doValueUpdate_(f),b&&g&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(g,
|
|
747
|
+
"field",this.name||null,h,f)),this.isDirty_&&this.forceRerender())}}}}finally{$.setGroup$$module$build$src$core$events$utils(c)}}}processValidation(a,b,c){return null===b?(this.doValueInvalid_(a,c),this.isDirty_&&this.forceRerender(),Error()):void 0===b?a:b}getValue(){return this.value_}doClassValidation_(a){return null===a||void 0===a?null:a}doValueUpdate_(a){this.value_=a;this.isDirty_=!0}doValueInvalid_(a,b){}onMouseDown_(a){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(a=this.sourceBlock_.workspace.getGesture(a))&&
|
|
748
|
+
a.setStartField(this)}setTooltip(a){a||""===a||(a=this.sourceBlock_);const b=this.getClickTarget_();b?b.tooltip=a:this.tooltip=a}getTooltip(){const a=this.getClickTarget_();return a?getTooltipOfObject$$module$build$src$core$tooltip(a):getTooltipOfObject$$module$build$src$core$tooltip({tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return getPageOffset$$module$build$src$core$utils$style(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let a=
|
|
749
|
+
null;const b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;const c=b.inputList;for(let d=0;d<b.inputList.length;d++){const e=c[d],f=e.fieldRow;for(let g=0;g<f.length;g++)if(f[g]===this){a=e;break}}return a}getFlipRtl(){return!1}onShortcut(a){return!1}getFocusableElement(){if(!this.fieldGroup_)throw Error("This field currently has no representative DOM element.");return this.fieldGroup_}getFocusableTree(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;
|
|
750
|
+
return a.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}static fromJson(a){throw Error("Attempted to instantiate a field from the registry that hasn't defined a 'fromJson' method.");}};Field$$module$build$src$core$field.NBSP="\u00a0";Field$$module$build$src$core$field.SKIP_SETUP=Symbol("SKIP_SETUP");
|
|
735
751
|
var UnattachedFieldError$$module$build$src$core$field=class extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}},module$build$src$core$field={};module$build$src$core$field.Field=Field$$module$build$src$core$field;module$build$src$core$field.UnattachedFieldError=UnattachedFieldError$$module$build$src$core$field;var owner$$module$build$src$core$widgetdiv=null,ownerWorkspace$$module$build$src$core$widgetdiv=null,dispose$$module$build$src$core$widgetdiv=null,containerClassName$$module$build$src$core$widgetdiv="blocklyWidgetDiv",rendererClassName$$module$build$src$core$widgetdiv="",themeClassName$$module$build$src$core$widgetdiv="",containerDiv$$module$build$src$core$widgetdiv,returnEphemeralFocus$$module$build$src$core$widgetdiv=null,module$build$src$core$widgetdiv={};
|
|
736
752
|
module$build$src$core$widgetdiv.createDom=createDom$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.getDiv=getDiv$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hide=hide$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hideIfOwner=hideIfOwner$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hideIfOwnerIsInWorkspace=hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.isVisible=isVisible$$module$build$src$core$widgetdiv;
|
|
737
753
|
module$build$src$core$widgetdiv.positionWithAnchor=positionWithAnchor$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.repositionForWindowResize=repositionForWindowResize$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.show=show$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.testOnly_setDiv=testOnly_setDiv$$module$build$src$core$widgetdiv;var currentBlock$$module$build$src$core$contextmenu=null,dummyOwner$$module$build$src$core$contextmenu={},menu_$$module$build$src$core$contextmenu=null,module$build$src$core$contextmenu={};module$build$src$core$contextmenu.callbackFactory=$.callbackFactory$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.dispose=dispose$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.getCurrentBlock=getCurrentBlock$$module$build$src$core$contextmenu;
|
|
@@ -769,14 +785,14 @@ a,b))}fireCollapseEvent(a){isEnabled$$module$build$src$core$events$utils()&&fire
|
|
|
769
785
|
fire$$module$build$src$core$events$utils(b)}getSize(){return this.size}setCollapsed(a){this.collapsed=a;this.fireCollapseEvent(a)}isCollapsed(){return this.collapsed}setEditable(a){this.editable=a}isEditable(){return this.isOwnEditable()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setMovable(a){this.movable=a}isMovable(){return this.isOwnMovable()&&!this.workspace.isReadOnly()}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&&
|
|
770
786
|
!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnDeletable(){return this.deletable}moveTo(a,b){const c=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this);b&&c.setReason(b);this.location=a;c.recordNew();fire$$module$build$src$core$events$utils(c)}getRelativeToSurfaceXY(){return this.location}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||
|
|
771
787
|
this.disposed}},module$build$src$core$comments$workspace_comment={};module$build$src$core$comments$workspace_comment.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment=class extends WorkspaceComment$$module$build$src$core$comments$workspace_comment{constructor(a,b){super(a,b);this.dragStrategy=new CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy(this);this.workspace=a;this.view=new CommentView$$module$build$src$core$comments$comment_view(a);this.view.setSize(this.getSize());this.view.setEditable(this.isEditable());this.view.getSvgRoot().setAttribute("data-id",
|
|
772
|
-
this.id);this.view.getSvgRoot().setAttribute("id",this.id);this.
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
"blocklySelected");fireSelectedEvent$$module$build$src$core$common(
|
|
778
|
-
|
|
779
|
-
|
|
788
|
+
this.id);this.view.getSvgRoot().setAttribute("id",this.id);this.addModelUpdateBindings();conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"pointerdown",this,this.startGesture);conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"wheel",this,c=>{c.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));this.view.addOnCollapseListener(()=>
|
|
789
|
+
void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(a){this.view.setText(a)}setPlaceholderText(a){this.view.setPlaceholderText(a)}setSize(a){this.view.setSize(a)}setCollapsed(a){this.view.setCollapsed(a)}setEditable(a){super.setEditable(a);this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const a=this.getRelativeToSurfaceXY();var b,
|
|
790
|
+
c;const d=null!=(c=null==(b=this.view)?void 0:b.getSize())?c:this.getSize();this.workspace.RTL?(b=a.x-d.width,c=a.x):(b=a.x,c=a.x+d.width);return new Rect$$module$build$src$core$utils$rect(a.y,a.y+d.height,b,c)}moveBy(a,b,c){const d=this.getRelativeToSurfaceXY();a=new Coordinate$$module$build$src$core$utils$coordinate(d.x+a,d.y+b);this.moveTo(a,c)}moveTo(a,b){super.moveTo(a,b);this.view.moveTo(a)}moveDuringDrag(a){this.location=a;this.view.moveTo(a)}setDragging(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
791
|
+
"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;const a=$.getFocusManager$$module$build$src$core$focus_manager();a.getFocusedNode()===this&&setTimeout(()=>a.focusTree(this.workspace),0);this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(isTargetInput$$module$build$src$core$browser_events(a)?a.stopPropagation():b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?
|
|
792
|
+
addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected");fireSelectedEvent$$module$build$src$core$common(this)}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
793
|
+
"blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,focusedNode:this},a);let c;c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
|
|
794
|
+
a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
|
|
795
|
+
let a;null==(a=this.workspace.getLayerManager())||a.append(this,BLOCK$$module$build$src$core$layers)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={};module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
|
|
780
796
|
module$build$src$core$xml.domToBlock=$.domToBlock$$module$build$src$core$xml;module$build$src$core$xml.domToBlockInternal=domToBlockInternal$$module$build$src$core$xml;module$build$src$core$xml.domToPrettyText=domToPrettyText$$module$build$src$core$xml;module$build$src$core$xml.domToText=domToText$$module$build$src$core$xml;module$build$src$core$xml.domToVariables=domToVariables$$module$build$src$core$xml;module$build$src$core$xml.domToWorkspace=$.domToWorkspace$$module$build$src$core$xml;
|
|
781
797
|
module$build$src$core$xml.loadWorkspaceComment=loadWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.saveWorkspaceComment=saveWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.variablesToDom=variablesToDom$$module$build$src$core$xml;module$build$src$core$xml.workspaceToDom=workspaceToDom$$module$build$src$core$xml;var BlockCreate$$module$build$src$core$events$events_block_create=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.xml=blockToDomWithXY$$module$build$src$core$xml(a),this.ids=getDescendantIds$$module$build$src$core$events$utils(a),this.json=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0}))}toJson(){const a=super.toJson();
|
|
782
798
|
if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,
|
|
@@ -818,7 +834,7 @@ if(!a.length)throw TypeError("FieldDropdown options must not be an empty array."
|
|
|
818
834
|
Found ${d[1]} in: ${d}`)):!d[0]||"string"===typeof d[0]||isImageProperties$$module$build$src$core$field_dropdown(d[0])||"undefined"!==typeof HTMLElement&&d[0]instanceof HTMLElement||(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
819
835
|
label, image description, or HTML element. Found ${d[0]} in: ${d}`)):(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must be an array or
|
|
820
836
|
the string literal 'separator'. Found: ${d}`))}if(b)throw TypeError("Found invalid FieldDropdown options.");}};FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR="separator";FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR="\u25be";FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET=5;FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING=2*FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET;
|
|
821
|
-
register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var
|
|
837
|
+
register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var Theme$$module$build$src$core$theme=class{constructor(a,b,c,d){this.name=a;this.startHats=!1;this.blockStyles=b||Object.create(null);this.categoryStyles=c||Object.create(null);this.componentStyles=d||Object.create(null);this.fontStyle=Object.create(null);register$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(a,b){this.blockStyles[a]=b}setCategoryStyle(a,b){this.categoryStyles[a]=b}getComponentStyle(a){a=
|
|
822
838
|
this.componentStyles[a];if(!a)return null;if("string"===typeof a){const b=this.getComponentStyle(a);if(b)return b}return`${a}`}setComponentStyle(a,b){this.componentStyles[a]=b}setFontStyle(a){this.fontStyle=a}setStartHats(a){this.startHats=a}static defineTheme(a,b){a=a.toLowerCase();const c=new Theme$$module$build$src$core$theme(a);let d=b.base;if(d){if("string"===typeof d){let e;d=null!=(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,d))?e:void 0}d instanceof
|
|
823
839
|
Theme$$module$build$src$core$theme&&(deepMerge$$module$build$src$core$utils$object(c,d),c.name=a)}deepMerge$$module$build$src$core$utils$object(c.blockStyles,b.blockStyles);deepMerge$$module$build$src$core$utils$object(c.categoryStyles,b.categoryStyles);deepMerge$$module$build$src$core$utils$object(c.componentStyles,b.componentStyles);deepMerge$$module$build$src$core$utils$object(c.fontStyle,b.fontStyle);null!==b.startHats&&(c.startHats=b.startHats);return c}},module$build$src$core$theme={};
|
|
824
840
|
module$build$src$core$theme.Theme=Theme$$module$build$src$core$theme;var defaultBlockStyles$$module$build$src$core$theme$classic={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},categoryStyles$$module$build$src$core$theme$classic={colour_category:{colour:"20"},
|
|
@@ -832,18 +848,17 @@ b){const c=a.move||{},d={};void 0===c.scrollbars&&void 0===a.scrollbars?d.scroll
|
|
|
832
848
|
{};module$build$src$core$options.Options=Options$$module$build$src$core$options;var BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy=class{constructor(a,b){this.bubble=a;this.workspace=b;this.startLoc=null}isMovable(){return!0}startDrag(){this.startLoc=this.bubble.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;null==(a=this.workspace.getLayerManager())||a.moveToDragLayer(this.bubble);this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(a){this.bubble.moveDuringDrag(a)}endDrag(){this.workspace.setResizesEnabled(!0);let a;null==
|
|
833
849
|
(a=this.workspace.getLayerManager())||a.moveOffDragLayer(this.bubble,BUBBLE$$module$build$src$core$layers);this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},module$build$src$core$dragging$bubble_drag_strategy={};module$build$src$core$dragging$bubble_drag_strategy.BubbleDragStrategy=BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy;var _a$$module$build$src$core$bubbles$bubble,Bubble$$module$build$src$core$bubbles$bubble=class{constructor(a,b,c,d){this.workspace=a;this.anchor=b;this.ownerRect=c;this.size=new Size$$module$build$src$core$utils$size(0,0);this.colour="#ffffff";this.disposed=!1;this.relativeLeft=this.relativeTop=0;this.dragStrategy=new BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy(this,this.workspace);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
834
850
|
{"class":"blocklyBubble"},a.getBubbleCanvas());a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyEmboss"},this.svgRoot);this.tail=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyBubbleTail"},a);this.background=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyDraggable",x:0,y:0,rx:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,
|
|
835
|
-
ry:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);this.contentContainer=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},this.svgRoot);this.focusableElement=null!=d?d:this.svgRoot;this.focusableElement.setAttribute("id",this.id);
|
|
836
|
-
|
|
837
|
-
`${a.
|
|
838
|
-
a
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
this.renderTail()}setDragging(a){}setDeleteStyle(a){}isDeletable(){return!1}showContextMenu(a){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){fireSelectedEvent$$module$build$src$core$common(this)}unselect(){fireSelectedEvent$$module$build$src$core$common(null)}getFocusableElement(){return this.focusableElement}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
|
|
851
|
+
ry:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);this.contentContainer=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},this.svgRoot);this.focusableElement=null!=d?d:this.svgRoot;this.focusableElement.setAttribute("id",this.id);conditionalBind$$module$build$src$core$browser_events(this.background,"pointerdown",this,this.onMouseDown)}dispose(){removeNode$$module$build$src$core$utils$dom(this.svgRoot);this.disposed=!0}setAnchorLocation(a,b=!1){this.anchor=
|
|
852
|
+
a;b?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor();this.renderTail()}setPositionRelativeToAnchor(a,b){this.relativeLeft=a;this.relativeTop=b;this.positionRelativeToAnchor();this.renderTail()}getSize(){return this.size}setSize(a,b=!1){a.width=Math.max(a.width,_a$$module$build$src$core$bubbles$bubble.MIN_SIZE);a.height=Math.max(a.height,_a$$module$build$src$core$bubbles$bubble.MIN_SIZE);this.size=a;this.background.setAttribute("width",`${a.width}`);this.background.setAttribute("height",
|
|
853
|
+
`${a.height}`);b?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor();this.renderTail()}getColour(){return this.colour}setColour(a){this.colour=a;this.tail.setAttribute("fill",a);this.background.setAttribute("fill",a)}onMouseDown(a){let b;null==(b=this.workspace.getGesture(a))||b.handleBubbleStart(a,this);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this)}positionRelativeToAnchor(){let a=this.anchor.x;a=this.workspace.RTL?a-(this.relativeLeft+this.size.width):
|
|
854
|
+
a+this.relativeLeft;this.moveTo(a,this.relativeTop+this.anchor.y)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a}, ${b})`)}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){var b=this.workspace.getMetricsManager().getViewMetrics(!0),c=this.getOptimalRelativeLeft(b),d=this.getOptimalRelativeTop(b);const e={x:c,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},f={x:-this.size.width-30,y:d};d={x:a.getWidth(),y:d};var g={x:c,y:a.getHeight()};
|
|
855
|
+
c=a.getWidth()<a.getHeight()?d:g;a=a.getWidth()<a.getHeight()?g:d;d=this.getOverlap(e,b);g=this.getOverlap(f,b);const h=this.getOverlap(c,b);b=this.getOverlap(a,b);b=Math.max(d,g,h,b);d===b?(this.relativeLeft=e.x,this.relativeTop=e.y):g===b?(this.relativeLeft=f.x,this.relativeTop=f.y):h===b?(this.relativeLeft=c.x,this.relativeTop=c.y):(this.relativeLeft=a.x,this.relativeTop=a.y);this.positionRelativeToAnchor()}getOverlap(a,b){var c=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x+this.anchor.x;
|
|
856
|
+
a=a.y+this.anchor.y;return Math.max(0,Math.min(1,(Math.min(c+this.size.width,b.left+b.width)-Math.max(c,b.left))*(Math.min(a+this.size.height,b.top+b.height)-Math.max(a,b.top))/(this.size.width*this.size.height)))}getOptimalRelativeLeft(a){let b=-this.size.width/4;if(this.size.width>a.width)return b;a=this.getWorkspaceViewRect(a);if(this.workspace.RTL){var c=this.anchor.x-b;c-this.size.width<a.left?b=-(a.left-this.anchor.x+this.size.width):c>a.right&&(b=-(a.right-this.anchor.x))}else{c=b+this.anchor.x;
|
|
857
|
+
const d=c+this.size.width;c<a.left?b=a.left-this.anchor.x:d>a.right&&(b=a.right-this.anchor.x-this.size.width)}return b}getOptimalRelativeTop(a){let b=-this.size.height/4;if(this.size.height>a.height)return b;const c=this.anchor.y+b,d=c+this.size.height;a=this.getWorkspaceViewRect(a);c<a.top?b=a.top-this.anchor.y:d>a.bottom&&(b=a.bottom-this.anchor.y-this.size.height);return b}getWorkspaceViewRect(a){const b=a.top;let c=a.top+a.height,d=a.left;a=a.left+a.width;c-=this.getScrollbarThickness();this.workspace.RTL?
|
|
858
|
+
d-=this.getScrollbarThickness():a-=this.getScrollbarThickness();return new Rect$$module$build$src$core$utils$rect(b,c,d,a)}getScrollbarThickness(){return Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness/this.workspace.scale}renderTail(){const a=[];var b=this.size.width/2,c=this.size.height/2,d=-this.relativeLeft,e=-this.relativeTop;if(b===d&&c===e)a.push("M "+b+","+c);else{e-=c;d-=b;this.workspace.RTL&&(d*=-1);var f=Math.sqrt(e*e+d*d),g=Math.acos(d/f);0>e&&(g=2*Math.PI-g);var h=g+Math.PI/
|
|
859
|
+
2;h>2*Math.PI&&(h-=2*Math.PI);var k=Math.sin(h);const m=Math.cos(h);let n=(this.size.width+this.size.height)/_a$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS;n=Math.min(n,this.size.width,this.size.height)/4;h=1-_a$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS/f;d=b+h*d;e=c+h*e;h=b+n*m;const p=c+n*k;b-=n*m;c-=n*k;k=toRadians$$module$build$src$core$utils$math(this.workspace.RTL?-_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE:_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE);k=g+
|
|
860
|
+
k;k>2*Math.PI&&(k-=2*Math.PI);g=Math.sin(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;f=Math.cos(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;a.push("M"+h+","+p);a.push("C"+(h+f)+","+(p+g)+" "+d+","+e+" "+d+","+e);a.push("C"+d+","+e+" "+(b+f)+","+(c+g)+" "+b+","+c)}a.push("z");let l;null==(l=this.tail)||l.setAttribute("d",a.join(" "))}bringToFront(){let a;const b=null==(a=this.svgRoot)?void 0:a.parentNode;return this.svgRoot&&(null==b?void 0:b.lastChild)!==this.svgRoot?(null==
|
|
861
|
+
b||b.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(a){this.moveTo(a.x,a.y);this.relativeLeft=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x-this.anchor.x;this.relativeTop=a.y-this.anchor.y;this.renderTail()}setDragging(a){}setDeleteStyle(a){}isDeletable(){return!1}showContextMenu(a){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){fireSelectedEvent$$module$build$src$core$common(this)}unselect(){fireSelectedEvent$$module$build$src$core$common(null)}getFocusableElement(){return this.focusableElement}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
|
|
847
862
|
this.bringToFront()}onNodeBlur(){this.unselect()}canBeFocused(){return!0}};_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6;Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER=2*_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH;Bubble$$module$build$src$core$bubbles$bubble.MIN_SIZE=_a$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;
|
|
848
863
|
Bubble$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS=1;Bubble$$module$build$src$core$bubbles$bubble.TAIL_ANGLE=20;Bubble$$module$build$src$core$bubbles$bubble.TAIL_BEND=4;Bubble$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS=8;var module$build$src$core$bubbles$bubble={};module$build$src$core$bubbles$bubble.Bubble=Bubble$$module$build$src$core$bubbles$bubble;var MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d){super(b,c,d);this.workspace=b;this.anchor=c;this.ownerRect=d;this.autoLayout=!0;b=new Options$$module$build$src$core$options(a);this.validateWorkspaceOptions(b);this.svgDialog=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},
|
|
849
864
|
this.contentContainer);a.parentWorkspace=this.workspace;this.miniWorkspace=this.newWorkspaceSvg(new Options$$module$build$src$core$options(a));this.miniWorkspace.internalIsMutator=!0;a=this.miniWorkspace.createDom("blocklyMutatorBackground");this.svgDialog.appendChild(a);b.languageTree&&(a.insertBefore(this.miniWorkspace.addFlyout(Svg$$module$build$src$core$utils$svg.G),this.miniWorkspace.getCanvas()),a=this.miniWorkspace.getFlyout(),null==a||a.init(this.miniWorkspace),null==a||a.show(b.languageTree));
|
|
@@ -854,8 +869,8 @@ Math.abs(a.height-b.height)<MiniWorkspaceBubble$$module$build$src$core$bubbles$m
|
|
|
854
869
|
b.height+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var a=this.miniWorkspace.getCanvas().getBBox();let b=a.width+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;a=a.height+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;const c=this.miniWorkspace.getFlyout();if(c){const d=c.getWorkspace().getMetricsManager().getScrollMetrics();
|
|
855
870
|
a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core$utils$size(b,a)}updateBlockStyles(){for(var a of this.miniWorkspace.getAllBlocks(!1))a.setStyle(a.getStyleName());let b;if(a=null==(b=this.miniWorkspace.getFlyout())?void 0:b.getWorkspace())for(const c of a.getAllBlocks(!1))c.setStyle(c.getStyleName())}moveDuringDrag(a){super.moveDuringDrag(a);this.autoLayout=!1}moveTo(a,b){super.moveTo(a,b);this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(a){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts");
|
|
856
871
|
}};MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE=10;MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN=3*Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;var module$build$src$core$bubbles$mini_workspace_bubble={};module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;var Icon$$module$build$src$core$icons$icon=class{constructor(a){this.sourceBlock=a;this.offsetInBlock=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspaceLocation=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.svgRoot=null;this.tooltip=a;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}getType(){throw Error("Icons must implement getType");}initView(a){if(!this.svgRoot){var b=this.sourceBlock;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
857
|
-
{"class":"blocklyIconGroup",
|
|
858
|
-
|
|
872
|
+
{"class":"blocklyIconGroup",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot)}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,0)}setTooltip(a){this.tooltip=
|
|
873
|
+
null!=a?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){let a;
|
|
859
874
|
null==(a=this.svgRoot)||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){const a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getSourceBlock(){return this.sourceBlock}},
|
|
860
875
|
module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
|
|
861
876
|
$.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a,b){super(b);this.flyoutBlockTypes=a;this.sourceBlock=b;this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconShape",
|
|
@@ -1033,7 +1048,7 @@ b=this.getPaddedContent_(b,d);d=void 0!==c.top?c.top:b.top;const e=void 0!==c.le
|
|
|
1033
1048
|
f=this.getContentMetrics(),g=this.getScrollMetrics(!1,e,f);return{contentHeight:f.height,contentWidth:f.width,contentTop:f.top,contentLeft:f.left,scrollHeight:g.height,scrollWidth:g.width,scrollTop:g.top,scrollLeft:g.left,viewHeight:e.height,viewWidth:e.width,viewTop:e.top,viewLeft:e.left,absoluteTop:d.top,absoluteLeft:d.left,svgHeight:c.height,svgWidth:c.width,toolboxWidth:a.width,toolboxHeight:a.height,toolboxPosition:a.position,flyoutWidth:b.width,flyoutHeight:b.height}}};
|
|
1034
1049
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,DEFAULT$$module$build$src$core$registry,MetricsManager$$module$build$src$core$metrics_manager);var module$build$src$core$metrics_manager={};module$build$src$core$metrics_manager.MetricsManager=MetricsManager$$module$build$src$core$metrics_manager;var FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager=class extends MetricsManager$$module$build$src$core$metrics_manager{constructor(a,b){super(a);this.flyout_=b}getBoundingBox(){let a;try{a=this.workspace_.getCanvas().getBBox()}catch(b){a={height:0,y:0,width:0,x:0}}return a}getContentMetrics(a){const b=this.getBoundingBox();a=a?1:this.workspace_.scale;return{height:b.height*a,width:b.width*a,top:b.y*a,left:b.x*a}}getScrollMetrics(a,b,c){b=c||this.getContentMetrics();c=this.flyout_.MARGIN*
|
|
1035
1050
|
this.workspace_.scale;a=a?this.workspace_.scale:1;return{height:(b.height+2*c)/a,width:(b.width+b.left+c)/a,top:0,left:0}}},module$build$src$core$flyout_metrics_manager={};module$build$src$core$flyout_metrics_manager.FlyoutMetricsManager=FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager;var FlyoutButton$$module$build$src$core$flyout_button=class{constructor(a,b,c,d){this.workspace=a;this.targetWorkspace=b;this.isFlyoutLabel=d;this.height=this.width=0;this.cursorSvg=this.svgText=null;this.text=c.text;this.position=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.callbackKey=c.callbackKey||c.callbackkey;this.cssClass=c["web-class"]||null;this.info=c;a=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(a+=" "+this.cssClass);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();
|
|
1036
|
-
this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{id:this.id,"class":a
|
|
1051
|
+
this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{id:this.id,"class":a},this.workspace.getCanvas());let e;this.isFlyoutLabel||(e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyFlyoutButtonShadow",rx:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS,ry:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS,x:1,y:1},this.svgGroup));a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
1037
1052
|
{"class":this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS,ry:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS},this.svgGroup);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);c=replaceMessageReferences$$module$build$src$core$utils$parsing(this.text);
|
|
1038
1053
|
this.workspace.RTL&&(c+="\u200f");b.textContent=c;this.isFlyoutLabel&&(this.svgText=b,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));d=getComputedStyle$$module$build$src$core$utils$style(b,"fontSize");const f=getComputedStyle$$module$build$src$core$utils$style(b,"fontWeight"),g=getComputedStyle$$module$build$src$core$utils$style(b,"fontFamily");this.width=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(b,d,f,g);c=measureFontMetrics$$module$build$src$core$utils$dom(c,
|
|
1039
1054
|
d,f,g);this.height=this.height||c.height;if(!this.isFlyoutLabel){this.width+=2*FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X;this.height+=2*FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y;let h;null==(h=e)||h.setAttribute("width",String(this.width));let k;null==(k=e)||k.setAttribute("height",String(this.height))}a.setAttribute("width",String(this.width));a.setAttribute("height",String(this.height));b.setAttribute("x",String(this.width/2));b.setAttribute("y",String(this.height/
|
|
@@ -1046,18 +1061,15 @@ var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.F
|
|
|
1046
1061
|
module$build$src$core$keyboard_nav$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy;var FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy=class{constructor(a,b){this.policy=a;this.flyout=b}getFirstChild(a){return null}getParent(a){return this.policy.getParent(a)}getNextSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===a);if(-1===c)return null;c++;c>=b.length&&(c=0);return b[c].getElement()}getPreviousSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===
|
|
1047
1062
|
a);if(-1===c)return null;c--;0>c&&(c=b.length-1);return b[c].getElement()}isNavigable(a){return this.policy.isNavigable(a)}isApplicable(a){return this.policy.isApplicable(a)}},module$build$src$core$keyboard_nav$flyout_navigation_policy={};module$build$src$core$keyboard_nav$flyout_navigation_policy.FlyoutNavigationPolicy=FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy;var FlyoutSeparator$$module$build$src$core$flyout_separator=class{constructor(a,b){this.gap=a;this.axis=b;this.y=this.x=0}getBoundingRectangle(){switch(this.axis){case "x":return new Rect$$module$build$src$core$utils$rect(this.y,this.y,this.x,this.x+this.gap);case "y":return new Rect$$module$build$src$core$utils$rect(this.y,this.y+this.gap,this.x,this.x)}}moveBy(a,b,c){this.x+=a;this.y+=b}isNavigable(){return!1}getFocusableElement(){throw Error("Cannot be focused");}getFocusableTree(){throw Error("Cannot be focused");
|
|
1048
1063
|
}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}},module$build$src$core$flyout_separator={};module$build$src$core$flyout_separator.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;var FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return!1}isApplicable(a){return a instanceof FlyoutSeparator$$module$build$src$core$flyout_separator}},module$build$src$core$keyboard_nav$flyout_separator_navigation_policy={};
|
|
1049
|
-
module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
a
|
|
1056
|
-
a.
|
|
1057
|
-
|
|
1058
|
-
a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let g;if((null==(g=e.connection)?0:g.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}let f;return null!=(f=c.getIcons().pop())?f:null}isNavigable(a){let b;return a.canBeFocused()&&a.isVisible()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?
|
|
1059
|
-
0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){const b=a.getSourceBlock(),c=b.getIcons();a=c.indexOf(a);if(0<=a&&a+1<c.length)return c[a+1];for(const d of b.inputList){if(d.fieldRow.length)return d.fieldRow[0];let e;if(null==(e=d.connection)?0:e.targetBlock())return d.connection.targetBlock()}return null}getPreviousSibling(a){const b=a.getSourceBlock().getIcons();a=b.indexOf(a);
|
|
1060
|
-
return 1<=a?b[a-1]:null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof Icon$$module$build$src$core$icons$icon}},module$build$src$core$keyboard_nav$icon_navigation_policy={};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
|
|
1064
|
+
module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){return getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(a)[0]}getParent(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if(null==(c=a.outputConnection)?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){let b;if(null==(b=a.nextConnection)?0:b.targetBlock()){let d;
|
|
1065
|
+
return null==(d=a.nextConnection)?void 0:d.targetBlock()}let c;return(null==(c=a.outputConnection)?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):null}getPreviousSibling(a){let b;if(null==(b=a.previousConnection)?0:b.targetBlock()){let d;return null==(d=a.previousConnection)?void 0:d.targetBlock()}let c;
|
|
1066
|
+
return(null==(c=a.outputConnection)?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}},module$build$src$core$keyboard_nav$block_navigation_policy={};
|
|
1067
|
+
module$build$src$core$keyboard_nav$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateStacks=navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy=class{getFirstChild(a){return a.getParentInput()?a.targetConnection:null}getParent(a){return a.getSourceBlock()}getNextSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){const c=a.targetConnection;var b=a.getSourceBlock();if(!c&&b.getRootBlock().lastConnectionInStack(!1)===
|
|
1068
|
+
a){a=b.workspace.getTopBlocks(!0);b=a.indexOf(b.getRootBlock())+1;b>=a.length&&(b=0);b=a[b];let d;return null!=(d=this.getParentConnection(b))?d:b}return c}return a.getSourceBlock()}getPreviousSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1);if(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE){const c=a.targetConnection&&
|
|
1069
|
+
!a.targetConnection.getParentInput()?a.targetConnection:null;var b=a.getSourceBlock();if(!c&&this.getParentConnection(b.getRootBlock())===a){a=b.workspace.getTopBlocks(!0);b=a.indexOf(b.getRootBlock())-1;0>b&&(b=a.length-1);b=a[b];let d;return null!=(d=b.lastConnectionInStack(!1))?d:b}return c}return a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?a.getSourceBlock():null}getParentConnection(a){let b;return!a.outputConnection||(null==(b=a.previousConnection)?0:b.isConnected())?
|
|
1070
|
+
a.previousConnection:a.outputConnection}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$connection_navigation_policy={};module$build$src$core$keyboard_nav$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){let b;return a.canBeFocused()&&a.isVisible()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?
|
|
1071
|
+
0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof Icon$$module$build$src$core$icons$icon}},module$build$src$core$keyboard_nav$icon_navigation_policy=
|
|
1072
|
+
{};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
|
|
1061
1073
|
module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy,new IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>
|
|
1062
1074
|
b.isApplicable(a))}getFirstChild(a){let b;const c=null==(b=this.get(a))?void 0:b.getFirstChild(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getNextSibling(c)}getParent(a){let b;const c=null==(b=this.get(a))?void 0:b.getParent(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getParent(c)}getNextSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getNextSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?
|
|
1063
1075
|
c:this.getNextSibling(c)}getPreviousSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getPreviousSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getPreviousSibling(c)}},module$build$src$core$navigator={};module$build$src$core$navigator.Navigator=Navigator$$module$build$src$core$navigator;var FlyoutNavigator$$module$build$src$core$flyout_navigator=class extends Navigator$$module$build$src$core$navigator{constructor(a){super();this.rules.push(new FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy,new FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy);this.rules=this.rules.map(b=>new FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy(b,a))}},module$build$src$core$flyout_navigator=
|
|
@@ -1070,23 +1082,23 @@ this.vScroll&&(a.y=this.vScroll.getRatio_()),this.workspace.setMetrics(a)}setX(a
|
|
|
1070
1082
|
this.hScroll.resizeContentHorizontal(a);this.vScroll&&this.vScroll.resizeContentVertical(a)}resizeView(a){this.hScroll&&this.hScroll.resizeViewHorizontal(a);this.vScroll&&this.vScroll.resizeViewVertical(a)}},module$build$src$core$scrollbar_pair={};module$build$src$core$scrollbar_pair.ScrollbarPair=ScrollbarPair$$module$build$src$core$scrollbar_pair;var SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater="sep",SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater=class{load(a,b){a=new FlyoutSeparator$$module$build$src$core$flyout_separator(0,b.horizontalLayout?"x":"y");return new FlyoutItem$$module$build$src$core$flyout_item(a,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater)}gapForItem(a,b){let c;return null!=(c=parseInt(String(a.gap)))?c:b}disposeItem(a){}getType(){return SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater}};
|
|
1071
1083
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater,SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater);var module$build$src$core$separator_flyout_inflater={SEPARATOR_TYPE:SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater};module$build$src$core$separator_flyout_inflater.SeparatorFlyoutInflater=SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater;var Flyout$$module$build$src$core$flyout_base=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.horizontalLayout=!1;this.boundEvents=[];this.reflowWrapper=null;this.contents=[];this.autoClose=!0;this.visible=!1;this.containerVisible=!0;this.CORNER_RADIUS=8;this.SCROLLBAR_MARGIN=2.5;this.height_=this.width_=0;this.dragAngleRange_=70;this.svgGroup_=this.svgBackground_=null;this.inflaters=new Map;a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new WorkspaceSvg$$module$build$src$core$workspace_svg(a);
|
|
1072
1084
|
this.workspace_.setMetricsManager(new FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager(this.workspace_,this));this.workspace_.internalIsFlyout=!0;this.workspace_.setVisible(this.visible);this.workspace_.setNavigator(new FlyoutNavigator$$module$build$src$core$flyout_navigator(this));this.id=genUid$$module$build$src$core$utils$idgenerator();this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH;this.MARGIN=this.CORNER_RADIUS;
|
|
1073
|
-
this.GAP_X=3*this.MARGIN;this.GAP_Y=3*this.MARGIN}createDom(a){this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(a,{"class":"blocklyFlyout"
|
|
1074
|
-
"fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity")
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
this.
|
|
1078
|
-
|
|
1079
|
-
(
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
this.
|
|
1083
|
-
return this.
|
|
1084
|
-
|
|
1085
|
-
this.targetWorkspace.setResizesEnabled(!1);try{b=this.placeNewBlock(a)}finally{$.enable$$module$build$src$core$events$utils()}this.targetWorkspace.hideChaff();a=getAddedVariables$$module$build$src$core$variables(this.targetWorkspace,c);if(isEnabled$$module$build$src$core$events$utils()){$.setGroup$$module$build$src$core$events$utils(!0);for(c=0;c<a.length;c++){const d=a[c];fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(d))}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(b))}this.autoClose&&
|
|
1085
|
+
this.GAP_X=3*this.MARGIN;this.GAP_Y=3*this.MARGIN}createDom(a){this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(a,{"class":"blocklyFlyout"});this.svgGroup_.style.display="none";this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour",
|
|
1086
|
+
"fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity");return this.svgGroup_}init(a){this.targetWorkspace=a;this.workspace_.targetWorkspace=a;this.workspace_.scrollbar=new ScrollbarPair$$module$build$src$core$scrollbar_pair(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN);this.hide();this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"wheel",this,this.wheel_));
|
|
1087
|
+
this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.svgBackground_,"pointerdown",this,this.onMouseDown));this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace);this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap());this.workspace_.createPotentialVariableMap();a.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.FLYOUT_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,
|
|
1088
|
+
ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET]})}dispose(){this.hide();this.targetWorkspace.getComponentManager().removeComponent(this.id);for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);this.boundEvents.length=0;this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.dispose());this.svgGroup_&&removeNode$$module$build$src$core$utils$dom(this.svgGroup_)}getWidth(){return this.width_}getHeight(){return this.height_}getFlyoutScale(){return this.targetWorkspace.scale}getWorkspace(){return this.workspace_}setAutoClose(a){this.autoClose=
|
|
1089
|
+
a;this.targetWorkspace.recordDragTargets();this.targetWorkspace.resizeContents()}autoHide(a){!a&&this.targetWorkspace.getFlyout(!0)===this&&this.autoClose&&this.hide()}getTargetWorkspace(){return this.targetWorkspace}isVisible(){return this.visible}setVisible(a){const b=a!==this.isVisible();this.visible=a;b&&(this.autoClose||this.targetWorkspace.recordDragTargets(),this.updateDisplay())}setContainerVisible(a){const b=a!==this.containerVisible;this.containerVisible=a;b&&this.updateDisplay()}getContents(){return this.contents}setContents(a){this.contents=
|
|
1090
|
+
a}updateDisplay(){let a;a=this.containerVisible?this.isVisible():!1;this.svgGroup_&&(this.svgGroup_.style.display=a?"block":"none");let b;null==(b=this.workspace_.scrollbar)||b.setContainerVisible(a)}positionAt_(a,b,c,d){let e;null==(e=this.svgGroup_)||e.setAttribute("width",`${a}`);let f;null==(f=this.svgGroup_)||f.setAttribute("height",`${b}`);this.workspace_.setCachedParentSvgSize(a,b);this.svgGroup_&&setCssTransform$$module$build$src$core$utils$dom(this.svgGroup_,"translate("+c+"px,"+d+"px)");
|
|
1091
|
+
if(a=this.workspace_.scrollbar)a.setOrigin(c,d),a.resize(),a.hScroll&&a.hScroll.setPosition(a.hScroll.position.x,a.hScroll.position.y),a.vScroll&&a.vScroll.setPosition(a.vScroll.position.x,a.vScroll.position.y)}hide(){this.isVisible()&&(this.setVisible(!1),this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null))}show(a){this.workspace_.setResizesEnabled(!1);this.hide();this.clearOldBlocks();"string"===typeof a&&(a=this.getDynamicCategoryContents(a));
|
|
1092
|
+
this.setVisible(!0);a=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a);a=this.createFlyoutInfo(a);triggerQueuedRenders$$module$build$src$core$render_management(this.workspace_);this.setContents(a);this.layout_(a);this.horizontalLayout?this.height_=0:this.width_=0;this.reflow();this.workspace_.setResizesEnabled(!0);this.reflowWrapper=b=>{b.type!==EventType$$module$build$src$core$events$type.BLOCK_CHANGE&&b.type!==EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE||
|
|
1093
|
+
this.reflow()};this.workspace_.addChangeListener(this.reflowWrapper)}createFlyoutInfo(a){const b=[],c=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const d of a)if("custom"in d&&(a=this.getDynamicCategoryContents(d.custom),a=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a),b.push(...this.createFlyoutInfo(a))),a=d.kind.toLowerCase(),a=this.getInflaterForType(a))b.push(a.load(d,this)),(a=a.gapForItem(d,c))&&b.push(new FlyoutItem$$module$build$src$core$flyout_item(new FlyoutSeparator$$module$build$src$core$flyout_separator(a,
|
|
1094
|
+
this.horizontalLayout?"x":"y"),SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater));return this.normalizeSeparators(b)}normalizeSeparators(a){for(let b=a.length-1;0<b;b--){const c=a[b].getType().toLowerCase(),d=a[b-1].getType().toLowerCase();c===SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater&&d===SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater&&a.splice(b-1,1)}return a}getDynamicCategoryContents(a){a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a);
|
|
1095
|
+
if("function"!==typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");return a(this.workspace_.targetWorkspace)}clearOldBlocks(){this.getContents().forEach(b=>{let c;null==(c=this.getInflaterForType(b.getType()))||c.disposeItem(b)});let a;null==(a=this.workspace_.getPotentialVariableMap())||a.clear()}onMouseDown(a){const b=this.targetWorkspace.getGesture(a);b&&b.handleFlyoutStart(a,this)}isBlockCreatable(a){return a.isEnabled()&&!this.getTargetWorkspace().isReadOnly()}createBlock(a){let b=
|
|
1096
|
+
null;$.disable$$module$build$src$core$events$utils();var c=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{b=this.placeNewBlock(a)}finally{$.enable$$module$build$src$core$events$utils()}this.targetWorkspace.hideChaff();a=getAddedVariables$$module$build$src$core$variables(this.targetWorkspace,c);if(isEnabled$$module$build$src$core$events$utils()){$.setGroup$$module$build$src$core$events$utils(!0);for(c=0;c<a.length;c++){const d=a[c];fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(d))}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(b))}this.autoClose&&
|
|
1086
1097
|
this.hide();return b}reflow(){this.reflowWrapper&&this.workspace_.removeChangeListener(this.reflowWrapper);this.reflowInternal_();this.reflowWrapper&&this.workspace_.addChangeListener(this.reflowWrapper)}isScrollable(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1}placeNewBlock(a){var b=this.targetWorkspace;if(!a.getSvgRoot())throw Error("oldBlock is not rendered");const c=this.serializeBlock(a);b.setResizesEnabled(!1);b=append$$module$build$src$core$serialization$blocks(c,
|
|
1087
1098
|
b);this.positionNewBlock(a,b);return b}serializeBlock(a){return save$$module$build$src$core$serialization$blocks(a)}positionNewBlock(a,b){const c=this.targetWorkspace;var d=c.getOriginOffsetInPixels(),e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY();a.scale(this.workspace_.scale);e=Coordinate$$module$build$src$core$utils$coordinate.sum(e,a);d=Coordinate$$module$build$src$core$utils$coordinate.difference(e,d);d.scale(1/c.scale);b.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(d.x,
|
|
1088
|
-
d.y))}getInflaterForType(a){if(this.inflaters.has(a)){var b;return null!=(b=this.inflaters.get(a))?b:null}return(b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,a))?(b=new b,this.inflaters.set(a,b),b):null}getFocusableElement(){
|
|
1089
|
-
|
|
1099
|
+
d.y))}getInflaterForType(a){if(this.inflaters.has(a)){var b;return null!=(b=this.inflaters.get(a))?b:null}return(b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,a))?(b=new b,this.inflaters.set(a,b),b):null}getFocusableElement(){throw Error("Flyouts are not directly focusable.");}getFocusableTree(){throw Error("Flyouts are not directly focusable.");}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}getRootFocusableNode(){throw Error("Flyouts are not directly focusable.");
|
|
1100
|
+
}getRestoredFocusableNode(a){throw Error("Flyouts are not directly focusable.");}getNestedTrees(){throw Error("Flyouts are not directly focusable.");}lookUpFocusableNode(a){throw Error("Flyouts are not directly focusable.");}onTreeFocus(a,b){}onTreeBlur(a){throw Error("Flyouts are not directly focusable.");}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;var module$build$src$core$interfaces$i_draggable={};module$build$src$core$interfaces$i_draggable.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=
|
|
1101
|
+
new KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller,module$build$src$core$keyboard_navigation_controller={};module$build$src$core$keyboard_navigation_controller.KeyboardNavigationController=KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var WorkspaceDragger$$module$build$src$core$workspace_dragger=class{constructor(a){this.workspace=a;this.horizontalScrollEnabled=this.workspace.isMovableHorizontally();this.verticalScrollEnabled=this.workspace.isMovableVertically();this.startScrollXY_=new Coordinate$$module$build$src$core$utils$coordinate(a.scrollX,a.scrollY)}dispose(){this.workspace=null}startDrag(){}endDrag(a){this.drag(a)}drag(a){a=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startScrollXY_,a);if(this.horizontalScrollEnabled&&
|
|
1090
1102
|
this.verticalScrollEnabled)this.workspace.scroll(a.x,a.y);else if(this.horizontalScrollEnabled)this.workspace.scroll(a.x,this.workspace.scrollY);else if(this.verticalScrollEnabled)this.workspace.scroll(this.workspace.scrollX,a.y);else throw new TypeError("Invalid state.");}},module$build$src$core$workspace_dragger={};module$build$src$core$workspace_dragger.WorkspaceDragger=WorkspaceDragger$$module$build$src$core$workspace_dragger;var ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture=5,ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture=6,Gesture$$module$build$src$core$gesture=class{constructor(a,b){this.creatorWorkspace=b;this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.startWorkspace_=this.targetBlock=this.startComment=this.startBlock=this.startIcon=this.startField=this.startBubble=null;this.hasExceededDragRadius=!1;this.boundEvents=[];this.workspaceDragger=this.dragger=null;this.dragging=
|
|
1091
1103
|
!1;this.flyout=null;this.multiTouch=this.isEnding_=this.gestureHasStarted=this.calledUpdateIsDragging=!1;this.cachedPoints=new Map;this.startDistance=this.previousScale=0;this.currentDropdownOwner=this.isPinchZoomEnabled=null;this.mostRecentEvent=a;this.currentDragDeltaXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0)}dispose(){clearTouchIdentifier$$module$build$src$core$touch();unblock$$module$build$src$core$tooltip();this.creatorWorkspace.clearGesture();for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);
|
|
1092
1104
|
this.boundEvents.length=0;this.workspaceDragger&&this.workspaceDragger.dispose()}updateFromEvent(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);this.updateDragDelta(b)&&(this.updateIsDragging(a),longStop$$module$build$src$core$touch());this.mostRecentEvent=a}updateDragDelta(a){this.currentDragDeltaXY=Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.mouseDownXY);return this.hasExceededDragRadius?!1:this.hasExceededDragRadius=Coordinate$$module$build$src$core$utils$coordinate.magnitude(this.currentDragDeltaXY)>
|
|
@@ -1098,29 +1110,29 @@ if(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorksp
|
|
|
1098
1110
|
this.currentDropdownOwner=getOwner$$module$build$src$core$dropdowndiv(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=a,block$$module$build$src$core$tooltip(),isRightButton$$module$build$src$core$browser_events(a)?this.handleRightClick(a):("pointerdown"===a.type.toLowerCase()&&"mouse"!==a.pointerType&&longStart$$module$build$src$core$touch(a,this),this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY),this.bindMouseEvents(a),
|
|
1099
1111
|
this.isEnding_||this.handleTouchStart(a)))}bindMouseEvents(a){this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointerdown",null,this.handleStart.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointermove",null,this.handleMove.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointerup",null,this.handleUp.bind(this),!0));a.preventDefault();a.stopPropagation()}handleStart(a){this.isDragging()||
|
|
1100
1112
|
(this.handleTouchStart(a),this.isMultiTouch()&&longStop$$module$build$src$core$touch())}handleMove(a){if(this.isDragging()&&shouldHandleEvent$$module$build$src$core$touch(a)||!this.isMultiTouch()){this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);else if(this.dragger)this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY);a.preventDefault();a.stopPropagation()}else this.isMultiTouch()&&(this.handleTouchMove(a),longStop$$module$build$src$core$touch())}handleUp(a){this.isDragging()||
|
|
1101
|
-
this.handleTouchEnd(a);if(!this.isMultiTouch()||this.isDragging()){if(!shouldHandleEvent$$module$build$src$core$touch(a))return;this.updateFromEvent(a);longStop$$module$build$src$core$touch();if(this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0;
|
|
1102
|
-
this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(a))}a.preventDefault();a.stopPropagation();this.dispose()}handleTouchStart(a){var b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));var c=Array.from(this.cachedPoints.keys());
|
|
1103
|
-
c),this.multiTouch=!0,a.preventDefault())}handleTouchMove(a){const b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));if(this.isPinchZoomEnabled&&2===this.cachedPoints.size)this.handlePinch(a);else{this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);
|
|
1104
|
-
Array.from(this.cachedPoints.keys()),c=this.cachedPoints.get(b[0]);b=this.cachedPoints.get(b[1]);c=Coordinate$$module$build$src$core$utils$coordinate.distance(c,b)/this.startDistance;if(0<this.previousScale&&Infinity>this.previousScale){b=c-this.previousScale;b=0<b?b*ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture:b*ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture;
|
|
1105
|
-
e=mouseToSvg$$module$build$src$core$browser_events(a,d.getParentSvg(),d.getInverseScreenCTM());d.zoom(e.x,e.y,b)}this.previousScale=c;a.preventDefault()}handleTouchEnd(a){a=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.has(a)&&this.cachedPoints.delete(a);2>this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(a){return this.startWorkspace_?
|
|
1106
|
-
if(this.dragger)this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY);else this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY);this.dispose()}}handleRightClick(a){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(a)):
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
this.
|
|
1111
|
-
$.setGroup$$module$build$src$core$events$utils(!0);var a=this.flyout.createBlock(this.targetBlock);a.snapToGrid();a.bumpNeighbours();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");
|
|
1112
|
-
|
|
1113
|
-
this.startIcon||(this.startIcon=a)}setStartBubble(a){this.startBubble||(this.startBubble=a)}setStartComment(a){this.startComment||(this.startComment=a)}setStartBlock(a){this.startBlock||this.startBubble||(this.startBlock=a,a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock(a.getRootBlock()):this.setTargetBlock(a))}setTargetBlock(a){a.isShadow()?
|
|
1114
|
-
(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?
|
|
1115
|
-
const a=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&a}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let a,b;return null!=(b=null!=(a=this.workspaceDragger)?
|
|
1116
|
-
for(let b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1}},module$build$src$core$gesture={};module$build$src$core$gesture.Gesture=Gesture$$module$build$src$core$gesture;var Grid$$module$build$src$core$grid=class{constructor(a,b){this.pattern=a;this.scale=1;let c;this.spacing=null!=(c=b.spacing)?c:0;let d;this.length=null!=(d=b.length)?d:1;this.line2=(this.line1=a.firstChild)&&this.line1.nextSibling;let e;this.snapToGrid=null!=(e=b.snap)?e:!1}setSpacing(a){this.spacing=a;this.update(this.scale)}getSpacing(){return this.spacing}setLength(a){this.length=a;this.update(this.scale)}getLength(){return this.length}setSnapToGrid(a){this.snapToGrid=a}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(a){this.scale=
|
|
1113
|
+
this.handleTouchEnd(a);if(!this.isMultiTouch()||this.isDragging()){if(!shouldHandleEvent$$module$build$src$core$touch(a))return;this.updateFromEvent(a);longStop$$module$build$src$core$touch();if(this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0;this.dragger?(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1),this.dragger.onDragEnd(a,this.currentDragDeltaXY)):this.workspaceDragger?(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1),
|
|
1114
|
+
this.workspaceDragger.endDrag(this.currentDragDeltaXY)):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(a))}a.preventDefault();a.stopPropagation();this.dispose()}handleTouchStart(a){var b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));var c=Array.from(this.cachedPoints.keys());
|
|
1115
|
+
2===c.length&&(b=this.cachedPoints.get(c[0]),c=this.cachedPoints.get(c[1]),this.startDistance=Coordinate$$module$build$src$core$utils$coordinate.distance(b,c),this.multiTouch=!0,a.preventDefault())}handleTouchMove(a){const b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));if(this.isPinchZoomEnabled&&2===this.cachedPoints.size)this.handlePinch(a);else{this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);
|
|
1116
|
+
else if(this.dragger)this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY);a.preventDefault();a.stopPropagation()}}handlePinch(a){var b=Array.from(this.cachedPoints.keys()),c=this.cachedPoints.get(b[0]);b=this.cachedPoints.get(b[1]);c=Coordinate$$module$build$src$core$utils$coordinate.distance(c,b)/this.startDistance;if(0<this.previousScale&&Infinity>this.previousScale){b=c-this.previousScale;b=0<b?b*ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture:b*ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture;
|
|
1117
|
+
if(!this.startWorkspace_)throw Error("Cannot handle a pinch because the start workspace is undefined");const d=this.startWorkspace_,e=mouseToSvg$$module$build$src$core$browser_events(a,d.getParentSvg(),d.getInverseScreenCTM());d.zoom(e.x,e.y,b)}this.previousScale=c;a.preventDefault()}handleTouchEnd(a){a=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.has(a)&&this.cachedPoints.delete(a);2>this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(a){return this.startWorkspace_?
|
|
1118
|
+
new Coordinate$$module$build$src$core$utils$coordinate(a.pageX,a.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){if(!this.isEnding_){longStop$$module$build$src$core$touch();if(this.dragger)this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY);else this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY);this.dispose()}}handleRightClick(a){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(a)):
|
|
1119
|
+
this.startBubble?this.startBubble.showContextMenu(a):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(a)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.startWorkspace_),this.startWorkspace_.showContextMenu(a));a.preventDefault();a.stopPropagation();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1);this.dispose()}handleWsStart(a,
|
|
1120
|
+
b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(b);this.mostRecentEvent=a;this.startBlock||this.startBubble||this.startComment?this.startBlock&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.startBlock):$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);this.doStart(a)}fireWorkspaceClick(a){fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(null,
|
|
1121
|
+
a.id,"workspace"))}handleFlyoutStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(b);this.handleWsStart(a,b.getWorkspace())}handleBlockStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(b);this.mostRecentEvent=a}handleBubbleStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");
|
|
1122
|
+
this.setStartBubble(b);this.mostRecentEvent=a}handleCommentStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(b);this.mostRecentEvent=a}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.bringBlockToFront();this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent)}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");
|
|
1123
|
+
this.bringBlockToFront();this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.flyout.isBlockCreatable(this.targetBlock)){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);var a=this.flyout.createBlock(this.targetBlock);a.snapToGrid();a.bumpNeighbours();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");
|
|
1124
|
+
a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(this.startBlock,this.startWorkspace_.id,"block");fire$$module$build$src$core$events$utils(a)}this.bringBlockToFront();$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){this.fireWorkspaceClick(this.startWorkspace_||this.creatorWorkspace)}bringBlockToFront(){this.targetBlock&&!this.flyout&&($.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.targetBlock),this.targetBlock.bringToFront())}setStartField(a){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");
|
|
1125
|
+
this.startField||(this.startField=a)}setStartIcon(a){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=a)}setStartBubble(a){this.startBubble||(this.startBubble=a)}setStartComment(a){this.startComment||(this.startComment=a)}setStartBlock(a){this.startBlock||this.startBubble||(this.startBlock=a,a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock(a.getRootBlock()):this.setTargetBlock(a))}setTargetBlock(a){a.isShadow()?
|
|
1126
|
+
this.setTargetBlock(a.getParent()):(this.targetBlock=a,$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a))}setStartWorkspace(a){this.startWorkspace_||(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?
|
|
1127
|
+
this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const a=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&a}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let a,b;return null!=(b=null!=(a=this.workspaceDragger)?
|
|
1128
|
+
a:this.dragger)?b:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const a=getAllWorkspaces$$module$build$src$core$common();for(let b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1}},module$build$src$core$gesture={};module$build$src$core$gesture.Gesture=Gesture$$module$build$src$core$gesture;var Grid$$module$build$src$core$grid=class{constructor(a,b){this.pattern=a;this.scale=1;let c;this.spacing=null!=(c=b.spacing)?c:0;let d;this.length=null!=(d=b.length)?d:1;this.line2=(this.line1=a.firstChild)&&this.line1.nextSibling;let e;this.snapToGrid=null!=(e=b.snap)?e:!1}setSpacing(a){this.spacing=a;this.update(this.scale)}getSpacing(){return this.spacing}setLength(a){this.length=a;this.update(this.scale)}getLength(){return this.length}setSnapToGrid(a){this.snapToGrid=a}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(a){this.scale=
|
|
1117
1129
|
a;var b=this.spacing*a;this.pattern.setAttribute("width",`${b}`);this.pattern.setAttribute("height",`${b}`);b=Math.floor(this.spacing/2)+.5;let c=b-this.length/2,d=b+this.length/2;b*=a;c*=a;d*=a;this.setLineAttributes(this.line1,a,c,d,b,b);this.setLineAttributes(this.line2,a,b,b,c,d)}setLineAttributes(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",`${b}`),a.setAttribute("x1",`${c}`),a.setAttribute("y1",`${e}`),a.setAttribute("x2",`${d}`),a.setAttribute("y2",`${f}`))}moveTo(a,b){this.pattern.setAttribute("x",
|
|
1118
1130
|
`${a}`);this.pattern.setAttribute("y",`${b}`)}alignXY(a){var b=this.getSpacing();const c=b/2,d=Math.round(Math.round((a.x-c)/b)*b+c);b=Math.round(Math.round((a.y-c)/b)*b+c);return d===a.x&&b===a.y?a:new Coordinate$$module$build$src$core$utils$coordinate(d,b)}static createDom(a,b,c,d){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATTERN,{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);let e,f;if(0<(null!=(e=b.length)?e:1)&&0<(null!=(f=b.spacing)?
|
|
1119
1131
|
f:0)){createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a);let g;null!=(g=b.length)&&g&&createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a)}else createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{},a);d&&d.style.setProperty("--blocklyGridPattern",`url(#${a.id})`);return a}},module$build$src$core$grid={};module$build$src$core$grid.Grid=Grid$$module$build$src$core$grid;var module$build$src$core$interfaces$i_autohideable={};module$build$src$core$interfaces$i_autohideable.isAutoHideable=isAutoHideable$$module$build$src$core$interfaces$i_autohideable;var LayerManager$$module$build$src$core$layer_manager=class{constructor(a){this.workspace=a;this.layers=new Map;if(a=a.getInjectionDiv())this.dragLayer=this.createDragLayer(a),this.animationLayer=this.createAnimationLayer(a);a=this.createLayer(BLOCK$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBlockCanvas");a=this.createLayer(BUBBLE$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBubbleCanvas")}createDragLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,
|
|
1120
1132
|
{"class":"blocklyBlockDragSurface",xmlns:SVG_NS$$module$build$src$core$utils$dom,"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}createAnimationLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{"class":"blocklyAnimationLayer",xmlns:SVG_NS$$module$build$src$core$utils$dom,
|
|
1121
1133
|
"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}appendToAnimationLayer(a){let b;const c=null==(b=this.dragLayer)?void 0:b.getAttribute("transform");if(c){let e;null==(e=this.animationLayer)||e.setAttribute("transform",c)}let d;null==(d=this.animationLayer)||d.appendChild(a.getSvgRoot())}translateLayers(a,b){a=
|
|
1122
|
-
`translate(${a.x}, ${a.y}) scale(${b})`;let c;null==(c=this.dragLayer)||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a){let b;null==(b=this.dragLayer)||b.appendChild(a.getSvgRoot())
|
|
1123
|
-
(c=this.layers.get(b))?void 0:c.lastChild)!==a){let d;null==(d=this.layers.get(b))||d.appendChild(a)}}createLayer(a){const b=this.workspace.getSvgGroup(),c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});let d=!1;const e=[...this.layers].sort((f,g)=>f[0]-g[0]);for(const [f,g]of e)if(a<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}},
|
|
1134
|
+
`translate(${a.x}, ${a.y}) scale(${b})`;let c;null==(c=this.dragLayer)||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a){let b;null==(b=this.dragLayer)||b.appendChild(a.getSvgRoot());a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}moveOffDragLayer(a,b){this.append(a,b);a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}append(a,b){this.layers.has(b)||this.createLayer(b);
|
|
1135
|
+
a=a.getSvgRoot();let c;if((null==(c=this.layers.get(b))?void 0:c.lastChild)!==a){let d;null==(d=this.layers.get(b))||d.appendChild(a)}}createLayer(a){const b=this.workspace.getSvgGroup(),c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});let d=!1;const e=[...this.layers].sort((f,g)=>f[0]-g[0]);for(const [f,g]of e)if(a<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}},
|
|
1124
1136
|
module$build$src$core$layer_manager={};module$build$src$core$layer_manager.LayerManager=LayerManager$$module$build$src$core$layer_manager;var MarkerManager$$module$build$src$core$marker_manager=class{constructor(a){this.workspace=a;this.cursor=null;this.markers=new Map}registerMarker(a,b){this.markers.has(a)&&this.unregisterMarker(a);this.markers.set(a,b)}unregisterMarker(a){const b=this.markers.get(a);if(b)b.dispose(),this.markers.delete(a);else throw Error("Marker with ID "+a+" does not exist. Can only unregister markers that exist.");}getCursor(){return this.cursor}getMarker(a){return this.markers.get(a)||null}setCursor(a){this.cursor=
|
|
1125
1137
|
a}dispose(){const a=Object.keys(this.markers);for(let b=0,c;c=a[b];b++)this.unregisterMarker(c);this.markers.clear();this.cursor&&(this.cursor.dispose(),this.cursor=null)}};MarkerManager$$module$build$src$core$marker_manager.LOCAL_MARKER="local_marker_1";var module$build$src$core$marker_manager={};module$build$src$core$marker_manager.MarkerManager=MarkerManager$$module$build$src$core$marker_manager;var TextInputBubble$$module$build$src$core$bubbles$textinput_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c){super(a,b,c,TextInputBubble$$module$build$src$core$bubbles$textinput_bubble.createTextArea());this.workspace=a;this.anchor=b;this.ownerRect=c;this.resizePointerMoveListener=this.resizePointerUpListener=null;this.textChangeListeners=[];this.sizeChangeListeners=[];this.locationChangeListeners=[];this.text="";this.DEFAULT_SIZE=new Size$$module$build$src$core$utils$size(160+
|
|
1126
1138
|
Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,80+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.MIN_SIZE=new Size$$module$build$src$core$utils$size(45+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,20+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.editable=!0;addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextInputBubble");this.textArea=this.getFocusableElement();this.inputRoot=this.createEditor(this.contentContainer,this.textArea);
|
|
@@ -1243,10 +1255,10 @@ c=d-c;0<c&&this.addAlignmentPadding_(a,c);c=a.width;d=this.getDesiredRowWidth_(a
|
|
|
1243
1255
|
c,d);a.hasStatement&&(c.followsStatement=!0);b.hasStatement&&(c.precedesStatement=!0);return c}getSpacerRowWidth_(a,b){return this.width-this.startX}getSpacerRowHeight_(a,b){return this.constants_.MEDIUM_PADDING}getElemCenterline_(a,b){return Types$$module$build$src$core$renderers$measurables$types.isSpacer(b)?a.yPos+b.height/2:Types$$module$build$src$core$renderers$measurables$types.isBottomRow(a)?(a=a.yPos+a.height-a.descenderHeight,Types$$module$build$src$core$renderers$measurables$types.isNextConnection(b)?
|
|
1244
1256
|
a+b.height/2:a-b.height/2):Types$$module$build$src$core$renderers$measurables$types.isTopRow(a)?Types$$module$build$src$core$renderers$measurables$types.isHat(b)?a.capline-b.height/2:a.capline+b.height/2:a.yPos+a.height/2}recordElemPositions_(a){let b=a.xPos;for(let c=0,d;d=a.elements[c];c++)Types$$module$build$src$core$renderers$measurables$types.isSpacer(d)&&(d.height=a.height),d.xPos=b,d.centerline=this.getElemCenterline_(a,d),b+=d.width}finalize_(){let a=0,b=0;for(let c=0,d;d=this.rows[c];c++)d.yPos=
|
|
1245
1257
|
b,d.xPos=this.startX,b+=d.height,a=Math.max(a,d.widthWithConnectedBlocks),this.recordElemPositions_(d);if(this.outputConnection&&this.block_.nextConnection){const c=this.block_.nextConnection.targetBlock();c&&(a=Math.max(a,c.getHeightWidth().width))}this.widthWithChildren=a+this.startX;this.height=b;this.startY=this.topRow.capline;this.bottomRow.baseline=b-this.bottomRow.descenderHeight}getMeasureableForConnection(a){let b;if((null==(b=this.outputConnection)?void 0:b.connectionModel)===a)return this.outputConnection;
|
|
1246
|
-
for(const c of this.rows)for(const d of c.elements)if(d instanceof Connection$$module$build$src$core$renderers$measurables$connection&&d.connectionModel===a)return d;return null}},module$build$src$core$renderers$common$info={};module$build$src$core$renderers$common$info.RenderInfo=RenderInfo$$module$build$src$core$renderers$common$info;var PathObject$$module$build$src$core$renderers$common$path_object=class{constructor(a,b,c){this.connectionHighlights=new WeakMap;this.highlightOffsets=new WeakMap;this.constants=c;this.style=b;this.svgRoot=a;this.svgPath=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyPath"
|
|
1258
|
+
for(const c of this.rows)for(const d of c.elements)if(d instanceof Connection$$module$build$src$core$renderers$measurables$connection&&d.connectionModel===a)return d;return null}},module$build$src$core$renderers$common$info={};module$build$src$core$renderers$common$info.RenderInfo=RenderInfo$$module$build$src$core$renderers$common$info;var PathObject$$module$build$src$core$renderers$common$path_object=class{constructor(a,b,c){this.connectionHighlights=new WeakMap;this.highlightOffsets=new WeakMap;this.constants=c;this.style=b;this.svgRoot=a;this.svgPath=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyPath"},this.svgRoot);this.setClass_("blocklyBlock",!0)}setPath(a){this.svgPath.setAttribute("d",a)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)")}applyColour(a){this.svgPath.setAttribute("stroke",
|
|
1247
1259
|
this.style.colourTertiary);this.svgPath.setAttribute("fill",this.style.colourPrimary);this.updateShadow_(a.isShadow());this.updateDisabled_(!a.isEnabled()||a.getInheritedDisabled())}setStyle(a){this.style=a}setClass_(a,b){a&&(b?addClass$$module$build$src$core$utils$dom(this.svgRoot,a):removeClass$$module$build$src$core$utils$dom(this.svgRoot,a))}updateHighlighted(a){a?this.setClass_("blocklyHighlighted",!0):this.setClass_("blocklyHighlighted",!1)}updateShadow_(a){a?(this.setClass_("blocklyShadow",
|
|
1248
1260
|
!0),this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary)):this.setClass_("blocklyShadow",!1)}updateDisabled_(a){this.setClass_("blocklyDisabled",a);this.setClass_("blocklyDisabledPattern",a)}updateSelected(a){this.setClass_("blocklySelected",a)}updateDraggingDelete(a){this.setClass_("blocklyDraggingDelete",a)}updateInsertionMarker(a){this.setClass_("blocklyInsertionMarker",a)}updateMovable(a){this.setClass_("blocklyDraggable",a)}updateReplacementFade(a){this.setClass_("blocklyReplaceable",
|
|
1249
|
-
a)}updateShapeForInputHighlight(a,b){}addConnectionHighlight(a,b,c,d){c=`translate(${c.x}, ${c.y})`+(d?" scale(-1 1)":"");if(d=this.connectionHighlights.get(a))return d.setAttribute("d",b),d.setAttribute("transform",c),d;b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{id:a.id,"class":"blocklyHighlightedConnectionPath",style:"display: none;",
|
|
1261
|
+
a)}updateShapeForInputHighlight(a,b){}addConnectionHighlight(a,b,c,d){c=`translate(${c.x}, ${c.y})`+(d?" scale(-1 1)":"");if(d=this.connectionHighlights.get(a))return d.setAttribute("d",b),d.setAttribute("transform",c),d;b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{id:a.id,"class":"blocklyHighlightedConnectionPath",style:"display: none;",d:b,transform:c},this.svgRoot);this.connectionHighlights.set(a,b);return b}removeConnectionHighlight(a){const b=
|
|
1250
1262
|
this.connectionHighlights.get(a);b&&(removeNode$$module$build$src$core$utils$dom(b),this.connectionHighlights.delete(a))}},module$build$src$core$renderers$common$path_object={};module$build$src$core$renderers$common$path_object.PathObject=PathObject$$module$build$src$core$renderers$common$path_object;var Renderer$$module$build$src$core$renderers$common$renderer=class{constructor(a){this.overrides=null;this.name=a}getClassName(){return this.name+"-renderer"}init(a,b){this.constants_=this.makeConstants_();b&&(this.overrides=b,Object.assign(this.constants_,b));this.constants_.setTheme(a);this.constants_.init()}createDom(a,b,c){this.constants_.createDom(a,this.name+"-"+b.name,"."+this.getClassName()+"."+b.getClassName(),c)}refreshDom(a,b,c){const d=this.getConstants();d.dispose();this.constants_=
|
|
1251
1263
|
this.makeConstants_();this.overrides&&Object.assign(this.constants_,this.overrides);this.constants_.randomIdentifier=d.randomIdentifier;this.constants_.setTheme(b);this.constants_.init();this.createDom(a,b,c)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new ConstantProvider$$module$build$src$core$renderers$common$constants}makeRenderInfo_(a){return new RenderInfo$$module$build$src$core$renderers$common$info(this,a)}makeDrawer_(a,b){return new Drawer$$module$build$src$core$renderers$common$drawer(a,
|
|
1252
1264
|
b)}makePathObject(a,b){return new PathObject$$module$build$src$core$renderers$common$path_object(a,b,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(a){return!0}orphanCanConnectAtEnd(a,b,c){return!!Connection$$module$build$src$core$connection.getConnectionForOrphanedConnection(a,c===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?b.outputConnection:b.previousConnection)}render(a){const b=this.makeRenderInfo_(a);b.measure();this.makeDrawer_(a,b).draw()}},
|
|
@@ -1297,22 +1309,22 @@ a;this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getCo
|
|
|
1297
1309
|
null===this.options.parentWorkspace;this.renderer.refreshDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0)}this.updateBlockStyles(this.getAllBlocks(!1).filter(b=>!!b.getStyleName()));this.refreshToolboxSelection();this.toolbox&&this.toolbox.refreshTheme();this.isVisible()&&this.setVisible(!0);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.THEME_CHANGE))(this.getTheme().name,this.id);fire$$module$build$src$core$events$utils(a)}updateBlockStyles(a){for(let b=
|
|
1298
1310
|
0,c;c=a[b];b++){const d=c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const a=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM=a.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(a){let b=0,c=0,d=1;if(this.getCanvas().contains(a)||this.getBubbleCanvas().contains(a))d=this.scale;do{const e=getRelativeXY$$module$build$src$core$utils$svg_math(a);
|
|
1299
1311
|
if(a===this.getCanvas()||a===this.getBubbleCanvas())d=1;b+=e.x*d;c+=e.y*d;a=a.parentNode}while(a&&a!==this.getParentSvg()&&a!==this.getInjectionDiv());return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}getCachedParentSvgSize(){const a=this.cachedParentSvgSize;return new Size$$module$build$src$core$utils$size(a.width,a.height)}getOriginOffsetInPixels(){return getInjectionDivXY$$module$build$src$core$utils$svg_math(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let a=this.svgGroup_;
|
|
1300
|
-
for(;a;){if((" "+(a.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=a;break}a=a.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(a){this.resizeHandlerWrapper=a}createDom(a,b){this.injectionDiv||(this.injectionDiv=null!=b?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace",
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
this.
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
this.options,!0))(b)
|
|
1310
|
-
this.
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
this.
|
|
1315
|
-
|
|
1312
|
+
for(;a;){if((" "+(a.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=a;break}a=a.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(a){this.resizeHandlerWrapper=a}createDom(a,b){this.injectionDiv||(this.injectionDiv=null!=b?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace",id:this.id});b&&setState$$module$build$src$core$utils$aria(this.svgGroup_,
|
|
1313
|
+
State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL);a&&(this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:"100%",width:"100%","class":a},this.svgGroup_),"blocklyMainBackground"===a&&this.grid?this.svgBackground_.style.fill="var(--blocklyGridPattern)":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill"));this.layerManager=new LayerManager$$module$build$src$core$layer_manager(this);
|
|
1314
|
+
this.svgBlockCanvas_=this.layerManager.getBlockLayer();this.svgBubbleCanvas_=this.layerManager.getBubbleLayer();this.isFlyout||(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"wheel",this,this.onMouseWheel));this.options.hasCategories&&(this.toolbox=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,
|
|
1315
|
+
this.options,!0))(this));this.grid&&this.grid.update(this.scale);this.recordDragTargets();(a=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,this.options))&&this.markerManager.setCursor(new a(this));a=null===this.options.parentWorkspace;this.renderer.createDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0);$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!!this.injectionDiv||this.isFlyout);return this.svgGroup_}dispose(){this.rendered=
|
|
1316
|
+
!1;this.currentGesture_&&this.currentGesture_.cancel();this.svgGroup_&&removeNode$$module$build$src$core$utils$dom(this.svgGroup_);this.toolbox&&(this.toolbox.dispose(),this.toolbox=null);this.flyout&&(this.flyout.dispose(),this.flyout=null);this.trashcan&&(this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null);this.zoomControls_&&this.zoomControls_.dispose();this.audioManager&&this.audioManager.dispose();this.grid&&(this.grid=null);this.renderer.dispose();
|
|
1317
|
+
this.markerManager&&this.markerManager.dispose();super.dispose();this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose());this.connectionDBList.length=0;this.toolboxCategoryCallbacks.clear();this.flyoutButtonCallbacks.clear();if(!this.options.parentWorkspace){const a=this.getParentSvg();a&&a.parentNode&&removeNode$$module$build$src$core$utils$dom(a.parentNode)}this.resizeHandlerWrapper&&
|
|
1318
|
+
(unbind$$module$build$src$core$browser_events(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null);this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null);$.getFocusManager$$module$build$src$core$focus_manager().isRegistered(this)&&$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}addTrashcan(){this.trashcan=WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan(this);const a=this.trashcan.createDom();
|
|
1319
|
+
this.svgGroup_.insertBefore(a,this.getCanvas())}static newTrashcan(a){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts");}addZoomControls(){this.zoomControls_=new ZoomControls$$module$build$src$core$zoom_controls(this);const a=this.zoomControls_.createDom();this.svgGroup_.appendChild(a)}copyOptionsForFlyout(){return new Options$$module$build$src$core$options({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,
|
|
1320
|
+
renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,plugins:this.options.plugins,modalInputs:this.options.modalInputs,move:{scrollbars:!0}})}addFlyout(a){const b=this.copyOptionsForFlyout();b.toolboxPosition=this.options.toolboxPosition;this.flyout=this.horizontalLayout?new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(b):new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,
|
|
1321
|
+
this.options,!0))(b);this.flyout.autoClose=!1;this.flyout.getWorkspace().setVisible(!0);return this.flyout.createDom(a)}getFlyout(a){return this.flyout||a?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM();this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox?this.toolbox.position():this.flyout&&
|
|
1322
|
+
this.flyout.position();const a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE,!0),b=this.getMetricsManager().getUiMetrics(),c=[];for(let d=0,e;e=a[d];d++){e.position(b,c);const f=e.getBoundingRectangle();f&&c.push(f)}this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const a=getDocumentScroll$$module$build$src$core$utils$svg_math();Coordinate$$module$build$src$core$utils$coordinate.equals(this.lastRecordedPageScroll,
|
|
1323
|
+
a)||(this.lastRecordedPageScroll=a,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(a,b){const c=this.getParentSvg();null!=a&&(this.cachedParentSvgSize.width=a,c.setAttribute("data-cached-width",`${a}`));null!=b&&(this.cachedParentSvgSize.height=b,c.setAttribute("data-cached-height",`${b}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let a=
|
|
1324
|
+
this.svgGroup_;for(;a;){if("svg"===a.tagName){this.cachedParentSvg=a;break}a=a.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(isEnabled$$module$build$src$core$events$utils()){var a=this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale&&1>Math.abs(b-this.oldTop)&&1>Math.abs(c-this.oldLeft))){var d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE))(b,c,a,this.id,this.oldScale);this.oldScale=a;this.oldTop=
|
|
1325
|
+
b;this.oldLeft=c;fire$$module$build$src$core$events$utils(d)}}}translate(a,b){let c;null==(c=this.layerManager)||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);let d;null==(d=this.grid)||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){const a=this.getMetrics();return a?a.viewWidth/this.scale:0}setVisible(a){this.visible=a;this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(a),this.getFlyout()&&this.getFlyout().setContainerVisible(a),
|
|
1326
|
+
this.getParentSvg().style.display=a?"block":"none",this.toolbox&&this.toolbox.setVisible(a),a||this.hideChaff(!0))}render(){const a=this.getAllBlocks(!1);for(let b=a.length-1;0<=b;b--)a[b].queueRender();this.getTopBlocks().flatMap(b=>b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender())}highlightBlock(a,b){if(void 0===b){for(let c=0,d;d=this.highlightedBlocks[c];c++)d.setHighlighted(!1);this.highlightedBlocks.length=0}if(a=a?this.getBlockById(a):null)(b=void 0===b||b)?
|
|
1327
|
+
this.highlightedBlocks.includes(a)||this.highlightedBlocks.push(a):removeElem$$module$build$src$core$utils$array(this.highlightedBlocks,a),a.setHighlighted(b)}variableChangeCallback(a){switch(a.type){case EventType$$module$build$src$core$events$type.VAR_CREATE:case EventType$$module$build$src$core$events$type.VAR_DELETE:case EventType$$module$build$src$core$events$type.VAR_RENAME:case EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE:this.refreshToolboxSelection()}}refreshToolboxSelection(){const a=
|
|
1316
1328
|
this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox&&a.toolbox.getFlyout()&&a.toolbox.refreshSelection()}recordDragTargets(){const a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let b=0,c;c=a[b];b++){const d=c.getClientRect();d&&this.dragTargetAreas.push({component:c,clientRect:d})}}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts");
|
|
1317
1329
|
}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}getDragTarget(a){for(let b=0,c;c=this.dragTargetAreas[b];b++)if(c.clientRect.contains(a.clientX,a.clientY))return c.component;return null}onMouseDown(a){const b=this.getGesture(a);b&&b.handleWsStart(a,this)}startDrag(a,b){start$$module$build$src$core$utils$drag(this,a,b)}moveDrag(a){return move$$module$build$src$core$utils$drag(this,a)}setKeyboardMoveInProgress(a){this.keyboardMoveInProgress=
|
|
1318
1330
|
a}isDragging(){return this.keyboardMoveInProgress||null!==this.currentGesture_&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const a=
|
|
@@ -1339,8 +1351,8 @@ addClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}removeClass(a){th
|
|
|
1339
1351
|
d.left+d.width);if(!(a.left>=d.left&&a.top>=d.top&&a.right<=d.right&&a.bottom<=d.bottom)){a=a.clone();a.top-=b;a.bottom+=b;a.left-=b;a.right+=b;var e=b=0;a.left<d.left?b=this.RTL?Math.min(d.left-a.left,d.right-a.right):d.left-a.left:a.right>d.right&&(b=this.RTL?d.right-a.right:Math.max(d.right-a.right,d.left-a.left));a.top<d.top?e=d.top-a.top:a.bottom>d.bottom&&(e=Math.max(d.bottom-a.bottom,d.top-a.top));this.scroll(this.scrollX+b*c,this.scrollY+e*c)}}}getFocusableElement(){return this.svgGroup_}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(a)return null;
|
|
1340
1352
|
let b;return null!=(b=this.getTopBlocks(!0)[0])?b:null}getNestedTrees(){return[]}lookUpFocusableNode(a){var b;const c=null==(b=this.targetWorkspace)?void 0:b.getFlyout();if(this.isFlyout&&c)for(var d of c.getContents())if(b=d.getElement(),isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(b)&&b.canBeFocused()&&b.getFocusableElement().id===a)return b;d=a.indexOf("_field_");b=a.indexOf("_connection_");if(-1!==d){var e=a.substring(0,d);if(e=this.getBlockById(e))for(var f of e.getFields())if(f.canBeFocused()&&
|
|
1341
1353
|
f.getFocusableElement().id===a)return f;return null}if(-1!==b){e=a.substring(0,b);if(e=this.getBlockById(e))for(const g of e.getConnections_(!0))if(g.id===a)return g;return null}if(f=this.getAllBlocks(!1).find(g=>g.getFocusableElement().id===a))return f;for(const g of this.getTopComments())if(g instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment&&g.canBeFocused()&&g.getFocusableElement().id===a)return g;f=this.getAllBlocks().map(g=>g.getIcons()).flat();for(e of f){if(e.canBeFocused()&&
|
|
1342
|
-
e.getFocusableElement().id===a)return e;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&(f=e.getBubble())&&f.canBeFocused()&&f.getFocusableElement().id===a)return f}return null}onTreeFocus(a,b){}onTreeBlur(a){if(
|
|
1343
|
-
a}},module$build$src$core$workspace_svg={};module$build$src$core$workspace_svg.WorkspaceSvg=WorkspaceSvg$$module$build$src$core$workspace_svg;module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;var VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank="undefined"===typeof a;a&&(this.varId=a.getId(),this.workspaceId=a.getWorkspace().id)}toJson(){const a=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");a.varId=this.varId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarBase$$module$build$src$core$events$events_var_base);
|
|
1354
|
+
e.getFocusableElement().id===a)return e;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&(f=e.getBubble())&&f.canBeFocused()&&f.getFocusableElement().id===a)return f}return null}onTreeFocus(a,b){}onTreeBlur(a){if(this.isFlyout&&this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()){var b=this.targetWorkspace.getFlyout(),c=this.targetWorkspace.getToolbox();c&&a===c||(c&&c.clearSelection(),b&&isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&
|
|
1355
|
+
b.autoHide(!1))}}getNavigator(){return this.navigator}setNavigator(a){this.navigator=a}},module$build$src$core$workspace_svg={};module$build$src$core$workspace_svg.WorkspaceSvg=WorkspaceSvg$$module$build$src$core$workspace_svg;module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;var VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank="undefined"===typeof a;a&&(this.varId=a.getId(),this.workspaceId=a.getWorkspace().id)}toJson(){const a=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");a.varId=this.varId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarBase$$module$build$src$core$events$events_var_base);
|
|
1344
1356
|
b.varId=a.varId;return b}},module$build$src$core$events$events_var_base={};module$build$src$core$events$events_var_base.VarBase=VarBase$$module$build$src$core$events$events_var_base;var VarCreate$$module$build$src$core$events$events_var_create=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_CREATE;a&&(this.varType=a.getType(),this.varName=a.getName())}toJson(){const a=super.toJson();if(void 0===this.varType)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");
|
|
1345
1357
|
a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarCreate$$module$build$src$core$events$events_var_create);b.varType=a.varType;b.varName=a.varName;return b}run(a){var b=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");b=b.getVariableMap();
|
|
1346
1358
|
a?b.createVariable(this.varName,this.varType,this.varId):(a=b.getVariableById(this.varId))&&b.deleteVariable(a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_CREATE,VarCreate$$module$build$src$core$events$events_var_create);var module$build$src$core$events$events_var_create={};module$build$src$core$events$events_var_create.VarCreate=VarCreate$$module$build$src$core$events$events_var_create;var VariableModel$$module$build$src$core$variable_model=class{constructor(a,b,c,d){this.workspace=a;this.name=b;this.type=c||"";this.id=d||genUid$$module$build$src$core$utils$idgenerator()}getId(){return this.id}getName(){return this.name}setName(a){this.name=a;return this}getType(){return this.type}setType(a){this.type=a;return this}getWorkspace(){return this.workspace}save(){const a={name:this.getName(),id:this.getId()},b=this.getType();b&&(a.type=b);return a}static load(a,b){a=new this(b,a.name,
|
|
@@ -1378,13 +1390,7 @@ this.svgGroup&&(this.svgGroup.style.opacity=`${b}`);this.lidOpen>this.minOpennes
|
|
|
1378
1390
|
this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(a){if(!(0>=this.workspace.options.maxTrashcanContents||!isBlockDelete$$module$build$src$core$events$predicates(a)||a.wasShadow)){if(!a.oldJson)throw Error("Encountered a delete event without proper oldJson");a=JSON.stringify(this.cleanBlockJson(a.oldJson));if(!this.contents.includes(a)){for(this.contents.unshift(a);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan)}}}cleanBlockJson(a){function b(c){if(c){delete c.id;
|
|
1379
1391
|
delete c.x;delete c.y;delete c.enabled;delete c.disabledReasons;if(c.icons&&c.icons.comment){var d=c.icons.comment;delete d.height;delete d.width;delete d.pinned}d=c.inputs;for(var e in d){var f=d[e];const g=f.block;f=f.shadow;g&&b(g);f&&b(f)}c.next&&(e=c.next,c=e.block,e=e.shadow,c&&b(c),e&&b(e))}}a=JSON.parse(JSON.stringify(a));b(a);return Object.assign({},{kind:"BLOCK"},a)}},WIDTH$$module$build$src$core$trashcan=47,BODY_HEIGHT$$module$build$src$core$trashcan=44,LID_HEIGHT$$module$build$src$core$trashcan=
|
|
1380
1392
|
16,MARGIN_VERTICAL$$module$build$src$core$trashcan=20,MARGIN_HORIZONTAL$$module$build$src$core$trashcan=20,MARGIN_HOTSPOT$$module$build$src$core$trashcan=10,SPRITE_LEFT$$module$build$src$core$trashcan=0,SPRITE_TOP$$module$build$src$core$trashcan=32,HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan=.1,ANIMATION_LENGTH$$module$build$src$core$trashcan=80,ANIMATION_FRAMES$$module$build$src$core$trashcan=4,OPACITY_MIN$$module$build$src$core$trashcan=.4,OPACITY_MAX$$module$build$src$core$trashcan=.8,
|
|
1381
|
-
MAX_LID_ANGLE$$module$build$src$core$trashcan=45,module$build$src$core$trashcan={};module$build$src$core$trashcan.Trashcan=Trashcan$$module$build$src$core$trashcan;var
|
|
1382
|
-
!1;this.removeAllKeyMappings(a);this.shortcuts.delete(a);return!0}addKeyMapping(a,b,c){a=`${a}`;const d=this.keyMap.get(a);if(d&&!c)throw Error(`Shortcut named "${b}" collides with shortcuts "${d}"`);d&&c?d.unshift(b):this.keyMap.set(a,[b])}removeKeyMapping(a,b,c){const d=this.keyMap.get(a);if(!d)return c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`),!1;const e=d.indexOf(b);if(-1<e)return d.splice(e,1),0===d.length&&this.keyMap.delete(a),!0;c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`);
|
|
1383
|
-
return!1}removeAllKeyMappings(a){for(const b of this.keyMap.keys())this.removeKeyMapping(b,a,!0)}setKeyMap(a){this.keyMap.clear();for(const b in a)this.keyMap.set(b,a[b])}getKeyMap(){const a=Object.create(null);for(const [b,c]of this.keyMap)a[b]=c;return a}getRegistry(){const a=Object.create(null);for(const [b,c]of this.shortcuts)a[b]=c;return deepMerge$$module$build$src$core$utils$object(Object.create(null),a)}onKeyDown(a,b){var c=this.serializeKeyEvent(b);c=this.getShortcutNamesByKeyCode(c);if(!c)return!1;
|
|
1384
|
-
for(const d of c){c=this.shortcuts.get(d);let e;if(!c||c.preconditionFn&&!c.preconditionFn(a,{focusedNode:null!=(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())?e:void 0}))continue;let f,g,h;if(null==(g=(f=c).callback)?0:g.call(f,a,b,c,{focusedNode:null!=(h=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())?h:void 0}))return!0}return!1}getShortcutNamesByKeyCode(a){return this.keyMap.get(a)||[]}getKeyCodesByShortcutName(a){const b=[];for(const [c,
|
|
1385
|
-
d]of this.keyMap)-1<d.indexOf(a)&&b.push(c);return b}serializeKeyEvent(a){let b="";for(const c in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)a.getModifierState(c)&&(""!==b&&(b+="+"),b+=c);""!==b&&a.keyCode?b+="+"+a.keyCode:a.keyCode&&(b=String(a.keyCode));return b}checkModifiers(a){for(const b of a)if(!(b in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys))throw Error(b+" is not a valid modifier key.");}createSerializedKey(a,b){let c="";if(b){this.checkModifiers(b);
|
|
1386
|
-
for(const d in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)b.includes(ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys[d])&&(""!==c&&(c+="+"),c+=d)}""!==c&&a?c+="+"+a:a&&(c=`${a}`);return c}};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry=new ShortcutRegistry$$module$build$src$core$shortcut_registry;
|
|
1387
|
-
(function(a){a=a.modifierKeys||(a.modifierKeys={});a[a.Shift=16]="Shift";a[a.Control=17]="Control";a[a.Alt=18]="Alt";a[a.Meta=91]="Meta"})(ShortcutRegistry$$module$build$src$core$shortcut_registry||(ShortcutRegistry$$module$build$src$core$shortcut_registry={}));var module$build$src$core$shortcut_registry={};module$build$src$core$shortcut_registry.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;var stashedCopyData$$module$build$src$core$clipboard=null,stashedWorkspace$$module$build$src$core$clipboard=null,TEST_ONLY$$module$build$src$core$clipboard={duplicateInternal:duplicateInternal$$module$build$src$core$clipboard,copyInternal:copyInternal$$module$build$src$core$clipboard},module$build$src$core$clipboard={};module$build$src$core$clipboard.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard.TEST_ONLY=TEST_ONLY$$module$build$src$core$clipboard;
|
|
1393
|
+
MAX_LID_ANGLE$$module$build$src$core$trashcan=45,module$build$src$core$trashcan={};module$build$src$core$trashcan.Trashcan=Trashcan$$module$build$src$core$trashcan;var stashedCopyData$$module$build$src$core$clipboard=null,stashedWorkspace$$module$build$src$core$clipboard=null,TEST_ONLY$$module$build$src$core$clipboard={duplicateInternal:duplicateInternal$$module$build$src$core$clipboard,copyInternal:copyInternal$$module$build$src$core$clipboard},module$build$src$core$clipboard={};module$build$src$core$clipboard.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard.TEST_ONLY=TEST_ONLY$$module$build$src$core$clipboard;
|
|
1388
1394
|
module$build$src$core$clipboard.paste=paste$$module$build$src$core$clipboard;module$build$src$core$clipboard.registry=module$build$src$core$clipboard$registry;var module$build$src$core$interfaces$i_copyable={};module$build$src$core$interfaces$i_copyable.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;var names$$module$build$src$core$shortcut_items;(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));var copyData$$module$build$src$core$shortcut_items=null,copyWorkspace$$module$build$src$core$shortcut_items=null,copyCoords$$module$build$src$core$shortcut_items=null;registerDefaultShortcuts$$module$build$src$core$shortcut_items();
|
|
1389
1395
|
var module$build$src$core$shortcut_items={};module$build$src$core$shortcut_items.names=names$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCopy=registerCopy$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCut=registerCut$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDefaultShortcuts=registerDefaultShortcuts$$module$build$src$core$shortcut_items;
|
|
1390
1396
|
module$build$src$core$shortcut_items.registerDelete=registerDelete$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerEscape=registerEscape$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerPaste=registerPaste$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerRedo=registerRedo$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src$core$shortcut_items;var ProcedureSerializer$$module$build$src$core$serialization$procedures=class{constructor(a,b){this.procedureModelClass=a;this.parameterModelClass=b;this.priority=PROCEDURES$$module$build$src$core$serialization$priorities}save(a){a=a.getProcedureMap().getProcedures().map(b=>saveProcedure$$module$build$src$core$serialization$procedures(b));return a.length?a:null}load(a,b){const c=b.getProcedureMap();for(const d of a)c.add(loadProcedure$$module$build$src$core$serialization$procedures(this.procedureModelClass,
|
|
@@ -1704,8 +1710,8 @@ b.style.display="none";var c=this.cssConfig_.contents;c&&addClass$$module$build$
|
|
|
1704
1710
|
CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName="collapsibleCategory";register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName,CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category);var module$build$src$core$toolbox$collapsible_category={};
|
|
1705
1711
|
module$build$src$core$toolbox$collapsible_category.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;var module$build$src$core$interfaces$i_selectable_toolbox_item={};module$build$src$core$interfaces$i_selectable_toolbox_item.isSelectableToolboxItem=isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item;var Toolbox$$module$build$src$core$toolbox$toolbox=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.id="toolbox";this.contentsDiv_=this.HtmlDiv=null;this.isVisible_=!1;this.height_=this.width_=0;this.flyout=null;this.contents=new Map;this.previouslySelectedItem_=this.selectedItem_=null;this.boundEvents_=[];this.workspace_=a;this.toolboxDef_=a.options.languageTree||{contents:[]};this.horizontalLayout=a.options.horizontalLayout;this.RTL=a.options.RTL;this.toolboxPosition=
|
|
1706
1712
|
a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_;const b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);const c=this.flyout.createDom("svg");addClass$$module$build$src$core$utils$dom(c,"blocklyToolboxFlyout");insertAfter$$module$build$src$core$utils$dom(c,b);this.setVisible(!0);this.flyout.init(a);this.render(this.toolboxDef_);a=a.getThemeManager();a.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color");a.subscribe(this.HtmlDiv,
|
|
1707
|
-
"toolboxForegroundColour","color");this.workspace_.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TOOLBOX_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET]});$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this
|
|
1708
|
-
a.getParentSvg();const b=this.createContainer_();this.contentsDiv_=this.createContentsContainer_();setRole$$module$build$src$core$utils$aria(this.contentsDiv_,Role$$module$build$src$core$utils$aria.TREE);b.appendChild(this.contentsDiv_);a.parentNode.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b}createContainer_(){const a=document.createElement("div");a.
|
|
1713
|
+
"toolboxForegroundColour","color");this.workspace_.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TOOLBOX_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET]});$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,
|
|
1714
|
+
!0)}createDom_(a){a=a.getParentSvg();const b=this.createContainer_();this.contentsDiv_=this.createContentsContainer_();setRole$$module$build$src$core$utils$aria(this.contentsDiv_,Role$$module$build$src$core$utils$aria.TREE);b.appendChild(this.contentsDiv_);a.parentNode.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b}createContainer_(){const a=document.createElement("div");a.setAttribute("layout",this.isHorizontal()?"h":"v");addClass$$module$build$src$core$utils$dom(a,"blocklyToolbox");
|
|
1709
1715
|
a.setAttribute("dir",this.RTL?"RTL":"LTR");return a}createContentsContainer_(){const a=document.createElement("div");addClass$$module$build$src$core$utils$dom(a,"blocklyToolboxCategoryGroup");this.isHorizontal()&&(a.style.flexDirection="row");return a}attachEvents_(a,b){a=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onClick_,!1);this.boundEvents_.push(a);b=conditionalBind$$module$build$src$core$browser_events(b,"keydown",this,this.onKeyDown_,!1);this.boundEvents_.push(b)}onClick_(a){if(isRightButton$$module$build$src$core$browser_events(a)||
|
|
1710
1716
|
a.target===this.HtmlDiv)getMainWorkspace$$module$build$src$core$common().hideChaff(!1);else{var b=a.target.getAttribute("id");b&&(b=this.getToolboxItemById(b),b.isSelectable()&&(this.setSelectedItem(b),b.onClick(a)));getMainWorkspace$$module$build$src$core$common().hideChaff(!0)}clearTouchIdentifier$$module$build$src$core$touch()}onKeyDown_(a){let b=!1;switch(a.key){case "ArrowDown":b=this.selectNext();break;case "ArrowUp":b=this.selectPrevious();break;case "ArrowLeft":b=this.selectParent();break;
|
|
1711
1717
|
case "ArrowRight":b=this.selectChild();break;case "Enter":case " ":this.selectedItem_&&this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),b=!0);break;default:b=!1}!b&&this.selectedItem_&&this.selectedItem_.onKeyDown&&(b=this.selectedItem_.onKeyDown(a));b&&a.preventDefault()}createFlyout_(){const a=this.workspace_,b=a.copyOptionsForFlyout();b.toolboxPosition=a.options.toolboxPosition;return new (a.horizontalLayout?getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,
|
|
@@ -1723,8 +1729,9 @@ b;this.previouslySelectedItem_=a;b.setSelected(!0);setState$$module$build$src$co
|
|
|
1723
1729
|
d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}selectParent(){return this.selectedItem_?this.selectedItem_.isCollapsible()&&this.selectedItem_.isExpanded()?(this.selectedItem_.toggleExpanded(),!0):this.selectedItem_.getParent()&&this.selectedItem_.getParent().isSelectable()?(this.setSelectedItem(this.selectedItem_.getParent()),!0):!1:!1}selectChild(){if(!this.selectedItem_||!this.selectedItem_.isCollapsible())return!1;const a=this.selectedItem_;a.isExpanded()?this.selectNext():
|
|
1724
1730
|
a.toggleExpanded();return!0}selectNext(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)+1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[++b];if(c&&c.isSelectable())return this.setSelectedItem(c),!0}return!1}selectPrevious(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)-1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[--b];if(c&&c.isSelectable())return this.setSelectedItem(c),
|
|
1725
1731
|
!0}return!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");this.flyout.dispose();this.contents.forEach(a=>a.dispose());for(let 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));$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");
|
|
1726
|
-
return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return null!=(b=this.getToolboxItems().find(c=>c.isSelectable()))?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){
|
|
1727
|
-
|
|
1732
|
+
return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return null!=(b=this.getToolboxItems().find(c=>c.isSelectable()))?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){let b;a&&a===(null==(b=this.flyout)?
|
|
1733
|
+
void 0:b.getWorkspace())||(this.clearSelection(),this.flyout&&isAutoHideable$$module$build$src$core$interfaces$i_autohideable(this.flyout)&&this.flyout.autoHide(!1))}};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 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');
|
|
1734
|
+
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="12.1.0",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,
|
|
1728
1735
|
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=
|
|
1729
1736
|
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,
|
|
1730
1737
|
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,
|
|
@@ -1742,9 +1749,9 @@ module$build$src$core$blockly.FieldVariable=FieldVariable$$module$build$src$core
|
|
|
1742
1749
|
module$build$src$core$blockly.FlyoutMetricsManager=FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager;module$build$src$core$blockly.FlyoutNavigationPolicy=FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy;module$build$src$core$blockly.FlyoutNavigator=FlyoutNavigator$$module$build$src$core$flyout_navigator;module$build$src$core$blockly.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;
|
|
1743
1750
|
module$build$src$core$blockly.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;module$build$src$core$blockly.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$blockly.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;module$build$src$core$blockly.Generator=$.CodeGenerator$$module$build$src$core$generator;
|
|
1744
1751
|
module$build$src$core$blockly.Gesture=Gesture$$module$build$src$core$gesture;module$build$src$core$blockly.Grid=Grid$$module$build$src$core$grid;module$build$src$core$blockly.HorizontalFlyout=HorizontalFlyout$$module$build$src$core$flyout_horizontal;module$build$src$core$blockly.INPUT_VALUE=INPUT_VALUE$$module$build$src$core$blockly;module$build$src$core$blockly.Input=Input$$module$build$src$core$inputs$input;module$build$src$core$blockly.InsertionMarkerPreviewer=InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer;
|
|
1745
|
-
module$build$src$core$blockly.
|
|
1746
|
-
module$build$src$core$blockly.
|
|
1747
|
-
module$build$src$core$blockly.OPPOSITE_TYPE=OPPOSITE_TYPE$$module$build$src$core$internal_constants;module$build$src$core$blockly.OUTPUT_VALUE=OUTPUT_VALUE$$module$build$src$core$blockly;module$build$src$core$blockly.Options=Options$$module$build$src$core$options;module$build$src$core$blockly.PREVIOUS_STATEMENT=PREVIOUS_STATEMENT$$module$build$src$core$blockly;module$build$src$core$blockly.PROCEDURE_CATEGORY_NAME=CATEGORY_NAME$$module$build$src$core$procedures;
|
|
1752
|
+
module$build$src$core$blockly.KeyboardNavigationController=KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$blockly.LabelFlyoutInflater=LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater;module$build$src$core$blockly.LineCursor=LineCursor$$module$build$src$core$keyboard_nav$line_cursor;module$build$src$core$blockly.Marker=Marker$$module$build$src$core$keyboard_nav$marker;module$build$src$core$blockly.MarkerManager=MarkerManager$$module$build$src$core$marker_manager;
|
|
1753
|
+
module$build$src$core$blockly.Menu=Menu$$module$build$src$core$menu;module$build$src$core$blockly.MenuItem=MenuItem$$module$build$src$core$menuitem;module$build$src$core$blockly.MetricsManager=MetricsManager$$module$build$src$core$metrics_manager;module$build$src$core$blockly.Msg=$.Msg$$module$build$src$core$msg;module$build$src$core$blockly.NEXT_STATEMENT=NEXT_STATEMENT$$module$build$src$core$blockly;module$build$src$core$blockly.Names=$.Names$$module$build$src$core$names;
|
|
1754
|
+
module$build$src$core$blockly.Navigator=Navigator$$module$build$src$core$navigator;module$build$src$core$blockly.OPPOSITE_TYPE=OPPOSITE_TYPE$$module$build$src$core$internal_constants;module$build$src$core$blockly.OUTPUT_VALUE=OUTPUT_VALUE$$module$build$src$core$blockly;module$build$src$core$blockly.Options=Options$$module$build$src$core$options;module$build$src$core$blockly.PREVIOUS_STATEMENT=PREVIOUS_STATEMENT$$module$build$src$core$blockly;module$build$src$core$blockly.PROCEDURE_CATEGORY_NAME=CATEGORY_NAME$$module$build$src$core$procedures;
|
|
1748
1755
|
module$build$src$core$blockly.Procedures=module$build$src$core$procedures;module$build$src$core$blockly.RENAME_VARIABLE_ID=RENAME_VARIABLE_ID$$module$build$src$core$internal_constants;module$build$src$core$blockly.RenderedConnection=RenderedConnection$$module$build$src$core$rendered_connection;module$build$src$core$blockly.Scrollbar=Scrollbar$$module$build$src$core$scrollbar;module$build$src$core$blockly.ScrollbarPair=ScrollbarPair$$module$build$src$core$scrollbar_pair;
|
|
1749
1756
|
module$build$src$core$blockly.SeparatorFlyoutInflater=SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater;module$build$src$core$blockly.ShortcutItems=module$build$src$core$shortcut_items;module$build$src$core$blockly.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;module$build$src$core$blockly.TOOLBOX_AT_BOTTOM=TOOLBOX_AT_BOTTOM$$module$build$src$core$blockly;module$build$src$core$blockly.TOOLBOX_AT_LEFT=TOOLBOX_AT_LEFT$$module$build$src$core$blockly;
|
|
1750
1757
|
module$build$src$core$blockly.TOOLBOX_AT_RIGHT=TOOLBOX_AT_RIGHT$$module$build$src$core$blockly;module$build$src$core$blockly.TOOLBOX_AT_TOP=TOOLBOX_AT_TOP$$module$build$src$core$blockly;module$build$src$core$blockly.Theme=Theme$$module$build$src$core$theme;module$build$src$core$blockly.ThemeManager=ThemeManager$$module$build$src$core$theme_manager;module$build$src$core$blockly.Themes=module$build$src$core$theme$themes;module$build$src$core$blockly.Toast=Toast$$module$build$src$core$toast;
|
|
@@ -1758,8 +1765,9 @@ module$build$src$core$blockly.dialog=module$build$src$core$dialog;module$build$s
|
|
|
1758
1765
|
module$build$src$core$blockly.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$blockly.hasBubble=hasBubble$$module$build$src$core$interfaces$i_has_bubble;module$build$src$core$blockly.hideChaff=hideChaff$$module$build$src$core$blockly;module$build$src$core$blockly.icons=module$build$src$core$icons;module$build$src$core$blockly.inject=inject$$module$build$src$core$inject;module$build$src$core$blockly.inputs=module$build$src$core$inputs;
|
|
1759
1766
|
module$build$src$core$blockly.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;module$build$src$core$blockly.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;module$build$src$core$blockly.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;module$build$src$core$blockly.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;module$build$src$core$blockly.isObservable=isObservable$$module$build$src$core$interfaces$i_observable;
|
|
1760
1767
|
module$build$src$core$blockly.isPaster=isPaster$$module$build$src$core$interfaces$i_paster;module$build$src$core$blockly.isRenderedElement=isRenderedElement$$module$build$src$core$interfaces$i_rendered_element;module$build$src$core$blockly.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;module$build$src$core$blockly.isSerializable=isSerializable$$module$build$src$core$interfaces$i_serializable;module$build$src$core$blockly.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;
|
|
1761
|
-
module$build$src$core$blockly.
|
|
1762
|
-
module$build$src$core$blockly.
|
|
1768
|
+
module$build$src$core$blockly.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$blockly.layers=module$build$src$core$layers;module$build$src$core$blockly.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$blockly.navigateStacks=navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$blockly.procedures=module$build$src$core$procedures;
|
|
1769
|
+
module$build$src$core$blockly.registry=module$build$src$core$registry;module$build$src$core$blockly.renderManagement=module$build$src$core$render_management;module$build$src$core$blockly.serialization=module$build$src$core$serialization;module$build$src$core$blockly.setLocale=setLocale$$module$build$src$core$msg;module$build$src$core$blockly.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$blockly.svgResize=svgResize$$module$build$src$core$common;
|
|
1770
|
+
module$build$src$core$blockly.thrasos=module$build$src$core$renderers$thrasos$thrasos;module$build$src$core$blockly.uiPosition=module$build$src$core$positionable_helpers;module$build$src$core$blockly.utils=module$build$src$core$utils;module$build$src$core$blockly.zelos=module$build$src$core$renderers$zelos$zelos;var module$build$src$core$utils$metrics={};var module$build$src$core$renderers$common$i_path_object={};var module$build$src$core$interfaces$i_variable_model={};var module$build$src$core$interfaces$i_variable_map={};var module$build$src$core$interfaces$i_toolbox_item={};var module$build$src$core$interfaces$i_toolbox={};var module$build$src$core$interfaces$i_styleable={};var module$build$src$core$interfaces$i_serializer={};var module$build$src$core$interfaces$i_registrable={};var module$build$src$core$interfaces$i_procedure_model={};var module$build$src$core$interfaces$i_procedure_map={};var module$build$src$core$interfaces$i_positionable={};var module$build$src$core$interfaces$i_parameter_model={};var module$build$src$core$interfaces$i_movable={};var module$build$src$core$interfaces$i_metrics_manager={};var module$build$src$core$interfaces$i_keyboard_accessible={};var module$build$src$core$interfaces$i_focusable_tree={};module$build$src$core$interfaces$i_focusable_tree.isFocusableTree=isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree;var module$build$src$core$interfaces$i_flyout_inflater={};var module$build$src$core$interfaces$i_flyout={};var module$build$src$core$interfaces$i_dragger={};var module$build$src$core$interfaces$i_drag_target={};var module$build$src$core$interfaces$i_delete_area={};var module$build$src$core$interfaces$i_contextmenu={};var module$build$src$core$interfaces$i_connection_previewer={};var module$build$src$core$interfaces$i_connection_checker={};var module$build$src$core$interfaces$i_component={};var module$build$src$core$interfaces$i_collapsible_toolbox_item={};var module$build$src$core$interfaces$i_bubble={};var module$build$src$core$interfaces$i_bounded_element={};
|
|
1763
1771
|
module$build$src$core$blockly.__namespace__=$;
|
|
1764
1772
|
return module$build$src$core$blockly;
|
|
1765
1773
|
}));
|