blockly 13.0.0-beta.3 → 13.0.0-beta.5
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 +645 -530
- package/blockly_compressed.js +553 -493
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +28 -25
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +19 -1
- package/core/block_aria_composer.d.ts +23 -4
- package/core/block_svg.d.ts +11 -2
- package/core/comments/collapse_comment_bar_button.d.ts +7 -0
- package/core/comments/comment_bar_button.d.ts +14 -0
- package/core/comments/comment_editor.d.ts +15 -0
- package/core/comments/comment_view.d.ts +2 -2
- package/core/comments/delete_comment_bar_button.d.ts +7 -0
- package/core/contextmenu_registry.d.ts +10 -0
- package/core/dragging/block_drag_strategy.d.ts +9 -1
- package/core/field.d.ts +31 -9
- package/core/field_checkbox.d.ts +2 -2
- package/core/field_dropdown.d.ts +11 -2
- package/core/field_image.d.ts +29 -2
- package/core/field_input.d.ts +3 -3
- package/core/field_label.d.ts +27 -0
- package/core/flyout_button.d.ts +3 -1
- package/core/hints.d.ts +34 -0
- package/core/inputs/input.d.ts +6 -2
- package/core/keyboard_navigation_controller.d.ts +12 -0
- package/core/rendered_connection.d.ts +6 -5
- package/core/shortcut_items.d.ts +28 -4
- package/core/workspace_audio.d.ts +13 -7
- package/core/workspace_svg.d.ts +16 -0
- package/msg/ab.js +64 -12
- package/msg/ab.mjs +52 -0
- package/msg/ace.js +64 -12
- package/msg/ace.mjs +52 -0
- package/msg/af.js +64 -12
- package/msg/af.mjs +52 -0
- package/msg/am.js +64 -12
- package/msg/am.mjs +52 -0
- package/msg/ar.js +61 -9
- package/msg/ar.mjs +52 -0
- package/msg/ast.js +64 -12
- package/msg/ast.mjs +52 -0
- package/msg/az.js +64 -12
- package/msg/az.mjs +52 -0
- package/msg/ba.js +64 -12
- package/msg/ba.mjs +52 -0
- package/msg/bcc.js +64 -12
- package/msg/bcc.mjs +52 -0
- package/msg/be-tarask.js +61 -9
- package/msg/be-tarask.mjs +52 -0
- package/msg/be.js +64 -12
- package/msg/be.mjs +52 -0
- package/msg/bg.js +64 -12
- package/msg/bg.mjs +52 -0
- package/msg/bn.js +64 -12
- package/msg/bn.mjs +52 -0
- package/msg/br.js +64 -12
- package/msg/br.mjs +52 -0
- package/msg/bs.js +64 -12
- package/msg/bs.mjs +52 -0
- package/msg/ca.js +64 -12
- package/msg/ca.mjs +52 -0
- package/msg/ce.js +64 -12
- package/msg/ce.mjs +52 -0
- package/msg/cs.js +64 -12
- package/msg/cs.mjs +52 -0
- package/msg/da.js +61 -9
- package/msg/da.mjs +52 -0
- package/msg/de.js +64 -12
- package/msg/de.mjs +52 -0
- package/msg/diq.js +64 -12
- package/msg/diq.mjs +52 -0
- package/msg/dtp.js +64 -12
- package/msg/dtp.mjs +52 -0
- package/msg/dty.js +64 -12
- package/msg/dty.mjs +52 -0
- package/msg/ee.js +64 -12
- package/msg/ee.mjs +52 -0
- package/msg/el.js +61 -9
- package/msg/el.mjs +52 -0
- package/msg/en-gb.js +64 -12
- package/msg/en-gb.mjs +52 -0
- package/msg/en.js +64 -12
- package/msg/en.mjs +52 -0
- package/msg/eo.js +64 -12
- package/msg/eo.mjs +52 -0
- package/msg/es.js +64 -12
- package/msg/es.mjs +52 -0
- package/msg/et.js +64 -12
- package/msg/et.mjs +52 -0
- package/msg/eu.js +64 -12
- package/msg/eu.mjs +52 -0
- package/msg/fa.js +64 -12
- package/msg/fa.mjs +52 -0
- package/msg/fi.js +64 -12
- package/msg/fi.mjs +52 -0
- package/msg/fo.js +64 -12
- package/msg/fo.mjs +52 -0
- package/msg/fr.js +61 -9
- package/msg/fr.mjs +52 -0
- package/msg/frr.js +64 -12
- package/msg/frr.mjs +52 -0
- package/msg/ga.js +61 -9
- package/msg/ga.mjs +52 -0
- package/msg/gl.js +61 -9
- package/msg/gl.mjs +52 -0
- package/msg/gn.js +64 -12
- package/msg/gn.mjs +52 -0
- package/msg/gor.js +64 -12
- package/msg/gor.mjs +52 -0
- package/msg/ha.js +64 -12
- package/msg/ha.mjs +52 -0
- package/msg/hak.js +64 -12
- package/msg/hak.mjs +52 -0
- package/msg/he.js +61 -9
- package/msg/he.mjs +52 -0
- package/msg/hi.js +64 -12
- package/msg/hi.mjs +52 -0
- package/msg/hr.js +64 -12
- package/msg/hr.mjs +52 -0
- package/msg/hrx.js +64 -12
- package/msg/hrx.mjs +52 -0
- package/msg/hsb.js +64 -12
- package/msg/hsb.mjs +52 -0
- package/msg/hu.js +64 -12
- package/msg/hu.mjs +52 -0
- package/msg/hy.js +64 -12
- package/msg/hy.mjs +52 -0
- package/msg/ia.js +61 -9
- package/msg/ia.mjs +52 -0
- package/msg/id.js +61 -9
- package/msg/id.mjs +52 -0
- package/msg/ig.js +64 -12
- package/msg/ig.mjs +52 -0
- package/msg/inh.js +64 -12
- package/msg/inh.mjs +52 -0
- package/msg/is.js +64 -12
- package/msg/is.mjs +52 -0
- package/msg/it.js +64 -12
- package/msg/it.mjs +52 -0
- package/msg/ja.js +61 -9
- package/msg/ja.mjs +52 -0
- package/msg/ka.js +64 -12
- package/msg/ka.mjs +52 -0
- package/msg/kab.js +64 -12
- package/msg/kab.mjs +52 -0
- package/msg/kbd-cyrl.js +64 -12
- package/msg/kbd-cyrl.mjs +52 -0
- package/msg/km.js +64 -12
- package/msg/km.mjs +52 -0
- package/msg/kn.js +64 -12
- package/msg/kn.mjs +52 -0
- package/msg/ko.js +64 -12
- package/msg/ko.mjs +52 -0
- package/msg/krc.js +61 -9
- package/msg/krc.mjs +52 -0
- package/msg/ksh.js +64 -12
- package/msg/ksh.mjs +52 -0
- package/msg/ku-latn.js +64 -12
- package/msg/ku-latn.mjs +52 -0
- package/msg/ky.js +64 -12
- package/msg/ky.mjs +52 -0
- package/msg/la.js +64 -12
- package/msg/la.mjs +52 -0
- package/msg/lb.js +63 -11
- package/msg/lb.mjs +52 -0
- package/msg/lki.js +64 -12
- package/msg/lki.mjs +52 -0
- package/msg/lo.js +64 -12
- package/msg/lo.mjs +52 -0
- package/msg/lrc.js +64 -12
- package/msg/lrc.mjs +52 -0
- package/msg/lt.js +64 -12
- package/msg/lt.mjs +52 -0
- package/msg/lv.js +64 -12
- package/msg/lv.mjs +52 -0
- package/msg/mg.js +64 -12
- package/msg/mg.mjs +52 -0
- package/msg/mk.js +64 -12
- package/msg/mk.mjs +52 -0
- package/msg/ml.js +64 -12
- package/msg/ml.mjs +52 -0
- package/msg/mnw.js +64 -12
- package/msg/mnw.mjs +52 -0
- package/msg/ms.js +64 -12
- package/msg/ms.mjs +52 -0
- package/msg/my.js +64 -12
- package/msg/my.mjs +52 -0
- package/msg/mzn.js +64 -12
- package/msg/mzn.mjs +52 -0
- package/msg/nb.js +64 -12
- package/msg/nb.mjs +52 -0
- package/msg/ne.js +64 -12
- package/msg/ne.mjs +52 -0
- package/msg/nl.js +61 -9
- package/msg/nl.mjs +52 -0
- package/msg/oc.js +64 -12
- package/msg/oc.mjs +52 -0
- package/msg/olo.js +64 -12
- package/msg/olo.mjs +52 -0
- package/msg/pa.js +64 -12
- package/msg/pa.mjs +52 -0
- package/msg/pl.js +61 -9
- package/msg/pl.mjs +52 -0
- package/msg/pms.js +61 -9
- package/msg/pms.mjs +52 -0
- package/msg/ps.js +64 -12
- package/msg/ps.mjs +52 -0
- package/msg/pt-br.js +61 -9
- package/msg/pt-br.mjs +52 -0
- package/msg/pt.js +61 -9
- package/msg/pt.mjs +52 -0
- package/msg/ro.js +61 -9
- package/msg/ro.mjs +52 -0
- package/msg/ru.js +61 -9
- package/msg/ru.mjs +52 -0
- package/msg/sc.js +64 -12
- package/msg/sc.mjs +52 -0
- package/msg/sco.js +64 -12
- package/msg/sco.mjs +52 -0
- package/msg/sd.js +64 -12
- package/msg/sd.mjs +52 -0
- package/msg/shn.js +64 -12
- package/msg/shn.mjs +52 -0
- package/msg/si.js +64 -12
- package/msg/si.mjs +52 -0
- package/msg/sk.js +64 -12
- package/msg/sk.mjs +52 -0
- package/msg/skr-arab.js +64 -12
- package/msg/skr-arab.mjs +52 -0
- package/msg/sl.js +61 -9
- package/msg/sl.mjs +52 -0
- package/msg/smn.js +64 -12
- package/msg/smn.mjs +52 -0
- package/msg/sq.js +63 -11
- package/msg/sq.mjs +52 -0
- package/msg/sr-latn.js +64 -12
- package/msg/sr-latn.mjs +52 -0
- package/msg/sr.js +64 -12
- package/msg/sr.mjs +52 -0
- package/msg/sv.js +61 -9
- package/msg/sv.mjs +52 -0
- package/msg/sw.js +64 -12
- package/msg/sw.mjs +52 -0
- package/msg/ta.js +64 -12
- package/msg/ta.mjs +52 -0
- package/msg/tcy.js +61 -9
- package/msg/tcy.mjs +52 -0
- package/msg/tdd.js +64 -12
- package/msg/tdd.mjs +52 -0
- package/msg/te.js +64 -12
- package/msg/te.mjs +52 -0
- package/msg/th.js +64 -12
- package/msg/th.mjs +52 -0
- package/msg/ti.js +64 -12
- package/msg/ti.mjs +52 -0
- package/msg/tl.js +64 -12
- package/msg/tl.mjs +52 -0
- package/msg/tlh.js +64 -12
- package/msg/tlh.mjs +52 -0
- package/msg/tr.js +61 -9
- package/msg/tr.mjs +52 -0
- package/msg/ug-arab.js +64 -12
- package/msg/ug-arab.mjs +52 -0
- package/msg/uk.js +64 -12
- package/msg/uk.mjs +52 -0
- package/msg/ur.js +64 -12
- package/msg/ur.mjs +52 -0
- package/msg/uz.js +64 -12
- package/msg/uz.mjs +52 -0
- package/msg/vi.js +61 -9
- package/msg/vi.mjs +52 -0
- package/msg/xmf.js +64 -12
- package/msg/xmf.mjs +52 -0
- package/msg/yo.js +64 -12
- package/msg/yo.mjs +52 -0
- package/msg/zgh.js +64 -12
- package/msg/zgh.mjs +52 -0
- package/msg/zh-hans.js +61 -9
- package/msg/zh-hans.mjs +52 -0
- package/msg/zh-hant.js +61 -9
- package/msg/zh-hant.mjs +52 -0
- package/package.json +39 -38
package/blockly_compressed.js
CHANGED
|
@@ -32,40 +32,42 @@ jsonFlyoutCategoryBlocks$$module$build$src$core$variables,xmlFlyoutCategory$$mod
|
|
|
32
32
|
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,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,
|
|
33
33
|
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,saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,append$$module$build$src$core$serialization$blocks,
|
|
34
34
|
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,tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,loadFields$$module$build$src$core$serialization$blocks,
|
|
35
|
-
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,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
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,getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting,getShortcutKeysLong$$module$build$src$core$utils$shortcut_formatting,getKeyName$$module$build$src$core$utils$shortcut_formatting,getShortcutKeys$$module$build$src$core$utils$shortcut_formatting,upperCaseFirst$$module$build$src$core$utils$shortcut_formatting,
|
|
36
|
+
modifierOrder$$module$build$src$core$utils$shortcut_formatting,toRadians$$module$build$src$core$utils$math,toDegrees$$module$build$src$core$utils$math,clamp$$module$build$src$core$utils$math,createDom$$module$build$src$core$dropdowndiv,handleFocusLoss$$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,
|
|
37
|
+
showPositionedByBlock$$module$build$src$core$dropdowndiv,showPositionedByField$$module$build$src$core$dropdowndiv,getScaledBboxOfBlock$$module$build$src$core$dropdowndiv,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,
|
|
38
|
+
getPositionX$$module$build$src$core$dropdowndiv,isVisible$$module$build$src$core$dropdowndiv,hideIfOwner$$module$build$src$core$dropdowndiv,hide$$module$build$src$core$dropdowndiv,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,
|
|
39
|
+
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,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,
|
|
40
|
+
unbindMouseEvents$$module$build$src$core$tooltip,onMouseOver$$module$build$src$core$tooltip,onMouseOut$$module$build$src$core$tooltip,onMouseMove$$module$build$src$core$tooltip,dispose$$module$build$src$core$tooltip,hide$$module$build$src$core$tooltip,display$$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,
|
|
41
|
+
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,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,
|
|
42
|
+
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,parseBlockColour$$module$build$src$core$utils$parsing,getDiv$$module$build$src$core$widgetdiv,testOnly_setDiv$$module$build$src$core$widgetdiv,handleFocusLoss$$module$build$src$core$widgetdiv,createDom$$module$build$src$core$widgetdiv,show$$module$build$src$core$widgetdiv,
|
|
43
|
+
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,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,
|
|
44
|
+
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,hide$$module$build$src$core$contextmenu,dispose$$module$build$src$core$contextmenu,getMenu$$module$build$src$core$contextmenu,makeMenuitem$$module$build$src$core$contextmenu,getKeyboardShortcut$$module$build$src$core$contextmenu,
|
|
45
|
+
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,cloneShadow$$module$build$src$core$xml,domToText$$module$build$src$core$xml,
|
|
46
|
+
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,applyDataTagNodes$$module$build$src$core$xml,applyFieldTagNodes$$module$build$src$core$xml,
|
|
47
|
+
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,isImageProperties$$module$build$src$core$field_dropdown,unregister$$module$build$src$core$extensions,
|
|
48
|
+
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,getMutatorProperties$$module$build$src$core$extensions,mutatorPropertiesMatch$$module$build$src$core$extensions,
|
|
49
|
+
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,line$$module$build$src$core$utils$svg_paths,lineOnAxis$$module$build$src$core$utils$svg_paths,arc$$module$build$src$core$utils$svg_paths,
|
|
50
|
+
connectReciprocally$$module$build$src$core$connection,getSingleConnection$$module$build$src$core$connection,getConnectionForOrphanedOutput$$module$build$src$core$connection,isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,computeAriaLabel$$module$build$src$core$block_aria_composer,configureAriaRole$$module$build$src$core$block_aria_composer,computeFieldRowLabel$$module$build$src$core$block_aria_composer,
|
|
51
|
+
getParentInputLabel$$module$build$src$core$block_aria_composer,getBeginStackLabel$$module$build$src$core$block_aria_composer,getInputLabels$$module$build$src$core$block_aria_composer,getInputLabelsSubset$$module$build$src$core$block_aria_composer,findStartOfStatementSection$$module$build$src$core$block_aria_composer,getParentToolboxCategoryLabel$$module$build$src$core$block_aria_composer,getAnnouncementTemplate$$module$build$src$core$block_aria_composer,computeMoveConnectionLabel$$module$build$src$core$block_aria_composer,
|
|
51
52
|
computeMoveLabel$$module$build$src$core$block_aria_composer,getConnectionPreposition$$module$build$src$core$block_aria_composer,getDisabledLabel$$module$build$src$core$block_aria_composer,getCollapsedLabel$$module$build$src$core$block_aria_composer,getShadowBlockLabel$$module$build$src$core$block_aria_composer,getInputCountLabel$$module$build$src$core$block_aria_composer,isIcon$$module$build$src$core$interfaces$i_icon,isCommentIcon$$module$build$src$core$interfaces$i_comment_icon,disposeUiEffect$$module$build$src$core$block_animations,
|
|
52
53
|
disposeUiStep$$module$build$src$core$block_animations,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,
|
|
53
|
-
bumpIntoBoundsHandler$$module$build$src$core$bump_objects,extractObjectFromEvent$$module$build$src$core$bump_objects,bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
registerDefaultOptions$$module$build$src$core$contextmenu_items,isBoundedElement$$module$build$src$core$interfaces$i_bounded_element,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
bumpIntoBoundsHandler$$module$build$src$core$bump_objects,extractObjectFromEvent$$module$build$src$core$bump_objects,bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects,copy$$module$build$src$core$clipboard,getLastCopiedData$$module$build$src$core$clipboard,setLastCopiedData$$module$build$src$core$clipboard,getLastCopiedWorkspace$$module$build$src$core$clipboard,setLastCopiedWorkspace$$module$build$src$core$clipboard,getLastCopiedLocation$$module$build$src$core$clipboard,setLastCopiedLocation$$module$build$src$core$clipboard,
|
|
55
|
+
paste$$module$build$src$core$clipboard,pasteFromData$$module$build$src$core$clipboard,hasContextMenu$$module$build$src$core$interfaces$i_contextmenu,isCopyable$$module$build$src$core$interfaces$i_copyable,isDeletable$$module$build$src$core$interfaces$i_deletable,isDraggable$$module$build$src$core$interfaces$i_draggable,registerEscape$$module$build$src$core$shortcut_items,registerDelete$$module$build$src$core$shortcut_items,isCopyable$$module$build$src$core$shortcut_items,isCuttable$$module$build$src$core$shortcut_items,
|
|
56
|
+
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,registerMovementShortcuts$$module$build$src$core$shortcut_items,registerShowContextMenu$$module$build$src$core$shortcut_items,registerArrowNavigation$$module$build$src$core$shortcut_items,registerFocusWorkspace$$module$build$src$core$shortcut_items,
|
|
57
|
+
registerFocusToolbox$$module$build$src$core$shortcut_items,registerReadInformation$$module$build$src$core$shortcut_items,registerReadExtendedInformation$$module$build$src$core$shortcut_items,registerDisconnectBlock$$module$build$src$core$shortcut_items,registerStackNavigation$$module$build$src$core$shortcut_items,registerHeadingNavigation$$module$build$src$core$shortcut_items,registerPerformAction$$module$build$src$core$shortcut_items,registerDuplicate$$module$build$src$core$shortcut_items,registerCleanup$$module$build$src$core$shortcut_items,
|
|
58
|
+
registerShowTooltip$$module$build$src$core$shortcut_items,registerToggleScreenreaderMode$$module$build$src$core$shortcut_items,registerDefaultShortcuts$$module$build$src$core$shortcut_items,registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items,registerScreenReaderShortcuts$$module$build$src$core$shortcut_items,showUnconstrainedMoveHint$$module$build$src$core$hints,showConstrainedMovementHint$$module$build$src$core$hints,clearMoveHints$$module$build$src$core$hints,showHelpHint$$module$build$src$core$hints,
|
|
59
|
+
showBlockNavigationHint$$module$build$src$core$hints,showWorkspaceNavigationHint$$module$build$src$core$hints,showFlyoutLabelActionHint$$module$build$src$core$hints,showCopiedHint$$module$build$src$core$hints,showCutHint$$module$build$src$core$hints,clearPasteHints$$module$build$src$core$hints,showScreenreaderModeHint$$module$build$src$core$hints,getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,
|
|
60
|
+
isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item,getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator,isAutoHideable$$module$build$src$core$interfaces$i_autohideable,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,allProcedures$$module$build$src$core$procedures,
|
|
61
|
+
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,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,
|
|
62
|
+
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,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,
|
|
63
|
+
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,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,
|
|
64
|
+
save$$module$build$src$core$serialization$workspaces,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,isFullBlockField$$module$build$src$core$contextmenu_items,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,
|
|
65
|
+
registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,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,
|
|
66
|
+
registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,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,
|
|
67
|
+
registerCommentCreate$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isBoundedElement$$module$build$src$core$interfaces$i_bounded_element,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,
|
|
68
|
+
$jscomp;
|
|
69
|
+
register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&typeof a!=="string"||`${a}`.trim()==="")throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if(typeof b!=="string"||b.trim()==="")throw Error('Invalid name "'+b+'". The name must be a non-empty string.');var e=b.toLowerCase();if(!c)throw Error("Can not register a null value");var f=typeMap$$module$build$src$core$registry[a],g=
|
|
70
|
+
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};
|
|
69
71
|
validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if(typeof b.fromJson!=="function")throw Error('Type "'+a+'" must have a fromJson function');}};
|
|
70
72
|
unregister$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();var 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.")};
|
|
71
73
|
getItem$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();b=b.toLowerCase();var 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};
|
|
@@ -236,28 +238,36 @@ loadIcons$$module$build$src$core$serialization$blocks=function(a,b){if(b.icons){
|
|
|
236
238
|
loadFields$$module$build$src$core$serialization$blocks=function(a,b){if(b.fields){var c=Object.keys(b.fields);for(let d=0;d<c.length;d++){let e=c[d],f=b.fields[e],g=a.getField(e);g?g.loadState(f):console.warn(`Ignoring non-existant field ${e} in block ${a.type}`)}}};
|
|
237
239
|
loadInputBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.inputs){var c=Object.keys(b.inputs);for(let d=0;d<c.length;d++){let e=c[d],f=a.getInput(e);if(!f||!f.connection)throw new MissingConnection$$module$build$src$core$serialization$exceptions(e,a,b);loadConnection$$module$build$src$core$serialization$blocks(f.connection,b.inputs[e])}}};
|
|
238
240
|
loadNextBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.next){if(!a.nextConnection)throw new MissingConnection$$module$build$src$core$serialization$exceptions("next",a,b);loadConnection$$module$build$src$core$serialization$blocks(a.nextConnection,b.next)}};loadConnection$$module$build$src$core$serialization$blocks=function(a,b){b.shadow&&a.setShadowState(b.shadow);b.block&&appendPrivate$$module$build$src$core$serialization$blocks(b.block,a.getSourceBlock().workspace,{parentConnection:a})};
|
|
239
|
-
initBlock$$module$build$src$core$serialization$blocks=function(a,b){if(b){a.setConnectionTracking(!1);a.initSvg();a.queueRender();for(let c of a.getIcons())c.onLocationChange(a.getRelativeToSurfaceXY())}else a.initModel()};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
initBlock$$module$build$src$core$serialization$blocks=function(a,b){if(b){a.setConnectionTracking(!1);a.initSvg();a.queueRender();for(let c of a.getIcons())c.onLocationChange(a.getRelativeToSurfaceXY())}else a.initModel()};
|
|
242
|
+
getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting=function(a){a=getShortcutKeys$$module$build$src$core$utils$shortcut_formatting(a,shortModifierNames$$module$build$src$core$utils$shortcut_formatting);return a.length?a[0].join(APPLE$$module$build$src$core$utils$useragent?" ":" + "):""};getShortcutKeysLong$$module$build$src$core$utils$shortcut_formatting=function(a){return getShortcutKeys$$module$build$src$core$utils$shortcut_formatting(a,longModifierNames$$module$build$src$core$utils$shortcut_formatting)};
|
|
243
|
+
getKeyName$$module$build$src$core$utils$shortcut_formatting=function(a){if(a>=65&&a<=90)return String.fromCharCode(a);var b={8:$.Msg$$module$build$src$core$msg.BACKSPACE_KEY,9:$.Msg$$module$build$src$core$msg.TAB_KEY,13:$.Msg$$module$build$src$core$msg.ENTER_KEY,16:$.Msg$$module$build$src$core$msg.SHIFT_KEY,17:$.Msg$$module$build$src$core$msg.CONTROL_KEY,18:$.Msg$$module$build$src$core$msg.ALT_KEY,19:$.Msg$$module$build$src$core$msg.PAUSE_KEY,20:$.Msg$$module$build$src$core$msg.CAPS_LOCK_KEY,27:$.Msg$$module$build$src$core$msg.ESCAPE,
|
|
244
|
+
32:$.Msg$$module$build$src$core$msg.SPACE_KEY,33:$.Msg$$module$build$src$core$msg.PAGE_UP_KEY,34:$.Msg$$module$build$src$core$msg.PAGE_DOWN_KEY,35:$.Msg$$module$build$src$core$msg.END_KEY,36:$.Msg$$module$build$src$core$msg.HOME_KEY,37:"\u2190",38:"\u2191",39:"\u2192",40:"\u2193",45:$.Msg$$module$build$src$core$msg.INSERT_KEY,46:$.Msg$$module$build$src$core$msg.DELETE_KEY,48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",93:$.Msg$$module$build$src$core$msg.CONTEXT_MENU_KEY,
|
|
245
|
+
96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"\u00d7",107:"+",109:"\u2212",110:".",111:"\u00f7",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",186:";",187:"=",189:"-",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"\u2318"}[a];if(b)return b;console.warn("Unknown key code: "+a);return String.fromCharCode(a)};
|
|
246
|
+
getShortcutKeys$$module$build$src$core$utils$shortcut_formatting=function(a,b){a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.getKeyCodesByShortcutName(a);if(a.length===0)return[];a=a.map(d=>d.split("+"));a.forEach(d=>d.sort((e,f)=>{e=modifierOrder$$module$build$src$core$utils$shortcut_formatting(e);f=modifierOrder$$module$build$src$core$utils$shortcut_formatting(f);return e-f}));a.sort((d,e)=>{d=d.includes("Meta")?1:0;return(e.includes("Meta")?1:0)-d});var c=a.filter(d=>d.includes("Meta")===
|
|
247
|
+
APPLE$$module$build$src$core$utils$useragent);c=c.length===0?a:c;c.sort((d,e)=>d.length-e.length);return(c.some(d=>d.some(e=>"Meta"===e||"Alt"===e||"Control"===e))?[c[0]]:c).map(d=>d.map(e=>Number.isFinite(+e)?getKeyName$$module$build$src$core$utils$shortcut_formatting(+e):e).map(e=>{var f;return upperCaseFirst$$module$build$src$core$utils$shortcut_formatting((f=b[e])!=null?f:e)}))};upperCaseFirst$$module$build$src$core$utils$shortcut_formatting=function(a){return a.charAt(0).toUpperCase()+a.substring(1)};
|
|
248
|
+
modifierOrder$$module$build$src$core$utils$shortcut_formatting=function(a){a=modifierOrdering$$module$build$src$core$utils$shortcut_formatting.indexOf(a);return a===-1?Number.MAX_VALUE:a};toRadians$$module$build$src$core$utils$math=function(a){return a*Math.PI/180};toDegrees$$module$build$src$core$utils$math=function(a){return a*180/Math.PI};clamp$$module$build$src$core$utils$math=function(a,b,c){if(c<a){let d=c;c=a;a=d}return Math.max(a,Math.min(b,c))};
|
|
249
|
+
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,div$$module$build$src$core$dropdowndiv.id=getNextUniqueId$$module$build$src$core$utils$idgenerator(),(getParentContainer$$module$build$src$core$common()||document.body).appendChild(div$$module$build$src$core$dropdowndiv),
|
|
250
|
+
content$$module$build$src$core$dropdowndiv=document.createElement("div"),content$$module$build$src$core$dropdowndiv.className="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=
|
|
251
|
+
document.createElement("div"),arrow$$module$build$src$core$dropdowndiv.className="blocklyDropDownArrow",div$$module$build$src$core$dropdowndiv.appendChild(arrow$$module$build$src$core$dropdowndiv),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")};
|
|
252
|
+
handleFocusLoss$$module$build$src$core$dropdowndiv=function(){returnEphemeralFocus$$module$build$src$core$dropdowndiv&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv(!1),returnEphemeralFocus$$module$build$src$core$dropdowndiv=null);hide$$module$build$src$core$dropdowndiv()};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};
|
|
253
|
+
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()};
|
|
245
254
|
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)};
|
|
246
255
|
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)};
|
|
247
256
|
getScaledBboxOfBlock$$module$build$src$core$dropdowndiv=function(a){var b=a.getSvgRoot(),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)};
|
|
248
257
|
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e){var f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;e&&(a+=e);e=b.getSourceBlock();for(var h=e.workspace;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)};
|
|
249
258
|
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){$.getFocusManager$$module$build$src$core$focus_manager().registerPopoverFocusLossHandler(handleFocusLoss$$module$build$src$core$dropdowndiv);var k;(k=getParentContainer$$module$build$src$core$common())==null||k.appendChild(div$$module$build$src$core$dropdowndiv);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();
|
|
250
|
-
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,renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);
|
|
251
|
-
|
|
252
|
-
getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
|
|
259
|
+
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,renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);b=getState$$module$build$src$core$utils$aria(a.getFocusableElement(),State$$module$build$src$core$utils$aria.OWNS);
|
|
260
|
+
setState$$module$build$src$core$utils$aria(a.getFocusableElement(),State$$module$build$src$core$utils$aria.OWNS,b?[b,div$$module$build$src$core$dropdowndiv.id]:div$$module$build$src$core$dropdowndiv.id);a.getFocusableElement().classList.add(SHOWING_DROPDOWNDIV_SELECTOR$$module$build$src$core$dropdowndiv);c=positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));
|
|
261
|
+
return c};getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
|
|
253
262
|
getPositionAboveMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:d.height-BORDER_SIZE$$module$build$src$core$dropdowndiv*2-ARROW_SIZE$$module$build$src$core$dropdowndiv/2,arrowAtTop:!1,arrowVisible:!0}};
|
|
254
263
|
getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv=function(a,b,c){a=getPositionX$$module$build$src$core$dropdowndiv(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};
|
|
255
264
|
getPositionX$$module$build$src$core$dropdowndiv=function(a,b,c,d){b=clamp$$module$build$src$core$utils$math(b,a-d/2,c-d);a=a-ARROW_SIZE$$module$build$src$core$dropdowndiv/2-b;c=ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv;a=clamp$$module$build$src$core$utils$math(c,a,d-c-ARROW_SIZE$$module$build$src$core$dropdowndiv);return{arrowX:a,divX:b}};isVisible$$module$build$src$core$dropdowndiv=function(){return!!owner$$module$build$src$core$dropdowndiv};
|
|
256
265
|
hideIfOwner$$module$build$src$core$dropdowndiv=function(a,b){return owner$$module$build$src$core$dropdowndiv===a?(b?hideWithoutAnimation$$module$build$src$core$dropdowndiv():hide$$module$build$src$core$dropdowndiv(),!0):!1};
|
|
257
266
|
hide$$module$build$src$core$dropdowndiv=function(){$.getFocusManager$$module$build$src$core$focus_manager().unregisterPopoverFocusLossHandler(handleFocusLoss$$module$build$src$core$dropdowndiv);div$$module$build$src$core$dropdowndiv.style.transform="translate(0, 0)";div$$module$build$src$core$dropdowndiv.style.opacity="0";animateOutTimer$$module$build$src$core$dropdowndiv=setTimeout(function(){hideWithoutAnimation$$module$build$src$core$dropdowndiv()},ANIMATION_TIME$$module$build$src$core$dropdowndiv*
|
|
258
267
|
1E3);onHide$$module$build$src$core$dropdowndiv&&(onHide$$module$build$src$core$dropdowndiv(),onHide$$module$build$src$core$dropdowndiv=null)};
|
|
259
|
-
hideWithoutAnimation$$module$build$src$core$dropdowndiv=function(){isVisible$$module$build$src$core$dropdowndiv()
|
|
260
|
-
(
|
|
268
|
+
hideWithoutAnimation$$module$build$src$core$dropdowndiv=function(){if(isVisible$$module$build$src$core$dropdowndiv()){animateOutTimer$$module$build$src$core$dropdowndiv&&clearTimeout(animateOutTimer$$module$build$src$core$dropdowndiv);onHide$$module$build$src$core$dropdowndiv&&(onHide$$module$build$src$core$dropdowndiv(),onHide$$module$build$src$core$dropdowndiv=null);owner$$module$build$src$core$dropdowndiv=null;var a=getMainWorkspace$$module$build$src$core$common(),b,c=(b=getState$$module$build$src$core$utils$aria(a.getFocusableElement(),
|
|
269
|
+
State$$module$build$src$core$utils$aria.OWNS))!=null?b:"";setState$$module$build$src$core$utils$aria(a.getFocusableElement(),State$$module$build$src$core$utils$aria.OWNS,c.replace(div$$module$build$src$core$dropdowndiv.id,""));a.getFocusableElement().classList.remove(SHOWING_DROPDOWNDIV_SELECTOR$$module$build$src$core$dropdowndiv);a.markFocused();returnEphemeralFocus$$module$build$src$core$dropdowndiv&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv(),returnEphemeralFocus$$module$build$src$core$dropdowndiv=
|
|
270
|
+
null);clearContent$$module$build$src$core$dropdowndiv()}};
|
|
261
271
|
positionInternal$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=internal$$module$build$src$core$dropdowndiv.getPositionMetrics(a,b,c,d);a.arrowVisible?(b=a.arrowX,c=a.arrowY,d=a.arrowAtTop?45:225,arrow$$module$build$src$core$dropdowndiv.style.display="",arrow$$module$build$src$core$dropdowndiv.style.transform=`translate(${b}px, ${c}px) rotate(${d}deg)`,arrow$$module$build$src$core$dropdowndiv.setAttribute("class","blocklyDropDownArrow")):arrow$$module$build$src$core$dropdowndiv.style.display=
|
|
262
272
|
"none";b=Math.floor(a.initialX);c=Math.floor(a.initialY);d=Math.floor(a.finalX);var e=Math.floor(a.finalY),f=div$$module$build$src$core$dropdowndiv.parentElement;f&&(f=f.getBoundingClientRect(),b-=f.left+window.scrollX,d-=f.left+window.scrollX,c-=f.top+window.scrollY,e-=f.top+window.scrollY);div$$module$build$src$core$dropdowndiv.style.left=b+"px";div$$module$build$src$core$dropdowndiv.style.top=c+"px";div$$module$build$src$core$dropdowndiv.style.visibility="visible";div$$module$build$src$core$dropdowndiv.style.opacity=
|
|
263
273
|
"1";div$$module$build$src$core$dropdowndiv.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return!!a.arrowAtTop};
|
|
@@ -303,14 +313,16 @@ checkMessageReferences$$module$build$src$core$utils$parsing=function(a){var b=!0
|
|
|
303
313
|
parseBlockColour$$module$build$src$core$utils$parsing=function(a){var b=typeof a==="string"?replaceMessageReferences$$module$build$src$core$utils$parsing(a):a,c=Number(b);if(!isNaN(c)&&0<=c&&c<=360)return{hue:c,hex:hsvToHex$$module$build$src$core$utils$colour(c,getHsvSaturation$$module$build$src$core$utils$colour(),getHsvValue$$module$build$src$core$utils$colour()*255)};if(c=parse$$module$build$src$core$utils$colour(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!==b&&(c+=' (from "'+a+'")');
|
|
304
314
|
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(a===null){let b;(b=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv))==null||b.remove()}};
|
|
305
315
|
handleFocusLoss$$module$build$src$core$widgetdiv=function(){returnEphemeralFocus$$module$build$src$core$widgetdiv&&(returnEphemeralFocus$$module$build$src$core$widgetdiv(!1),returnEphemeralFocus$$module$build$src$core$widgetdiv=null);hide$$module$build$src$core$widgetdiv()};
|
|
306
|
-
createDom$$module$build$src$core$widgetdiv=function(){var 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.
|
|
307
|
-
|
|
308
|
-
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){
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
(
|
|
316
|
+
createDom$$module$build$src$core$widgetdiv=function(){var 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.id=getNextUniqueId$$module$build$src$core$utils$idgenerator(),containerDiv$$module$build$src$core$widgetdiv.className=
|
|
317
|
+
containerClassName$$module$build$src$core$widgetdiv,containerDiv$$module$build$src$core$widgetdiv.tabIndex=-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)};
|
|
318
|
+
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){ownerWorkspace$$module$build$src$core$widgetdiv=d!=null?d:getMainWorkspace$$module$build$src$core$common();var f=getState$$module$build$src$core$utils$aria(ownerWorkspace$$module$build$src$core$widgetdiv.getFocusableElement(),State$$module$build$src$core$utils$aria.OWNS);
|
|
319
|
+
setState$$module$build$src$core$utils$aria(ownerWorkspace$$module$build$src$core$widgetdiv.getFocusableElement(),State$$module$build$src$core$utils$aria.OWNS,f?[f,c.id]:c.id);ownerWorkspace$$module$build$src$core$widgetdiv.getFocusableElement().classList.add(SHOWING_WIDGETDIV_SELECTOR$$module$build$src$core$widgetdiv);var g;(g=getParentContainer$$module$build$src$core$common())==null||g.appendChild(c);c.style.direction=b?"rtl":"ltr";c.style.display="block";!d&&a instanceof Field$$module$build$src$core$field&&
|
|
320
|
+
a.getSourceBlock();rendererClassName$$module$build$src$core$widgetdiv=ownerWorkspace$$module$build$src$core$widgetdiv.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=ownerWorkspace$$module$build$src$core$widgetdiv.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,
|
|
321
|
+
themeClassName$$module$build$src$core$widgetdiv);e&&(returnEphemeralFocus$$module$build$src$core$widgetdiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c));$.getFocusManager$$module$build$src$core$focus_manager().registerPopoverFocusLossHandler(handleFocusLoss$$module$build$src$core$widgetdiv)}};
|
|
322
|
+
hide$$module$build$src$core$widgetdiv=function(){if(isVisible$$module$build$src$core$widgetdiv()){owner$$module$build$src$core$widgetdiv=null;var a=containerDiv$$module$build$src$core$widgetdiv;if(a){$.getFocusManager$$module$build$src$core$focus_manager().unregisterPopoverFocusLossHandler(handleFocusLoss$$module$build$src$core$widgetdiv);a.style.display="none";a.style.left="";a.style.top="";dispose$$module$build$src$core$widgetdiv&&(dispose$$module$build$src$core$widgetdiv(),dispose$$module$build$src$core$widgetdiv=
|
|
323
|
+
null);a.textContent="";rendererClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,rendererClassName$$module$build$src$core$widgetdiv),rendererClassName$$module$build$src$core$widgetdiv="");themeClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,themeClassName$$module$build$src$core$widgetdiv),themeClassName$$module$build$src$core$widgetdiv="");var b;(b=ownerWorkspace$$module$build$src$core$widgetdiv)==null||b.markFocused();
|
|
324
|
+
returnEphemeralFocus$$module$build$src$core$widgetdiv&&(returnEphemeralFocus$$module$build$src$core$widgetdiv(),returnEphemeralFocus$$module$build$src$core$widgetdiv=null);if(ownerWorkspace$$module$build$src$core$widgetdiv&&containerDiv$$module$build$src$core$widgetdiv){var c;a=(c=getState$$module$build$src$core$utils$aria(ownerWorkspace$$module$build$src$core$widgetdiv.getFocusableElement(),State$$module$build$src$core$utils$aria.OWNS))!=null?c:"";setState$$module$build$src$core$utils$aria(ownerWorkspace$$module$build$src$core$widgetdiv.getFocusableElement(),
|
|
325
|
+
State$$module$build$src$core$utils$aria.OWNS,a.replace(containerDiv$$module$build$src$core$widgetdiv.id,""));ownerWorkspace$$module$build$src$core$widgetdiv.getFocusableElement().classList.remove(SHOWING_WIDGETDIV_SELECTOR$$module$build$src$core$widgetdiv)}}}};isVisible$$module$build$src$core$widgetdiv=function(){return!!owner$$module$build$src$core$widgetdiv};hideIfOwner$$module$build$src$core$widgetdiv=function(a){owner$$module$build$src$core$widgetdiv===a&&hide$$module$build$src$core$widgetdiv()};
|
|
314
326
|
hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv=function(a){for(var b=ownerWorkspace$$module$build$src$core$widgetdiv===null,c=a;!b&&c;){if(c===a){b=!0;break}c=a.options.parentWorkspace}b&&hide$$module$build$src$core$widgetdiv()};
|
|
315
327
|
positionInternal$$module$build$src$core$widgetdiv=function(a,b,c){if(containerDiv$$module$build$src$core$widgetdiv){var d=containerDiv$$module$build$src$core$widgetdiv.parentElement;d&&(d=d.getBoundingClientRect(),a-=d.left+window.scrollX,b-=d.top+window.scrollY);containerDiv$$module$build$src$core$widgetdiv.style.left=a+"px";containerDiv$$module$build$src$core$widgetdiv.style.top=b+"px";containerDiv$$module$build$src$core$widgetdiv.style.height=c+"px"}};
|
|
316
328
|
positionWithAnchor$$module$build$src$core$widgetdiv=function(a,b,c,d){var e=calculateY$$module$build$src$core$widgetdiv(a,b,c);a=calculateX$$module$build$src$core$widgetdiv(a,b,c,d);e<0?positionInternal$$module$build$src$core$widgetdiv(a,0,c.height+e):positionInternal$$module$build$src$core$widgetdiv(a,e,c.height)};calculateX$$module$build$src$core$widgetdiv=function(a,b,c,d){return d?Math.min(Math.max(b.right-c.width,a.left),a.right-c.width):Math.max(Math.min(b.left,a.right-c.width),a.left)};
|
|
@@ -318,15 +330,17 @@ calculateY$$module$build$src$core$widgetdiv=function(a,b,c){return b.bottom+c.he
|
|
|
318
330
|
getCurrentBlock$$module$build$src$core$contextmenu=function(){return currentBlock$$module$build$src$core$contextmenu};setCurrentBlock$$module$build$src$core$contextmenu=function(a){currentBlock$$module$build$src$core$contextmenu=a};
|
|
319
331
|
show$$module$build$src$core$contextmenu=function(a,b,c,d,e){show$$module$build$src$core$widgetdiv(dummyOwner$$module$build$src$core$contextmenu,c,dispose$$module$build$src$core$contextmenu,d);if(b.length){e||(a instanceof PointerEvent?e=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):(console.warn("Context menu opened with keyboard but no location given"),e=new Coordinate$$module$build$src$core$utils$coordinate(0,0)));var f=populate_$$module$build$src$core$contextmenu(b,
|
|
320
332
|
c,a,e);menu_$$module$build$src$core$contextmenu=f;position_$$module$build$src$core$contextmenu(f,c,e);setTimeout(function(){f.focus()},1);currentBlock$$module$build$src$core$contextmenu=null}else hide$$module$build$src$core$contextmenu()};
|
|
321
|
-
populate_$$module$build$src$core$contextmenu=function(a,b,c,d){var e=new Menu$$module$build$src$core$menu;e.setRole(Role$$module$build$src$core$utils$aria.MENU);for(let f=0;f<a.length;f++){let g=a[f];if(g.separator){e.addChild(new MenuSeparator$$module$build$src$core$menu_separator);continue}let h=new MenuItem$$module$build$src$core$menuitem(g
|
|
322
|
-
l){hide$$module$build$src$core$contextmenu();requestAnimationFrame(()=>{setTimeout(()=>{g.callback(g.scope,c,l,d)},0)})},{})}return e};
|
|
333
|
+
populate_$$module$build$src$core$contextmenu=function(a,b,c,d){var e=new Menu$$module$build$src$core$menu;e.setRole(Role$$module$build$src$core$utils$aria.MENU);for(let f=0;f<a.length;f++){let g=a[f];if(g.separator){e.addChild(new MenuSeparator$$module$build$src$core$menu_separator);continue}let h=new MenuItem$$module$build$src$core$menuitem(makeMenuitem$$module$build$src$core$contextmenu(g));h.setRightToLeft(b);h.setRole(Role$$module$build$src$core$utils$aria.MENUITEM);e.addChild(h);h.setEnabled(g.enabled);
|
|
334
|
+
if(g.enabled)h.onAction(function(k,l){hide$$module$build$src$core$contextmenu();requestAnimationFrame(()=>{setTimeout(()=>{g.callback(g.scope,c,l,d)},0)})},{})}return e};
|
|
323
335
|
position_$$module$build$src$core$contextmenu=function(a,b,c){var d=getViewportBBox$$module$build$src$core$utils$svg_math();c=new Rect$$module$build$src$core$utils$rect(c.y+d.top,c.y+d.top,c.x+d.left,c.x+d.left);createWidget_$$module$build$src$core$contextmenu(a);var e=a.getSize();b&&(c.left+=e.width,c.right+=e.width,d.left+=e.width,d.right+=e.width);positionWithAnchor$$module$build$src$core$widgetdiv(d,c,e,b);a.focus()};
|
|
324
336
|
createWidget_$$module$build$src$core$contextmenu=function(a){var b=getDiv$$module$build$src$core$widgetdiv();if(!b)throw Error("Attempting to create a context menu when widget div is null");b=a.render(b);addClass$$module$build$src$core$utils$dom(b,"blocklyContextMenu");conditionalBind$$module$build$src$core$browser_events(b,"contextmenu",null,haltPropagation$$module$build$src$core$contextmenu);a.focus()};haltPropagation$$module$build$src$core$contextmenu=function(a){a.preventDefault();a.stopPropagation()};
|
|
325
337
|
hide$$module$build$src$core$contextmenu=function(){hideIfOwner$$module$build$src$core$widgetdiv(dummyOwner$$module$build$src$core$contextmenu);currentBlock$$module$build$src$core$contextmenu=null;var a;(a=menu_$$module$build$src$core$contextmenu)==null||a.dispose();menu_$$module$build$src$core$contextmenu=null};
|
|
326
338
|
dispose$$module$build$src$core$contextmenu=function(){menu_$$module$build$src$core$contextmenu&&(menu_$$module$build$src$core$contextmenu.dispose(),menu_$$module$build$src$core$contextmenu=null)};
|
|
327
339
|
$.callbackFactory$$module$build$src$core$contextmenu=function(a,b){return()=>{$.disable$$module$build$src$core$events$utils();try{var c=b instanceof Element?domToBlockInternal$$module$build$src$core$xml(b,a.workspace):appendInternal$$module$build$src$core$serialization$blocks(b,a.workspace);let d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-$.config$$module$build$src$core$config.snapRadius:d.x+$.config$$module$build$src$core$config.snapRadius;d.y+=$.config$$module$build$src$core$config.snapRadius*2;c.moveBy(d.x,
|
|
328
340
|
d.y)}finally{$.enable$$module$build$src$core$events$utils()}isEnabled$$module$build$src$core$events$utils()&&!c.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(c));$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return c}};getMenu$$module$build$src$core$contextmenu=function(){return menu_$$module$build$src$core$contextmenu};
|
|
329
|
-
|
|
341
|
+
makeMenuitem$$module$build$src$core$contextmenu=function(a){var b=a.text;if(b&&!(b instanceof HTMLElement)){let c=document.createElement("div");c.className="blocklyShortcutContainer";let d=document.createElement("span");d.textContent=b;b=document.createElement("span");b.className="blocklyShortcut";b.textContent=` ${getKeyboardShortcut$$module$build$src$core$contextmenu(a)}`;c.appendChild(d);c.appendChild(b);return c}return a.text};
|
|
342
|
+
getKeyboardShortcut$$module$build$src$core$contextmenu=function(a){return"id"in a&&a.associatedKeyboardShortcut?getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(a.associatedKeyboardShortcut):""};mouseToWorkspacePoint$$module$build$src$core$utils$drag=function(a,b){b=mouseToSvg$$module$build$src$core$browser_events(b,a.getParentSvg(),a.getInverseScreenCTM());b.x/=a.scale;b.y/=a.scale;return b};
|
|
343
|
+
start$$module$build$src$core$utils$drag=function(a,b,c){b=mouseToWorkspacePoint$$module$build$src$core$utils$drag(a,b);workspaceToDragDelta$$module$build$src$core$utils$drag.set(a,Coordinate$$module$build$src$core$utils$coordinate.difference(c,b))};
|
|
330
344
|
move$$module$build$src$core$utils$drag=function(a,b){b=mouseToWorkspacePoint$$module$build$src$core$utils$drag(a,b);a=workspaceToDragDelta$$module$build$src$core$utils$drag.get(a);if(!a)throw Error("Drag not initialized");return Coordinate$$module$build$src$core$utils$coordinate.sum(a,b)};
|
|
331
345
|
workspaceToDom$$module$build$src$core$xml=function(a,b=!1){var c=$.createElement$$module$build$src$core$utils$xml("xml"),d=variablesToDom$$module$build$src$core$xml($.allUsedVarModels$$module$build$src$core$variables(a));d.hasChildNodes()&&c.appendChild(d);for(let e of a.getTopComments())c.appendChild(saveWorkspaceComment$$module$build$src$core$xml(e,b));a=a.getTopBlocks(!0);for(d=0;d<a.length;d++)c.appendChild(blockToDomWithXY$$module$build$src$core$xml(a[d],b));return c};
|
|
332
346
|
saveWorkspaceComment$$module$build$src$core$xml=function(a,b=!1){var c=$.createElement$$module$build$src$core$utils$xml("comment");b||c.setAttribute("id",a.id);b=a.workspace;var d=a.getRelativeToSurfaceXY().clone();d.x=b.RTL?b.getWidth()-d.x:d.x;c.setAttribute("x",`${d.x}`);c.setAttribute("y",`${d.y}`);c.setAttribute("w",`${a.getSize().width}`);c.setAttribute("h",`${a.getSize().height}`);a.getText()&&(c.textContent=a.getText());a.isCollapsed()&&c.setAttribute("collapsed","true");a.isOwnEditable()||
|
|
@@ -390,25 +404,29 @@ lineOnAxis$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+" "+
|
|
|
390
404
|
getSingleConnection$$module$build$src$core$connection=function(a,b){var c=null;b=b.outputConnection;var d=b==null?void 0:b.getConnectionChecker();for(let e=0,f;f=a.inputList[e];e++){let g=f.connection;if(g&&(d==null?0:d.canConnect(b,g,!1))){if(c)return null;c=g}}return c};getConnectionForOrphanedOutput$$module$build$src$core$connection=function(a,b){for(var c;c=getSingleConnection$$module$build$src$core$connection(a,b);)if(a=c.targetBlock(),!a||a.isShadow())return c;return null};
|
|
391
405
|
isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item=function(a){return a&&typeof a.init==="function"&&typeof a.getDiv==="function"&&typeof a.getId==="function"&&typeof a.getParent==="function"&&typeof a.getLevel==="function"&&typeof a.isSelectable==="function"&&typeof a.isCollapsible==="function"&&typeof a.dispose==="function"&&typeof a.getClickTarget==="function"&&typeof a.setVisible_==="function"&&typeof a.getParentToolbox==="function"};
|
|
392
406
|
isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item=function(a){return typeof a.getName==="function"&&typeof a.getContents==="function"&&typeof a.setSelected==="function"&&typeof a.onClick==="function"&&isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item(a)&&a.isSelectable()};
|
|
393
|
-
computeAriaLabel$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD){return
|
|
394
|
-
b
|
|
407
|
+
computeAriaLabel$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD,c=!0){if(a.isSimpleReporter()){let d=a.getFullBlockField();if(d)return d.computeAriaLabel(b>=Verbosity$$module$build$src$core$utils$aria.STANDARD)}return[b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getBeginStackLabel$$module$build$src$core$block_aria_composer(a),getParentInputLabel$$module$build$src$core$block_aria_composer(a),...getInputLabels$$module$build$src$core$block_aria_composer(a,
|
|
408
|
+
b,c),b===Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS&&getParentToolboxCategoryLabel$$module$build$src$core$block_aria_composer(a),b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getDisabledLabel$$module$build$src$core$block_aria_composer(a),b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getCollapsedLabel$$module$build$src$core$block_aria_composer(a),b>=Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS&&getShadowBlockLabel$$module$build$src$core$block_aria_composer(a),
|
|
409
|
+
b>=Verbosity$$module$build$src$core$utils$aria.STANDARD&&getInputCountLabel$$module$build$src$core$block_aria_composer(a)].filter(d=>!!d).join(", ")};
|
|
395
410
|
configureAriaRole$$module$build$src$core$block_aria_composer=function(a){setRole$$module$build$src$core$utils$aria(a.getSvgRoot(),Role$$module$build$src$core$utils$aria.PRESENTATION);var b=a.getFocusableElement();a.isInFlyout||setRole$$module$build$src$core$utils$aria(b,Role$$module$build$src$core$utils$aria.FIGURE);var c=a.getAriaRoleDescription();setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,c?c:a.statementInputCount?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_CONTAINER:
|
|
396
411
|
a.outputConnection?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_VALUE:$.Msg$$module$build$src$core$msg.BLOCK_LABEL_STATEMENT)};
|
|
397
|
-
computeFieldRowLabel$$module$build$src$core$block_aria_composer=function(a,b,c=Verbosity$$module$build$src$core$utils$aria.STANDARD){var d=c>=Verbosity$$module$build$src$core$utils$aria.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
412
|
+
computeFieldRowLabel$$module$build$src$core$block_aria_composer=function(a,b,c=Verbosity$$module$build$src$core$utils$aria.STANDARD){var d=c>=Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS,e=[],f=a.fieldRow.filter(g=>g.isVisible()).flatMap((g,h,k)=>{if(g instanceof FieldLabel$$module$build$src$core$field_label){if(h<k.length-1&&k[h+1]instanceof FieldLabel$$module$build$src$core$field_label)return e.push(g.computeAriaLabel(d)),[];if(e.length>=1)return e.push(g.computeAriaLabel(d)),g=e.join(" "),
|
|
413
|
+
e=[],g}return g.computeAriaLabel(d)});if(!f.length&&b){let g=a.getSourceBlock().inputList;a=g.indexOf(a);if(a>0)return computeFieldRowLabel$$module$build$src$core$block_aria_composer(g[a-1],b,c)}return f.filter(g=>!!g)};
|
|
414
|
+
getParentInputLabel$$module$build$src$core$block_aria_composer=function(a){var b,c,d,e=(b=(d=a.outputConnection)!=null?d:a.previousConnection)==null?void 0:(c=b.targetConnection)==null?void 0:c.getParentInput();if(e&&(a=e.getSourceBlock(),!a.isInsertionMarker())){if(b=e.getAriaLabelText())a=b;else{if(!a.statementInputCount)return;a=a.inputList.find(f=>f.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT);if(e===a)return;a=computeFieldRowLabel$$module$build$src$core$block_aria_composer(e,
|
|
415
|
+
!0)}return e.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT?(e=Array.isArray(a)?a.join(" "):a,$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_PREFIX.replace("%1",e)):a}};getBeginStackLabel$$module$build$src$core$block_aria_composer=function(a){if(!a.isInFlyout&&!a.workspace.isDragging())return a.getRootBlock()===a?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_STACK:void 0};
|
|
416
|
+
getInputLabels$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD,c=!0){var d=a=a.inputList.filter(e=>e.isVisible());if(b<=Verbosity$$module$build$src$core$utils$aria.STANDARD){let e=a.filter(f=>f.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT);e.length>1&&(d=a.slice(0,a.indexOf(e[0])+1))}return d.map(e=>{var f;return(f=c?e.getAriaLabelText():null)!=null?f:e.getLabel(b)})};
|
|
417
|
+
getInputLabelsSubset$$module$build$src$core$block_aria_composer=function(a,b){var c=a.inputList.indexOf(b);if(c===-1)throw Error(`Input with name "${b.name}" not found on block with id "${a.id}".`);b=b.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT?findStartOfStatementSection$$module$build$src$core$block_aria_composer(a.inputList,c):c;return a.inputList.slice(b,c+1).filter(d=>d.isVisible()).map(d=>d.getLabel(Verbosity$$module$build$src$core$utils$aria.TERSE)||$.Msg$$module$build$src$core$msg.INPUT_LABEL_INDEX.replace("%1",
|
|
418
|
+
(d.getIndex()+1).toString()))};findStartOfStatementSection$$module$build$src$core$block_aria_composer=function(a,b){for(--b;b>=0;b--)if(a[b].type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT)return b+1;return 0};
|
|
403
419
|
getParentToolboxCategoryLabel$$module$build$src$core$block_aria_composer=function(a){var b=a.workspace.getToolbox();if(b){var c=void 0;for(let d of b.getToolboxItems()){if(!isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(d))continue;b=d.getContents();if(Array.isArray(b)&&b.some(e=>e.kind.toLowerCase()==="block"&&"type"in e&&e.type===a.type)){c=d;break}"getColour"in d&&typeof d.getColour==="function"&&d.getColour()===a.getColour()&&(c=d)}if(c)return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_TOOLBOX_CATEGORY.replace("%1",
|
|
404
420
|
c.getName())}};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
421
|
+
getAnnouncementTemplate$$module$build$src$core$block_aria_composer=function(a){switch(a){case ConnectionPreposition$$module$build$src$core$block_aria_composer.BEFORE:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_BEFORE;case ConnectionPreposition$$module$build$src$core$block_aria_composer.AFTER:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_AFTER;case ConnectionPreposition$$module$build$src$core$block_aria_composer.INSIDE:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_INSIDE;case ConnectionPreposition$$module$build$src$core$block_aria_composer.AROUND:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_AROUND;
|
|
422
|
+
default:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_TO}};computeMoveConnectionLabel$$module$build$src$core$block_aria_composer=function(a,b){var c=a.getParentInput();if(!c)return b;var d=c.getAriaLabelText();if(!d){a=getInputLabelsSubset$$module$build$src$core$block_aria_composer(a.getSourceBlock(),c);if(!a.length)return b;d=a.join(", ")}return b?$.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_OF.replace("%1",d).replace("%2",b):d};
|
|
423
|
+
computeMoveLabel$$module$build$src$core$block_aria_composer=function(a,b,c,d=!1){var e=getConnectionPreposition$$module$build$src$core$block_aria_composer(a,b),f=getAnnouncementTemplate$$module$build$src$core$block_aria_composer(e),g=![ConnectionPreposition$$module$build$src$core$block_aria_composer.BEFORE,ConnectionPreposition$$module$build$src$core$block_aria_composer.AFTER].includes(e);e=g&&c(!0);c=g&&c(!1);d=d?a.getSourceBlock().getStackBlocksCountLabel():"";g=b.getSourceBlock().getAriaLabel(Verbosity$$module$build$src$core$utils$aria.TERSE);
|
|
424
|
+
e&&(d=computeMoveConnectionLabel$$module$build$src$core$block_aria_composer(a,d));c&&(g=computeMoveConnectionLabel$$module$build$src$core$block_aria_composer(b,g));return f.replace("%1",d).replace("%2",g)};
|
|
425
|
+
getConnectionPreposition$$module$build$src$core$block_aria_composer=function(a,b){switch(a.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:return ConnectionPreposition$$module$build$src$core$block_aria_composer.TO;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return a===a.getSourceBlock().nextConnection?ConnectionPreposition$$module$build$src$core$block_aria_composer.BEFORE:
|
|
426
|
+
ConnectionPreposition$$module$build$src$core$block_aria_composer.AROUND;case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:return b===b.getSourceBlock().nextConnection?ConnectionPreposition$$module$build$src$core$block_aria_composer.AFTER:ConnectionPreposition$$module$build$src$core$block_aria_composer.INSIDE}return ConnectionPreposition$$module$build$src$core$block_aria_composer.UNKNOWN};
|
|
410
427
|
getDisabledLabel$$module$build$src$core$block_aria_composer=function(a){return a.isEnabled()?void 0:$.Msg$$module$build$src$core$msg.BLOCK_LABEL_DISABLED};getCollapsedLabel$$module$build$src$core$block_aria_composer=function(a){return a.isCollapsed()?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_COLLAPSED:void 0};getShadowBlockLabel$$module$build$src$core$block_aria_composer=function(a){return a.isShadow()?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_REPLACEABLE:void 0};
|
|
411
|
-
getInputCountLabel$$module$build$src$core$block_aria_composer=function(a){switch(a.inputList.reduce((
|
|
428
|
+
getInputCountLabel$$module$build$src$core$block_aria_composer=function(a){var b=a.inputList.filter(c=>c.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT).length;if(b>1)return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_BRANCHES.replace("%1",b.toString());switch(a.inputList.reduce((c,d)=>{var e;return d.fieldRow.reduce((f,g)=>g.EDITABLE&&!g.isFullBlockField()?f++:f,c)+(((e=d.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?
|
|
429
|
+
1:0)},0)){case 0:break;case 1:return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_INPUT;default:return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_INPUTS}};
|
|
412
430
|
isIcon$$module$build$src$core$interfaces$i_icon=function(a){return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&typeof a.getType==="function"&&typeof a.initView==="function"&&typeof a.dispose==="function"&&typeof a.getWeight==="function"&&typeof a.getSize==="function"&&typeof a.applyColour==="function"&&typeof a.hideForInsertionMarker==="function"&&typeof a.updateEditable==="function"&&typeof a.updateCollapsed==="function"&&typeof a.isShownWhenCollapsed==="function"&&typeof a.setOffsetInBlock===
|
|
413
431
|
"function"&&typeof a.onLocationChange==="function"&&typeof a.onClick==="function"};
|
|
414
432
|
isCommentIcon$$module$build$src$core$interfaces$i_comment_icon=function(a){return isIcon$$module$build$src$core$interfaces$i_icon(a)&&hasBubble$$module$build$src$core$interfaces$i_has_bubble(a)&&isSerializable$$module$build$src$core$interfaces$i_serializable(a)&&typeof a.setText==="function"&&typeof a.getText==="function"&&typeof a.setBubbleSize==="function"&&typeof a.getBubbleSize==="function"&&typeof a.setBubbleLocation==="function"&&typeof a.getBubbleLocation==="function"&&a.getType()===IconType$$module$build$src$core$icons$icon_types.COMMENT};
|
|
@@ -428,79 +446,28 @@ bumpIntoBoundsHandler$$module$build$src$core$bump_objects=function(a){return b=>
|
|
|
428
446
|
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)}}};
|
|
429
447
|
extractObjectFromEvent$$module$build$src$core$bump_objects=function(a,b){var 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};
|
|
430
448
|
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)}};
|
|
431
|
-
getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting=function(a){a=getShortcutKeys$$module$build$src$core$utils$shortcut_formatting(a,shortModifierNames$$module$build$src$core$utils$shortcut_formatting);return a.length?a[0].join(APPLE$$module$build$src$core$utils$useragent?" ":" + "):""};getShortcutKeysLong$$module$build$src$core$utils$shortcut_formatting=function(a){return getShortcutKeys$$module$build$src$core$utils$shortcut_formatting(a,longModifierNames$$module$build$src$core$utils$shortcut_formatting)};
|
|
432
|
-
getKeyName$$module$build$src$core$utils$shortcut_formatting=function(a){if(a>=65&&a<=90)return String.fromCharCode(a);var b=keyNames$$module$build$src$core$utils$shortcut_formatting[a];if(b)return b;console.warn("Unknown key code: "+a);return String.fromCharCode(a)};
|
|
433
|
-
getShortcutKeys$$module$build$src$core$utils$shortcut_formatting=function(a,b){a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.getKeyCodesByShortcutName(a);if(a.length===0)return[];a=a.map(d=>d.split("+"));a.forEach(d=>d.sort((e,f)=>{e=modifierOrder$$module$build$src$core$utils$shortcut_formatting(e);f=modifierOrder$$module$build$src$core$utils$shortcut_formatting(f);return e-f}));a.sort((d,e)=>{d=d.includes("Meta")?1:0;return(e.includes("Meta")?1:0)-d});var c=a.filter(d=>d.includes("Meta")===
|
|
434
|
-
APPLE$$module$build$src$core$utils$useragent);c=c.length===0?a:c;c.sort((d,e)=>d.length-e.length);return(c.some(d=>d.some(e=>"Meta"===e||"Alt"===e||"Control"===e))?[c[0]]:c).map(d=>d.map(e=>Number.isFinite(+e)?getKeyName$$module$build$src$core$utils$shortcut_formatting(+e):e).map(e=>{var f;return upperCaseFirst$$module$build$src$core$utils$shortcut_formatting((f=b[e])!=null?f:e)}))};upperCaseFirst$$module$build$src$core$utils$shortcut_formatting=function(a){return a.charAt(0).toUpperCase()+a.substring(1)};
|
|
435
|
-
modifierOrder$$module$build$src$core$utils$shortcut_formatting=function(a){a=modifierOrdering$$module$build$src$core$utils$shortcut_formatting.indexOf(a);return a===-1?Number.MAX_VALUE:a};
|
|
436
|
-
showUnconstrainedMoveHint$$module$build$src$core$hints=function(a,b=!1){var c=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT.replace("%1",MAC$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent?$.Msg$$module$build$src$core$msg.COMMAND_KEY:$.Msg$$module$build$src$core$msg.CONTROL_KEY).replace("%2",$.Msg$$module$build$src$core$msg.ENTER_KEY);Toast$$module$build$src$core$toast.show(a,{message:c,id:unconstrainedMoveHintId$$module$build$src$core$hints,
|
|
437
|
-
oncePerSession:!b})};showConstrainedMovementHint$$module$build$src$core$hints=function(a){var b=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_CONSTRAINED_MOVE_HINT.replace("%1",$.Msg$$module$build$src$core$msg.ENTER_KEY);Toast$$module$build$src$core$toast.show(a,{message:b,id:constrainedMoveHintId$$module$build$src$core$hints,oncePerSession:!0})};
|
|
438
|
-
clearMoveHints$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.hide(a,constrainedMoveHintId$$module$build$src$core$hints);Toast$$module$build$src$core$toast.hide(a,unconstrainedMoveHintId$$module$build$src$core$hints)};
|
|
439
|
-
showHelpHint$$module$build$src$core$hints=function(a){var b=getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting("list_shortcuts");b&&(b=$.Msg$$module$build$src$core$msg.HELP_PROMPT.replace("%1",b),Toast$$module$build$src$core$toast.show(a,{message:b,id:helpHintId$$module$build$src$core$hints}))};showBlockNavigationHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_BLOCK_NAVIGATION_HINT,id:blockNavigationHintId$$module$build$src$core$hints})};
|
|
440
|
-
showWorkspaceNavigationHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT,id:workspaceNavigationHintId$$module$build$src$core$hints})};
|
|
441
|
-
isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return a&&typeof a.getRelativeToSurfaceXY==="function"&&typeof a.isMovable==="function"&&typeof a.startDrag==="function"&&typeof a.drag==="function"&&typeof a.endDrag==="function"&&typeof a.revertDrag==="function"};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return a&&typeof a.isDeletable==="function"&&typeof a.dispose==="function"&&typeof a.setDeleteStyle==="function"};
|
|
442
|
-
getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=function(a){if(a.isCollapsed())return[];var b=[];for(var c of a.getIcons()){b.push(c);let d;hasBubble$$module$build$src$core$interfaces$i_has_bubble(c)&&c.bubbleIsVisible()&&(d=c.getBubble())&&b.push(d)}for(let d of a.inputList){if(!d.isVisible())continue;b.push(...d.fieldRow);c=d.connection;if(!c)continue;b.push(c);c=c.targetBlock();if(!c)continue;b.push(c);(c=c.lastConnectionInStack(!1))&&
|
|
443
|
-
b.push(c)}a.nextConnection&&b.push(a.nextConnection);return b};navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=function(a,b,c){a=getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a);b=a.indexOf(b);if(b===-1)return null;c=b+c;return c>=0&&c<a.length?a[c]:null};
|
|
444
|
-
isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item=function(a){return a&&typeof a.getChildToolboxItems==="function"&&typeof a.isExpanded==="function"&&typeof a.toggleExpanded==="function"&&isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(a)&&a.isCollapsible()};
|
|
445
|
-
getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator=function(a){var b=a.options.toolboxPosition;return a.options.RTL&&b!==Position$$module$build$src$core$utils$toolbox.TOP&&b!==Position$$module$build$src$core$utils$toolbox.BOTTOM?b===Position$$module$build$src$core$utils$toolbox.LEFT?Position$$module$build$src$core$utils$toolbox.RIGHT:Position$$module$build$src$core$utils$toolbox.LEFT:b};
|
|
446
|
-
hasContextMenu$$module$build$src$core$interfaces$i_contextmenu=function(a){return a&&typeof a.showContextMenu==="function"};isAutoHideable$$module$build$src$core$interfaces$i_autohideable=function(a){return a&&typeof a.autoHide==="function"};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)};
|
|
447
|
-
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 typeof a.getProcedureModel==="function"&&typeof a.doProcedureUpdate==="function"&&typeof a.isProcedureDef==="function"};
|
|
448
|
-
isObservable$$module$build$src$core$interfaces$i_observable=function(a){return a&&typeof a.startPublishing==="function"&&typeof a.stopPublishing==="function"};
|
|
449
|
-
allProcedures$$module$build$src$core$procedures=function(a){var 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())});var c=a.getProcedureMap().getProcedures().filter(d=>
|
|
450
|
-
!!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!0]);a.getBlocksByType("procedures_defreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&c.push(d.getProcedureDef())});b.sort(procTupleComparator$$module$build$src$core$procedures);c.sort(procTupleComparator$$module$build$src$core$procedures);return[b,c]};
|
|
451
|
-
procTupleComparator$$module$build$src$core$procedures=function(a,b){return a[0].localeCompare(b[0],void 0,{sensitivity:"base"})};$.findLegalName$$module$build$src$core$procedures=function(a,b){if(b.isInFlyout)return a;for(a=a||$.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!isLegalName$$module$build$src$core$procedures(a,b.workspace,b);){let c=a.match(/^(.*?)(\d+)$/);a=c?c[1]+(parseInt(c[2])+1):a+"2"}return a};
|
|
452
|
-
isLegalName$$module$build$src$core$procedures=function(a,b,c){return!isNameUsed$$module$build$src$core$procedures(a,b,c)};
|
|
453
|
-
isNameUsed$$module$build$src$core$procedures=function(a,b,c){for(let d of b.getAllBlocks(!1))if(d!==c&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&$.Names$$module$build$src$core$names.equals(d.getProcedureDef()[0],a))return!0;c=c&&isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)?c==null?void 0:c.getProcedureModel():void 0;for(let d of b.getProcedureMap().getProcedures())if(d!==c&&$.Names$$module$build$src$core$names.equals(d.getName(),
|
|
454
|
-
a))return!0;return!1};
|
|
455
|
-
$.rename$$module$build$src$core$procedures=function(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;a=a.trim();var c=$.findLegalName$$module$build$src$core$procedures(a,b);isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(b)&&!b.isInsertionMarker()&&b.getProcedureModel().setName(c);var d=this.getValue();if(d!==a&&d!==c)for(a=b.workspace.getAllBlocks(!1),b=0;b<a.length;b++){let e=a[b];e.renameProcedure&&e.renameProcedure(d,c)}return c};
|
|
456
|
-
xmlFlyoutCategory$$module$build$src$core$procedures=function(a){function b(f,g){for(let k=0;k<f.length;k++){var h=f[k][0];let l=f[k][1],m=$.createElement$$module$build$src$core$utils$xml("block");m.setAttribute("type",g);m.setAttribute("gap","16");let n=$.createElement$$module$build$src$core$utils$xml("mutation");n.setAttribute("name",h);m.appendChild(n);for(h=0;h<l.length;h++){let p=$.createElement$$module$build$src$core$utils$xml("arg");p.setAttribute("name",l[h]);n.appendChild(p)}c.push(m)}}var c=
|
|
457
|
-
[];if(Blocks$$module$build$src$core$blocks.procedures_defnoreturn){var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_defnoreturn");d.setAttribute("gap","16");var e=$.createElement$$module$build$src$core$utils$xml("field");e.setAttribute("name","NAME");e.appendChild($.createTextNode$$module$build$src$core$utils$xml($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE));d.appendChild(e);c.push(d)}Blocks$$module$build$src$core$blocks.procedures_defreturn&&
|
|
458
|
-
(d=$.createElement$$module$build$src$core$utils$xml("block"),d.setAttribute("type","procedures_defreturn"),d.setAttribute("gap","16"),e=$.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name","NAME"),e.appendChild($.createTextNode$$module$build$src$core$utils$xml($.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE)),d.appendChild(e),c.push(d));Blocks$$module$build$src$core$blocks.procedures_ifreturn&&(d=$.createElement$$module$build$src$core$utils$xml("block"),
|
|
459
|
-
d.setAttribute("type","procedures_ifreturn"),d.setAttribute("gap","16"),c.push(d));c.length&&c[c.length-1].setAttribute("gap","24");a=allProcedures$$module$build$src$core$procedures(a);b(a[0],"procedures_callnoreturn");b(a[1],"procedures_callreturn");return c};internalFlyoutCategory$$module$build$src$core$procedures=function(a){return flyoutCategory$$module$build$src$core$procedures(a,!1)};
|
|
460
|
-
flyoutCategory$$module$build$src$core$procedures=function(a,b=!0){function c(e,f){for(let [g,h]of e)d.push({kind:"block",type:f,gap:16,extraState:{name:g,params:h}})}if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.Procedures.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),xmlFlyoutCategory$$module$build$src$core$procedures(a);var d=[];Blocks$$module$build$src$core$blocks.procedures_defnoreturn&&
|
|
461
|
-
d.push({kind:"block",type:"procedures_defnoreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_defreturn&&d.push({kind:"block",type:"procedures_defreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_ifreturn&&d.push({kind:"block",type:"procedures_ifreturn",gap:16});d.length&&(d[d.length-1].gap=24);a=allProcedures$$module$build$src$core$procedures(a);
|
|
462
|
-
c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};
|
|
463
|
-
updateMutatorFlyout$$module$build$src$core$procedures=function(a){var b=[],c=a.getBlocksByType("procedures_mutatorarg",!1);for(let f=0,g;g=c[f];f++)b.push(g.getFieldValue("NAME"));c=$.createElement$$module$build$src$core$utils$xml("xml");var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_mutatorarg");var e=$.createElement$$module$build$src$core$utils$xml("field");e.setAttribute("name","NAME");b=generateUniqueNameFromOptions$$module$build$src$core$variables($.DEFAULT_ARG$$module$build$src$core$procedures,
|
|
464
|
-
b);b=$.createTextNode$$module$build$src$core$utils$xml(b);e.appendChild(b);d.appendChild(e);c.appendChild(d);a.updateToolbox(c)};
|
|
465
|
-
mutatorOpenListener$$module$build$src$core$procedures=function(a){if(isBubbleOpen$$module$build$src$core$events$predicates(a)&&a.bubbleType==="mutator"&&a.isOpen&&a.blockId){a=getWorkspaceById$$module$build$src$core$common(a.workspaceId).getBlockById(a.blockId);var b=a.type;if(b==="procedures_defnoreturn"||b==="procedures_defreturn")a=a.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE).getWorkspace(),updateMutatorFlyout$$module$build$src$core$procedures(a),a.addChangeListener(mutatorChangeListener$$module$build$src$core$procedures)}};
|
|
466
|
-
mutatorChangeListener$$module$build$src$core$procedures=function(a){if(isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockDelete$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)||isBlockFieldIntermediateChange$$module$build$src$core$events$predicates(a))a=getWorkspaceById$$module$build$src$core$common(a.workspaceId),updateMutatorFlyout$$module$build$src$core$procedures(a)};
|
|
467
|
-
getCallers$$module$build$src$core$procedures=function(a,b){return b.getAllBlocks(!1).filter(c=>blockIsModernCallerFor$$module$build$src$core$procedures(c,a)||isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureCall(),a))};
|
|
468
|
-
blockIsModernCallerFor$$module$build$src$core$procedures=function(a,b){return isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(a)&&!a.isProcedureDef()&&a.getProcedureModel()&&$.Names$$module$build$src$core$names.equals(a.getProcedureModel().getName(),b)};
|
|
469
|
-
$.mutateCallers$$module$build$src$core$procedures=function(a){var b=getRecordUndo$$module$build$src$core$events$utils(),c=a.getProcedureDef()[0],d=a.mutationToDom(!0);a=getCallers$$module$build$src$core$procedures(c,a.workspace);for(let f=0,g;g=a[f];f++){c=(c=g.mutationToDom())&&domToText$$module$build$src$core$utils$xml(c);g.domToMutation&&g.domToMutation(d);var e=g.mutationToDom();e=e&&domToText$$module$build$src$core$utils$xml(e);c!==e&&($.setRecordUndo$$module$build$src$core$events$utils(!1),
|
|
470
|
-
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,"mutation",null,c,e)),$.setRecordUndo$$module$build$src$core$events$utils(b))}};
|
|
471
|
-
$.getDefinition$$module$build$src$core$procedures=function(a,b){for(let c of b.getAllBlocks(!1))if(isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)&&c.isProcedureDef()&&$.Names$$module$build$src$core$names.equals(c.getProcedureModel().getName(),a)||isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureDef()[0],a))return c;return null};
|
|
472
|
-
isDynamicShape$$module$build$src$core$renderers$common$constants=function(a){return a.isDynamic};isPuzzleTab$$module$build$src$core$renderers$common$constants=function(a){return a.pathDown!==void 0&&a.pathUp!==void 0};isNotch$$module$build$src$core$renderers$common$constants=function(a){return a.pathLeft!==void 0&&a.pathRight!==void 0};
|
|
473
|
-
register$$module$build$src$core$renderers$common$block_rendering=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a,b)};unregister$$module$build$src$core$renderers$common$block_rendering=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a)};
|
|
474
|
-
init$$module$build$src$core$renderers$common$block_rendering=function(a,b,c){a=new (getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a))(a);a.init(b,c);return a};stringButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"String")};
|
|
475
|
-
numberButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Number")};colourButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Colour")};
|
|
476
|
-
internalFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){return flyoutCategory$$module$build$src$core$variables_dynamic(a,!1)};
|
|
477
|
-
flyoutCategory$$module$build$src$core$variables_dynamic=function(a,b=!0){Blocks$$module$build$src$core$blocks.variables_set_dynamic||Blocks$$module$build$src$core$blocks.variables_get_dynamic||console.warn("There are no dynamic variable blocks, but there is a dynamic variable category.");if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.VariablesDynamic.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),
|
|
478
|
-
xmlFlyoutCategory$$module$build$src$core$variables_dynamic(a);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);return[{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE,callbackkey:"CREATE_VARIABLE_STRING"},
|
|
479
|
-
{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE,callbackkey:"CREATE_VARIABLE_NUMBER"},{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE,callbackkey:"CREATE_VARIABLE_COLOUR"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,a.getVariableMap().getAllVariables(),!1,"variables_get_dynamic","variables_set_dynamic")]};
|
|
480
|
-
xmlFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE);
|
|
481
|
-
c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR");b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);a=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic(a);return b=b.concat(a)};
|
|
482
|
-
flyoutCategoryBlocks$$module$build$src$core$variables_dynamic=function(a){a=a.getVariableMap().getAllVariables();var b=[];if(a.length>0){if(Blocks$$module$build$src$core$blocks.variables_set_dynamic){var c=a[a.length-1];let d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","variables_set_dynamic");d.setAttribute("gap","24");d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c));b.push(d)}if(Blocks$$module$build$src$core$blocks.variables_get_dynamic){a.sort(compareByName$$module$build$src$core$variables);
|
|
483
|
-
for(let d=0,e;e=a[d];d++)c=$.createElement$$module$build$src$core$utils$xml("block"),c.setAttribute("type","variables_get_dynamic"),c.setAttribute("gap","8"),c.appendChild(generateVariableFieldDom$$module$build$src$core$variables(e)),b.push(c)}}return b};resizeSvgContents$$module$build$src$core$workspace_svg=function(a){a.resizeContents()};
|
|
484
449
|
copy$$module$build$src$core$clipboard=function(a,b){var c=a.toCopyData();stashedCopyData$$module$build$src$core$clipboard=c;stashedWorkspace$$module$build$src$core$clipboard=isSelectable$$module$build$src$core$interfaces$i_selectable(a)&&a.workspace instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?a.workspace:null;stashedCoordinates$$module$build$src$core$clipboard=b;return c};getLastCopiedData$$module$build$src$core$clipboard=function(){return stashedCopyData$$module$build$src$core$clipboard};
|
|
485
450
|
setLastCopiedData$$module$build$src$core$clipboard=function(a){stashedCopyData$$module$build$src$core$clipboard=a};getLastCopiedWorkspace$$module$build$src$core$clipboard=function(){return stashedWorkspace$$module$build$src$core$clipboard};setLastCopiedWorkspace$$module$build$src$core$clipboard=function(a){stashedWorkspace$$module$build$src$core$clipboard=a};getLastCopiedLocation$$module$build$src$core$clipboard=function(){return stashedCoordinates$$module$build$src$core$clipboard};
|
|
486
451
|
setLastCopiedLocation$$module$build$src$core$clipboard=function(a){stashedCoordinates$$module$build$src$core$clipboard=a};
|
|
487
452
|
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,stashedCoordinates$$module$build$src$core$clipboard):null};
|
|
488
|
-
pasteFromData$$module$build$src$core$clipboard=function(a,b,c){var d;b=b.isMutator?b:(d=b.options.parentWorkspace)!=null?d:b;var e,f;return(f=(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a.paster,!1))==null?void 0:e.paste(a,b,c))!=null?f:null};
|
|
453
|
+
pasteFromData$$module$build$src$core$clipboard=function(a,b,c){var d;b=b.isMutator?b:(d=b.options.parentWorkspace)!=null?d:b;var e,f;return(f=(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a.paster,!1))==null?void 0:e.paste(a,b,c))!=null?f:null};hasContextMenu$$module$build$src$core$interfaces$i_contextmenu=function(a){return a&&typeof a.showContextMenu==="function"};
|
|
454
|
+
isCopyable$$module$build$src$core$interfaces$i_copyable=function(a){return a&&typeof a.toCopyData==="function"};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return a&&typeof a.isDeletable==="function"&&typeof a.dispose==="function"&&typeof a.setDeleteStyle==="function"};
|
|
455
|
+
isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return a&&typeof a.getRelativeToSurfaceXY==="function"&&typeof a.isMovable==="function"&&typeof a.startDrag==="function"&&typeof a.drag==="function"&&typeof a.endDrag==="function"&&typeof a.revertDrag==="function"};
|
|
489
456
|
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],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_ESCAPE})};
|
|
490
457
|
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()&&b!=null&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!a.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(a,b,c,d){b.preventDefault();b=d.focusedNode;b instanceof
|
|
491
458
|
BlockSvg$$module$build$src$core$block_svg?b.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),b.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),a.getAudioManager().play("delete"));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DELETE})};
|
|
492
459
|
isCopyable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&isDraggable$$module$build$src$core$interfaces$i_draggable(a)?a.isCopyable?a.isCopyable():a instanceof BlockSvg$$module$build$src$core$block_svg||a instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment?a.isOwnDeletable()&&a.isOwnMovable():a.isDeletable()&&a.isMovable():!1};
|
|
493
460
|
isCuttable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$shortcut_items(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()};
|
|
494
461
|
registerCopy$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.COPY,preconditionFn(b,c){c=c.focusedNode;b=b.isFlyout?b.targetWorkspace:b;return!!c&&!!b&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&
|
|
495
|
-
isCopyable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){c.preventDefault();c=e.focusedNode;if(!c||!isCopyable$$module$build$src$core$interfaces$i_copyable(c)||!isCopyable$$module$build$src$core$shortcut_items(c))return!1;
|
|
496
|
-
|
|
462
|
+
isCopyable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){c.preventDefault();c=e.focusedNode;if(!c||!isCopyable$$module$build$src$core$interfaces$i_copyable(c)||!isCopyable$$module$build$src$core$shortcut_items(c))return!1;d=b.isFlyout?b.targetWorkspace:b;if(!d)return!1;c.workspace.isFlyout||d.hideChaff();d=isDraggable$$module$build$src$core$interfaces$i_draggable(c)&&c.workspace==d?c.getRelativeToSurfaceXY():void 0;(c=!!copy$$module$build$src$core$clipboard(c,d))&&showCopiedHint$$module$build$src$core$hints(b);
|
|
463
|
+
return c},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.COPY_SHORTCUT})};
|
|
497
464
|
registerCut$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CUT,preconditionFn(b,c){c=c.focusedNode;return!!c&&!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&
|
|
498
465
|
isCuttable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){d=e.focusedNode;if(!d||!isCuttable$$module$build$src$core$shortcut_items(d)||!isCopyable$$module$build$src$core$interfaces$i_copyable(d))return!1;e=isDraggable$$module$build$src$core$interfaces$i_draggable(d)?d.getRelativeToSurfaceXY():void 0;e=copy$$module$build$src$core$clipboard(d,e);d instanceof BlockSvg$$module$build$src$core$block_svg?(d.checkAndDelete(),c.preventDefault()):isDeletable$$module$build$src$core$interfaces$i_deletable(d)&&
|
|
499
|
-
($.setGroup$$module$build$src$core$events$utils(!0),d.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),b.getAudioManager().play("delete"),c.preventDefault());return!!e},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.CUT_SHORTCUT})};
|
|
466
|
+
($.setGroup$$module$build$src$core$events$utils(!0),d.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),b.getAudioManager().play("delete"),c.preventDefault());e&&showCutHint$$module$build$src$core$hints(b);return!!e},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.CUT_SHORTCUT})};
|
|
500
467
|
registerPaste$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PASTE,preconditionFn(){var b=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!b||!b.rendered)return!1;
|
|
501
|
-
b=b.isFlyout?b.targetWorkspace:b;return!!getLastCopiedData$$module$build$src$core$clipboard()&&!!b&&!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(b,c){
|
|
502
|
-
new Coordinate$$module$build$src$core$utils$coordinate(c.clientX,c.clientY)),!!paste$$module$build$src$core$clipboard(b,
|
|
503
|
-
|
|
468
|
+
b=b.isFlyout?b.targetWorkspace:b;return!!getLastCopiedData$$module$build$src$core$clipboard()&&!!b&&!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(b,c){var d=getLastCopiedData$$module$build$src$core$clipboard();if(!d)return!1;var e=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!e)return!1;clearPasteHints$$module$build$src$core$hints(b);b=e.isFlyout?e.targetWorkspace:e;if(!b||b.isReadOnly())return!1;if(c instanceof
|
|
469
|
+
PointerEvent)return c=screenToWsCoordinates$$module$build$src$core$utils$svg_math(b,new Coordinate$$module$build$src$core$utils$coordinate(c.clientX,c.clientY)),!!paste$$module$build$src$core$clipboard(d,b,c);c=getLastCopiedLocation$$module$build$src$core$clipboard();if(!c)return!!paste$$module$build$src$core$clipboard(d,b);var {left:f,top:g,width:h,height:k}=b.getMetricsManager().getViewMetrics(!0);if((new Rect$$module$build$src$core$utils$rect(g,g+k,f,f+h)).contains(c.x,c.y))return!!paste$$module$build$src$core$clipboard(d,
|
|
470
|
+
b);c=new Coordinate$$module$build$src$core$utils$coordinate(f+h/2,g+k/2);return!!paste$$module$build$src$core$clipboard(d,b,c)},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.PASTE_SHORTCUT})};
|
|
504
471
|
registerUndo$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.UNDO,preconditionFn(b){return!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},
|
|
505
472
|
callback(b,c){b.hideChaff();b.undo();c.preventDefault();return!0},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.UNDO})};
|
|
506
473
|
registerRedo$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD,KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]),b=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]);
|
|
@@ -515,27 +482,37 @@ e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.RIGHT,ShortcutRegis
|
|
|
515
482
|
callback:(d,e)=>{e.preventDefault();return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.move(Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP,e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.UP,ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.UP,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_MOVE_UP},
|
|
516
483
|
{name:names$$module$build$src$core$shortcut_items.MOVE_DOWN,preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),callback:(d,e)=>{e.preventDefault();return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.move(Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DOWN,ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.DOWN,
|
|
517
484
|
[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_MOVE_DOWN}];for(let d of b)ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(d)};
|
|
518
|
-
registerShowContextMenu$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.ENTER,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
485
|
+
registerShowContextMenu$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.ENTER,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.F10,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.MENU,
|
|
486
|
+
preconditionFn:c=>!c.isDragging(),callback:(c,d)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);c=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(hasContextMenu$$module$build$src$core$interfaces$i_contextmenu(c)){c.showContextMenu(d);let e;(e=getMenu$$module$build$src$core$contextmenu())==null||e.highlightNext();return!0}return!1},keyCodes:[a,b,KeyCodes$$module$build$src$core$utils$keycodes.CONTEXT_MENU],displayText:()=>
|
|
487
|
+
$.Msg$$module$build$src$core$msg.SHORTCUTS_SHOW_CONTEXT_MENU})};
|
|
488
|
+
registerArrowNavigation$$module$build$src$core$shortcut_items=function(){var a={right:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_RIGHT,preconditionFn:b=>!b.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d,e;c=b.RTL?(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?
|
|
489
|
+
void 0:d.getNavigator().getOutNode():(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:e.getNavigator().getInNode();if(!c)return b.getAudioManager().playErrorBeep(),!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.RIGHT],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NAVIGATE_RIGHT},left:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_LEFT,
|
|
490
|
+
preconditionFn:b=>!b.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d,e;c=b.RTL?(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:d.getNavigator().getInNode():(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:e.getNavigator().getOutNode();
|
|
491
|
+
if(!c)return b.getAudioManager().playErrorBeep(),!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.LEFT],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NAVIGATE_LEFT},down:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_DOWN,preconditionFn:b=>!b.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),callback:(b,c)=>
|
|
492
|
+
{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d;c=(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:d.getNavigator().getNextNode();if(!c)return b.getAudioManager().playErrorBeep(),!1;b.getAudioManager().maybePlayScopeChangeAudioCue(c);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DOWN],allowCollision:!0,
|
|
493
|
+
displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NAVIGATE_DOWN},up:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_UP,preconditionFn:b=>!b.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d;c=(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:
|
|
494
|
+
d.getNavigator().getPreviousNode();if(!c)return b.getAudioManager().playErrorBeep(),!1;b.getAudioManager().maybePlayScopeChangeAudioCue(c);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.UP],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NAVIGATE_UP}};for(let b of Object.values(a))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(b)};
|
|
527
495
|
registerFocusWorkspace$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.FOCUS_WORKSPACE,preconditionFn:a=>!a.isDragging(),callback:a=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(resolveWorkspace$$module$build$src$core$shortcut_items(a));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.W],
|
|
528
496
|
displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_WORKSPACE})};
|
|
529
497
|
registerFocusToolbox$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.FOCUS_TOOLBOX,preconditionFn:a=>!a.isDragging(),callback:a=>{var b=a.getToolbox();if(b)keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0),$.getFocusManager$$module$build$src$core$focus_manager().focusTree(b);else{a=a.getFlyout();if(!a)return!1;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
530
498
|
$.getFocusManager$$module$build$src$core$focus_manager().focusTree(a.getWorkspace())}return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.T],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_TOOLBOX})};
|
|
531
|
-
|
|
532
|
-
"";b>0&&(d=$.Msg$$module$build$src$core$msg[b===1?"WORKSPACE_CONTENTS_COMMENTS_ONE":"WORKSPACE_CONTENTS_COMMENTS_MANY"].replace("%1",String(b)));a=$.Msg$$module$build$src$core$msg[c].replace("%1",
|
|
499
|
+
registerReadInformation$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.INFORMATION,preconditionFn:()=>!0,callback:a=>{var b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),c=a.getNavigator().getSourceBlockFromNode(b);if(c)return a=computeAriaLabel$$module$build$src$core$block_aria_composer(c,Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS,
|
|
500
|
+
!1),announceDynamicAriaState$$module$build$src$core$utils$aria(a),!0;if(b===a){b=resolveWorkspace$$module$build$src$core$shortcut_items(a);a=b.getTopBlocks().length;b=b.getTopComments().length;c=a===0?"WORKSPACE_CONTENTS_BLOCKS_ZERO":a===1?"WORKSPACE_CONTENTS_BLOCKS_ONE":"WORKSPACE_CONTENTS_BLOCKS_MANY";let d="";b>0&&(d=$.Msg$$module$build$src$core$msg[b===1?"WORKSPACE_CONTENTS_COMMENTS_ONE":"WORKSPACE_CONTENTS_COMMENTS_MANY"].replace("%1",String(b)));a=$.Msg$$module$build$src$core$msg[c].replace("%1",
|
|
501
|
+
String(a)).replace("%2",d);announceDynamicAriaState$$module$build$src$core$utils$aria(a);return!0}return!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.I],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_INFORMATION})};
|
|
502
|
+
registerReadExtendedInformation$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.I,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.EXTENDED_INFORMATION,preconditionFn:()=>!0,callback:b=>{b=b.getNavigator().getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());
|
|
503
|
+
if(!b)return!1;for(var c=[],d=b,e;(e=d.outputConnection)==null?0:e.isConnected();)d=d.getParent();d!==b&&c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(d,Verbosity$$module$build$src$core$utils$aria.TERSE,!1));for(e=d.getParent();e;)c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(e,Verbosity$$module$build$src$core$utils$aria.TERSE,!1)),e=e.getParent();if(c.length){c.reverse();let f;((f=b.outputConnection)==null?0:f.isConnected())||c.push($.Msg$$module$build$src$core$msg.CURRENT_BLOCK_ANNOUNCEMENT.replace("%1",
|
|
504
|
+
computeAriaLabel$$module$build$src$core$block_aria_composer(b,Verbosity$$module$build$src$core$utils$aria.TERSE,!1)));announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.PARENT_BLOCKS_ANNOUNCEMENT.replace("%1",c.join(",")))}else announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.NO_PARENT_ANNOUNCEMENT);return!0},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_EXTENDED_INFORMATION})};
|
|
533
505
|
registerDisconnectBlock$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DISCONNECT,preconditionFn:b=>!b.isDragging()&&!b.isReadOnly(),callback:(b,c)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
534
506
|
b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;c=!(c instanceof KeyboardEvent&&c.shiftKey);$.setGroup$$module$build$src$core$events$utils(!0);b.unplug(c);$.setGroup$$module$build$src$core$events$utils(!1);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.X,a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DISCONNECT})};
|
|
535
507
|
registerStackNavigation$$module$build$src$core$shortcut_items=function(){var a=(c,d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())=>{var e=c.getNavigator();for(let f=d;f&&f!==c;f=e.getParent(f))d=f;return isSelectable$$module$build$src$core$interfaces$i_selectable(d)?d:null},b={name:names$$module$build$src$core$shortcut_items.PREVIOUS_STACK,preconditionFn:c=>!c.isDragging()&&!!a(c)&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),
|
|
536
508
|
callback:c=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d=a(c);if(!d)return!1;c=a(c,c.getNavigator().navigateStacks(d,-1));if(!c)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.B],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_PREVIOUS_STACK};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.NEXT_STACK,
|
|
537
509
|
preconditionFn:c=>!c.isDragging()&&!!a(c)&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),callback:c=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d=a(c);if(!d)return!1;c=c.getNavigator().navigateStacks(d,1);if(!c)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.N],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NEXT_STACK});
|
|
538
510
|
ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(b)};
|
|
511
|
+
registerHeadingNavigation$$module$build$src$core$shortcut_items=function(){var a=()=>{var e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree();if(e instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&e.isFlyout&&e.targetWorkspace){let f;return(f=e.targetWorkspace.getFlyout())!=null?f:null}return null},b=e=>{var f=e.getWorkspace().getNavigator();e=e.getContents().map(k=>k.getElement());for(var g,h=(g=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())!=
|
|
512
|
+
null?g:null;h&&!e.includes(h);)h=f.getParent(h);return h},c=(e,f)=>{var g=e.getContents().map(k=>k.getElement());e=(e=b(e))?g.indexOf(e):f===1?-1:g.length;for(let k=1;k<=g.length;k++){var h=e+f*k;if(h<0||h>=g.length)break;h=g[h];if(h instanceof FlyoutButton$$module$build$src$core$flyout_button&&h.isLabel())return h}return null},d=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.H,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);
|
|
513
|
+
d={name:names$$module$build$src$core$shortcut_items.PREVIOUS_HEADING,preconditionFn:e=>!e.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv()&&!!a(),callback:()=>{var e=a();if(!e)return!1;e=c(e,-1);if(!e)return!1;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e);return!0},keyCodes:[d],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_PREVIOUS_HEADING};
|
|
514
|
+
ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.NEXT_HEADING,preconditionFn:e=>!e.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv()&&!!a(),callback:()=>{var e=a();if(!e)return!1;e=c(e,1);if(!e)return!1;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e);
|
|
515
|
+
return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.H],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NEXT_HEADING});ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(d)};
|
|
539
516
|
registerPerformAction$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PERFORM_ACTION,preconditionFn:a=>!a.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken(),callback:(a,b)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
540
517
|
if((a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())&&"performAction"in a){b.preventDefault();let c;(c=a.performAction)==null||c.call(a,b);return!0}return!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ENTER,KeyCodes$$module$build$src$core$utils$keycodes.SPACE],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_PERFORM_ACTION})};
|
|
541
518
|
registerDuplicate$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DUPLICATE,preconditionFn:(a,b)=>{({focusedNode:b}=b);return!a.isDragging()&&!a.isReadOnly()&&!a.isFlyout&&(b instanceof BlockSvg$$module$build$src$core$block_svg?b.isDuplicatable():!0)},callback:(a,b,c,d)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);b=
|
|
@@ -543,9 +520,64 @@ isCopyable$$module$build$src$core$interfaces$i_copyable(d.focusedNode)&&d.focuse
|
|
|
543
520
|
registerCleanup$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CLEANUP,preconditionFn:a=>!a.isDragging()&&!a.isReadOnly()&&!a.isFlyout,callback:a=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);a.cleanUp();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.C],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_CLEANUP})};
|
|
544
521
|
registerShowTooltip$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.J,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.SHOW_TOOLTIP,preconditionFn:b=>!b.isDragging(),callback:b=>{var c=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();
|
|
545
522
|
c!==null&&(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0),display$$module$build$src$core$tooltip(c,b));return!0},keyCodes:[a],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_SHOW_TOOLTIP})};
|
|
523
|
+
registerToggleScreenreaderMode$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD,KeyCodes$$module$build$src$core$utils$keycodes.ALT]),b=!1;ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.TOGGLE_SCREENREADER,preconditionFn:()=>
|
|
524
|
+
!0,callback:(c,d)=>{b=!b;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setScopeChangeAudioCuesEnabled(b);c.getNavigator().setNavigationLoops(!b);var e;(e=c.getToolbox())==null||e.getNavigator().setNavigationLoops(!b);var f;(f=c.getFlyout())==null||f.getWorkspace().getNavigator().setNavigationLoops(!b);showScreenreaderModeHint$$module$build$src$core$hints(c,b);d.preventDefault();return!0},keyCodes:[a],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_TOGGLE_SCREENREADER_MODE})};
|
|
546
525
|
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()};
|
|
547
526
|
registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items=function(){registerShowContextMenu$$module$build$src$core$shortcut_items();registerMovementShortcuts$$module$build$src$core$shortcut_items();registerFocusWorkspace$$module$build$src$core$shortcut_items();registerFocusToolbox$$module$build$src$core$shortcut_items();registerArrowNavigation$$module$build$src$core$shortcut_items();registerDisconnectBlock$$module$build$src$core$shortcut_items();registerStackNavigation$$module$build$src$core$shortcut_items();
|
|
548
|
-
|
|
527
|
+
registerHeadingNavigation$$module$build$src$core$shortcut_items();registerPerformAction$$module$build$src$core$shortcut_items();registerDuplicate$$module$build$src$core$shortcut_items();registerCleanup$$module$build$src$core$shortcut_items();registerShowTooltip$$module$build$src$core$shortcut_items()};
|
|
528
|
+
registerScreenReaderShortcuts$$module$build$src$core$shortcut_items=function(){registerReadInformation$$module$build$src$core$shortcut_items();registerReadExtendedInformation$$module$build$src$core$shortcut_items();registerToggleScreenreaderMode$$module$build$src$core$shortcut_items()};
|
|
529
|
+
showUnconstrainedMoveHint$$module$build$src$core$hints=function(a,b=!1){var c=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT.replace("%1",MAC$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent?$.Msg$$module$build$src$core$msg.COMMAND_KEY:$.Msg$$module$build$src$core$msg.CONTROL_KEY).replace("%2",$.Msg$$module$build$src$core$msg.ENTER_KEY);Toast$$module$build$src$core$toast.show(a,{message:c,id:unconstrainedMoveHintId$$module$build$src$core$hints,
|
|
530
|
+
oncePerSession:!b})};showConstrainedMovementHint$$module$build$src$core$hints=function(a){var b=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_CONSTRAINED_MOVE_HINT.replace("%1",$.Msg$$module$build$src$core$msg.ENTER_KEY);Toast$$module$build$src$core$toast.show(a,{message:b,id:constrainedMoveHintId$$module$build$src$core$hints,oncePerSession:!0})};
|
|
531
|
+
clearMoveHints$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.hide(a,constrainedMoveHintId$$module$build$src$core$hints);Toast$$module$build$src$core$toast.hide(a,unconstrainedMoveHintId$$module$build$src$core$hints)};
|
|
532
|
+
showHelpHint$$module$build$src$core$hints=function(a){var b=getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting("list_shortcuts");b&&(b=$.Msg$$module$build$src$core$msg.HELP_PROMPT.replace("%1",b),Toast$$module$build$src$core$toast.show(a,{message:b,id:helpHintId$$module$build$src$core$hints}))};
|
|
533
|
+
showBlockNavigationHint$$module$build$src$core$hints=function(a){var b=getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(a.RTL?names$$module$build$src$core$shortcut_items.NAVIGATE_LEFT:names$$module$build$src$core$shortcut_items.NAVIGATE_RIGHT);b=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_BLOCK_NAVIGATION_HINT.replace("%1",b);Toast$$module$build$src$core$toast.show(a,{message:b,id:blockNavigationHintId$$module$build$src$core$hints})};
|
|
534
|
+
showWorkspaceNavigationHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT,id:workspaceNavigationHintId$$module$build$src$core$hints})};
|
|
535
|
+
showFlyoutLabelActionHint$$module$build$src$core$hints=function(a){var b=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_FLYOUT_LABEL_HINT.replace("%1",getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(names$$module$build$src$core$shortcut_items.NEXT_HEADING));Toast$$module$build$src$core$toast.show(a,{message:b,id:flyoutLabelHintId$$module$build$src$core$hints})};
|
|
536
|
+
showCopiedHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_COPIED_HINT.replace("%1",getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(names$$module$build$src$core$shortcut_items.PASTE)),duration:7,id:copiedHintId$$module$build$src$core$hints})};
|
|
537
|
+
showCutHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_CUT_HINT.replace("%1",getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(names$$module$build$src$core$shortcut_items.PASTE)),duration:7,id:cutHintId$$module$build$src$core$hints})};
|
|
538
|
+
clearPasteHints$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.hide(a,cutHintId$$module$build$src$core$hints);Toast$$module$build$src$core$toast.hide(a,copiedHintId$$module$build$src$core$hints)};
|
|
539
|
+
showScreenreaderModeHint$$module$build$src$core$hints=function(a,b){Toast$$module$build$src$core$toast.show(a,{message:(b?$.Msg$$module$build$src$core$msg.SCREENREADER_MODE_ENABLED:$.Msg$$module$build$src$core$msg.SCREENREADER_MODE_DISABLED).replace("%1",getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(names$$module$build$src$core$shortcut_items.TOGGLE_SCREENREADER)),duration:7,id:screenreaderHintId$$module$build$src$core$hints})};
|
|
540
|
+
getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=function(a){if(a.isCollapsed())return[];var b=[];for(var c of a.getIcons()){b.push(c);let d;hasBubble$$module$build$src$core$interfaces$i_has_bubble(c)&&c.bubbleIsVisible()&&(d=c.getBubble())&&b.push(d)}for(let d of a.inputList){if(!d.isVisible())continue;b.push(...d.fieldRow);c=d.connection;if(!c)continue;b.push(c);c=c.targetBlock();if(!c)continue;b.push(c);(c=c.lastConnectionInStack(!1))&&
|
|
541
|
+
b.push(c)}a.nextConnection&&b.push(a.nextConnection);return b};navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=function(a,b,c){a=getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a);b=a.indexOf(b);if(b===-1)return null;c=b+c;return c>=0&&c<a.length?a[c]:null};
|
|
542
|
+
isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item=function(a){return a&&typeof a.getChildToolboxItems==="function"&&typeof a.isExpanded==="function"&&typeof a.toggleExpanded==="function"&&isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(a)&&a.isCollapsible()};
|
|
543
|
+
getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator=function(a){var b=a.options.toolboxPosition;return a.options.RTL&&b!==Position$$module$build$src$core$utils$toolbox.TOP&&b!==Position$$module$build$src$core$utils$toolbox.BOTTOM?b===Position$$module$build$src$core$utils$toolbox.LEFT?Position$$module$build$src$core$utils$toolbox.RIGHT:Position$$module$build$src$core$utils$toolbox.LEFT:b};
|
|
544
|
+
isAutoHideable$$module$build$src$core$interfaces$i_autohideable=function(a){return a&&typeof a.autoHide==="function"};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)};unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)};
|
|
545
|
+
isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return typeof a.getProcedureModel==="function"&&typeof a.doProcedureUpdate==="function"&&typeof a.isProcedureDef==="function"};isObservable$$module$build$src$core$interfaces$i_observable=function(a){return a&&typeof a.startPublishing==="function"&&typeof a.stopPublishing==="function"};
|
|
546
|
+
allProcedures$$module$build$src$core$procedures=function(a){var 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())});var c=a.getProcedureMap().getProcedures().filter(d=>
|
|
547
|
+
!!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!0]);a.getBlocksByType("procedures_defreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&c.push(d.getProcedureDef())});b.sort(procTupleComparator$$module$build$src$core$procedures);c.sort(procTupleComparator$$module$build$src$core$procedures);return[b,c]};
|
|
548
|
+
procTupleComparator$$module$build$src$core$procedures=function(a,b){return a[0].localeCompare(b[0],void 0,{sensitivity:"base"})};$.findLegalName$$module$build$src$core$procedures=function(a,b){if(b.isInFlyout)return a;for(a=a||$.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!isLegalName$$module$build$src$core$procedures(a,b.workspace,b);){let c=a.match(/^(.*?)(\d+)$/);a=c?c[1]+(parseInt(c[2])+1):a+"2"}return a};
|
|
549
|
+
isLegalName$$module$build$src$core$procedures=function(a,b,c){return!isNameUsed$$module$build$src$core$procedures(a,b,c)};
|
|
550
|
+
isNameUsed$$module$build$src$core$procedures=function(a,b,c){for(let d of b.getAllBlocks(!1))if(d!==c&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&$.Names$$module$build$src$core$names.equals(d.getProcedureDef()[0],a))return!0;c=c&&isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)?c==null?void 0:c.getProcedureModel():void 0;for(let d of b.getProcedureMap().getProcedures())if(d!==c&&$.Names$$module$build$src$core$names.equals(d.getName(),
|
|
551
|
+
a))return!0;return!1};
|
|
552
|
+
$.rename$$module$build$src$core$procedures=function(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;a=a.trim();var c=$.findLegalName$$module$build$src$core$procedures(a,b);isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(b)&&!b.isInsertionMarker()&&b.getProcedureModel().setName(c);var d=this.getValue();if(d!==a&&d!==c)for(a=b.workspace.getAllBlocks(!1),b=0;b<a.length;b++){let e=a[b];e.renameProcedure&&e.renameProcedure(d,c)}return c};
|
|
553
|
+
xmlFlyoutCategory$$module$build$src$core$procedures=function(a){function b(f,g){for(let k=0;k<f.length;k++){var h=f[k][0];let l=f[k][1],m=$.createElement$$module$build$src$core$utils$xml("block");m.setAttribute("type",g);m.setAttribute("gap","16");let n=$.createElement$$module$build$src$core$utils$xml("mutation");n.setAttribute("name",h);m.appendChild(n);for(h=0;h<l.length;h++){let p=$.createElement$$module$build$src$core$utils$xml("arg");p.setAttribute("name",l[h]);n.appendChild(p)}c.push(m)}}var c=
|
|
554
|
+
[];if(Blocks$$module$build$src$core$blocks.procedures_defnoreturn){var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_defnoreturn");d.setAttribute("gap","16");var e=$.createElement$$module$build$src$core$utils$xml("field");e.setAttribute("name","NAME");e.appendChild($.createTextNode$$module$build$src$core$utils$xml($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE));d.appendChild(e);c.push(d)}Blocks$$module$build$src$core$blocks.procedures_defreturn&&
|
|
555
|
+
(d=$.createElement$$module$build$src$core$utils$xml("block"),d.setAttribute("type","procedures_defreturn"),d.setAttribute("gap","16"),e=$.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name","NAME"),e.appendChild($.createTextNode$$module$build$src$core$utils$xml($.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE)),d.appendChild(e),c.push(d));Blocks$$module$build$src$core$blocks.procedures_ifreturn&&(d=$.createElement$$module$build$src$core$utils$xml("block"),
|
|
556
|
+
d.setAttribute("type","procedures_ifreturn"),d.setAttribute("gap","16"),c.push(d));c.length&&c[c.length-1].setAttribute("gap","24");a=allProcedures$$module$build$src$core$procedures(a);b(a[0],"procedures_callnoreturn");b(a[1],"procedures_callreturn");return c};internalFlyoutCategory$$module$build$src$core$procedures=function(a){return flyoutCategory$$module$build$src$core$procedures(a,!1)};
|
|
557
|
+
flyoutCategory$$module$build$src$core$procedures=function(a,b=!0){function c(e,f){for(let [g,h]of e)d.push({kind:"block",type:f,gap:16,extraState:{name:g,params:h}})}if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.Procedures.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),xmlFlyoutCategory$$module$build$src$core$procedures(a);var d=[];Blocks$$module$build$src$core$blocks.procedures_defnoreturn&&
|
|
558
|
+
d.push({kind:"block",type:"procedures_defnoreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_defreturn&&d.push({kind:"block",type:"procedures_defreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_ifreturn&&d.push({kind:"block",type:"procedures_ifreturn",gap:16});d.length&&(d[d.length-1].gap=24);a=allProcedures$$module$build$src$core$procedures(a);
|
|
559
|
+
c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};
|
|
560
|
+
updateMutatorFlyout$$module$build$src$core$procedures=function(a){var b=[],c=a.getBlocksByType("procedures_mutatorarg",!1);for(let f=0,g;g=c[f];f++)b.push(g.getFieldValue("NAME"));c=$.createElement$$module$build$src$core$utils$xml("xml");var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_mutatorarg");var e=$.createElement$$module$build$src$core$utils$xml("field");e.setAttribute("name","NAME");b=generateUniqueNameFromOptions$$module$build$src$core$variables($.DEFAULT_ARG$$module$build$src$core$procedures,
|
|
561
|
+
b);b=$.createTextNode$$module$build$src$core$utils$xml(b);e.appendChild(b);d.appendChild(e);c.appendChild(d);a.updateToolbox(c)};
|
|
562
|
+
mutatorOpenListener$$module$build$src$core$procedures=function(a){if(isBubbleOpen$$module$build$src$core$events$predicates(a)&&a.bubbleType==="mutator"&&a.isOpen&&a.blockId){a=getWorkspaceById$$module$build$src$core$common(a.workspaceId).getBlockById(a.blockId);var b=a.type;if(b==="procedures_defnoreturn"||b==="procedures_defreturn")a=a.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE).getWorkspace(),updateMutatorFlyout$$module$build$src$core$procedures(a),a.addChangeListener(mutatorChangeListener$$module$build$src$core$procedures)}};
|
|
563
|
+
mutatorChangeListener$$module$build$src$core$procedures=function(a){if(isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockDelete$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)||isBlockFieldIntermediateChange$$module$build$src$core$events$predicates(a))a=getWorkspaceById$$module$build$src$core$common(a.workspaceId),updateMutatorFlyout$$module$build$src$core$procedures(a)};
|
|
564
|
+
getCallers$$module$build$src$core$procedures=function(a,b){return b.getAllBlocks(!1).filter(c=>blockIsModernCallerFor$$module$build$src$core$procedures(c,a)||isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureCall(),a))};
|
|
565
|
+
blockIsModernCallerFor$$module$build$src$core$procedures=function(a,b){return isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(a)&&!a.isProcedureDef()&&a.getProcedureModel()&&$.Names$$module$build$src$core$names.equals(a.getProcedureModel().getName(),b)};
|
|
566
|
+
$.mutateCallers$$module$build$src$core$procedures=function(a){var b=getRecordUndo$$module$build$src$core$events$utils(),c=a.getProcedureDef()[0],d=a.mutationToDom(!0);a=getCallers$$module$build$src$core$procedures(c,a.workspace);for(let f=0,g;g=a[f];f++){c=(c=g.mutationToDom())&&domToText$$module$build$src$core$utils$xml(c);g.domToMutation&&g.domToMutation(d);var e=g.mutationToDom();e=e&&domToText$$module$build$src$core$utils$xml(e);c!==e&&($.setRecordUndo$$module$build$src$core$events$utils(!1),
|
|
567
|
+
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,"mutation",null,c,e)),$.setRecordUndo$$module$build$src$core$events$utils(b))}};
|
|
568
|
+
$.getDefinition$$module$build$src$core$procedures=function(a,b){for(let c of b.getAllBlocks(!1))if(isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)&&c.isProcedureDef()&&$.Names$$module$build$src$core$names.equals(c.getProcedureModel().getName(),a)||isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureDef()[0],a))return c;return null};
|
|
569
|
+
isDynamicShape$$module$build$src$core$renderers$common$constants=function(a){return a.isDynamic};isPuzzleTab$$module$build$src$core$renderers$common$constants=function(a){return a.pathDown!==void 0&&a.pathUp!==void 0};isNotch$$module$build$src$core$renderers$common$constants=function(a){return a.pathLeft!==void 0&&a.pathRight!==void 0};
|
|
570
|
+
register$$module$build$src$core$renderers$common$block_rendering=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a,b)};unregister$$module$build$src$core$renderers$common$block_rendering=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a)};
|
|
571
|
+
init$$module$build$src$core$renderers$common$block_rendering=function(a,b,c){a=new (getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a))(a);a.init(b,c);return a};stringButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"String")};
|
|
572
|
+
numberButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Number")};colourButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Colour")};
|
|
573
|
+
internalFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){return flyoutCategory$$module$build$src$core$variables_dynamic(a,!1)};
|
|
574
|
+
flyoutCategory$$module$build$src$core$variables_dynamic=function(a,b=!0){Blocks$$module$build$src$core$blocks.variables_set_dynamic||Blocks$$module$build$src$core$blocks.variables_get_dynamic||console.warn("There are no dynamic variable blocks, but there is a dynamic variable category.");if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.VariablesDynamic.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),
|
|
575
|
+
xmlFlyoutCategory$$module$build$src$core$variables_dynamic(a);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);return[{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE,callbackkey:"CREATE_VARIABLE_STRING"},
|
|
576
|
+
{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE,callbackkey:"CREATE_VARIABLE_NUMBER"},{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE,callbackkey:"CREATE_VARIABLE_COLOUR"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,a.getVariableMap().getAllVariables(),!1,"variables_get_dynamic","variables_set_dynamic")]};
|
|
577
|
+
xmlFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE);
|
|
578
|
+
c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR");b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);a=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic(a);return b=b.concat(a)};
|
|
579
|
+
flyoutCategoryBlocks$$module$build$src$core$variables_dynamic=function(a){a=a.getVariableMap().getAllVariables();var b=[];if(a.length>0){if(Blocks$$module$build$src$core$blocks.variables_set_dynamic){var c=a[a.length-1];let d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","variables_set_dynamic");d.setAttribute("gap","24");d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c));b.push(d)}if(Blocks$$module$build$src$core$blocks.variables_get_dynamic){a.sort(compareByName$$module$build$src$core$variables);
|
|
580
|
+
for(let d=0,e;e=a[d];d++)c=$.createElement$$module$build$src$core$utils$xml("block"),c.setAttribute("type","variables_get_dynamic"),c.setAttribute("gap","8"),c.appendChild(generateVariableFieldDom$$module$build$src$core$variables(e)),b.push(c)}}return b};resizeSvgContents$$module$build$src$core$workspace_svg=function(a){a.resizeContents()};
|
|
549
581
|
saveProcedure$$module$build$src$core$serialization$procedures=function(a){var 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(let [e,f]of c.parameters.entries())a.insertParameter(b.loadState(f,d),e);return a};
|
|
550
582
|
save$$module$build$src$core$serialization$workspaces=function(a){var b=Object.create(null),c=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);for(let d in c){let e,f=(e=c[d])==null?void 0:e.save(a);f&&(b[d]=f)}return b};
|
|
551
583
|
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();
|
|
@@ -556,17 +588,17 @@ Role$$module$build$src$core$utils$aria.APPLICATION);c.appendChild(d);b=createDom
|
|
|
556
588
|
initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria(d);return e};
|
|
557
589
|
createDom$$module$build$src$core$inject=function(a,b){a.setAttribute("dir","LTR");inject$$module$build$src$core$css(a,b.hasCss,b.pathToMedia);var 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,
|
|
558
590
|
{},c),e=String(Math.random()).substring(2);b.gridPattern=Grid$$module$build$src$core$grid.createDom(e,b.gridOptions,d,a);return c};
|
|
559
|
-
createMainWorkspace$$module$build$src$core$inject=function(a,b,c){c.parentWorkspace=null;c=new WorkspaceSvg$$module$build$src$core$workspace_svg(c);var 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&&(
|
|
560
|
-
|
|
591
|
+
createMainWorkspace$$module$build$src$core$inject=function(a,b,c){c.parentWorkspace=null;c=new WorkspaceSvg$$module$build$src$core$workspace_svg(c);var 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&&(e=c.addFlyout(Svg$$module$build$src$core$utils$svg.SVG),
|
|
592
|
+
a.insertBefore(e,b));d.hasTrashcan&&c.addTrashcan();d.zoomOptions&&d.zoomOptions.controls&&c.addZoomControls();c.getThemeManager().subscribe(b,"workspaceBackgroundColour","background-color");c.translate(0,0);c.addChangeListener(bumpIntoBoundsHandler$$module$build$src$core$bump_objects(c));svgResize$$module$build$src$core$common(c);createDom$$module$build$src$core$widgetdiv();createDom$$module$build$src$core$dropdowndiv();createDom$$module$build$src$core$tooltip();return c};
|
|
561
593
|
init$$module$build$src$core$inject=function(a){var b=a.options,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();
|
|
562
594
|
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();let d=a.getFlyout(!0);c?c.init():d&&(d.init(a),d.show(b.languageTree),typeof d.scrollToStart==="function"&&d.scrollToStart())}b.hasTrashcan&&a.trashcan.init();b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init();b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new ScrollbarPair$$module$build$src$core$scrollbar_pair(a,
|
|
563
595
|
b.moveOptions.scrollbars===!0||!!b.moveOptions.scrollbars.horizontal,b.moveOptions.scrollbars===!0||!!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)};
|
|
564
596
|
bindDocumentEvents$$module$build$src$core$inject=function(){documentEventsBound$$module$build$src$core$inject||(conditionalBind$$module$build$src$core$browser_events(document,"scroll",null,function(){var 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,
|
|
565
|
-
"touchcancel",null,longStop$$module$build$src$core$touch)
|
|
566
|
-
isFullBlockField$$module$build$src$core$contextmenu_items=function(a){if(!a||!a.isSimpleReporter())return!1;var b;return(b=a.getFields().next().value)==null?void 0:b.isFullBlockField()};
|
|
567
|
-
registerUndo$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.UNDO},preconditionFn(a){return a.workspace.getUndoStack().length>0?"enabled":"disabled"},callback(a){a.workspace.undo()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"undoWorkspace",weight:1})};
|
|
568
|
-
registerRedo$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.REDO},preconditionFn(a){return a.workspace.getRedoStack().length>0?"enabled":"disabled"},callback(a){a.workspace.redo()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"redoWorkspace",weight:2})};
|
|
569
|
-
registerCleanup$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.CLEAN_UP},preconditionFn(a){return a.workspace.isMovable()?a.workspace.getTopBlocks(!1).length>1?"enabled":"disabled":"hidden"},callback(a){a.workspace.cleanUp()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"cleanWorkspace",weight:3})};
|
|
597
|
+
"touchcancel",null,longStop$$module$build$src$core$touch),bind$$module$build$src$core$browser_events(document,"keydown",null,function(a){a.key==="Tab"&&keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0)}));documentEventsBound$$module$build$src$core$inject=!0};
|
|
598
|
+
loadSounds$$module$build$src$core$inject=function(a,b){b=b.getAudioManager();b.load([`${a}click.mp3`],"click");b.load([`${a}disconnect.mp3`],"disconnect");b.load([`${a}delete.mp3`],"delete");b.load([`${a}drop.mp3`],"drop")};isFullBlockField$$module$build$src$core$contextmenu_items=function(a){if(!a||!a.isSimpleReporter())return!1;var b;return(b=a.getFields().next().value)==null?void 0:b.isFullBlockField()};
|
|
599
|
+
registerUndo$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.UNDO},preconditionFn(a){return a.workspace.getUndoStack().length>0?"enabled":"disabled"},callback(a){a.workspace.undo()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"undoWorkspace",weight:1,associatedKeyboardShortcut:"undo"})};
|
|
600
|
+
registerRedo$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.REDO},preconditionFn(a){return a.workspace.getRedoStack().length>0?"enabled":"disabled"},callback(a){a.workspace.redo()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"redoWorkspace",weight:2,associatedKeyboardShortcut:"redo"})};
|
|
601
|
+
registerCleanup$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.CLEAN_UP},preconditionFn(a){return a.workspace.isMovable()?a.workspace.getTopBlocks(!1).length>1?"enabled":"disabled":"hidden"},callback(a){a.workspace.cleanUp()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"cleanWorkspace",weight:3,associatedKeyboardShortcut:"cleanup"})};
|
|
570
602
|
toggleOption_$$module$build$src$core$contextmenu_items=function(a,b){function c(f){e--;f.setCollapsed(a);e===0&&$.setGroup$$module$build$src$core$events$utils(!1)}var d=0,e=0;$.setGroup$$module$build$src$core$events$utils(!0);for(let f=0;f<b.length;f++){let g=b[f];for(;g;)e++,setTimeout(c.bind(null,g),d),g=g.getNextBlock(),d+=10}};
|
|
571
603
|
registerCollapse$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.COLLAPSE_ALL},preconditionFn(a){if(a.workspace.options.collapse){a=a.workspace.getTopBlocks(!1);for(let b=0;b<a.length;b++){let c=a[b];for(;c;){if(!c.isCollapsed())return"enabled";c=c.getNextBlock()}}return"disabled"}return"hidden"},callback(a){toggleOption_$$module$build$src$core$contextmenu_items(!0,
|
|
572
604
|
a.workspace.getTopBlocks(!0))},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"collapseWorkspace",weight:4})};
|
|
@@ -578,9 +610,9 @@ registerDeleteAll$$module$build$src$core$contextmenu_items=function(){ContextMen
|
|
|
578
610
|
0?"enabled":"disabled":"disabled"},callback(a){if(a.workspace){a.workspace.cancelCurrentGesture();var b=getDeletableBlocks_$$module$build$src$core$contextmenu_items(a.workspace);b.length<2?deleteNext_$$module$build$src$core$contextmenu_items(b):confirm$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(b.length)),function(c){c&&deleteNext_$$module$build$src$core$contextmenu_items(b)})}},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,
|
|
579
611
|
id:"workspaceDelete",weight:6})};registerWorkspaceOptions_$$module$build$src$core$contextmenu_items=function(){registerUndo$$module$build$src$core$contextmenu_items();registerRedo$$module$build$src$core$contextmenu_items();registerCleanup$$module$build$src$core$contextmenu_items();registerCollapse$$module$build$src$core$contextmenu_items();registerExpand$$module$build$src$core$contextmenu_items();registerDeleteAll$$module$build$src$core$contextmenu_items()};
|
|
580
612
|
registerDuplicate$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(a){a=a.block;return!a.isInFlyout&&a.isDeletable()&&a.isMovable()?a.isDuplicatable()?"enabled":"disabled":"hidden"},callback(a){if(a.block){var b=a.block.toCopyData();b&&paste$$module$build$src$core$clipboard(b,a.block.workspace)}},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,
|
|
581
|
-
id:"blockDuplicate",weight:1})};
|
|
582
|
-
registerComment$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){return a.block.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)?$.Msg$$module$build$src$core$msg.REMOVE_COMMENT:$.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(a){a=a.block;return!a||a.isInFlyout||!a.workspace.options.comments||a.isCollapsed()||!a.isEditable()||!a.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)&&
|
|
583
|
-
"hidden":"enabled"},callback(a){(a=a.block)&&a.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)?a.setCommentText(null):a.setCommentText("")},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockComment",weight:2})};
|
|
613
|
+
id:"blockDuplicate",weight:1,associatedKeyboardShortcut:"duplicate"})};
|
|
614
|
+
registerComment$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){return a.block.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)?$.Msg$$module$build$src$core$msg.REMOVE_COMMENT:$.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(a){a=a.block;return!a||a.isInFlyout||!a.workspace.options.comments||a.isCollapsed()||!a.isEditable()||!a.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)&&
|
|
615
|
+
isFullBlockField$$module$build$src$core$contextmenu_items(a)?"hidden":"enabled"},callback(a){(a=a.block)&&a.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)?a.setCommentText(null):a.setCommentText("")},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockComment",weight:2})};
|
|
584
616
|
registerInline$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){return a.block.getInputsInline()?$.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:$.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(a){a=a.block;if(!a.isInFlyout&&a.isMovable()&&!a.isCollapsed())for(let b=1;b<a.inputList.length;b++)if(!(a.inputList[b-1]instanceof StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs||
|
|
585
617
|
a.inputList[b]instanceof StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs))return"enabled";return"hidden"},callback(a){a.block.setInputsInline(!a.block.getInputsInline())},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockInline",weight:3})};
|
|
586
618
|
registerCollapseExpandBlock$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){return a.block.isCollapsed()?$.Msg$$module$build$src$core$msg.EXPAND_BLOCK:$.Msg$$module$build$src$core$msg.COLLAPSE_BLOCK},preconditionFn(a){a=a.block;return!a.isInFlyout&&a.isMovable()&&a.workspace.options.collapse?"enabled":"hidden"},callback(a){a.block.setCollapsed(!a.block.isCollapsed())},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,
|
|
@@ -589,12 +621,12 @@ registerDisable$$module$build$src$core$contextmenu_items=function(){ContextMenuR
|
|
|
589
621
|
1:0);return a.getInheritedDisabled()||b?"disabled":"enabled"}return"hidden"},callback(a){a=a.block;var b=$.getGroup$$module$build$src$core$events$utils();b||$.setGroup$$module$build$src$core$events$utils(!0);a.setDisabledReason(!a.hasDisabledReason(MANUALLY_DISABLED$$module$build$src$core$constants),MANUALLY_DISABLED$$module$build$src$core$constants);$.setGroup$$module$build$src$core$events$utils(b)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockDisable",
|
|
590
622
|
weight:5})};
|
|
591
623
|
registerDelete$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){var b=a.block;a=b.getDescendants(!1).length;(b=b.getNextBlock())&&(a-=b.getDescendants(!1).length);return a===1?$.Msg$$module$build$src$core$msg.DELETE_BLOCK:$.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${a}`)},preconditionFn(a){return!a.block.isInFlyout&&a.block.isDeletable()?"enabled":"hidden"},callback(a){a.block&&a.block.checkAndDelete()},
|
|
592
|
-
scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockDelete",weight:6})};
|
|
624
|
+
scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockDelete",weight:6,associatedKeyboardShortcut:"delete"})};
|
|
593
625
|
registerHelp$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.HELP},preconditionFn(a){a=a.block;return(typeof a.helpUrl==="function"?a.helpUrl():a.helpUrl)?"enabled":"hidden"},callback(a){a.block.showHelp()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockHelp",weight:7})};
|
|
594
626
|
registerCommentDelete$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText:()=>$.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(a){var b;return((b=a.comment)==null?0:b.isDeletable())?"enabled":"hidden"},callback(a){$.setGroup$$module$build$src$core$events$utils(!0);var b;(b=a.comment)==null||b.dispose();$.setGroup$$module$build$src$core$events$utils(!1);var c;(c=a.comment)==null||c.workspace.getAudioManager().play("delete")},
|
|
595
|
-
scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT,id:"commentDelete",weight:6})};
|
|
627
|
+
scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT,id:"commentDelete",weight:6,associatedKeyboardShortcut:"delete"})};
|
|
596
628
|
registerCommentDuplicate$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText:()=>$.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(a){var b;return((b=a.comment)==null?0:b.isMovable())?"enabled":"hidden"},callback(a){if(a.comment){var b=a.comment.toCopyData();b&&paste$$module$build$src$core$clipboard(b,a.comment.workspace)}},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT,
|
|
597
|
-
id:"commentDuplicate",weight:1})};
|
|
629
|
+
id:"commentDuplicate",weight:1,associatedKeyboardShortcut:"duplicate"})};
|
|
598
630
|
registerCommentCreate$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText:()=>$.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:a=>{var b;return((b=a.workspace)==null?0:b.isMutator)?"hidden":"enabled"},callback:(a,b,c,d)=>{if(a=a.workspace)$.setGroup$$module$build$src$core$events$utils(!0),b=new RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment(a),b.moveTo(screenToWsCoordinates$$module$build$src$core$utils$svg_math(a,
|
|
599
631
|
new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y))),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b),$.setGroup$$module$build$src$core$events$utils(!1)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"commentCreate",weight:8})};
|
|
600
632
|
registerBlockOptions_$$module$build$src$core$contextmenu_items=function(){registerDuplicate$$module$build$src$core$contextmenu_items();registerComment$$module$build$src$core$contextmenu_items();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()};
|
|
@@ -1138,6 +1170,19 @@ input[type=number] {
|
|
|
1138
1170
|
margin-right: 4px;
|
|
1139
1171
|
}
|
|
1140
1172
|
|
|
1173
|
+
.blocklyRTL .blocklyMenuItemContent .blocklyShortcutContainer {
|
|
1174
|
+
flex-direction: row-reverse;
|
|
1175
|
+
}
|
|
1176
|
+
.blocklyMenuItemContent .blocklyShortcutContainer {
|
|
1177
|
+
width: 100%;
|
|
1178
|
+
display: flex;
|
|
1179
|
+
justify-content: space-between;
|
|
1180
|
+
gap: 16px;
|
|
1181
|
+
}
|
|
1182
|
+
.blocklyMenuItemContent .blocklyShortcutContainer .blocklyShortcut {
|
|
1183
|
+
color: #ccc;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1141
1186
|
.blocklyBlockDragSurface, .blocklyAnimationLayer {
|
|
1142
1187
|
position: absolute;
|
|
1143
1188
|
top: 0;
|
|
@@ -1171,7 +1216,9 @@ input[type=number] {
|
|
|
1171
1216
|
.blocklyComment,
|
|
1172
1217
|
.blocklyBubble,
|
|
1173
1218
|
.blocklyIconGroup,
|
|
1174
|
-
.blocklyTextarea
|
|
1219
|
+
.blocklyTextarea,
|
|
1220
|
+
.blocklyZoom,
|
|
1221
|
+
.blocklyTrash,
|
|
1175
1222
|
) {
|
|
1176
1223
|
outline: none;
|
|
1177
1224
|
}
|
|
@@ -1200,19 +1247,16 @@ input[type=number] {
|
|
|
1200
1247
|
/* Icons with active focus. */
|
|
1201
1248
|
.blocklyKeyboardNavigation
|
|
1202
1249
|
.blocklyActiveFocus.blocklyIconGroup
|
|
1203
|
-
> .blocklyIconShape:first-child
|
|
1250
|
+
> .blocklyIconShape:first-child,
|
|
1251
|
+
.blocklyKeyboardNavigation
|
|
1252
|
+
.blocklyActiveFocus
|
|
1253
|
+
> .blocklyFocusRing {
|
|
1204
1254
|
stroke: var(--blockly-active-node-color);
|
|
1205
1255
|
stroke-width: var(--blockly-selection-width);
|
|
1206
1256
|
}
|
|
1207
1257
|
|
|
1208
1258
|
/* Passive focus cases: */
|
|
1209
1259
|
/* Blocks with passive focus except when widget/dropdown div in use. */
|
|
1210
|
-
.blocklyKeyboardNavigation:not(
|
|
1211
|
-
:has(
|
|
1212
|
-
.blocklyDropDownDiv:focus-within,
|
|
1213
|
-
.blocklyWidgetDiv:focus-within
|
|
1214
|
-
)
|
|
1215
|
-
)
|
|
1216
1260
|
.blocklyPassiveFocus:is(
|
|
1217
1261
|
.blocklyPath:not(.blocklyFlyout .blocklyPath),
|
|
1218
1262
|
.blocklyHighlightedConnectionPath
|
|
@@ -1279,11 +1323,11 @@ input[type=number] {
|
|
|
1279
1323
|
.blocklyWorkspace.blocklyActiveFocus
|
|
1280
1324
|
.blocklyWorkspaceFocusRing,
|
|
1281
1325
|
/* Focus in widget/dropdown div considered to be in workspace. */
|
|
1282
|
-
.blocklyKeyboardNavigation
|
|
1283
|
-
.
|
|
1284
|
-
.
|
|
1285
|
-
|
|
1286
|
-
.blocklyWorkspace
|
|
1326
|
+
.blocklyKeyboardNavigation
|
|
1327
|
+
.blocklyWorkspace.blocklyShowingDropDownDiv
|
|
1328
|
+
.blocklyWorkspaceFocusRing,
|
|
1329
|
+
.blocklyKeyboardNavigation
|
|
1330
|
+
.blocklyWorkspace.blocklyShowingWidgetDiv
|
|
1287
1331
|
.blocklyWorkspaceFocusRing {
|
|
1288
1332
|
stroke: var(--blockly-active-tree-color);
|
|
1289
1333
|
stroke-width: calc(var(--blockly-selection-width) * 2);
|
|
@@ -1363,15 +1407,16 @@ module$build$src$core$utils$toolbox.convertToolboxDefToJson=convertToolboxDefToJ
|
|
|
1363
1407
|
var bumpDirection$$module$build$src$core$positionable_helpers;(function(a){a[a.UP=0]="UP";a[a.DOWN=1]="DOWN"})(bumpDirection$$module$build$src$core$positionable_helpers||(bumpDirection$$module$build$src$core$positionable_helpers={}));var module$build$src$core$positionable_helpers={};module$build$src$core$positionable_helpers.bumpDirection=bumpDirection$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.bumpPositionRect=bumpPositionRect$$module$build$src$core$positionable_helpers;
|
|
1364
1408
|
module$build$src$core$positionable_helpers.getCornerOppositeToolbox=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.getStartPositionRect=getStartPositionRect$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.horizontalPosition=horizontalPosition$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.verticalPosition=verticalPosition$$module$build$src$core$positionable_helpers;var SPRITE$$module$build$src$core$sprites={width:96,height:124,url:"sprites.svg"},module$build$src$core$sprites={SPRITE:SPRITE$$module$build$src$core$sprites};var ZoomControl$$module$build$src$core$zoom_controls=class{constructor(a,b){this.workspace=a;this.group=b;this.pointerDownHandler=conditionalBind$$module$build$src$core$browser_events(b,"pointerdown",null,this.performAction.bind(this));setRole$$module$build$src$core$utils$aria(b,Role$$module$build$src$core$utils$aria.BUTTON);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.group.id=this.id}getId(){return this.id}zoom(a,b){this.workspace.markFocused();this.workspace.zoomCenter(a);
|
|
1365
1409
|
this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();b.stopPropagation();b.preventDefault()}fireZoomEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(null,this.workspace.id,"zoom_controls");fire$$module$build$src$core$events$utils(a)}getFocusableElement(){return this.group}getFocusableTree(){return this.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}dispose(){unbind$$module$build$src$core$browser_events(this.pointerDownHandler)}},
|
|
1366
|
-
ZoomInControl$$module$build$src$core$zoom_controls=class extends ZoomControl$$module$build$src$core$zoom_controls{constructor(a,b){var c=String(Math.random()).substring(2);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomIn",tabindex:"0"},b);setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.ZOOM_IN);
|
|
1367
|
-
{id:"blocklyZoominClipPath"+c},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},d);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,
|
|
1368
|
-
SPRITE$$module$build$src$core$sprites.url);super(a,b)}performAction(a){this.zoom(1,a)}},ZoomOutControl$$module$build$src$core$zoom_controls=class extends ZoomControl$$module$build$src$core$zoom_controls{constructor(a,b){var c=String(Math.random()).substring(2);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
b)
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1410
|
+
ZoomInControl$$module$build$src$core$zoom_controls=class extends ZoomControl$$module$build$src$core$zoom_controls{constructor(a,b){var c=String(Math.random()).substring(2);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomIn",tabindex:"0"},b);setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.ZOOM_IN);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
1411
|
+
{width:40,height:40,x:-4,y:-4,rx:2,ry:2,fill:"none","class":"blocklyFocusRing"},b);var d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoominClipPath"+c},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},d);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,
|
|
1412
|
+
x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+c+")"},b).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);super(a,b)}performAction(a){this.zoom(1,a)}},ZoomOutControl$$module$build$src$core$zoom_controls=class extends ZoomControl$$module$build$src$core$zoom_controls{constructor(a,b){var c=String(Math.random()).substring(2);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
1413
|
+
{"class":"blocklyZoom blocklyZoomOut",tabindex:"0"},b);setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.ZOOM_OUT);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:40,height:40,x:-4,y:-4,rx:2,ry:2,fill:"none","class":"blocklyFocusRing"},b);var d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoomoutClipPath"+c},b);
|
|
1414
|
+
createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},d);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+c+")"},b).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);
|
|
1415
|
+
super(a,b)}performAction(a){this.zoom(-1,a)}},ZoomResetControl$$module$build$src$core$zoom_controls=class extends ZoomControl$$module$build$src$core$zoom_controls{constructor(a,b){var c=String(Math.random()).substring(2);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomReset",tabindex:"0"},b);setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.RESET_ZOOM);
|
|
1416
|
+
createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:40,height:40,x:-4,y:-4,rx:2,ry:2,fill:"none","class":"blocklyFocusRing"},b);var d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoomresetClipPath"+c},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},d);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,
|
|
1417
|
+
{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+c+")"},b).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);super(a,b)}performAction(a){this.workspace.markFocused();var b=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition();
|
|
1418
|
+
this.workspace.zoomCenter(b);this.workspace.scrollCenter();setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();a.stopPropagation();a.preventDefault()}},ZoomControls$$module$build$src$core$zoom_controls=class{constructor(a){this.workspace=a;this.id="zoomControls";this.zoomResetControl=this.zoomOutControl=this.zoomInControl=null;this.HEIGHT=this.WIDTH=32;this.SMALL_SPACING=2;this.LARGE_SPACING=11;this.MARGIN_HORIZONTAL=
|
|
1419
|
+
this.MARGIN_VERTICAL=20;this.svgGroup=null;this.top=this.left=0;this.initialized=!1}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});this.zoomOutControl=new ZoomOutControl$$module$build$src$core$zoom_controls(this.workspace,this.svgGroup);this.zoomInControl=new ZoomInControl$$module$build$src$core$zoom_controls(this.workspace,this.svgGroup);this.workspace.isMovable()&&(this.zoomResetControl=new ZoomResetControl$$module$build$src$core$zoom_controls(this.workspace,
|
|
1375
1420
|
this.svgGroup));return this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE]});this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls");this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup);var a;(a=this.zoomInControl)==
|
|
1376
1421
|
null||a.dispose();var b;(b=this.zoomOutControl)==null||b.dispose();var c;(c=this.zoomResetControl)==null||c.dispose()}getBoundingRectangle(){var a=this.SMALL_SPACING+2*this.HEIGHT;this.zoomResetControl&&(a+=this.LARGE_SPACING+this.HEIGHT);return new Rect$$module$build$src$core$utils$rect(this.top,this.top+a,this.left,this.left+this.WIDTH)}position(a,b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace,a),d=this.SMALL_SPACING+2*this.HEIGHT;
|
|
1377
1422
|
this.zoomResetControl&&(d+=this.LARGE_SPACING+this.HEIGHT);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(this.WIDTH,d),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,a,this.workspace);c=c.vertical;b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,this.MARGIN_VERTICAL,c===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN:bumpDirection$$module$build$src$core$positionable_helpers.UP,
|
|
@@ -1384,7 +1429,7 @@ module$build$src$core$serialization$workspace_comments.WorkspaceCommentSerialize
|
|
|
1384
1429
|
$.getFocusManager$$module$build$src$core$focus_manager().focusNode(d);return d}};WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE="workspace-comment";register$$module$build$src$core$clipboard$registry(WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,new WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster);var module$build$src$core$clipboard$workspace_comment_paster={};
|
|
1385
1430
|
module$build$src$core$clipboard$workspace_comment_paster.WorkspaceCommentPaster=WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster;var DEFAULT_SNAP_RADIUS$$module$build$src$core$config,module$build$src$core$config;DEFAULT_SNAP_RADIUS$$module$build$src$core$config=28;$.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,connectingSnapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,currentConnectionPreference:8,bumpDelay:250};module$build$src$core$config={config:$.config$$module$build$src$core$config};var MenuItem$$module$build$src$core$menuitem=class{constructor(a,b,c){this.content=a;this.opt_value=b;this.ariaLabel=c;this.enabled=!0;this.element=null;this.rightToLeft=!1;this.roleName=null;this.highlight=this.checked=this.checkable=!1;this.actionHandler=null;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}createDom(){var a=document.createElement("div");a.id=this.getId();this.element=a;a.className="blocklyMenuItem "+(this.enabled?"":"blocklyMenuItemDisabled ")+(this.checked?"blocklyMenuItemSelected ":
|
|
1386
1431
|
"")+(this.highlight?"blocklyMenuItemHighlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl ":"");var b=document.createElement("div");setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,this.getAriaLabel());setRole$$module$build$src$core$utils$aria(b,Role$$module$build$src$core$utils$aria.PRESENTATION);b.className="blocklyMenuItemContent";var c=this.content;typeof this.content==="string"&&(c=document.createTextNode(this.content));b.appendChild(c);a.appendChild(b);
|
|
1387
|
-
this.checkable&&this.toggleHasCheckbox(!0);this.roleName&&setRole$$module$build$src$core$utils$aria(a,this.roleName);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.SELECTED,this.checkable&&this.checked||!1);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.DISABLED,!this.enabled);return a}getAriaLabel(){return this.ariaLabel||
|
|
1432
|
+
this.checkable&&this.toggleHasCheckbox(!0);this.roleName&&setRole$$module$build$src$core$utils$aria(a,this.roleName);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.SELECTED,this.checkable&&this.checked||!1);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.DISABLED,!this.enabled);return a}getAriaLabel(){return this.ariaLabel||(typeof this.content==="string"?this.content:this.content.textContent)}dispose(){this.element=null}getElement(){return this.element}getId(){return this.id}getValue(){var a;
|
|
1388
1433
|
return(a=this.opt_value)!=null?a:null}setRightToLeft(a){this.rightToLeft=a;var b;(b=this.getElement())==null||b.classList.toggle("blocklyMenuItemRtl",this.rightToLeft)}setRole(a){this.roleName=a}setCheckable(a){(this.checkable=a)||this.setChecked(!1);this.toggleHasCheckbox(a)}setChecked(a){if(!a||this.checkable)if(this.checked=a,a=this.getElement())a.classList.toggle("blocklyMenuItemSelected",this.checked),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.SELECTED,
|
|
1389
1434
|
this.checked)}setHighlighted(a){this.highlight=a;if(this.isEnabled()){let b;(b=this.getElement())==null||b.classList.toggle("blocklyMenuItemHighlight",this.highlight)}}isEnabled(){return this.enabled}setEnabled(a){this.enabled=a;if(a=this.getElement())a.classList.toggle("blocklyMenuItemDisabled",!this.enabled),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.DISABLED,!this.enabled)}performAction(a){this.isEnabled()&&this.actionHandler&&this.actionHandler(this,a)}onAction(a,
|
|
1390
1435
|
b){this.actionHandler=a.bind(b)}toggleHasCheckbox(a){if(a){let d;if((d=this.getElement())==null||!d.querySelector(".blocklyMenuItemContent .blocklyMenuItemCheckbox")){a=document.createElement("div");setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.HIDDEN,!0);a.className="blocklyMenuItemCheckbox ";var b,c;(b=this.getElement())==null||(c=b.querySelector(".blocklyMenuItemContent"))==null||c.prepend(a)}}else{let d,e;(d=this.getElement())==null||(e=d.querySelector(".blocklyMenuItemContent .blocklyMenuItemCheckbox"))==
|
|
@@ -1526,8 +1571,9 @@ module$build$src$core$events$events.VAR_CREATE=VAR_CREATE$$module$build$src$core
|
|
|
1526
1571
|
module$build$src$core$events$events.VarCreate=VarCreate$$module$build$src$core$events$events_var_create;module$build$src$core$events$events.VarDelete=VarDelete$$module$build$src$core$events$events_var_delete;module$build$src$core$events$events.VarRename=VarRename$$module$build$src$core$events$events_var_rename;module$build$src$core$events$events.VarTypeChange=VarTypeChange$$module$build$src$core$events$events_var_type_change;module$build$src$core$events$events.ViewportChange=ViewportChange$$module$build$src$core$events$events_viewport;
|
|
1527
1572
|
module$build$src$core$events$events.clearPendingUndo=clearPendingUndo$$module$build$src$core$events$utils;module$build$src$core$events$events.disable=$.disable$$module$build$src$core$events$utils;module$build$src$core$events$events.disableOrphans=disableOrphans$$module$build$src$core$events$utils;module$build$src$core$events$events.enable=$.enable$$module$build$src$core$events$utils;module$build$src$core$events$events.filter=filter$$module$build$src$core$events$utils;
|
|
1528
1573
|
module$build$src$core$events$events.fire=fire$$module$build$src$core$events$utils;module$build$src$core$events$events.fromJson=fromJson$$module$build$src$core$events$utils;module$build$src$core$events$events.get=get$$module$build$src$core$events$utils;module$build$src$core$events$events.getDescendantIds=getDescendantIds$$module$build$src$core$events$utils;module$build$src$core$events$events.getGroup=$.getGroup$$module$build$src$core$events$utils;module$build$src$core$events$events.getRecordUndo=getRecordUndo$$module$build$src$core$events$utils;
|
|
1529
|
-
module$build$src$core$events$events.isEnabled=isEnabled$$module$build$src$core$events$utils;module$build$src$core$events$events.setGroup=$.setGroup$$module$build$src$core$events$utils;module$build$src$core$events$events.setRecordUndo=$.setRecordUndo$$module$build$src$core$events$utils;var module$build$src$core$interfaces$i_legacy_procedure_blocks={};module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureCallBlock=isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureDefBlock=isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;var module$build$src$core$interfaces$i_variable_backed_parameter_model={};module$build$src$core$interfaces$i_variable_backed_parameter_model.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;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):
|
|
1530
|
-
|
|
1574
|
+
module$build$src$core$events$events.isEnabled=isEnabled$$module$build$src$core$events$utils;module$build$src$core$events$events.setGroup=$.setGroup$$module$build$src$core$events$utils;module$build$src$core$events$events.setRecordUndo=$.setRecordUndo$$module$build$src$core$events$utils;var module$build$src$core$interfaces$i_legacy_procedure_blocks={};module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureCallBlock=isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureDefBlock=isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;var module$build$src$core$interfaces$i_variable_backed_parameter_model={};module$build$src$core$interfaces$i_variable_backed_parameter_model.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.scopeChangeAudioCuesEnabled=this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}setScopeChangeAudioCuesEnabled(a){this.scopeChangeAudioCuesEnabled=a}getScopeChangeAudioCuesEnabled(){return this.scopeChangeAudioCuesEnabled}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):
|
|
1575
|
+
document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=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;
|
|
1576
|
+
module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var previousWarnings$$module$build$src$core$utils$deprecation=new Set,module$build$src$core$utils$deprecation={};module$build$src$core$utils$deprecation.warn=$.warn$$module$build$src$core$utils$deprecation;var CATEGORY_NAME$$module$build$src$core$variables="VARIABLE",VAR_LETTER_OPTIONS$$module$build$src$core$variables="ijkmnopqrstuvwxyzabcdefgh",TEST_ONLY$$module$build$src$core$variables={generateUniqueNameInternal:generateUniqueNameInternal$$module$build$src$core$variables},module$build$src$core$variables={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables,TEST_ONLY:TEST_ONLY$$module$build$src$core$variables,VAR_LETTER_OPTIONS:VAR_LETTER_OPTIONS$$module$build$src$core$variables};
|
|
1531
1577
|
module$build$src$core$variables.allDeveloperVariables=$.allDeveloperVariables$$module$build$src$core$variables;module$build$src$core$variables.allUsedVarModels=$.allUsedVarModels$$module$build$src$core$variables;module$build$src$core$variables.compareByName=compareByName$$module$build$src$core$variables;module$build$src$core$variables.createVariableButtonHandler=createVariableButtonHandler$$module$build$src$core$variables;module$build$src$core$variables.deleteVariable=$.deleteVariable$$module$build$src$core$variables;
|
|
1532
1578
|
module$build$src$core$variables.flyoutCategory=flyoutCategory$$module$build$src$core$variables;module$build$src$core$variables.flyoutCategoryBlocks=flyoutCategoryBlocks$$module$build$src$core$variables;module$build$src$core$variables.generateUniqueName=generateUniqueName$$module$build$src$core$variables;module$build$src$core$variables.generateUniqueNameFromOptions=generateUniqueNameFromOptions$$module$build$src$core$variables;module$build$src$core$variables.generateVariableFieldDom=generateVariableFieldDom$$module$build$src$core$variables;
|
|
1533
1579
|
module$build$src$core$variables.getAddedVariables=getAddedVariables$$module$build$src$core$variables;module$build$src$core$variables.getOrCreateVariablePackage=$.getOrCreateVariablePackage$$module$build$src$core$variables;module$build$src$core$variables.getVariable=$.getVariable$$module$build$src$core$variables;module$build$src$core$variables.getVariableUsesById=getVariableUsesById$$module$build$src$core$variables;module$build$src$core$variables.internalFlyoutCategory=internalFlyoutCategory$$module$build$src$core$variables;
|
|
@@ -1538,14 +1584,20 @@ ${b} to its parent, because: ${a}`);this.childBlock=c;this.childState=d}},RealCh
|
|
|
1538
1584
|
b,c){super(`Cannot add an icon of type '${a}' to the block ${b.toDevString()}, because there is no icon registered with type '${a}'. Make sure that all of your icons have been registered.`);this.block=b;this.state=c}},module$build$src$core$serialization$exceptions={};module$build$src$core$serialization$exceptions.BadConnectionCheck=BadConnectionCheck$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.DeserializationError=DeserializationError$$module$build$src$core$serialization$exceptions;
|
|
1539
1585
|
module$build$src$core$serialization$exceptions.MissingBlockType=MissingBlockType$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.MissingConnection=MissingConnection$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.RealChildOfShadow=RealChildOfShadow$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.UnregisteredIcon=UnregisteredIcon$$module$build$src$core$serialization$exceptions;var saveBlock$$module$build$src$core$serialization$blocks=save$$module$build$src$core$serialization$blocks,BlockSerializer$$module$build$src$core$serialization$blocks=class{constructor(){this.priority=BLOCKS$$module$build$src$core$serialization$priorities}save(a){var b=[];for(let c of a.getTopBlocks(!1))(a=save$$module$build$src$core$serialization$blocks(c,{addCoordinates:!0,doFullSerialization:!1}))&&b.push(a);return b.length?{languageVersion:0,blocks:b}:null}load(a,b){a=a.blocks;for(let c of a)append$$module$build$src$core$serialization$blocks(c,
|
|
1540
1586
|
b,{recordUndo:getRecordUndo$$module$build$src$core$events$utils()})}clear(a){for(let b of a.getTopBlocks(!1))b.dispose(!1)}};register$$module$build$src$core$serialization$registry("blocks",new BlockSerializer$$module$build$src$core$serialization$blocks);var module$build$src$core$serialization$blocks={};module$build$src$core$serialization$blocks.BlockSerializer=BlockSerializer$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.append=append$$module$build$src$core$serialization$blocks;
|
|
1541
|
-
module$build$src$core$serialization$blocks.appendInternal=appendInternal$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.save=save$$module$build$src$core$serialization$blocks
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
module$build$src$core$
|
|
1547
|
-
module$build$src$core$
|
|
1548
|
-
|
|
1587
|
+
module$build$src$core$serialization$blocks.appendInternal=appendInternal$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.save=save$$module$build$src$core$serialization$blocks;/*
|
|
1588
|
+
|
|
1589
|
+
Copyright 2026 Raspberry Pi Foundation
|
|
1590
|
+
SPDX-License-Identifier: Apache-2.0
|
|
1591
|
+
*/
|
|
1592
|
+
var longModifierNames$$module$build$src$core$utils$shortcut_formatting={Control:$.Msg$$module$build$src$core$msg.CONTROL_KEY,Meta:$.Msg$$module$build$src$core$msg.COMMAND_KEY,Alt:APPLE$$module$build$src$core$utils$useragent?$.Msg$$module$build$src$core$msg.OPTION_KEY:$.Msg$$module$build$src$core$msg.ALT_KEY},shortModifierNames$$module$build$src$core$utils$shortcut_formatting={Control:$.Msg$$module$build$src$core$msg.CONTROL_KEY,Meta:"\u2318",Alt:APPLE$$module$build$src$core$utils$useragent?"\u2325":
|
|
1593
|
+
$.Msg$$module$build$src$core$msg.ALT_KEY},modifierOrdering$$module$build$src$core$utils$shortcut_formatting=["Meta","Control","Alt","Shift"],module$build$src$core$utils$shortcut_formatting={};module$build$src$core$utils$shortcut_formatting.getShortcutKeysLong=getShortcutKeysLong$$module$build$src$core$utils$shortcut_formatting;module$build$src$core$utils$shortcut_formatting.getShortcutKeysShort=getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting;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,SHOWING_DROPDOWNDIV_SELECTOR$$module$build$src$core$dropdowndiv="blocklyShowingDropDownDiv",animateOutTimer$$module$build$src$core$dropdowndiv=null,onHide$$module$build$src$core$dropdowndiv=null,renderedClassName$$module$build$src$core$dropdowndiv=
|
|
1594
|
+
"",themeClassName$$module$build$src$core$dropdowndiv="",div$$module$build$src$core$dropdowndiv,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(){var a=
|
|
1595
|
+
getPageOffset$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv),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){var 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?
|
|
1596
|
+
getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>e.top?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,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=
|
|
1597
|
+
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,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};
|
|
1598
|
+
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;module$build$src$core$dropdowndiv.getOwner=getOwner$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.getPositionX=getPositionX$$module$build$src$core$dropdowndiv;
|
|
1599
|
+
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;module$build$src$core$dropdowndiv.isVisible=isVisible$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.repositionForWindowResize=repositionForWindowResize$$module$build$src$core$dropdowndiv;
|
|
1600
|
+
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;module$build$src$core$dropdowndiv.showPositionedByBlock=showPositionedByBlock$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.showPositionedByField=showPositionedByField$$module$build$src$core$dropdowndiv;var module$build$src$core$utils$string={};module$build$src$core$utils$string.commonWordPrefix=commonWordPrefix$$module$build$src$core$utils$string;module$build$src$core$utils$string.commonWordSuffix=commonWordSuffix$$module$build$src$core$utils$string;module$build$src$core$utils$string.isNumber=$.isNumber$$module$build$src$core$utils$string;module$build$src$core$utils$string.shortestStringLength=shortestStringLength$$module$build$src$core$utils$string;module$build$src$core$utils$string.wrap=$.wrap$$module$build$src$core$utils$string;var customTooltip$$module$build$src$core$tooltip=void 0,visible$$module$build$src$core$tooltip=!1,blocked$$module$build$src$core$tooltip=!1,LIMIT$$module$build$src$core$tooltip=50,mouseOutPid$$module$build$src$core$tooltip=0,showPid$$module$build$src$core$tooltip=0,lastX$$module$build$src$core$tooltip=0,lastY$$module$build$src$core$tooltip=0,element$$module$build$src$core$tooltip=null,poisonedElement$$module$build$src$core$tooltip=null,OFFSET_X$$module$build$src$core$tooltip=0,OFFSET_Y$$module$build$src$core$tooltip=
|
|
1549
1601
|
10,RADIUS_OK$$module$build$src$core$tooltip=10,HOVER_MS$$module$build$src$core$tooltip=750,MARGINS$$module$build$src$core$tooltip=5,containerDiv$$module$build$src$core$tooltip=null,module$build$src$core$tooltip={HOVER_MS:HOVER_MS$$module$build$src$core$tooltip,LIMIT:LIMIT$$module$build$src$core$tooltip,MARGINS:MARGINS$$module$build$src$core$tooltip,OFFSET_X:OFFSET_X$$module$build$src$core$tooltip,OFFSET_Y:OFFSET_Y$$module$build$src$core$tooltip,RADIUS_OK:RADIUS_OK$$module$build$src$core$tooltip};
|
|
1550
1602
|
module$build$src$core$tooltip.bindMouseEvents=bindMouseEvents$$module$build$src$core$tooltip;module$build$src$core$tooltip.block=block$$module$build$src$core$tooltip;module$build$src$core$tooltip.createDom=createDom$$module$build$src$core$tooltip;module$build$src$core$tooltip.display=display$$module$build$src$core$tooltip;module$build$src$core$tooltip.dispose=dispose$$module$build$src$core$tooltip;module$build$src$core$tooltip.getCustomTooltip=getCustomTooltip$$module$build$src$core$tooltip;
|
|
1551
1603
|
module$build$src$core$tooltip.getDiv=getDiv$$module$build$src$core$tooltip;module$build$src$core$tooltip.getTooltipOfObject=getTooltipOfObject$$module$build$src$core$tooltip;module$build$src$core$tooltip.hide=hide$$module$build$src$core$tooltip;module$build$src$core$tooltip.isVisible=isVisible$$module$build$src$core$tooltip;module$build$src$core$tooltip.setCustomTooltip=setCustomTooltip$$module$build$src$core$tooltip;module$build$src$core$tooltip.unbindMouseEvents=unbindMouseEvents$$module$build$src$core$tooltip;
|
|
@@ -1553,9 +1605,9 @@ module$build$src$core$tooltip.unblock=unblock$$module$build$src$core$tooltip;var
|
|
|
1553
1605
|
module$build$src$core$utils$colour.getHsvSaturation=getHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.getHsvValue=getHsvValue$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hexToRgb=hexToRgb$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hsvToHex=hsvToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hueToHex=hueToHex$$module$build$src$core$utils$colour;
|
|
1554
1606
|
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.ariaTypeName=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=
|
|
1555
1607
|
this.prefixField=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));a.ariaTypeName&&
|
|
1556
|
-
(this.ariaTypeName=a.ariaTypeName)}setSourceBlock(a){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=a;if(a.id.includes("_field"))throw Error(`Field ID indicator is contained in block ID. This may cause problems with focus: ${a.id}.`);
|
|
1557
|
-
|
|
1558
|
-
this.
|
|
1608
|
+
(this.ariaTypeName=a.ariaTypeName)}setSourceBlock(a){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=a;if(a.id.includes("_field"))throw Error(`Field ID indicator is contained in block ID. This may cause problems with focus: ${a.id}.`);}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_}getAriaTypeName(){return this.ariaTypeName||
|
|
1609
|
+
null}getAriaValue(){return this.getValue()==null?null:this.getText()}computeAriaLabel(a=!0){a=a?this.getAriaTypeName():null;var b=this.getAriaValue();if(b===null||b==="")b=$.Msg$$module$build$src$core$msg.FIELD_LABEL_EMPTY;return a?`${a}: ${b}`:b}init(){if(!this.fieldGroup_){this.fieldGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});this.isVisible()||(this.fieldGroup_.style.display="none");var a=this.sourceBlock_;a.getSvgRoot().appendChild(this.fieldGroup_);
|
|
1610
|
+
this.initView();this.updateEditable();this.setTooltip(this.tooltip);this.bindEvents_();this.initModel();this.applyColour();this.isFullBlockField()?this.id_=getNextUniqueId$$module$build$src$core$utils$idgenerator():this.id_=`${a.id}_field_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`;this.fieldGroup_.setAttribute("id",this.id_)}}initView(){this.createBorderRect_();this.createTextElement_();this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField")}initModel(){}isFullBlockField(){return!1}createBorderRect_(){this.borderRect_=
|
|
1559
1611
|
createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{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","aria-hidden":"true"},this.fieldGroup_);
|
|
1560
1612
|
this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)}bindEvents_(){var 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=
|
|
1561
1613
|
this.getValue();return a}saveState(a){a=this.saveLegacyState(Field$$module$build$src$core$field);return a!==null?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"',
|
|
@@ -1563,45 +1615,50 @@ this.getValue();return a}saveState(a){a=this.saveLegacyState(Field$$module$build
|
|
|
1563
1615
|
this.EDITABLE&&a&&b&&(this.enabled_&&b.isEditable()?(addClass$$module$build$src$core$utils$dom(a,"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()&&
|
|
1564
1616
|
this.showEditor_!==Field$$module$build$src$core$field.prototype.showEditor_}isClickableInFlyout(a){return!a}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){var 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_!==
|
|
1565
1617
|
a){this.visible_=a;var b=this.fieldGroup_;b&&(b.style.display=a?"block":"none")}}setValidator(a){this.validator_=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_}.`);
|
|
1566
|
-
return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()}showEditor(a){this.isClickable()&&this.showEditor_(a)}showEditor_(a){}repositionForWindowResize(){return!1}updateSize_(a){var b=this.getConstants();a=a!==void 0?a:this.
|
|
1567
|
-
|
|
1618
|
+
return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()}showEditor(a){this.isClickable()&&this.showEditor_(a)}showEditor_(a){}repositionForWindowResize(){return!1}updateSize_(a){var b=this.getConstants();a=a!==void 0?a:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var c=a*2,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=getTextWidth$$module$build$src$core$utils$dom(this.textElement_),c+=e);this.borderRect_&&
|
|
1619
|
+
(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_=new Size$$module$build$src$core$utils$size(c,d);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(((e=this.getSourceBlock())==null?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_&&
|
|
1568
1620
|
(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",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(){var a=this.getSourceBlock();
|
|
1569
|
-
if(!a)throw new UnattachedFieldError$$module$build$src$core$field;if(this.
|
|
1570
|
-
c.
|
|
1621
|
+
if(!a)throw new UnattachedFieldError$$module$build$src$core$field;if(this.borderRect_){var b=this.borderRect_.getBoundingClientRect();var c=getPageOffset$$module$build$src$core$utils$style(this.borderRect_);a=b.width;b=b.height}else{b=this.sourceBlock_.getHeightWidth();let d=a.workspace.scale;c=this.getAbsoluteXY_();a=(b.width+1)*d;b=(b.height+1)*d;GECKO$$module$build$src$core$utils$useragent?(c.x+=1.5*d,c.y+=1.5*d):(c.x-=.5*d,c.y-=.5*d)}return new Rect$$module$build$src$core$utils$rect(c.y,c.y+b,
|
|
1622
|
+
c.x,c.x+a)}onLocationChange(a){}getDisplayText_(){var a=this.getText();a.length>this.maxDisplayLength&&(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(){var a=this.getText_();return a!==null?String(a):String(this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0;this.constants_=null}forceRerender(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&
|
|
1571
1623
|
this.sourceBlock_.queueRender()}setValue(a,b=!0){if(a!==null){var c=$.getGroup$$module$build$src$core$events$utils();c||$.setGroup$$module$build$src$core$events$utils(!0);try{let k=this.doClassValidation_(a),l=this.processValidation(a,k,b);if(!(l instanceof Error)){var d,e=(d=this.getValidator())==null?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),
|
|
1572
1624
|
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,"field",this.name||null,h,f)),this.isDirty_&&this.forceRerender())}}}}finally{$.setGroup$$module$build$src$core$events$utils(c)}}}processValidation(a,b,c){return b===null?(this.doValueInvalid_(a,c),this.isDirty_&&this.forceRerender(),Error()):b===void 0?a:b}getValue(){return this.value_}doClassValidation_(a){return a===
|
|
1573
1625
|
null||a===void 0?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))&&a.setStartField(this)}setTooltip(a){a||a===""||(a=this.sourceBlock_);var b=this.getClickTarget_();b?b.tooltip=a:this.tooltip=a}getTooltip(){var 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_||
|
|
1574
1626
|
this.getSvgRoot()}getAbsoluteXY_(){return getPageOffset$$module$build$src$core$utils$style(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){var a=null,b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;var c=b.inputList;for(let d=0;d<b.inputList.length;d++){let 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.");
|
|
1575
|
-
return this.fieldGroup_}getFocusableTree(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;return a.workspace}onNodeFocus(){var a=this.getSourceBlock();a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren())}onNodeBlur(){}canBeFocused(){return!0}performAction(){this.showEditor()}
|
|
1576
|
-
|
|
1577
|
-
module$build$src$core$
|
|
1578
|
-
module$build$src$core$
|
|
1627
|
+
return this.fieldGroup_}getFocusableTree(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;return a.workspace}onNodeFocus(){var a=this.getSourceBlock();a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren())}onNodeBlur(){}canBeFocused(){return!0}performAction(){this.showEditor()}recomputeAriaContext(){try{var a=this.getFocusableElement()}catch(d){return!1}if(!a)return!1;var b;if((b=this.getSourceBlock())==null?0:b.isInFlyout){let d,e;
|
|
1628
|
+
if((d=this.getSourceBlock())==null||!d.getFullBlockField()||((e=this.getSourceBlock())==null?0:e.getParent()))return setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.HIDDEN,!0),!1;var c;b=((c=this.getSourceBlock())==null?void 0:c.getAriaRoleDescription())||$.Msg$$module$build$src$core$msg.BLOCK_LABEL_VALUE;setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,b)}clearState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.HIDDEN);
|
|
1629
|
+
setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.BUTTON);c=this.computeAriaLabel(!0);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,c);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");
|
|
1630
|
+
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,SHOWING_WIDGETDIV_SELECTOR$$module$build$src$core$widgetdiv="blocklyShowingWidgetDiv",
|
|
1631
|
+
module$build$src$core$widgetdiv={};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;
|
|
1632
|
+
module$build$src$core$widgetdiv.isVisible=isVisible$$module$build$src$core$widgetdiv;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;
|
|
1579
1633
|
module$build$src$core$contextmenu.getMenu=getMenu$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.hide=hide$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.setCurrentBlock=setCurrentBlock$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.show=show$$module$build$src$core$contextmenu;var ContextMenuRegistry$$module$build$src$core$contextmenu_registry=class{constructor(){this.registeredItems=new Map;this.reset()}reset(){this.registeredItems.clear()}register(a){if(this.registeredItems.has(a.id))throw Error('Menu item with ID "'+a.id+'" is already registered.');this.registeredItems.set(a.id,a)}unregister(a){if(!this.registeredItems.has(a))throw Error('Menu item with ID "'+a+'" not found.');this.registeredItems.delete(a)}getItem(a){var b;return(b=this.registeredItems.get(a))!=null?
|
|
1580
|
-
b:null}getContextMenuOptions(a,b){var c=[];for(let d of this.registeredItems.values()){if(d.scopeType){if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.BLOCK&&!a.block)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.COMMENT&&!a.comment)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.WORKSPACE&&!a.workspace)continue}let e;e={scope:a,weight:d.weight};let f,g,h=(g=(f=d).preconditionFn)==null?void 0:g.call(f,
|
|
1581
|
-
"hidden"){if(d.separator)e=Object.assign({},e,{separator:!0});else{let k=typeof d.displayText==="function"?d.displayText(a):d.displayText;e=Object.assign({},e,{text:k,callback:d.callback,enabled:h==="enabled"})}c.push(e)}}c.sort(function(d,e){return d.weight-e.weight});return c}};
|
|
1634
|
+
b:null}getContextMenuOptions(a,b){var c=[];for(let d of this.registeredItems.values()){if(d.scopeType){if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.BLOCK&&!a.block)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.COMMENT&&!a.comment)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.WORKSPACE&&!a.workspace)continue}let e;e={id:d.id,scope:a,weight:d.weight};let f,g,h=(g=(f=d).preconditionFn)==null?void 0:g.call(f,
|
|
1635
|
+
a,b);if(h!=="hidden"){if(d.separator)e=Object.assign({},e,{separator:!0});else{let k=typeof d.displayText==="function"?d.displayText(a):d.displayText;e=Object.assign({},e,{text:k,callback:d.callback,enabled:h==="enabled",associatedKeyboardShortcut:d.associatedKeyboardShortcut})}c.push(e)}}c.sort(function(d,e){return d.weight-e.weight});return c}};
|
|
1582
1636
|
(function(a){var b=a.ScopeType||(a.ScopeType={});b.BLOCK="block";b.WORKSPACE="workspace";b.COMMENT="comment";a.registry=new a})(ContextMenuRegistry$$module$build$src$core$contextmenu_registry||(ContextMenuRegistry$$module$build$src$core$contextmenu_registry={}));var ScopeType$$module$build$src$core$contextmenu_registry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType,module$build$src$core$contextmenu_registry={};
|
|
1583
1637
|
module$build$src$core$contextmenu_registry.ContextMenuRegistry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry;module$build$src$core$contextmenu_registry.ScopeType=ScopeType$$module$build$src$core$contextmenu_registry;var BLOCK$$module$build$src$core$layers=50,BUBBLE$$module$build$src$core$layers=100,module$build$src$core$layers={BLOCK:BLOCK$$module$build$src$core$layers,BUBBLE:BUBBLE$$module$build$src$core$layers};var CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy=class{constructor(a){this.comment=a;this.startLoc=null;this.workspace=a.workspace}isMovable(){return this.comment.isOwnMovable()&&!this.comment.isDeadOrDying()&&!this.workspace.isReadOnly()}startDrag(){this.fireDragStartEvent();this.startLoc=this.comment.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);var a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.comment);this.comment.setDragging(!0);
|
|
1584
1638
|
return this.comment}drag(a){this.comment.moveDuringDrag(a)}endDrag(){this.fireDragEndEvent();this.fireMoveEvent();var a;(a=this.workspace.getLayerManager())==null||a.moveOffDragLayer(this.comment,BLOCK$$module$build$src$core$layers);this.workspace.getAudioManager().play("drop");this.comment.setDragging(!1);this.comment.snapToGrid();this.workspace.setResizesEnabled(!0)}fireDragStartEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,
|
|
1585
1639
|
!0);fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,!1);fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.comment.isDeadOrDying()){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this.comment);a.setReason(["drag"]);a.oldCoordinate_=this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}revertDrag(){this.startLoc&&
|
|
1586
1640
|
this.comment.moveDuringDrag(this.startLoc)}},module$build$src$core$dragging$comment_drag_strategy={};module$build$src$core$dragging$comment_drag_strategy.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;var workspaceToDragDelta$$module$build$src$core$utils$drag=new WeakMap,module$build$src$core$utils$drag={};module$build$src$core$utils$drag.move=move$$module$build$src$core$utils$drag;module$build$src$core$utils$drag.start=start$$module$build$src$core$utils$drag;var CommentBarButton$$module$build$src$core$comments$comment_bar_button=class{constructor(a,b,c,d){this.id=a;this.workspace=b;this.container=c;this.commentView=d}isVisible(){return this.icon.checkVisibility()}getCommentView(){return this.commentView}getSize(a=!1){var b=this.icon.getBBox();b=Rect$$module$build$src$core$utils$rect.from(b);a&&(a=this.getMargin(),b.left-=a,b.top-=a,b.bottom+=a,b.right+=a);return b}getMargin(){return(this.container.getBBox().height-this.icon.getBBox().height)/2}getFocusableElement(){return this.icon}getFocusableTree(){return this.workspace}onNodeFocus(){var a=
|
|
1587
|
-
this.getCommentView(),b=a.getRelativeToSurfaceXY(),c=a.getSize();b=new Rect$$module$build$src$core$utils$rect(b.y,b.y+c.height,b.x,b.x+c.width);a.workspace.scrollBoundsIntoView(b)}onNodeBlur(){}canBeFocused(){return this.isVisible()}
|
|
1588
|
-
{
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
"
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
{COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
{"class":"
|
|
1603
|
-
|
|
1604
|
-
|
|
1641
|
+
this.getCommentView(),b=a.getRelativeToSurfaceXY(),c=a.getSize();b=new Rect$$module$build$src$core$utils$rect(b.y,b.y+c.height,b.x,b.x+c.width);a.workspace.scrollBoundsIntoView(b)}onNodeBlur(){}canBeFocused(){return this.isVisible()}recomputeAriaContext(){if(this.icon){setRole$$module$build$src$core$utils$aria(this.icon,Role$$module$build$src$core$utils$aria.BUTTON);var a=this.getAriaLabel();setState$$module$build$src$core$utils$aria(this.icon,State$$module$build$src$core$utils$aria.LABEL,a||$.Msg$$module$build$src$core$msg.ARIA_LABEL_BUTTON)}}getAriaLabel(){return null}},
|
|
1642
|
+
module$build$src$core$comments$comment_bar_button={};module$build$src$core$comments$comment_bar_button.CommentBarButton=CommentBarButton$$module$build$src$core$comments$comment_bar_button;var COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button="_collapse_bar_button",CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button=class extends CommentBarButton$$module$build$src$core$comments$comment_bar_button{constructor(a,b,c,d){super(a,b,c,d);this.id=a;this.workspace=b;this.container=c;this.commentView=d;this.icon=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,
|
|
1643
|
+
{"class":"blocklyFoldoutIcon",href:`${this.workspace.options.pathToMedia}foldout-icon.svg`,id:`${this.id}${COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button}`},this.container);this.recomputeAriaContext();this.bindId=conditionalBind$$module$build$src$core$browser_events(this.icon,"pointerdown",this,this.performAction.bind(this))}dispose(){unbind$$module$build$src$core$browser_events(this.bindId)}reposition(){var a=this.getMargin();this.icon.setAttribute("y",
|
|
1644
|
+
`${a}`);this.icon.setAttribute("x",`${a}`)}performAction(a){clearTouchIdentifier$$module$build$src$core$touch();this.getCommentView().bringToFront();a&&a instanceof PointerEvent&&isRightButton$$module$build$src$core$browser_events(a)?a.stopPropagation():(this.getCommentView().setCollapsed(!this.getCommentView().isCollapsed()),this.recomputeAriaContext(),this.workspace.hideChaff(),a==null||a.stopPropagation())}getAriaLabel(){return this.getCommentView().isCollapsed()?$.Msg$$module$build$src$core$msg.ARIA_LABEL_COMMENT_EXPAND:
|
|
1645
|
+
$.Msg$$module$build$src$core$msg.ARIA_LABEL_COMMENT_COLLAPSE}},module$build$src$core$comments$collapse_comment_bar_button={COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER:COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button};module$build$src$core$comments$collapse_comment_bar_button.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;var COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor="_comment_textarea_",CommentEditor$$module$build$src$core$comments$comment_editor=class{constructor(a,b,c){this.workspace=a;this.onFinishEditing=c;this.textChangeListeners=[];this.text="";this.foreignObject=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{"class":"blocklyCommentForeignObject"});a=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");
|
|
1646
|
+
a.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);a.className="blocklyMinimalBody";this.textArea=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");this.textArea.setAttribute("tabindex","-1");this.textArea.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");setRole$$module$build$src$core$utils$aria(this.textArea,Role$$module$build$src$core$utils$aria.TEXTBOX);this.textArea.setAttribute("placeholder",$.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT);
|
|
1647
|
+
addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyCommentText");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyTextarea");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyText");a.appendChild(this.textArea);this.foreignObject.appendChild(a);this.id=b+COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor;this.textArea.setAttribute("id",this.id);conditionalBind$$module$build$src$core$browser_events(this.textArea,"change",this,this.onTextChange);
|
|
1648
|
+
conditionalBind$$module$build$src$core$browser_events(this.textArea,"pointerdown",this,d=>{d.stopPropagation();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this);clearTouchIdentifier$$module$build$src$core$touch()});conditionalBind$$module$build$src$core$browser_events(this.textArea,"wheel",this,d=>{d.stopPropagation()},!1,{passive:!0});conditionalBind$$module$build$src$core$browser_events(this.textArea,"keydown",this,this.handleKeyDown)}getDom(){return this.foreignObject}getText(){return this.text}setText(a){this.textArea.value=
|
|
1649
|
+
a;this.onTextChange()}setParent(a){this.parent=a}getParent(){return this.parent}onTextChange(){var a=this.text;this.text=this.textArea.value;for(let b=this.textChangeListeners.length-1;b>=0;b--)this.textChangeListeners[b](a,this.text)}handleKeyDown(a){if(a.key==="Escape"||a.key==="Enter"&&(a.ctrlKey||a.metaKey)){if(this.onFinishEditing)this.onFinishEditing();a.stopPropagation()}}addTextChangeListener(a){this.textChangeListeners.push(a)}removeTextChangeListener(a){this.textChangeListeners.splice(this.textChangeListeners.indexOf(a),
|
|
1650
|
+
1)}setPlaceholderText(a){this.textArea.placeholder=a}setEditable(a){a?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","true")}updateSize(a,b){this.foreignObject.setAttribute("height",`${a.height-b.height}`);this.foreignObject.setAttribute("width",`${a.width}`);this.foreignObject.setAttribute("y",`${b.height}`);this.workspace.RTL&&this.foreignObject.setAttribute("x",`${-a.width}`)}getFocusableElement(){return this.textArea}getFocusableTree(){return this.workspace}onNodeFocus(){var a=
|
|
1651
|
+
Rect$$module$build$src$core$utils$rect.from(this.foreignObject.getBoundingClientRect());this.workspace.scrollBoundsIntoView(Rect$$module$build$src$core$utils$rect.createFromPoint(screenToWsCoordinates$$module$build$src$core$utils$svg_math(this.workspace,a.getOrigin()),a.getWidth(),a.getHeight()))}onNodeBlur(){}canBeFocused(){return this.id?!0:!1}},module$build$src$core$comments$comment_editor={COMMENT_EDITOR_FOCUS_IDENTIFIER:COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor};
|
|
1652
|
+
module$build$src$core$comments$comment_editor.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;var COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button="_delete_bar_button",DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button=class extends CommentBarButton$$module$build$src$core$comments$comment_bar_button{constructor(a,b,c,d){super(a,b,c,d);this.id=a;this.workspace=b;this.container=c;this.commentView=d;this.icon=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyDeleteIcon",
|
|
1653
|
+
href:`${this.workspace.options.pathToMedia}delete-icon.svg`,id:`${this.id}${COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button}`},c);this.recomputeAriaContext();this.bindId=conditionalBind$$module$build$src$core$browser_events(this.icon,"pointerdown",this,this.performAction.bind(this))}dispose(){unbind$$module$build$src$core$browser_events(this.bindId)}reposition(){var a=this.getMargin();this.icon.setAttribute("x","0");var b=this.container.getBBox();
|
|
1654
|
+
this.icon.setAttribute("y",`${a}`);this.icon.setAttribute("x",`${b.width-this.getSize(!0).getWidth()}`)}performAction(a){clearTouchIdentifier$$module$build$src$core$touch();a&&a instanceof PointerEvent&&isRightButton$$module$build$src$core$browser_events(a)?a.stopPropagation():(this.getCommentView().dispose(),a==null||a.stopPropagation(),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.workspace),this.workspace.getAudioManager().play("delete"))}getAriaLabel(){return $.Msg$$module$build$src$core$msg.REMOVE_COMMENT}},
|
|
1655
|
+
module$build$src$core$comments$delete_comment_bar_button={COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER:COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button};module$build$src$core$comments$delete_comment_bar_button.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;var CommentView$$module$build$src$core$comments$comment_view=class{constructor(a,b){this.workspace=a;this.commentId=b;this.collapsed=!1;this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.sizeChangeListeners=[];this.disposeListeners=[];this.collapseChangeListeners=[];this.resizePointerMoveListener=this.resizePointerUpListener=null;this.disposed=this.disposing=!1;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
1656
|
+
{"class":"blocklyComment blocklyEditable blocklyDraggable"});setRole$$module$build$src$core$utils$aria(this.svgRoot,Role$$module$build$src$core$utils$aria.BUTTON);setState$$module$build$src$core$utils$aria(this.svgRoot,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,$.Msg$$module$build$src$core$msg.ARIA_LABEL_COMMENT);this.highlightRect=this.createHighlightRect(this.svgRoot);({topBarGroup:this.topBarGroup,topBarBackground:this.topBarBackground,deleteButton:this.deleteButton,foldoutButton:this.foldoutButton,
|
|
1657
|
+
textPreview:this.textPreview,textPreviewNode:this.textPreviewNode}=this.createTopBar(this.svgRoot));this.commentEditor=this.createTextArea();setState$$module$build$src$core$utils$aria(this.svgRoot,State$$module$build$src$core$utils$aria.LABELLEDBY,this.commentEditor.getFocusableElement().id);this.resizeHandle=this.createResizeHandle(this.svgRoot,a);var c;(c=a.getLayerManager())==null||c.append(this,BLOCK$$module$build$src$core$layers);this.size=CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize;
|
|
1658
|
+
this.setSizeWithoutFiringEvents(this.size);this.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(0,0))}createHighlightRect(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentHighlight"},a)}createTopBar(a){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyCommentTopbar"},a);var b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
1659
|
+
{"class":"blocklyCommentTopbarBackground"},a),c=new DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button(this.commentId,this.workspace,a,this),d=new CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button(this.commentId,this.workspace,a,this);this.addDisposeListener(()=>{c.dispose();d.dispose()});var e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyCommentPreview blocklyCommentText blocklyText"},
|
|
1660
|
+
a),f=document.createTextNode("");e.appendChild(f);return{topBarGroup:a,topBarBackground:b,deleteButton:c,foldoutButton:d,textPreview:e,textPreviewNode:f}}createTextArea(){var a=new CommentEditor$$module$build$src$core$comments$comment_editor(this.workspace,this.commentId,()=>this.svgRoot.focus());this.svgRoot.appendChild(a.getDom());a.addTextChangeListener((b,c)=>{this.updateTextPreview(c);this.setSize(this.size)});return a}getEditorFocusableNode(){return this.commentEditor}createResizeHandle(a,b){a=
|
|
1661
|
+
createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}getSvgRoot(){return this.svgRoot}getSize(){return this.collapsed?this.topBarBackground.getBBox():this.size}setSizeWithoutFiringEvents(a){var b=this.topBarBackground.getBBox(),c=this.textPreview.getBBox(),d=this.resizeHandle.getBBox();
|
|
1605
1662
|
this.size=a=Size$$module$build$src$core$utils$size.max(a,this.calcMinSize(b));this.svgRoot.setAttribute("height",`${a.height}`);this.svgRoot.setAttribute("width",`${a.width}`);this.updateHighlightRect(a);this.updateTopBarSize(a);this.commentEditor.updateSize(a,b);this.deleteButton.reposition();this.foldoutButton.reposition();this.updateTextPreviewSize(a,b,c);this.updateResizeHandlePosition(a,d)}setSize(a){var b=this.preResizeSize||this.size;this.setSizeWithoutFiringEvents(a);this.onSizeChange(b,this.size)}calcMinSize(a){var b;
|
|
1606
1663
|
this.updateTextPreview((b=this.commentEditor.getText())!=null?b:"");var c=b=getTextWidth$$module$build$src$core$utils$dom(this.textPreview);this.foldoutButton.isVisible()?c+=this.foldoutButton.getSize(!0).getWidth():b&&(c+=4);this.deleteButton.isVisible()?c+=this.deleteButton.getSize(!0).getWidth():b&&(c+=4);return new Size$$module$build$src$core$utils$size(c,a.height+20)}updateHighlightRect(a){this.highlightRect.setAttribute("height",`${a.height}`);this.highlightRect.setAttribute("width",`${a.width}`);
|
|
1607
1664
|
this.workspace.RTL&&this.highlightRect.setAttribute("x",`${-a.width}`)}updateTopBarSize(a){this.topBarBackground.setAttribute("width",`${a.width}`)}updateTextPreviewSize(a,b,c){b=(b.height-c.height)/2;var d=this.foldoutButton.getSize(!0),e=this.deleteButton.getSize(!0);a=a.width-d.getWidth()-e.getWidth();this.textPreview.setAttribute("x",`${(this.workspace.RTL?-1:1)*d.getWidth()}`);this.textPreview.setAttribute("y",`${b+c.height/2}`);this.textPreview.setAttribute("width",`${a}`)}updateResizeHandlePosition(a,
|
|
@@ -1618,60 +1675,54 @@ fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$
|
|
|
1618
1675
|
a,b))}fireCollapseEvent(a){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.COMMENT_COLLAPSE))(this,a))}setText(a){var b=this.text;this.text=a;this.fireChangeEvent(b,a)}getText(){return this.text}setSize(a){var b=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_RESIZE))(this);this.size=a;b.recordCurrentSizeAsNewSize();fire$$module$build$src$core$events$utils(b)}getSize(){return this.size}setCollapsed(a){this.collapsed=
|
|
1619
1676
|
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()&&!this.workspace.isFlyout}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnDeletable(){return this.deletable}moveTo(a,
|
|
1620
1677
|
b){var 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.clone()}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||this.disposed}},module$build$src$core$comments$workspace_comment=
|
|
1621
|
-
{};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.id);this.view.
|
|
1622
|
-
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)}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));this.view.addOnCollapseListener(()=>void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>
|
|
1623
|
-
this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){var a=this.getRelativeToSurfaceXY(),b,c,d=(c=(b=this.view)==null?void 0:b.getSize())!=null?c:this.getSize();this.workspace.RTL?
|
|
1624
|
-
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(),"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
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;
|
|
1678
|
+
{};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.id);this.view.getEditorFocusableNode().setParent(this);this.view.setSize(this.getSize());this.view.setEditable(this.isEditable());
|
|
1679
|
+
this.view.getSvgRoot().setAttribute("data-id",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)}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));this.view.addOnCollapseListener(()=>void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>
|
|
1680
|
+
{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(){var a=this.getRelativeToSurfaceXY(),b,c,d=(c=(b=this.view)==null?void 0:b.getSize())!=null?c:this.getSize();this.workspace.RTL?
|
|
1681
|
+
(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){var 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(),"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
1682
|
+
"blocklyDragging")}dispose(){this.disposing=!0;var 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){var b=this.workspace.getGesture(a);b&&(b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):
|
|
1683
|
+
removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isCopyable(){return this.isOwnMovable()&&this.isOwnDeletable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(){return 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(),
|
|
1684
|
+
"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,saveIds:!1})}}showContextMenu(a){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,focusedNode:this},a);var c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
|
|
1685
|
+
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(a!=null&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}getEditorFocusableNode(){return this.view.getEditorFocusableNode()}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
|
|
1686
|
+
var a;(a=this.getSvgRoot().parentElement)==null||a.appendChild(this.getSvgRoot());this.workspace.scrollBoundsIntoView(this.getBoundingRectangle())}onNodeBlur(){this.unselect()}canBeFocused(){return!0}performAction(){this.setCollapsed(!1);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.getEditorFocusableNode())}},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;
|
|
1630
1687
|
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;
|
|
1631
1688
|
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 TEST_ONLY$$module$build$src$core$field_registry={fromJsonInternal:fromJsonInternal$$module$build$src$core$field_registry},module$build$src$core$field_registry={TEST_ONLY:TEST_ONLY$$module$build$src$core$field_registry};module$build$src$core$field_registry.fromJson=$.fromJson$$module$build$src$core$field_registry;module$build$src$core$field_registry.register=register$$module$build$src$core$field_registry;module$build$src$core$field_registry.unregister=unregister$$module$build$src$core$field_registry;var FieldDropdown$$module$build$src$core$field_dropdown=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.svgArrow=this.arrow=this.imageElement=this.menu_=this.selectedMenuItem=null;this.SERIALIZABLE=!0;this.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null;this.isInitialized=!1;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(this.setOptions(a),c&&this.configure_(c),b&&this.setValidator(b))}fromXml(a){this.isOptionListDynamic()&&
|
|
1632
1689
|
this.getOptions(!1);this.setValue(a.textContent)}loadState(a){this.loadLegacyState(FieldDropdown$$module$build$src$core$field_dropdown,a)||(this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(a))}initView(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?
|
|
1633
|
-
this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&addClass$$module$build$src$core$utils$dom(this.borderRect_,"blocklyDropdownRect");this.fieldGroup_&&(addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField"),addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyDropdownField"));this.recomputeAriaContext();this.isInitialized=!0}
|
|
1634
|
-
!((a=this.getSourceBlock())==null?0:a.isShadow())}createTextArrow_(){this.arrow=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{},this.textElement_);var a;this.arrow.appendChild(document.createTextNode(((a=this.getSourceBlock())==null?0:a.RTL)?FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR+" ":" "+FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR));
|
|
1635
|
-
"central");var b;((b=this.getSourceBlock())==null?0:b.RTL)?this.getTextElement().insertBefore(this.arrow,this.textContent_):this.getTextElement().appendChild(this.arrow)}createSVGArrow_(){this.svgArrow=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+
|
|
1636
|
-
"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}showEditor_(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.dropdownCreate();this.menu_&&(this.menu_.openingCoords=a&&typeof a.clientX==="number"?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):null,clearContent$$module$build$src$core$dropdowndiv(),a=this.menu_.render(getContentDiv$$module$build$src$core$dropdowndiv()),
|
|
1637
|
-
"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV&&(b=b.getColour(),a=this.sourceBlock_.getColourTertiary(),setColour$$module$build$src$core$dropdowndiv(b,a)),showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this)),getContentDiv$$module$build$src$core$dropdowndiv().style.height=`${this.menu_.getSize().height}px`,this.menu_.focus(),this.selectedMenuItem&&this.menu_.setHighlighted(this.selectedMenuItem),
|
|
1638
|
-
State$$module$build$src$core$utils$aria.EXPANDED,!0))}dropdownCreate(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;var b=new Menu$$module$build$src$core$menu;b.setRole(Role$$module$build$src$core$utils$aria.LISTBOX);this.menu_=b;setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.CONTROLS,this.menu_.getId());
|
|
1639
|
-
c[f];if(d===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR){b.addChild(new MenuSeparator$$module$build$src$core$menu_separator);continue}let [g,h]=d;d=this.computeOptionAriaLabel(d,f);if(isImageProperties$$module$build$src$core$field_dropdown(g)){var e=new Image(g.width,g.height);e.src=g.src;e.alt=g.alt}else e=g;d=new MenuItem$$module$build$src$core$menuitem(e,h,d);d.setRole(Role$$module$build$src$core$utils$aria.OPTION);
|
|
1640
|
-
this.value_);h===this.value_&&(this.selectedMenuItem=d);d.onAction(this.handleMenuActionEvent,this)}}dropdownDispose_(){this.menu_&&this.menu_.dispose();this.selectedMenuItem=this.menu_=null;this.applyColour();setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.EXPANDED,!1)}handleMenuActionEvent(a){hideIfOwner$$module$build$src$core$dropdowndiv(this,!0);this.onItemSelected_(this.menu_,
|
|
1641
|
-
"function"}getOptions(a){if(!this.menuGenerator_)throw TypeError("A menu generator was never defined.");if(Array.isArray(this.menuGenerator_))return this.menuGenerator_;if(a&&this.generatedOptions)return this.generatedOptions;this.generatedOptions=this.menuGenerator_();this.validateOptions(this.generatedOptions);return this.generatedOptions}setOptions(a){Array.isArray(a)?(this.validateOptions(a),
|
|
1642
|
-
null):this.menuGenerator_=a;this.selectedOption=this.getOptions(!1)[0];this.setValue(this.selectedOption[1])}doClassValidation_(a){return this.getOptions(!0).some(b=>b[1]===a)?a:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+a),null)}doValueUpdate_(a){super.doValueUpdate_(a);
|
|
1643
|
-
this.recomputeAriaContext()}applyColour(){var a=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",a.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",a.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent"));a&&this.arrow&&(a.isShadow()?this.arrow.style.fill=a.getColourSecondary():this.arrow.style.fill=a.getColour())}render_(){this.getTextContent().nodeValue=
|
|
1644
|
-
isImageProperties$$module$build$src$core$field_dropdown(a)?this.renderSelectedImage(a):this.renderSelectedText();this.positionBorderRect_()}renderSelectedImage(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.imageElement.style.display="";this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.src);this.imageElement.setAttribute("height",
|
|
1645
|
-
var c=Number(a.height);a=Number(a.width);var d=!!this.borderRect_,e=Math.max(d?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,c+FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING);d=d?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var f=this.svgArrow?this.positionSVGArrow(a+d,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):getTextWidth$$module$build$src$core$utils$dom(this.arrow);this.size_=
|
|
1646
|
-
|
|
1647
|
-
0,this.getConstants().FIELD_TEXT_HEIGHT);var c=getTextWidth$$module$build$src$core$utils$dom(this.getTextElement());b=b?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var d=0;this.svgArrow&&(d=this.positionSVGArrow(c+b,a/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_=new Size$$module$build$src$core$utils$size(c+d+b*2,a);this.positionTextElement_(b,c)}positionSVGArrow(a,b){if(!this.svgArrow)return 0;
|
|
1648
|
-
var d=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,f=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow.setAttribute("transform","translate("+(c.RTL?d:a+e)+","+b+")");return f+e}getText_(){if(!this.selectedOption)return null;var a=this.selectedOption[0];if(isImageProperties$$module$build$src$core$field_dropdown(a))return a.alt;
|
|
1649
|
-
((b=a.ariaLabel)!=null?b:a.innerText)}if(typeof a==="string")return a;console.warn("Can't get text for existing dropdown option. If you're using HTMLElement dropdown options in node, ensure you're using jsdom-global or similar.");return null}static fromJson(a){if(!a.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");
|
|
1650
|
-
{if(g===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)return b=!0,g;var [h,k,l]=g;if(typeof h==="string")return g=[replaceMessageReferences$$module$build$src$core$utils$parsing(h),k],l&&g.push(l),g;b=!0;g=[isImageProperties$$module$build$src$core$field_dropdown(h)?Object.assign({},h,{alt:replaceMessageReferences$$module$build$src$core$utils$parsing(h.alt)}):
|
|
1651
|
-
a=commonWordPrefix$$module$build$src$core$utils$string(d,e);var f=commonWordSuffix$$module$build$src$core$utils$string(d,e);if(!a&&!f||e<=a+f)return{options:c};e=a?d[0].substring(0,a-1):void 0;d=f?d[0].substr(1-f):void 0;return{options:this.applyTrim(c,a,f),prefix:e,suffix:d}}applyTrim(a,b,
|
|
1652
|
-
var b=!1;for(let c=0;c<a.length;c++){let d=a[c];Array.isArray(d)||d===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR?typeof d[1]!=="string"?(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option id must be a string.
|
|
1690
|
+
this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&addClass$$module$build$src$core$utils$dom(this.borderRect_,"blocklyDropdownRect");this.fieldGroup_&&(addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField"),addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyDropdownField"));this.recomputeAriaContext();this.isInitialized=!0}isFullBlockField(){var a;return!this.shouldAddBorderRect_()&&!((a=this.getSourceBlock())==null||!a.isSimpleReporter())}shouldAddBorderRect_(){var a;
|
|
1691
|
+
return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!((a=this.getSourceBlock())==null?0:a.isShadow())}createTextArrow_(){this.arrow=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{},this.textElement_);var a;this.arrow.appendChild(document.createTextNode(((a=this.getSourceBlock())==null?0:a.RTL)?FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR+" ":" "+FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR));
|
|
1692
|
+
this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.arrow.setAttribute("dominant-baseline","central");var b;((b=this.getSourceBlock())==null?0:b.RTL)?this.getTextElement().insertBefore(this.arrow,this.textContent_):this.getTextElement().appendChild(this.arrow)}createSVGArrow_(){this.svgArrow=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+
|
|
1693
|
+
"px"},this.fieldGroup_);this.svgArrow.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}showEditor_(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.dropdownCreate();this.menu_&&(this.menu_.openingCoords=a&&typeof a.clientX==="number"?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):null,clearContent$$module$build$src$core$dropdowndiv(),a=this.menu_.render(getContentDiv$$module$build$src$core$dropdowndiv()),
|
|
1694
|
+
addClass$$module$build$src$core$utils$dom(a,"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV&&(b=b.getColour(),a=this.sourceBlock_.getColourTertiary(),setColour$$module$build$src$core$dropdowndiv(b,a)),showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this)),getContentDiv$$module$build$src$core$dropdowndiv().style.height=`${this.menu_.getSize().height}px`,this.menu_.focus(),this.selectedMenuItem&&this.menu_.setHighlighted(this.selectedMenuItem),
|
|
1695
|
+
this.applyColour(),setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.EXPANDED,!0))}dropdownCreate(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;var b=new Menu$$module$build$src$core$menu;b.setRole(Role$$module$build$src$core$utils$aria.LISTBOX);this.menu_=b;setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.CONTROLS,this.menu_.getId());
|
|
1696
|
+
var c=this.getOptions(!1);this.selectedMenuItem=null;for(let f=0;f<c.length;f++){var d=c[f];if(d===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR){b.addChild(new MenuSeparator$$module$build$src$core$menu_separator);continue}let [g,h]=d;d=this.computeOptionAriaLabel(d,f);if(isImageProperties$$module$build$src$core$field_dropdown(g)){var e=new Image(g.width,g.height);e.src=g.src;e.alt=g.alt}else e=g;d=new MenuItem$$module$build$src$core$menuitem(e,h,d);d.setRole(Role$$module$build$src$core$utils$aria.OPTION);
|
|
1697
|
+
d.setRightToLeft(a.RTL);d.setCheckable(!0);b.addChild(d);d.setChecked(h===this.value_);h===this.value_&&(this.selectedMenuItem=d);d.onAction(this.handleMenuActionEvent,this)}}dropdownDispose_(){this.menu_&&this.menu_.dispose();this.selectedMenuItem=this.menu_=null;this.applyColour();setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.EXPANDED,!1)}handleMenuActionEvent(a){hideIfOwner$$module$build$src$core$dropdowndiv(this,!0);this.onItemSelected_(this.menu_,
|
|
1698
|
+
a)}onItemSelected_(a,b){this.setValue(b.getValue())}isOptionListDynamic(){return typeof this.menuGenerator_==="function"}getOptions(a){if(!this.menuGenerator_)throw TypeError("A menu generator was never defined.");if(Array.isArray(this.menuGenerator_))return this.menuGenerator_;if(a&&this.generatedOptions)return this.generatedOptions;this.generatedOptions=this.menuGenerator_();this.validateOptions(this.generatedOptions);return this.generatedOptions}setOptions(a){Array.isArray(a)?(this.validateOptions(a),
|
|
1699
|
+
a=this.trimOptions(a),this.menuGenerator_=a.options,this.prefixField=a.prefix||null,this.suffixField=a.suffix||null):this.menuGenerator_=a;this.selectedOption=this.getOptions(!1)[0];this.setValue(this.selectedOption[1])}doClassValidation_(a){return this.getOptions(!0).some(b=>b[1]===a)?a:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+a),null)}doValueUpdate_(a){super.doValueUpdate_(a);
|
|
1700
|
+
a=this.getOptions(!0);for(let b=0,c;c=a[b];b++)c[1]===this.value_&&(this.selectedOption=c);this.isInitialized&&this.recomputeAriaContext()}applyColour(){var a=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",a.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",a.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent"));a&&this.arrow&&(a.isShadow()?this.arrow.style.fill=a.getColourSecondary():this.arrow.style.fill=a.getColour())}render_(){this.getTextContent().nodeValue=
|
|
1701
|
+
"";this.imageElement.style.display="none";var a=this.selectedOption&&this.selectedOption[0];isImageProperties$$module$build$src$core$field_dropdown(a)?this.renderSelectedImage(a):this.renderSelectedText();this.positionBorderRect_()}renderSelectedImage(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.imageElement.style.display="";this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.src);this.imageElement.setAttribute("height",
|
|
1702
|
+
String(a.height));this.imageElement.setAttribute("width",String(a.width));var c=Number(a.height);a=Number(a.width);var d=!!this.borderRect_,e=Math.max(d?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,c+FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING);d=d?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var f=this.svgArrow?this.positionSVGArrow(a+d,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):getTextWidth$$module$build$src$core$utils$dom(this.arrow);this.size_=
|
|
1703
|
+
new Size$$module$build$src$core$utils$size(a+f+d*2,e);var g=0;b.RTL?this.imageElement.setAttribute("x",`${d+f}`):(g=a+f,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${d}`));this.imageElement.setAttribute("y",String(e/2-c/2));this.positionTextElement_(g+d,a+f)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var a=this.getTextElement();addClass$$module$build$src$core$utils$dom(a,"blocklyDropdownText");a.setAttribute("text-anchor",
|
|
1704
|
+
"start");var b=!!this.borderRect_;a=Math.max(b?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);var c=getTextWidth$$module$build$src$core$utils$dom(this.getTextElement());b=b?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var d=0;this.svgArrow&&(d=this.positionSVGArrow(c+b,a/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_=new Size$$module$build$src$core$utils$size(c+d+b*2,a);this.positionTextElement_(b,c)}positionSVGArrow(a,b){if(!this.svgArrow)return 0;
|
|
1705
|
+
var c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;var d=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,f=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow.setAttribute("transform","translate("+(c.RTL?d:a+e)+","+b+")");return f+e}getText_(){if(!this.selectedOption)return null;var a=this.selectedOption[0];if(isImageProperties$$module$build$src$core$field_dropdown(a))return a.alt;
|
|
1706
|
+
if(typeof HTMLElement!=="undefined"&&a instanceof HTMLElement){let b;return a.title||((b=a.ariaLabel)!=null?b:a.innerText)}if(typeof a==="string")return a;console.warn("Can't get text for existing dropdown option. If you're using HTMLElement dropdown options in node, ensure you're using jsdom-global or similar.");return null}static fromJson(a){if(!a.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");
|
|
1707
|
+
return new this(a.options,void 0,a)}trimOptions(a){var b=!1,c=a.map(g=>{if(g===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)return b=!0,g;var [h,k,l]=g;if(typeof h==="string")return g=[replaceMessageReferences$$module$build$src$core$utils$parsing(h),k],l&&g.push(replaceMessageReferences$$module$build$src$core$utils$parsing(l)),g;b=!0;g=[isImageProperties$$module$build$src$core$field_dropdown(h)?Object.assign({},h,{alt:replaceMessageReferences$$module$build$src$core$utils$parsing(h.alt)}):
|
|
1708
|
+
h,k];l&&g.push(replaceMessageReferences$$module$build$src$core$utils$parsing(l));return g});if(b||a.length<2)return{options:c};var d=c.map(([g])=>g),e=shortestStringLength$$module$build$src$core$utils$string(d);a=commonWordPrefix$$module$build$src$core$utils$string(d,e);var f=commonWordSuffix$$module$build$src$core$utils$string(d,e);if(!a&&!f||e<=a+f)return{options:c};e=a?d[0].substring(0,a-1):void 0;d=f?d[0].substr(1-f):void 0;return{options:this.applyTrim(c,a,f),prefix:e,suffix:d}}applyTrim(a,b,
|
|
1709
|
+
c){return a.map(([d,e,f])=>{d=d.substring(b,d.length-c);return f!==void 0?[d,e,f]:[d,e]})}validateOptions(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");var b=!1;for(let c=0;c<a.length;c++){let d=a[c];Array.isArray(d)||d===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR?typeof d[1]!=="string"?(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option id must be a string.
|
|
1653
1710
|
Found ${d[1]} in: ${d}`)):!d[0]||typeof d[0]==="string"||isImageProperties$$module$build$src$core$field_dropdown(d[0])||typeof HTMLElement!=="undefined"&&d[0]instanceof HTMLElement?d[2]&&typeof d[2]!=="string"&&(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option ARIA label must be a string.
|
|
1654
1711
|
Found ${d[2]} in: ${d}`)):(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
1655
1712
|
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
|
|
1656
1713
|
the string literal 'separator'. Found: ${d}`))}if(b)throw TypeError("Found invalid FieldDropdown options.");}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_DROPDOWN}getAriaValue(){return this.getSelectedAriaLabel()||this.getText()||$.Msg$$module$build$src$core$msg.FIELD_LABEL_EMPTY}getSelectedAriaLabel(){if(!this.selectedOption)return null;var a=this.selectedOption;a=this.computeOptionAriaLabel(a,this.getOptions(!1).indexOf(a));return typeof a===
|
|
1657
|
-
"string"?a:null}recomputeAriaContext(){var a=this.getFocusableElement()
|
|
1658
|
-
|
|
1659
|
-
"
|
|
1660
|
-
FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING=FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET*2;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 KeyCodes$$module$build$src$core$utils$keycodes;
|
|
1714
|
+
"string"?a:null}recomputeAriaContext(){if(!super.recomputeAriaContext())return!1;var a=this.getFocusableElement(),b=this.computeAriaLabel(!0);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,b);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.HASPOPUP,"listbox");setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.EXPANDED,!!this.menu_);return!0}computeOptionAriaLabel(a,b){if(a===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)return"";
|
|
1715
|
+
var [c,,d]=a;if(typeof d==="string"&&d.trim())return d;a=null;if(isImageProperties$$module$build$src$core$field_dropdown(c)){let e;a=(e=c.ariaLabel)!=null?e:c.alt}else if(typeof HTMLElement!=="undefined"&&c instanceof HTMLElement){let e;a=(e=c.ariaLabel)!=null?e:c.title||c.innerText}else typeof c==="string"&&(a=c);return a&&a.trim()?a:$.Msg$$module$build$src$core$msg.FIELD_LABEL_OPTION_INDEX.replace("%1",String(b+1))}};FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR="separator";
|
|
1716
|
+
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=FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET*2;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 KeyCodes$$module$build$src$core$utils$keycodes;
|
|
1661
1717
|
(function(a){a[a.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX";a[a.MAC_ENTER=3]="MAC_ENTER";a[a.BACKSPACE=8]="BACKSPACE";a[a.TAB=9]="TAB";a[a.NUM_CENTER=12]="NUM_CENTER";a[a.ENTER=13]="ENTER";a[a.SHIFT=16]="SHIFT";a[a.CTRL=17]="CTRL";a[a.ALT=18]="ALT";a[a.PAUSE=19]="PAUSE";a[a.CAPS_LOCK=20]="CAPS_LOCK";a[a.ESC=27]="ESC";a[a.SPACE=32]="SPACE";a[a.PAGE_UP=33]="PAGE_UP";a[a.PAGE_DOWN=34]="PAGE_DOWN";a[a.END=35]="END";a[a.HOME=36]="HOME";a[a.LEFT=37]="LEFT";a[a.UP=38]="UP";a[a.RIGHT=39]="RIGHT";a[a.DOWN=40]=
|
|
1662
1718
|
"DOWN";a[a.PLUS_SIGN=43]="PLUS_SIGN";a[a.PRINT_SCREEN=44]="PRINT_SCREEN";a[a.INSERT=45]="INSERT";a[a.DELETE=46]="DELETE";a[a.ZERO=48]="ZERO";a[a.ONE=49]="ONE";a[a.TWO=50]="TWO";a[a.THREE=51]="THREE";a[a.FOUR=52]="FOUR";a[a.FIVE=53]="FIVE";a[a.SIX=54]="SIX";a[a.SEVEN=55]="SEVEN";a[a.EIGHT=56]="EIGHT";a[a.NINE=57]="NINE";a[a.FF_SEMICOLON=59]="FF_SEMICOLON";a[a.FF_EQUALS=61]="FF_EQUALS";a[a.FF_DASH=173]="FF_DASH";a[a.FF_HASH=163]="FF_HASH";a[a.QUESTION_MARK=63]="QUESTION_MARK";a[a.AT_SIGN=64]="AT_SIGN";
|
|
1663
1719
|
a[a.A=65]="A";a[a.B=66]="B";a[a.C=67]="C";a[a.D=68]="D";a[a.E=69]="E";a[a.F=70]="F";a[a.G=71]="G";a[a.H=72]="H";a[a.I=73]="I";a[a.J=74]="J";a[a.K=75]="K";a[a.L=76]="L";a[a.M=77]="M";a[a.N=78]="N";a[a.O=79]="O";a[a.P=80]="P";a[a.Q=81]="Q";a[a.R=82]="R";a[a.S=83]="S";a[a.T=84]="T";a[a.U=85]="U";a[a.V=86]="V";a[a.W=87]="W";a[a.X=88]="X";a[a.Y=89]="Y";a[a.Z=90]="Z";a[a.META=91]="META";a[a.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT";a[a.CONTEXT_MENU=93]="CONTEXT_MENU";a[a.NUM_ZERO=96]="NUM_ZERO";a[a.NUM_ONE=97]=
|
|
1664
1720
|
"NUM_ONE";a[a.NUM_TWO=98]="NUM_TWO";a[a.NUM_THREE=99]="NUM_THREE";a[a.NUM_FOUR=100]="NUM_FOUR";a[a.NUM_FIVE=101]="NUM_FIVE";a[a.NUM_SIX=102]="NUM_SIX";a[a.NUM_SEVEN=103]="NUM_SEVEN";a[a.NUM_EIGHT=104]="NUM_EIGHT";a[a.NUM_NINE=105]="NUM_NINE";a[a.NUM_MULTIPLY=106]="NUM_MULTIPLY";a[a.NUM_PLUS=107]="NUM_PLUS";a[a.NUM_MINUS=109]="NUM_MINUS";a[a.NUM_PERIOD=110]="NUM_PERIOD";a[a.NUM_DIVISION=111]="NUM_DIVISION";a[a.F1=112]="F1";a[a.F2=113]="F2";a[a.F3=114]="F3";a[a.F4=115]="F4";a[a.F5=116]="F5";a[a.F6=
|
|
1665
1721
|
117]="F6";a[a.F7=118]="F7";a[a.F8=119]="F8";a[a.F9=120]="F9";a[a.F10=121]="F10";a[a.F11=122]="F11";a[a.F12=123]="F12";a[a.NUMLOCK=144]="NUMLOCK";a[a.SCROLL_LOCK=145]="SCROLL_LOCK";a[a.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY";a[a.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY";a[a.SEMICOLON=186]="SEMICOLON";a[a.DASH=189]="DASH";a[a.EQUALS=187]="EQUALS";a[a.COMMA=188]="COMMA";a[a.PERIOD=190]="PERIOD";a[a.SLASH=191]="SLASH";a[a.APOSTROPHE=192]="APOSTROPHE";a[a.TILDE=192]="TILDE";a[a.SINGLE_QUOTE=222]="SINGLE_QUOTE";
|
|
1666
1722
|
a[a.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET";a[a.BACKSLASH=220]="BACKSLASH";a[a.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET";a[a.WIN_KEY=224]="WIN_KEY";a[a.MAC_FF_META=224]="MAC_FF_META";a[a.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT";a[a.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT";a[a.WIN_IME=229]="WIN_IME";a[a.VK_NONAME=252]="VK_NONAME";a[a.PHANTOM=255]="PHANTOM";a[a.CTRL_CMD=MAC$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent?
|
|
1667
|
-
a.MAC_WK_CMD_LEFT:a.CTRL]="CTRL_CMD"})(KeyCodes$$module$build$src$core$utils$keycodes||(KeyCodes$$module$build$src$core$utils$keycodes={}));var module$build$src$core$utils$keycodes={};module$build$src$core$utils$keycodes.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
SPDX-License-Identifier: Apache-2.0
|
|
1671
|
-
*/
|
|
1672
|
-
var MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator=class{constructor(a){this.workspace=a;var b;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},(b=a.getLayerManager())==null?void 0:b.getDragLayer());this.svgRoot.classList.add("blocklyMoveIndicator");a=a.RTL;createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{fill:"white","fill-opacity":"0.8",stroke:"grey","stroke-width":"1",r:20,cx:20*
|
|
1673
|
-
(a?-1:1),cy:20},this.svgRoot);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m18 9l3 3l-3 3m-3-3h6M6 9l-3 3l3 3m-3-3h6m0 6l3 3l3-3m-3-3v6m3-15l-3-3l-3 3m3-3v6",transform:`translate(${(a?-4:1)*8} 8)`},this.svgRoot)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a+(this.workspace.RTL?20:-20)}, ${b-20})`)}dispose(){removeNode$$module$build$src$core$utils$dom(this.svgRoot)}},
|
|
1674
|
-
module$build$src$core$keyboard_nav$move_indicator={};module$build$src$core$keyboard_nav$move_indicator.MoveIndicator=MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator;var Direction$$module$build$src$core$keyboard_nav$keyboard_mover;(function(a){a[a.NONE=0]="NONE";a[a.UP=1]="UP";a[a.DOWN=2]="DOWN";a[a.LEFT=3]="LEFT";a[a.RIGHT=4]="RIGHT"})(Direction$$module$build$src$core$keyboard_nav$keyboard_mover||(Direction$$module$build$src$core$keyboard_nav$keyboard_mover={}));
|
|
1723
|
+
a.MAC_WK_CMD_LEFT:a.CTRL]="CTRL_CMD"})(KeyCodes$$module$build$src$core$utils$keycodes||(KeyCodes$$module$build$src$core$utils$keycodes={}));var module$build$src$core$utils$keycodes={};module$build$src$core$utils$keycodes.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;var MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator=class{constructor(a){this.workspace=a;var b,c,d;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},(d=(b=a.getLayerManager())==null?void 0:b.getDragLayer())!=null?d:(c=a.getLayerManager())==null?void 0:c.getBlockLayer());this.svgRoot.classList.add("blocklyMoveIndicator");a=a.RTL;createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{fill:"white",
|
|
1724
|
+
"fill-opacity":"0.8",stroke:"grey","stroke-width":"1",r:20,cx:20*(a?-1:1),cy:20},this.svgRoot);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m18 9l3 3l-3 3m-3-3h6M6 9l-3 3l3 3m-3-3h6m0 6l3 3l3-3m-3-3v6m3-15l-3-3l-3 3m3-3v6",transform:`translate(${(a?-4:1)*8} 8)`},this.svgRoot)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a+(this.workspace.RTL?
|
|
1725
|
+
20:-20)}, ${b-20})`)}dispose(){removeNode$$module$build$src$core$utils$dom(this.svgRoot)}},module$build$src$core$keyboard_nav$move_indicator={};module$build$src$core$keyboard_nav$move_indicator.MoveIndicator=MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator;var Direction$$module$build$src$core$keyboard_nav$keyboard_mover;(function(a){a[a.NONE=0]="NONE";a[a.UP=1]="UP";a[a.DOWN=2]="DOWN";a[a.LEFT=3]="LEFT";a[a.RIGHT=4]="RIGHT"})(Direction$$module$build$src$core$keyboard_nav$keyboard_mover||(Direction$$module$build$src$core$keyboard_nav$keyboard_mover={}));
|
|
1675
1726
|
var COMMIT_MOVE_SHORTCUT$$module$build$src$core$keyboard_nav$keyboard_mover="commitMove",KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover=class{constructor(){this.totalDelta=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.stepDistance=20;this.allowedShortcuts=[];this.blurListener=()=>{this.abortMove()}}canMove(a){return!a.workspace.isReadOnly()&&a.isMovable()}isMoving(){return!!this.draggable}startMove(a,b){if(!this.canMove(a)||this.isMoving())return!1;var c=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,
|
|
1676
1727
|
a.workspace.options,!0);if(!c)throw Error("no Dragger registered");this.dragger=new c(a,a.workspace);this.draggable=this.dragger.onDragStart(b);this.startLocation=this.draggable.getRelativeToSurfaceXY();this.updateTotalDelta();this.draggable.getFocusableElement().addEventListener("blur",this.blurListener);a=Object.values(ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.getRegistry()).flatMap(d=>d.keyCodes).filter(d=>d&&![KeyCodes$$module$build$src$core$utils$keycodes.RIGHT,KeyCodes$$module$build$src$core$utils$keycodes.LEFT,
|
|
1677
1728
|
KeyCodes$$module$build$src$core$utils$keycodes.UP,KeyCodes$$module$build$src$core$utils$keycodes.DOWN,KeyCodes$$module$build$src$core$utils$keycodes.ENTER,KeyCodes$$module$build$src$core$utils$keycodes.ESC,KeyCodes$$module$build$src$core$utils$keycodes.M].includes(typeof d==="number"?d:parseInt(`${d.split("+").pop()}`))).filter(d=>!!d);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:COMMIT_MOVE_SHORTCUT$$module$build$src$core$keyboard_nav$keyboard_mover,preconditionFn:()=>
|
|
@@ -1686,9 +1737,9 @@ module$build$src$core$keyboard_nav$keyboard_mover.KeyboardMover=KeyboardMover$$m
|
|
|
1686
1737
|
this.componentStyles[a];if(!a)return null;if(typeof a==="string"){let 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();var c=new Theme$$module$build$src$core$theme(a),d=b.base;if(d){if(typeof d==="string"){let e;d=(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,d))!=null?e:void 0}d instanceof Theme$$module$build$src$core$theme&&
|
|
1687
1738
|
(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);b.startHats!==null&&(c.startHats=b.startHats);return c}},module$build$src$core$theme={};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"},
|
|
1688
1739
|
list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},Classic$$module$build$src$core$theme$classic=new Theme$$module$build$src$core$theme("classic",defaultBlockStyles$$module$build$src$core$theme$classic,categoryStyles$$module$build$src$core$theme$classic),module$build$src$core$theme$classic={Classic:Classic$$module$build$src$core$theme$classic};var Options$$module$build$src$core$options=class{constructor(a){this.gridPattern=null;this.getMetrics=this.setMetrics=void 0;var b=null,c=!1,d=!1,e=!1,f=!1,g=!1,h=!1,k=!!a.readOnly;if(!k){var l;b=convertToolboxDefToJson$$module$build$src$core$utils$toolbox((l=a.toolbox)!=null?l:null);c=hasCategories$$module$build$src$core$utils$toolbox(b);d=a.trashcan;d=d===void 0?c:d;e=a.collapse;e=e===void 0?c:e;f=a.comments;f=f===void 0?c:f;g=a.disable;g=g===void 0?c:g;h=a.sounds;h=h===void 0?!0:h}l=a.maxTrashcanContents;
|
|
1689
|
-
d?l===void 0&&(l=32):l=0;var m=!!a.rtl,n=a.horizontalLayout;n===void 0&&(n=!1);var p=a.toolboxPosition!=="end";p=n?p?Position$$module$build$src$core$utils$toolbox.TOP:Position$$module$build$src$core$utils$toolbox.BOTTOM:p===m?Position$$module$build$src$core$utils$toolbox.RIGHT:Position$$module$build$src$core$utils$toolbox.LEFT;var r=a.css;r===void 0&&(r=!0);var q="https://blockly
|
|
1690
|
-
|
|
1691
|
-
|
|
1740
|
+
d?l===void 0&&(l=32):l=0;var m=!!a.rtl,n=a.horizontalLayout;n===void 0&&(n=!1);var p=a.toolboxPosition!=="end";p=n?p?Position$$module$build$src$core$utils$toolbox.TOP:Position$$module$build$src$core$utils$toolbox.BOTTOM:p===m?Position$$module$build$src$core$utils$toolbox.RIGHT:Position$$module$build$src$core$utils$toolbox.LEFT;var r=a.css;r===void 0&&(r=!0);var q="https://static.blockly.com/media/";a.media&&(q=a.media.endsWith("/")?a.media:a.media+"/");var u=a.oneBasedIndex,y=a.renderer||"geras",
|
|
1741
|
+
z=a.plugins||{},t=a.modalInputs;t===void 0&&(t=!0);this.RTL=m;this.oneBasedIndex=u===void 0?!0:u;this.collapse=e;this.comments=f;this.disable=g;this.readOnly=k;this.maxBlocks=a.maxBlocks||Infinity;var v;this.maxInstances=(v=a.maxInstances)!=null?v:null;this.modalInputs=t;this.pathToMedia=q;this.hasCategories=c;this.moveOptions=Options$$module$build$src$core$options.parseMoveOptions(a,c);this.hasScrollbars=!!this.moveOptions.scrollbars;this.hasTrashcan=d;this.maxTrashcanContents=l;this.hasSounds=h;
|
|
1742
|
+
this.hasCss=r;this.horizontalLayout=n;this.languageTree=b;this.gridOptions=Options$$module$build$src$core$options.parseGridOptions(a);this.zoomOptions=Options$$module$build$src$core$options.parseZoomOptions(a);this.toolboxPosition=p;this.theme=Options$$module$build$src$core$options.parseThemeOptions(a);this.renderer=y;var w;this.rendererOverrides=(w=a.rendererOverrides)!=null?w:null;var x;this.parentWorkspace=(x=a.parentWorkspace)!=null?x:null;this.plugins=z}static parseMoveOptions(a,b){var c=a.move||
|
|
1692
1743
|
{},d={};c.scrollbars===void 0&&a.scrollbars===void 0?d.scrollbars=b:typeof c.scrollbars==="object"?(d.scrollbars={horizontal:!!c.scrollbars.horizontal,vertical:!!c.scrollbars.vertical},d.scrollbars.horizontal&&d.scrollbars.vertical?d.scrollbars=!0:d.scrollbars.horizontal||d.scrollbars.vertical||(d.scrollbars=!1)):d.scrollbars=!!c.scrollbars||!!a.scrollbars;d.wheel=d.scrollbars&&c.wheel!==void 0?!!c.wheel:typeof d.scrollbars==="object";d.drag=d.scrollbars?c.drag===void 0?!0:!!c.drag:!1;return d}static parseZoomOptions(a){a=
|
|
1693
1744
|
a.zoom||{};var b={};b.controls=a.controls===void 0?!1:!!a.controls;b.wheel=a.wheel===void 0?!1:!!a.wheel;b.startScale=a.startScale===void 0?1:Number(a.startScale);b.maxScale=a.maxScale===void 0?3:Number(a.maxScale);b.minScale=a.minScale===void 0?.3:Number(a.minScale);b.scaleSpeed=a.scaleSpeed===void 0?1.2:Number(a.scaleSpeed);b.pinch=a.pinch===void 0?b.wheel||b.controls:!!a.pinch;return b}static parseGridOptions(a){a=a.grid||{};var b={};b.spacing=Number(a.spacing)||0;b.colour=a.colour||"#888";b.length=
|
|
1694
1745
|
a.length===void 0?1:Number(a.length);b.snap=b.spacing>0&&!!a.snap;return b}static parseThemeOptions(a){a=a.theme||Classic$$module$build$src$core$theme$classic;return typeof a==="string"?getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a):a instanceof Theme$$module$build$src$core$theme?a:Theme$$module$build$src$core$theme.defineTheme(a.name||"builtin"+getNextUniqueId$$module$build$src$core$utils$idgenerator(),a)}},module$build$src$core$options={};
|
|
@@ -1773,8 +1824,8 @@ c=this.getShadowState(),d=this.getShadowDom();if(b.isDeadOrDying()||!c&&!d)retur
|
|
|
1773
1824
|
b){if(b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return getConnectionForOrphanedOutput$$module$build$src$core$connection(a,b.getSourceBlock());a=a.lastConnectionInStack(!0);var c=b.getConnectionChecker();return a&&c.canConnect(b,a,!1)?a:null}};Connection$$module$build$src$core$connection.CAN_CONNECT=0;Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION=1;Connection$$module$build$src$core$connection.REASON_WRONG_TYPE=2;
|
|
1774
1825
|
Connection$$module$build$src$core$connection.REASON_TARGET_NULL=3;Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED=4;Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES=5;Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT=6;Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED=7;Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT=8;var module$build$src$core$connection={};
|
|
1775
1826
|
module$build$src$core$connection.Connection=Connection$$module$build$src$core$connection;var DuplicateIconType$$module$build$src$core$icons$exceptions=class extends Error{constructor(a){super(`Tried to append an icon of type ${a.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`);this.icon=a}},module$build$src$core$icons$exceptions={};module$build$src$core$icons$exceptions.DuplicateIconType=DuplicateIconType$$module$build$src$core$icons$exceptions;(function(a){a[a.LEFT=-1]="LEFT";a[a.CENTRE=0]="CENTRE";a[a.RIGHT=1]="RIGHT"})($.Align$$module$build$src$core$inputs$align||($.Align$$module$build$src$core$inputs$align={}));var module$build$src$core$inputs$align={};module$build$src$core$inputs$align.Align=$.Align$$module$build$src$core$inputs$align;var FieldLabel$$module$build$src$core$field_label=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.class=null;this.EDITABLE=!1;this.maxDisplayLength=Infinity;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c?this.configure_(c):this.class=b||null,this.setValue(a))}configure_(a){super.configure_(a);a.class&&(this.class=a.class)}initView(){this.createTextElement_();this.class&&addClass$$module$build$src$core$utils$dom(this.getTextElement(),
|
|
1776
|
-
this.class);this.fieldGroup_&&(addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyLabelField"),setState$$module$build$src$core$utils$aria(this.fieldGroup_,State$$module$build$src$core$utils$aria.HIDDEN,!0))}doClassValidation_(a){return a===null||a===void 0?null:`${a}`}setClass(a){this.textElement_&&(this.class&&removeClass$$module$build$src$core$utils$dom(this.textElement_,
|
|
1777
|
-
void 0,a)}};register$$module$build$src$core$field_registry("field_label",FieldLabel$$module$build$src$core$field_label);FieldLabel$$module$build$src$core$field_label.prototype.DEFAULT_VALUE="";var module$build$src$core$field_label={};module$build$src$core$field_label.FieldLabel=FieldLabel$$module$build$src$core$field_label;var module$build$src$core$interfaces$i_toolbox_item={};module$build$src$core$interfaces$i_toolbox_item.isToolboxItem=isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item;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 ConnectionPreposition$$module$build$src$core$block_aria_composer;(function(a){a[a.UNKNOWN=0]="UNKNOWN";a[a.BEFORE=1]="BEFORE";a[a.AFTER=2]="AFTER";a[a.AROUND=3]="AROUND";a[a.INSIDE=4]="INSIDE"})(ConnectionPreposition$$module$build$src$core$block_aria_composer||(ConnectionPreposition$$module$build$src$core$block_aria_composer={}));var module$build$src$core$block_aria_composer={};module$build$src$core$block_aria_composer.ConnectionPreposition=ConnectionPreposition$$module$build$src$core$block_aria_composer;
|
|
1827
|
+
this.class);this.fieldGroup_&&(addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyLabelField"),setState$$module$build$src$core$utils$aria(this.fieldGroup_,State$$module$build$src$core$utils$aria.HIDDEN,!0))}computeAriaLabel(a=!0){a=a?this.getAriaTypeName():null;var b,c=(b=this.getAriaValue())!=null?b:"";return a?`${a}: ${c}`:c}doClassValidation_(a){return a===null||a===void 0?null:`${a}`}setClass(a){this.textElement_&&(this.class&&removeClass$$module$build$src$core$utils$dom(this.textElement_,
|
|
1828
|
+
this.class),a&&addClass$$module$build$src$core$utils$dom(this.textElement_,a));this.class=a}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};register$$module$build$src$core$field_registry("field_label",FieldLabel$$module$build$src$core$field_label);FieldLabel$$module$build$src$core$field_label.prototype.DEFAULT_VALUE="";var module$build$src$core$field_label={};module$build$src$core$field_label.FieldLabel=FieldLabel$$module$build$src$core$field_label;var module$build$src$core$interfaces$i_toolbox_item={};module$build$src$core$interfaces$i_toolbox_item.isToolboxItem=isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item;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 ConnectionPreposition$$module$build$src$core$block_aria_composer;(function(a){a[a.UNKNOWN=0]="UNKNOWN";a[a.BEFORE=1]="BEFORE";a[a.AFTER=2]="AFTER";a[a.AROUND=3]="AROUND";a[a.INSIDE=4]="INSIDE";a[a.TO=5]="TO"})(ConnectionPreposition$$module$build$src$core$block_aria_composer||(ConnectionPreposition$$module$build$src$core$block_aria_composer={}));var module$build$src$core$block_aria_composer={};module$build$src$core$block_aria_composer.ConnectionPreposition=ConnectionPreposition$$module$build$src$core$block_aria_composer;
|
|
1778
1829
|
module$build$src$core$block_aria_composer.computeAriaLabel=computeAriaLabel$$module$build$src$core$block_aria_composer;module$build$src$core$block_aria_composer.computeFieldRowLabel=computeFieldRowLabel$$module$build$src$core$block_aria_composer;module$build$src$core$block_aria_composer.computeMoveLabel=computeMoveLabel$$module$build$src$core$block_aria_composer;module$build$src$core$block_aria_composer.configureAriaRole=configureAriaRole$$module$build$src$core$block_aria_composer;
|
|
1779
1830
|
module$build$src$core$block_aria_composer.getInputLabels=getInputLabels$$module$build$src$core$block_aria_composer;module$build$src$core$block_aria_composer.getInputLabelsSubset=getInputLabelsSubset$$module$build$src$core$block_aria_composer;var COLLAPSE_CHARS$$module$build$src$core$internal_constants=30,OPPOSITE_TYPE$$module$build$src$core$internal_constants=[];OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE]=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE;OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE]=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE;
|
|
1780
1831
|
OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT]=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT;OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT]=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT;
|
|
@@ -1783,23 +1834,26 @@ RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.WILL_
|
|
|
1783
1834
|
a*a)}bumpAwayFrom(a,b=!1){if(!this.sourceBlock_.workspace.isDragging()){var c=$.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*BUMP_RANDOMNESS$$module$build$src$core$rendered_connection),d=$.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*BUMP_RANDOMNESS$$module$build$src$core$rendered_connection),e=a.sourceBlock_.getRootBlock(),f=this.sourceBlock_.getRootBlock();if(!e.isInFlyout&&!f.isInFlyout){var g=!0;if(f.isMovable())e.isMovable()&&b&&(d=-d);
|
|
1784
1835
|
else if(e.isMovable())g=!1,c=-c,d=-d;else return;b=g?a:this;a=g?this:a;e=g?f:e;e.RTL&&(c=-c);e.moveBy(b.x+c-a.x,b.y+d-a.y,["bump"])}}}moveTo(a,b){var c=!1;this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.WILL_TRACK?(this.db.addConnection(this,b),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED,c=!0):this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED&&
|
|
1785
1836
|
(this.db.removeConnection(this,this.y),this.db.addConnection(this,b),c=!0);this.x=a;this.y=b;return c}moveBy(a,b){return this.moveTo(this.x+a,this.y+b)}moveToOffset(a){return this.moveTo(a.x+this.offsetInBlock.x,a.y+this.offsetInBlock.y)}setOffsetInBlock(a,b){this.offsetInBlock.x=a;this.offsetInBlock.y=b}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var a=this.targetConnection,b=this.targetBlock();a&&b&&(a=Coordinate$$module$build$src$core$utils$coordinate.difference(this.offsetInBlock,
|
|
1786
|
-
a.offsetInBlock),b.translate(a.x,a.y))}closest(a,b){return this.dbOpposite.searchForClosest(this,a,b)}
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
var
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1837
|
+
a.offsetInBlock),b.translate(a.x,a.y))}closest(a,b){return this.dbOpposite.searchForClosest(this,a,b)}recomputeAriaContext(a){var b=this.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?$.Msg$$module$build$src$core$msg.INPUT_LABEL_VALUE:$.Msg$$module$build$src$core$msg.INPUT_LABEL_STATEMENT;setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.FIGURE);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,
|
|
1838
|
+
b);var c,d,e;if(b=(e=this.getParentInput())!=null?e:(c=this.getSourceBlock().getTopStackBlock().previousConnection)==null?void 0:(d=c.targetConnection)==null?void 0:d.getParentInput()){var f;c=(f=b==null?void 0:b.getAriaLabelText())!=null?f:getInputLabelsSubset$$module$build$src$core$block_aria_composer(b.getSourceBlock(),b).join(", ");this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,
|
|
1839
|
+
$.Msg$$module$build$src$core$msg.INPUT_LABEL_END_STATEMENT.replace("%1",c)):setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,c)}else setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.INPUT_LABEL_EMPTY)}highlight(){this.highlighted=!0;var a=this.findHighlightSvg();if(a){a.style.display="";let b;(b=a.parentElement)==null||b.appendChild(a);this.recomputeAriaContext(a)}}unhighlight(){this.highlighted=
|
|
1840
|
+
!1;var a=this.findHighlightSvg();a&&(a.style.display="none")}isHighlighted(){return this.highlighted}setTracking(a){a&&this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED||!a&&this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(a?(this.db.addConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED):
|
|
1841
|
+
(this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.UNTRACKED))}stopTrackingAll(){this.setTracking(!1);if(this.targetConnection){let a=this.targetBlock().getDescendants(!1);for(let b=0;b<a.length;b++){let c=a[b],d=c.getConnections_(!0);for(let e=0;e<d.length;e++)d[e].setTracking(!1);for(let e of c.getIcons())hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&
|
|
1842
|
+
e.setBubbleVisible(!1)}}}startTrackingAll(){this.setTracking(!0);var a=[];if(this.type!==ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&this.type!==ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)return a;var b=this.targetBlock();if(b){let c;b.isCollapsed()?(c=[],b.outputConnection&&c.push(b.outputConnection),b.nextConnection&&c.push(b.nextConnection),b.previousConnection&&c.push(b.previousConnection)):c=b.getConnections_(!0);for(let d=0;d<c.length;d++)a.push(...c[d].startTrackingAll());
|
|
1843
|
+
a.length||(a=[b])}return a}onFailedConnect(a){var b=this.getSourceBlock();if(getRecordUndo$$module$build$src$core$events$utils()){let c=$.getGroup$$module$build$src$core$events$utils();setTimeout(function(){b.isDisposed()||b.getParent()||($.setGroup$$module$build$src$core$events$utils(c),this.bumpAwayFrom(a),$.setGroup$$module$build$src$core$events$utils(!1))}.bind(this),$.config$$module$build$src$core$config.bumpDelay)}}disconnectInternal(a=!0){var {parentConnection:b,childConnection:c}=this.getParentAndChildConnections();
|
|
1844
|
+
if(b&&c){var d=$.getGroup$$module$build$src$core$events$utils();d||$.setGroup$$module$build$src$core$events$utils(!0);var e=b.getSourceBlock(),f=c.getSourceBlock();super.disconnectInternal(a);e.queueRender();f.updateDisabled();f.queueRender();f.getSvgRoot().style.display="block";$.setGroup$$module$build$src$core$events$utils(d)}}respawnShadow_(){super.respawnShadow_();var a=this.targetBlock();a&&(a.initSvg(),a.queueRender())}neighbours(a){return this.dbOpposite.getNeighbours(this,a)}connect_(a){super.connect_(a);
|
|
1845
|
+
var b=this.getSourceBlock();a=a.getSourceBlock();b.updateDisabled();a.updateDisabled();a.queueRender();if(b=b.getInputWithBlock(a))b=b.isVisible(),a.getSvgRoot().style.display=b?"block":"none"}onCheckChanged_(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(a){super.setCheck(a);this.sourceBlock_.queueRender();return this}showContextMenu(a){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({focusedNode:this},
|
|
1846
|
+
a);if(b.length){var c=this.getSourceBlock(),d=c.workspace;if(a instanceof PointerEvent)var e=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);else e=new Coordinate$$module$build$src$core$utils$coordinate(this.x,this.y),e=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(d,e).translate(c.RTL?-5:5,5);show$$module$build$src$core$contextmenu(a,b,c.RTL,d,e)}}getFocusableElement(){var a=this.findHighlightSvg();if(a)return a;throw Error("No highlight SVG found corresponding to this connection.");
|
|
1847
|
+
}getFocusableTree(){return this.getSourceBlock().workspace}onNodeFocus(){this.highlight();this.getSourceBlock().workspace.scrollBoundsIntoView(this.getSourceBlock().getBoundingRectangleWithoutChildren())}onNodeBlur(){this.unhighlight()}canBeFocused(){return this.findHighlightSvg()!==null}findHighlightSvg(){return document.getElementById(this.id)}};
|
|
1794
1848
|
(function(a){a=a.TrackedState||(a.TrackedState={});a[a.WILL_TRACK=-1]="WILL_TRACK";a[a.UNTRACKED=0]="UNTRACKED";a[a.TRACKED=1]="TRACKED"})(RenderedConnection$$module$build$src$core$rendered_connection||(RenderedConnection$$module$build$src$core$rendered_connection={}));var TrackedState$$module$build$src$core$rendered_connection=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState,module$build$src$core$rendered_connection={};
|
|
1795
1849
|
module$build$src$core$rendered_connection.RenderedConnection=RenderedConnection$$module$build$src$core$rendered_connection;module$build$src$core$rendered_connection.TrackedState=TrackedState$$module$build$src$core$rendered_connection;var Input$$module$build$src$core$inputs$input=class{constructor(a,b){this.name=a;this.sourceBlock=b;this.fieldRow=[];this.align=$.Align$$module$build$src$core$inputs$align.LEFT;this.visible=!0;this.ariaLabelProvider=null;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM;this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this}insertFieldAt(a,b,c){if(a<0||a>this.fieldRow.length)throw Error("index "+
|
|
1796
1850
|
a+" out of bounds.");if(!(b||b===""&&c))return a;typeof b==="string"&&(b=$.fromJson$$module$build$src$core$field_registry({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock);this.sourceBlock.initialized&&this.initField(b);b.name=c;b.setVisible(this.isVisible());b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);a++;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock.rendered&&this.sourceBlock.queueRender();return a}removeField(a,b){for(let c=
|
|
1797
1851
|
0,d;d=this.fieldRow[c];c++)if(d.name===a)return d.dispose(),this.fieldRow.splice(c,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(b)return!1;throw Error('Field "'+a+'" not found.');}isVisible(){return this.visible}setVisible(a){var b=[];if(this.visible===a)return b;this.visible=a;for(let c=0,d;d=this.fieldRow[c];c++)d.setVisible(a);if(this.connection&&this.connection instanceof RenderedConnection$$module$build$src$core$rendered_connection){a?b=this.connection.startTrackingAll():
|
|
1798
1852
|
this.connection.stopTrackingAll();let c=this.connection.targetBlock();c&&(c.getSvgRoot().style.display=a?"block":"none")}return b}markDirty(){for(let a=0,b;b=this.fieldRow[a];a++)b.markDirty()}setCheck(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this}setAlign(a){this.align=a;this.sourceBlock.rendered&&this.sourceBlock.queueRender();return this}setShadowDom(a){if(!this.connection)throw Error("This input does not have a connection.");
|
|
1799
1853
|
this.connection.setShadowDom(a);return this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(let a of this.fieldRow)a.init()}setAriaLabelProvider(a){this.ariaLabelProvider=a}getAriaLabelText(){return this.ariaLabelProvider?typeof this.ariaLabelProvider==="string"?replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaLabelProvider):this.ariaLabelProvider(this):null}initModel(){for(let a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?
|
|
1800
|
-
a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}getRowId(){var a=this.getSourceBlock().inputList;if(this===a[0])return this.getSourceBlock().getRowId();var b=a.indexOf(this),c,d=((c=a[b-1].connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,e;return
|
|
1801
|
-
|
|
1802
|
-
|
|
1854
|
+
a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}getRowId(){var a=this.getSourceBlock().inputList;if(this===a[0])return this.getSourceBlock().getRowId();var b=a.indexOf(this),c,d=((c=a[b-1].connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,e;return((e=this.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||
|
|
1855
|
+
d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}getLabel(a=Verbosity$$module$build$src$core$utils$aria.STANDARD){if(!this.isVisible())return"";var b=computeFieldRowLabel$$module$build$src$core$block_aria_composer(this,!1,a),c;((c=this.connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&(c=this.connection.targetBlock())&&!c.isInsertionMarker()&&b.push(getInputLabels$$module$build$src$core$block_aria_composer(c,a).join(" "));return b.join(", ")}getIndex(){var a=
|
|
1856
|
+
[$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY,$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW];return this.getSourceBlock().inputList.filter(b=>!a.includes(b.type)).indexOf(this)}},module$build$src$core$inputs$input={};module$build$src$core$inputs$input.Input=Input$$module$build$src$core$inputs$input;var DummyInput$$module$build$src$core$inputs$dummy_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},module$build$src$core$inputs$dummy_input={};module$build$src$core$inputs$dummy_input.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;var EndRowInput$$module$build$src$core$inputs$end_row_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},module$build$src$core$inputs$end_row_input={};module$build$src$core$inputs$end_row_input.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;var StatementInput$$module$build$src$core$inputs$statement_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Statement inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)}},module$build$src$core$inputs$statement_input={};
|
|
1803
1857
|
module$build$src$core$inputs$statement_input.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;var module$build$src$core$inputs$value_input;$.ValueInput$$module$build$src$core$inputs$value_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Value inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.VALUE;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE)}};module$build$src$core$inputs$value_input={};
|
|
1804
1858
|
module$build$src$core$inputs$value_input.ValueInput=$.ValueInput$$module$build$src$core$inputs$value_input;var module$build$src$core$interfaces$i_icon={};module$build$src$core$interfaces$i_icon.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;var module$build$src$core$interfaces$i_comment_icon={};module$build$src$core$interfaces$i_comment_icon.isCommentIcon=isCommentIcon$$module$build$src$core$interfaces$i_comment_icon;var Block$$module$build$src$core$block=class{constructor(a,b,c){this.data=null;this.disposed=!1;this.hue=null;this.colour_="#000000";this.styleName_="";this.suppressPrefixSuffix=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.inputList=[];this.icons=[];this.disabledReasons=new Set;this.tooltip="";this.contextMenu=!0;this.parentBlock_=null;this.childBlocks_=[];this.editable=this.movable=this.deletable=!0;this.collapsed_=this.shadow=!1;this.outputShape_=null;this.rendered=
|
|
1805
1859
|
this.isInsertionMarker_=this.initialized=this.disposing=!1;this.onchangeWrapper=this.helpUrl=null;this.statementInputCount=0;this.workspace=a;this.id=c&&!a.getBlockById(c)?c:genUid$$module$build$src$core$utils$idgenerator();a.setBlockById(this.id,this);this.xy=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.isInFlyout=a.isFlyout;this.isInMutator=a.isMutator;this.RTL=a.RTL;if(b){this.type=b;c=Blocks$$module$build$src$core$blocks[b];if(!c||typeof c!=="object")throw TypeError("Invalid block definition for type: "+
|
|
@@ -1814,78 +1868,103 @@ a,!1)&&b.connect(a)}}}getConnections_(a){a=[];this.outputConnection&&a.push(this
|
|
|
1814
1868
|
while(b&&b.getNextBlock()===a&&(a=b));return a}getChildren(a){if(!a)return this.childBlocks_;a=[];for(let c=0,d;d=this.inputList[c];c++)if(d.connection){var b=d.connection.targetBlock();b&&a.push(b)}(b=this.getNextBlock())&&a.push(b);return a}setParent(a){if(a!==this.parentBlock_){var b=this.previousConnection&&this.previousConnection.targetBlock()||this.outputConnection&&this.outputConnection.targetBlock(),c=!!b;if(c&&a&&b!==a)throw Error("Block connected to superior one that is not new parent.");
|
|
1815
1869
|
if(!c&&a)throw Error("Block not connected to new parent.");if(c&&!a)throw Error("Cannot set parent to null while block is still connected to superior block.");this.parentBlock_?removeElem$$module$build$src$core$utils$array(this.parentBlock_.childBlocks_,this):this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}}getDescendants(a){var b=[this],c=this.getChildren(a);for(let d,e=0;d=c[e];e++)b.push(...d.getDescendants(a));return b}isDeletable(){return this.deletable&&
|
|
1816
1870
|
!this.isInFlyout&&!this.shadow&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnDeletable(){return this.deletable}setDeletable(a){this.deletable=a}isMovable(){return this.movable&&!this.isInFlyout&&!this.shadow&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnMovable(){return this.movable}setMovable(a){this.movable=a}isDuplicatable(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(getBlockTypeCounts$$module$build$src$core$common(this,!0)):!0}isShadow(){return this.shadow}setShadow(a){this.shadow=
|
|
1817
|
-
a}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(a){this.isInsertionMarker_=a}isEditable(){return this.editable&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setEditable(a){this.editable=a;for(let b of this.getFields())b.updateEditable()}isDisposed(){return this.disposed}
|
|
1818
|
-
this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!==a.length)throw Error("Connection lists did not match in length.");for(let d=0;d<a.length;d++)if(a[d]===b)return c[d];return null}setHelpUrl(a){this.helpUrl=a}setTooltip(a){this.tooltip=a}getTooltip(){return getTooltipOfObject$$module$build$src$core$tooltip(this)}getColour(){return this.colour_}getStyleName(){return this.styleName_}getHue(){return this.hue}setColour(a){a=
|
|
1819
|
-
a.hue;this.colour_=a.hex}setStyle(a){this.styleName_=a}setOnChange(a){if(a&&typeof a!=="function")throw Error("onchange must be a function.");this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.onchange=a;this.onchangeWrapper=a.bind(this);this.workspace.addChangeListener(this.onchangeWrapper)}getField(a){if(typeof a!=="string")throw TypeError("Block.prototype.getField expects a string with the field name but received "+
|
|
1820
|
-
" instead");for(let b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(let a of this.inputList)for(let b of a.fieldRow)yield b}getVars(){$.warn$$module$build$src$core$utils$deprecation("Blockly.Block.getVars()","v13","v14","Blockly.Block.getVarModels().map(model => model.getId())");var a=[];for(let b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){var a=[];for(let b of this.getFields())if(b.referencesVariables()){let c=
|
|
1821
|
-
c&&a.push(c)}return a}updateVarName(a){for(let b of this.getFields())b.referencesVariables()&&a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,b){for(let c of this.getFields())c.referencesVariables()&&a===c.getValue()&&c.setValue(b)}getFieldValue(a){return(a=this.getField(a))?a.getValue():null}setFieldValue(a,b){var c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,b){if(a)b===
|
|
1822
|
-
this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(b);else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.previousConnection.dispose();this.previousConnection=null}}setNextStatement(a,b){if(a)b===void 0&&(b=null),this.nextConnection||(this.nextConnection=
|
|
1823
|
-
this.nextConnection.setCheck(b);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");this.nextConnection.dispose();this.nextConnection=null}}setOutput(a,b){if(a)b===void 0&&(b=null),this.outputConnection||(this.outputConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)),this.outputConnection.setCheck(b);
|
|
1824
|
-
this.outputConnection.dispose();this.outputConnection=null}}setInputsInline(a){this.inputsInline!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"inline",null,this.inputsInline,a)),this.inputsInline=a)}getInputsInline(){if(this.inputsInline!==void 0)return this.inputsInline;
|
|
1825
|
-
this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!1;for(a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof $.ValueInput$$module$build$src$core$inputs$value_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!0;for(a=0;a<this.inputList.length;a++)if(this.inputList[a]instanceof EndRowInput$$module$build$src$core$inputs$end_row_input)return!0;
|
|
1826
|
-
0}setDisabledReason(a,b){a||this.workspace.options.disable||!this.hasDisabledReason(MANUALLY_DISABLED$$module$build$src$core$constants)||b==MANUALLY_DISABLED$$module$build$src$core$constants||this.setDisabledReason(!1,MANUALLY_DISABLED$$module$build$src$core$constants);this.disabledReasons.has(b)!==a&&(a?this.disabledReasons.add(b):this.disabledReasons.delete(b),
|
|
1827
|
-
fire$$module$build$src$core$events$utils(a))}getInheritedDisabled(){for(var a=this.getSurroundParent();a;){if(!a.isEnabled())return!0;a=a.getSurroundParent()}return!1}hasDisabledReason(a){return this.disabledReasons.has(a)}getDisabledReasons(){return this.disabledReasons}isCollapsed(){return this.collapsed_}setCollapsed(a){this.collapsed_!==a&&
|
|
1828
|
-
null,this.collapsed_,a)),this.collapsed_=a)}setAriaRoleDescriptionProvider(a){this.ariaRoleDescriptionProvider=a}getAriaRoleDescription(){if(this.ariaRoleDescriptionProvider)return typeof this.ariaRoleDescriptionProvider==="function"?this.ariaRoleDescriptionProvider():replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaRoleDescriptionProvider)}toString(a,
|
|
1829
|
-
e)=>{d=d+(c==="("||e===")"?"":" ")+e;c=e[e.length-1];return d},"");b=b.trim()||"???";a&&b.length>a&&(b=b.substring(0,a-3)+"...");return b}toTokens(a="?"){var b=[];for(let d of this.inputList)if(d.name!=COLLAPSED_INPUT_NAME$$module$build$src$core$constants){for(let e of d.fieldRow)b.push(e.getText());if(d.connection){let e=d.connection.targetBlock();if(e){var c=d.connection;
|
|
1830
|
-
b.push("(");b.push(...e.toTokens(a));c&&b.push(")")}else b.push(a)}}return b}appendValueInput(a){return this.appendInput(new $.ValueInput$$module$build$src$core$inputs$value_input(a,this))}appendStatementInput(a){this.statementInputCount++;return this.appendInput(new StatementInput$$module$build$src$core$inputs$statement_input(a,this))}appendDummyInput(a=""){return this.appendInput(new DummyInput$$module$build$src$core$inputs$dummy_input(a,
|
|
1831
|
-
this))}appendInput(a){this.inputList.push(a);return a}appendInputFromRegistry(a,b){return(a=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,a,!1))?this.appendInput(new a(b,this)):null}jsonInit(a){var b=a.type?'Block "'+a.type+'": ':"";if(a.output&&a.previousStatement)throw Error(b+"Must not have both an output and a previousStatement.");for(var c=
|
|
1832
|
-
c++}a.style&&typeof a.style==="object"&&(this.hat=a.style.hat,a.style=null);if(a.style&&a.colour)throw Error(b+"Must not have both a colour and a style.");a.style?this.jsonInitStyle(a,b):this.jsonInitColour(a,b);for(c=0;a[`message${c}`]!==void 0;)this.interpolate(a[`message${c}`]||"",a[`args${c}`]||[],a[`implicitAlign${c}`]||a[`lastDummyAlign${c}`],b),c++;a.inputsInline!==void 0&&
|
|
1833
|
-
a.output!==void 0&&this.setOutput(!0,a.output);a.outputShape!==void 0&&this.setOutputShape(a.outputShape);a.previousStatement!==void 0&&this.setPreviousStatement(!0,a.previousStatement);a.nextStatement!==void 0&&this.setNextStatement(!0,a.nextStatement);a.tooltip!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip),this.setTooltip(c));
|
|
1834
|
-
|
|
1835
|
-
a.extensions;if(Array.isArray(a))for(b=0;b<a.length;b++)apply$$module$build$src$core$extensions(a[b],this,!1)}jsonInitColour(a,b){if("colour"in a)if(a.colour===void 0)console.warn(b+"Undefined colour value.");else{a=a.colour;try{this.setColour(a)}catch(c){console.warn(b+"Illegal colour value: ",a)}}}jsonInitStyle(a,b){a=a.style;try{this.setStyle(a)}catch(c){console.warn(b+
|
|
1836
|
-
if(!b){b=[];for(let c in a)this[c]!==void 0&&b.push(c);if(b.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(b));}Object.assign(this,a)}interpolate(a,b,c,d){a=tokenizeInterpolation$$module$build$src$core$utils$parsing(a);this.validateTokens(a,b.length);b=this.interpolateArguments(a,b,c);c=[];for(let e=0,f;f=b[e];e++)if(this.isInputKeyword(f.type)){if(a=
|
|
1837
|
-
f.name])}validateTokens(a,b){var c=[],d=0;for(let e=0;e<a.length;e++){let f=a[e];if(typeof f==="number"){if(f<1||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");
|
|
1838
|
-
"\n")e={type:"input_end_row"},c&&(e.align=c);else if(e=this.stringToFieldJson(e),!e)continue;d.push(e)}(a=d.length)&&!this.isInputKeyword(d[a-1].type)&&(a={type:"input_dummy"},c&&(a.align=c),d.push(a));return d}fieldFromJson(a){var b=$.fromJson$$module$build$src$core$field_registry(a);return!b&&a.alt?typeof a.alt==="string"?(a=this.stringToFieldJson(a.alt))?this.fieldFromJson(a):
|
|
1839
|
-
CENTRE:$.Align$$module$build$src$core$inputs$align.CENTRE,CENTER:$.Align$$module$build$src$core$inputs$align.CENTRE};switch(a.type){case "input_value":var d=this.appendValueInput(a.name);break;case "input_statement":d=this.appendStatementInput(a.name);break;case "input_dummy":d=this.appendDummyInput(a.name);break;case "input_end_row":d=
|
|
1840
|
-
c===void 0?console.warn(b+"Illegal align value: ",a.align):d.setAlign(c));a.ariaLabelText&&d.setAriaLabelProvider(a.ariaLabelText);return d}isInputKeyword(a){return a==="input_value"||a==="input_statement"||a==="input_dummy"||a==="input_end_row"||hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,
|
|
1841
|
-
a){if(c=e,d!==-1)break}else if(b&&f.name===b&&(d=e,c!==-1))break;if(c===-1)throw Error('Named input "'+a+'" not found.');if(d===-1)throw Error('Reference input "'+b+'" not found.');this.moveNumberedInputBefore(c,d)}}moveNumberedInputBefore(a,b){if(a===b)throw Error("Can't move input to itself.");if(a>=this.inputList.length)throw RangeError("Input index "+
|
|
1842
|
-
1);a<b&&b--;this.inputList.splice(b,0,c)}removeInput(a,b){for(let c=0,d;d=this.inputList[c];c++)if(d.name===a)return d instanceof StatementInput$$module$build$src$core$inputs$statement_input&&this.statementInputCount--,d.dispose(),this.inputList.splice(c,1),!0;if(b)return!1;throw Error("Input not found: "+a);}getInput(a){for(let b=0,c;c=this.inputList[b];b++)if(c.name===
|
|
1843
|
-
b;return(b=(a=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:a.getText())!=null?b:null}setCommentText(a){var b,c,d=(c=(b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:b.getText())!=null?c:null;if(d!==a){if(a!==null){b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);
|
|
1844
|
-
!1);if(!b)throw Error("No comment icon class is registered, so a comment cannot be set");b=new b(this);if(!isCommentIcon$$module$build$src$core$interfaces$i_comment_icon(b))throw Error("The class registered as a comment icon does not conform to the ICommentIcon interface");b=this.addIcon(b)}$.disable$$module$build$src$core$events$utils();b.setText(a)
|
|
1845
|
-
"comment",null,d,a))}}setWarningText(a,b){}setMutator(a){}addIcon(a){if(this.hasIcon(a.getType()))throw new DuplicateIconType$$module$build$src$core$icons$exceptions(a);this.icons.push(a);this.icons.sort((b,c)=>b.getWeight()-
|
|
1846
|
-
this.icons.find(b=>b.getType().equals(a)):this.icons.find(b=>b.getType().toString()===a)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");
|
|
1847
|
-
a)}allInputsFilled(a){a===void 0&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++){if(!d.connection)continue;var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=
|
|
1848
|
-
Block$$module$build$src$core$block.COLLAPSED_FIELD_NAME=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;var module$build$src$core$block={};module$build$src$core$block.Block=Block$$module$build$src$core$block;var disconnectPid$$module$build$src$core$block_animations=null,wobblingBlock$$module$build$src$core$block_animations=null,module$build$src$core$block_animations={};module$build$src$core$block_animations.connectionUiEffect=connectionUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiEffect=disconnectUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiStop=disconnectUiStop$$module$build$src$core$block_animations;
|
|
1871
|
+
a}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(a){this.isInsertionMarker_=a}isEditable(){return this.editable&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setEditable(a){this.editable=a;for(let b of this.getFields())b.updateEditable()}isDisposed(){return this.disposed}getFullBlockField(){if(!this.isSimpleReporter())return null;var a,b=(a=this.inputList[0])==null?void 0:a.fieldRow[0];return(b==null?0:b.isFullBlockField())?b:null}isSimpleReporter(){if(!this.outputConnection)return!1;
|
|
1872
|
+
for(let a of this.inputList)if(a.connection||a.fieldRow.length>1)return!1;return!0}getMatchingConnection(a,b){var c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!==a.length)throw Error("Connection lists did not match in length.");for(let d=0;d<a.length;d++)if(a[d]===b)return c[d];return null}setHelpUrl(a){this.helpUrl=a}setTooltip(a){this.tooltip=a}getTooltip(){return getTooltipOfObject$$module$build$src$core$tooltip(this)}getColour(){return this.colour_}getStyleName(){return this.styleName_}getHue(){return this.hue}setColour(a){a=
|
|
1873
|
+
parseBlockColour$$module$build$src$core$utils$parsing(a);this.hue=a.hue;this.colour_=a.hex}setStyle(a){this.styleName_=a}setOnChange(a){if(a&&typeof a!=="function")throw Error("onchange must be a function.");this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.onchange=a;this.onchangeWrapper=a.bind(this);this.workspace.addChangeListener(this.onchangeWrapper)}getField(a){if(typeof a!=="string")throw TypeError("Block.prototype.getField expects a string with the field name but received "+
|
|
1874
|
+
(a===void 0?"nothing":a+" of type "+typeof a)+" instead");for(let b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(let a of this.inputList)for(let b of a.fieldRow)yield b}getVars(){$.warn$$module$build$src$core$utils$deprecation("Blockly.Block.getVars()","v13","v14","Blockly.Block.getVarModels().map(model => model.getId())");var a=[];for(let b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){var a=[];for(let b of this.getFields())if(b.referencesVariables()){let c=
|
|
1875
|
+
this.workspace.getVariableMap().getVariableById(b.getValue());c&&a.push(c)}return a}updateVarName(a){for(let b of this.getFields())b.referencesVariables()&&a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,b){for(let c of this.getFields())c.referencesVariables()&&a===c.getValue()&&c.setValue(b)}getFieldValue(a){return(a=this.getField(a))?a.getValue():null}setFieldValue(a,b){var c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,b){if(a)b===
|
|
1876
|
+
void 0&&(b=null),this.previousConnection||(this.previousConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(b);else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.previousConnection.dispose();this.previousConnection=null}}setNextStatement(a,b){if(a)b===void 0&&(b=null),this.nextConnection||(this.nextConnection=
|
|
1877
|
+
this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)),this.nextConnection.setCheck(b);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");this.nextConnection.dispose();this.nextConnection=null}}setOutput(a,b){if(a)b===void 0&&(b=null),this.outputConnection||(this.outputConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)),this.outputConnection.setCheck(b);
|
|
1878
|
+
else if(this.outputConnection){if(this.outputConnection.isConnected())throw Error("Must disconnect output value before removing connection.");this.outputConnection.dispose();this.outputConnection=null}}setInputsInline(a){this.inputsInline!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"inline",null,this.inputsInline,a)),this.inputsInline=a)}getInputsInline(){if(this.inputsInline!==void 0)return this.inputsInline;
|
|
1879
|
+
for(var a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof DummyInput$$module$build$src$core$inputs$dummy_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!1;for(a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof $.ValueInput$$module$build$src$core$inputs$value_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!0;for(a=0;a<this.inputList.length;a++)if(this.inputList[a]instanceof EndRowInput$$module$build$src$core$inputs$end_row_input)return!0;
|
|
1880
|
+
return!1}setOutputShape(a){this.outputShape_=a}getOutputShape(){return this.outputShape_}isEnabled(){return this.disabledReasons.size===0}setDisabledReason(a,b){a||this.workspace.options.disable||!this.hasDisabledReason(MANUALLY_DISABLED$$module$build$src$core$constants)||b==MANUALLY_DISABLED$$module$build$src$core$constants||this.setDisabledReason(!1,MANUALLY_DISABLED$$module$build$src$core$constants);this.disabledReasons.has(b)!==a&&(a?this.disabledReasons.add(b):this.disabledReasons.delete(b),
|
|
1881
|
+
a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"disabled",null,!a,a),a.setDisabledReason(b),fire$$module$build$src$core$events$utils(a))}getInheritedDisabled(){for(var a=this.getSurroundParent();a;){if(!a.isEnabled())return!0;a=a.getSurroundParent()}return!1}hasDisabledReason(a){return this.disabledReasons.has(a)}getDisabledReasons(){return this.disabledReasons}isCollapsed(){return this.collapsed_}setCollapsed(a){this.collapsed_!==a&&
|
|
1882
|
+
(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"collapsed",null,this.collapsed_,a)),this.collapsed_=a)}setAriaRoleDescriptionProvider(a){this.ariaRoleDescriptionProvider=a}getAriaRoleDescription(){if(this.ariaRoleDescriptionProvider)return typeof this.ariaRoleDescriptionProvider==="function"?this.ariaRoleDescriptionProvider():replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaRoleDescriptionProvider)}toString(a,
|
|
1883
|
+
b){b=this.toTokens(b);for(let d=2;d<b.length;d++)b[d-2]==="("&&b[d]===")"&&(b[d-2]=b[d-1],b.splice(d-1,2));var c="";b=b.reduce((d,e)=>{d=d+(c==="("||e===")"?"":" ")+e;c=e[e.length-1];return d},"");b=b.trim()||"???";a&&b.length>a&&(b=b.substring(0,a-3)+"...");return b}toTokens(a="?"){var b=[];for(let d of this.inputList)if(d.name!=COLLAPSED_INPUT_NAME$$module$build$src$core$constants){for(let e of d.fieldRow)b.push(e.getText());if(d.connection){let e=d.connection.targetBlock();if(e){var c=d.connection;
|
|
1884
|
+
let f=c.getCheck();!f&&c.targetConnection&&(f=c.targetConnection.getCheck());(c=!!f&&(f.includes("Boolean")||f.includes("Number")))&&b.push("(");b.push(...e.toTokens(a));c&&b.push(")")}else b.push(a)}}return b}appendValueInput(a){return this.appendInput(new $.ValueInput$$module$build$src$core$inputs$value_input(a,this))}appendStatementInput(a){this.statementInputCount++;return this.appendInput(new StatementInput$$module$build$src$core$inputs$statement_input(a,this))}appendDummyInput(a=""){return this.appendInput(new DummyInput$$module$build$src$core$inputs$dummy_input(a,
|
|
1885
|
+
this))}appendEndRowInput(a=""){return this.appendInput(new EndRowInput$$module$build$src$core$inputs$end_row_input(a,this))}appendInput(a){this.inputList.push(a);return a}appendInputFromRegistry(a,b){return(a=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,a,!1))?this.appendInput(new a(b,this)):null}jsonInit(a){var b=a.type?'Block "'+a.type+'": ':"";if(a.output&&a.previousStatement)throw Error(b+"Must not have both an output and a previousStatement.");for(var c=
|
|
1886
|
+
0;a[`args${c}`];){if(a[`message${c}`]===void 0)throw Error(b+`args${c} must have a corresponding message (message${c}).`);c++}a.style&&typeof a.style==="object"&&(this.hat=a.style.hat,a.style=null);if(a.style&&a.colour)throw Error(b+"Must not have both a colour and a style.");a.style?this.jsonInitStyle(a,b):this.jsonInitColour(a,b);for(c=0;a[`message${c}`]!==void 0;)this.interpolate(a[`message${c}`]||"",a[`args${c}`]||[],a[`implicitAlign${c}`]||a[`lastDummyAlign${c}`],b),c++;a.inputsInline!==void 0&&
|
|
1887
|
+
($.disable$$module$build$src$core$events$utils(),this.setInputsInline(a.inputsInline),$.enable$$module$build$src$core$events$utils());a.output!==void 0&&this.setOutput(!0,a.output);a.outputShape!==void 0&&this.setOutputShape(a.outputShape);a.previousStatement!==void 0&&this.setPreviousStatement(!0,a.previousStatement);a.nextStatement!==void 0&&this.setNextStatement(!0,a.nextStatement);a.tooltip!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip),this.setTooltip(c));
|
|
1888
|
+
a.enableContextMenu!==void 0&&(this.contextMenu=!!a.enableContextMenu);a.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!a.suppressPrefixSuffix);a.helpUrl!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.helpUrl),this.setHelpUrl(c));a.ariaRoleDescription!==void 0&&this.setAriaRoleDescriptionProvider(a.ariaRoleDescription);typeof a.extensions==="string"&&(console.warn(b+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+
|
|
1889
|
+
a.type+"' block."),a.extensions=[a.extensions]);a.mutator!==void 0&&apply$$module$build$src$core$extensions(a.mutator,this,!0);a=a.extensions;if(Array.isArray(a))for(b=0;b<a.length;b++)apply$$module$build$src$core$extensions(a[b],this,!1)}jsonInitColour(a,b){if("colour"in a)if(a.colour===void 0)console.warn(b+"Undefined colour value.");else{a=a.colour;try{this.setColour(a)}catch(c){console.warn(b+"Illegal colour value: ",a)}}}jsonInitStyle(a,b){a=a.style;try{this.setStyle(a)}catch(c){console.warn(b+
|
|
1890
|
+
"Style does not exist: ",a)}}mixin(a,b){if(b!==void 0&&typeof b!=="boolean")throw Error("opt_disableCheck must be a boolean if provided");if(!b){b=[];for(let c in a)this[c]!==void 0&&b.push(c);if(b.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(b));}Object.assign(this,a)}interpolate(a,b,c,d){a=tokenizeInterpolation$$module$build$src$core$utils$parsing(a);this.validateTokens(a,b.length);b=this.interpolateArguments(a,b,c);c=[];for(let e=0,f;f=b[e];e++)if(this.isInputKeyword(f.type)){if(a=
|
|
1891
|
+
this.inputFromJson(f,d)){for(let g=0,h;h=c[g];g++)a.appendField(h[0],h[1]);c.length=0}}else(a=this.fieldFromJson(f))&&c.push([a,f.name])}validateTokens(a,b){var c=[],d=0;for(let e=0;e<a.length;e++){let f=a[e];if(typeof f==="number"){if(f<1||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");
|
|
1892
|
+
}interpolateArguments(a,b,c){var d=[];for(let f=0;f<a.length;f++){var e=a[f];typeof e==="number"&&(e=b[e-1]);if(typeof e==="string")if(e==="\n")e={type:"input_end_row"},c&&(e.align=c);else if(e=this.stringToFieldJson(e),!e)continue;d.push(e)}(a=d.length)&&!this.isInputKeyword(d[a-1].type)&&(a={type:"input_dummy"},c&&(a.align=c),d.push(a));return d}fieldFromJson(a){var b=$.fromJson$$module$build$src$core$field_registry(a);return!b&&a.alt?typeof a.alt==="string"?(a=this.stringToFieldJson(a.alt))?this.fieldFromJson(a):
|
|
1893
|
+
null:this.fieldFromJson(a.alt):b}inputFromJson(a,b){var c={LEFT:$.Align$$module$build$src$core$inputs$align.LEFT,RIGHT:$.Align$$module$build$src$core$inputs$align.RIGHT,CENTRE:$.Align$$module$build$src$core$inputs$align.CENTRE,CENTER:$.Align$$module$build$src$core$inputs$align.CENTRE};switch(a.type){case "input_value":var d=this.appendValueInput(a.name);break;case "input_statement":d=this.appendStatementInput(a.name);break;case "input_dummy":d=this.appendDummyInput(a.name);break;case "input_end_row":d=
|
|
1894
|
+
this.appendEndRowInput(a.name);break;default:d=this.appendInputFromRegistry(a.type,a.name)}if(!d)return null;a.check&&d.setCheck(a.check);a.align&&(c=c[a.align.toUpperCase()],c===void 0?console.warn(b+"Illegal align value: ",a.align):d.setAlign(c));a.ariaLabelText&&d.setAriaLabelProvider(a.ariaLabelText);return d}isInputKeyword(a){return a==="input_value"||a==="input_statement"||a==="input_dummy"||a==="input_end_row"||hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,
|
|
1895
|
+
a)}stringToFieldJson(a){return(a=a.trim())?{type:"field_label",text:a}:null}moveInputBefore(a,b){if(a!==b){var c=-1,d=b?-1:this.inputList.length;for(let e=0,f;f=this.inputList[e];e++)if(f.name===a){if(c=e,d!==-1)break}else if(b&&f.name===b&&(d=e,c!==-1))break;if(c===-1)throw Error('Named input "'+a+'" not found.');if(d===-1)throw Error('Reference input "'+b+'" not found.');this.moveNumberedInputBefore(c,d)}}moveNumberedInputBefore(a,b){if(a===b)throw Error("Can't move input to itself.");if(a>=this.inputList.length)throw RangeError("Input index "+
|
|
1896
|
+
a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);a<b&&b--;this.inputList.splice(b,0,c)}removeInput(a,b){for(let c=0,d;d=this.inputList[c];c++)if(d.name===a)return d instanceof StatementInput$$module$build$src$core$inputs$statement_input&&this.statementInputCount--,d.dispose(),this.inputList.splice(c,1),!0;if(b)return!1;throw Error("Input not found: "+a);}getInput(a){for(let b=0,c;c=this.inputList[b];b++)if(c.name===
|
|
1897
|
+
a)return c;return null}getInputTargetBlock(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()}getCommentText(){var a,b;return(b=(a=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:a.getText())!=null?b:null}setCommentText(a){var b,c,d=(c=(b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:b.getText())!=null?c:null;if(d!==a){if(a!==null){b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);
|
|
1898
|
+
if(!b){b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,IconType$$module$build$src$core$icons$icon_types.COMMENT.toString(),!1);if(!b)throw Error("No comment icon class is registered, so a comment cannot be set");b=new b(this);if(!isCommentIcon$$module$build$src$core$interfaces$i_comment_icon(b))throw Error("The class registered as a comment icon does not conform to the ICommentIcon interface");b=this.addIcon(b)}$.disable$$module$build$src$core$events$utils();b.setText(a);
|
|
1899
|
+
$.enable$$module$build$src$core$events$utils()}else this.removeIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"comment",null,d,a))}}setWarningText(a,b){}setMutator(a){}addIcon(a){if(this.hasIcon(a.getType()))throw new DuplicateIconType$$module$build$src$core$icons$exceptions(a);this.icons.push(a);this.icons.sort((b,c)=>b.getWeight()-
|
|
1900
|
+
c.getWeight());return a}removeIcon(a){if(!this.hasIcon(a))return!1;var b;(b=this.getIcon(a))==null||b.dispose();this.icons=this.icons.filter(c=>!c.getType().equals(a));return!0}hasIcon(a){return this.icons.some(b=>b.getType().equals(a))}getIcon(a){return a instanceof IconType$$module$build$src$core$icons$icon_types?this.icons.find(b=>b.getType().equals(a)):this.icons.find(b=>b.getType().toString()===a)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");
|
|
1901
|
+
var d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this);c&&d.setReason(c);this.xy.translate(a,b);d.recordNew();fire$$module$build$src$core$events$utils(d)}makeConnection_(a){return new Connection$$module$build$src$core$connection(this,a)}allInputsFilled(a){a===void 0&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++){if(!d.connection)continue;var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=
|
|
1902
|
+
this.getNextBlock())?b.allInputsFilled(a):!0}toDevString(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a}};Block$$module$build$src$core$block.COLLAPSED_INPUT_NAME=COLLAPSED_INPUT_NAME$$module$build$src$core$constants;Block$$module$build$src$core$block.COLLAPSED_FIELD_NAME=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;var module$build$src$core$block={};module$build$src$core$block.Block=Block$$module$build$src$core$block;var disconnectPid$$module$build$src$core$block_animations=null,wobblingBlock$$module$build$src$core$block_animations=null,module$build$src$core$block_animations={};module$build$src$core$block_animations.connectionUiEffect=connectionUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiEffect=disconnectUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiStop=disconnectUiStop$$module$build$src$core$block_animations;
|
|
1849
1903
|
module$build$src$core$block_animations.disposeUiEffect=disposeUiEffect$$module$build$src$core$block_animations;var BlockPaster$$module$build$src$core$clipboard$block_paster=class{paste(a,b,c){if(!b.isCapacityAvailable(a.typeCounts))return null;c&&(a.blockState.x=c.x,a.blockState.y=c.y);c=c||new Coordinate$$module$build$src$core$utils$coordinate(a.blockState.x||0,a.blockState.y||0);$.disable$$module$build$src$core$events$utils();try{var d=append$$module$build$src$core$serialization$blocks(a.blockState,b);moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster(d,c)}finally{$.enable$$module$build$src$core$events$utils()}if(!d)return d;
|
|
1850
1904
|
isEnabled$$module$build$src$core$events$utils()&&!d.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(d));var e=d;finishQueuedRenders$$module$build$src$core$render_management().then(()=>$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e));return d}};BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE="block";
|
|
1851
|
-
register$$module$build$src$core$clipboard$registry(BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,new BlockPaster$$module$build$src$core$clipboard$block_paster);var module$build$src$core$clipboard$block_paster={};module$build$src$core$clipboard$block_paster.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard$block_paster.moveBlockToNotConflict=moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster;var bumpIntoBounds$$module$build$src$core$bump_objects=bumpObjectIntoBounds$$module$build$src$core$bump_objects,module$build$src$core$bump_objects={};module$build$src$core$bump_objects.bumpIntoBounds=bumpObjectIntoBounds$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpIntoBoundsHandler=bumpIntoBoundsHandler$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpTopObjectsIntoBounds=bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects;var
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1905
|
+
register$$module$build$src$core$clipboard$registry(BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,new BlockPaster$$module$build$src$core$clipboard$block_paster);var module$build$src$core$clipboard$block_paster={};module$build$src$core$clipboard$block_paster.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard$block_paster.moveBlockToNotConflict=moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster;var bumpIntoBounds$$module$build$src$core$bump_objects=bumpObjectIntoBounds$$module$build$src$core$bump_objects,module$build$src$core$bump_objects={};module$build$src$core$bump_objects.bumpIntoBounds=bumpObjectIntoBounds$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpIntoBoundsHandler=bumpIntoBoundsHandler$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpTopObjectsIntoBounds=bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects;var stashedCopyData$$module$build$src$core$clipboard=null,stashedWorkspace$$module$build$src$core$clipboard=null,stashedCoordinates$$module$build$src$core$clipboard=void 0,module$build$src$core$clipboard={};module$build$src$core$clipboard.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard.copy=copy$$module$build$src$core$clipboard;module$build$src$core$clipboard.getLastCopiedData=getLastCopiedData$$module$build$src$core$clipboard;
|
|
1906
|
+
module$build$src$core$clipboard.getLastCopiedLocation=getLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.getLastCopiedWorkspace=getLastCopiedWorkspace$$module$build$src$core$clipboard;module$build$src$core$clipboard.paste=paste$$module$build$src$core$clipboard;module$build$src$core$clipboard.registry=module$build$src$core$clipboard$registry;module$build$src$core$clipboard.setLastCopiedData=setLastCopiedData$$module$build$src$core$clipboard;
|
|
1907
|
+
module$build$src$core$clipboard.setLastCopiedLocation=setLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.setLastCopiedWorkspace=setLastCopiedWorkspace$$module$build$src$core$clipboard;var module$build$src$core$comments={};module$build$src$core$comments.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;module$build$src$core$comments.CommentBarButton=CommentBarButton$$module$build$src$core$comments$comment_bar_button;module$build$src$core$comments.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;module$build$src$core$comments.CommentView=CommentView$$module$build$src$core$comments$comment_view;
|
|
1908
|
+
module$build$src$core$comments.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;module$build$src$core$comments.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;module$build$src$core$comments.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;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();
|
|
1909
|
+
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());if(!this.isFlyoutLabel){var 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);setRole$$module$build$src$core$utils$aria(e,
|
|
1910
|
+
Role$$module$build$src$core$utils$aria.PRESENTATION)}a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"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);setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.PRESENTATION);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,
|
|
1911
|
+
{"class":this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);c=replaceMessageReferences$$module$build$src$core$utils$parsing(this.text);this.workspace.RTL&&(c+="\u200f");b.textContent=c;this.isFlyoutLabel&&(this.svgText=b,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));setRole$$module$build$src$core$utils$aria(b,Role$$module$build$src$core$utils$aria.PRESENTATION);d=`${c}, ${this.isFlyoutLabel?$.Msg$$module$build$src$core$msg.ARIA_LABEL_HEADING:
|
|
1912
|
+
$.Msg$$module$build$src$core$msg.ARIA_LABEL_BUTTON}`;setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.LABEL,d);setRole$$module$build$src$core$utils$aria(this.getFocusableElement(),Role$$module$build$src$core$utils$aria.LISTITEM);d=getComputedStyle$$module$build$src$core$utils$style(b,"fontSize");var f=getComputedStyle$$module$build$src$core$utils$style(b,"fontWeight"),g=getComputedStyle$$module$build$src$core$utils$style(b,"fontFamily");
|
|
1913
|
+
this.width=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(b,d,f,g);c=measureFontMetrics$$module$build$src$core$utils$dom(c,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;(h=e)==null||h.setAttribute("width",String(this.width));let k;(k=e)==null||k.setAttribute("height",String(this.height))}a.setAttribute("width",
|
|
1914
|
+
String(this.width));a.setAttribute("height",String(this.height));b.setAttribute("x",String(this.width/2));b.setAttribute("y",String(this.height/2-c.height/2+c.baseline));this.updateTransform();this.onMouseDownWrapper=conditionalBind$$module$build$src$core$browser_events(this.svgGroup,"pointerdown",this,this.onMouseDown);this.onMouseUpWrapper=conditionalBind$$module$build$src$core$browser_events(this.svgGroup,"pointerup",this,this.onMouseUp)}createDom(){return this.svgGroup}show(){this.updateTransform();
|
|
1915
|
+
this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(a,b){this.position.x=a;this.position.y=b;this.updateTransform()}moveBy(a,b,c){this.moveTo(this.position.x+a,this.position.y+b)}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.position.y,this.position.y+this.height,this.position.x,this.position.x+
|
|
1916
|
+
this.width)}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){unbind$$module$build$src$core$browser_events(this.onMouseDownWrapper);unbind$$module$build$src$core$browser_events(this.onMouseUpWrapper);this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup);this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(a){a?this.svgGroup&&(this.svgGroup.appendChild(a),this.cursorSvg=
|
|
1917
|
+
a):this.cursorSvg=null}onMouseUp(a){(a=this.targetWorkspace.getGesture(a))&&a.cancel();this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(a=this.targetWorkspace.getButtonCallback(this.callbackKey))&&a(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}onMouseDown(a){var b=this.targetWorkspace.getGesture(a),
|
|
1918
|
+
c=this.targetWorkspace.getFlyout();b&&c&&b.handleFlyoutStart(a,c)}getSvgRoot(){return this.svgGroup}getFocusableElement(){return this.svgGroup}getFocusableTree(){return this.workspace}onNodeFocus(){var a=this.getPosition();a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.height,a.x,a.x+this.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}getId(){return this.id}performAction(){if(this.isFlyoutLabel)showFlyoutLabelActionHint$$module$build$src$core$hints(this.targetWorkspace);
|
|
1919
|
+
else{var a=this.targetWorkspace.getButtonCallback(this.callbackKey);a&&a(this)}}};FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X=5;FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y=2;FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS=4;register$$module$build$src$core$css("\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n@media (hover: hover) {\n .blocklyFlyoutButton:hover {\n fill: #aaa;\n }\n}\n\n.blocklyFlyoutButton:active {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n");
|
|
1920
|
+
var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.FlyoutButton=FlyoutButton$$module$build$src$core$flyout_button;var module$build$src$core$interfaces$i_contextmenu={};module$build$src$core$interfaces$i_contextmenu.hasContextMenu=hasContextMenu$$module$build$src$core$interfaces$i_contextmenu;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 module$build$src$core$interfaces$i_deletable={};module$build$src$core$interfaces$i_deletable.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;var DragDisposition$$module$build$src$core$interfaces$i_draggable;(function(a){a[a.COMMIT=1]="COMMIT";a[a.DELETE=2]="DELETE";a[a.REVERT=3]="REVERT"})(DragDisposition$$module$build$src$core$interfaces$i_draggable||(DragDisposition$$module$build$src$core$interfaces$i_draggable={}));var module$build$src$core$interfaces$i_draggable={};module$build$src$core$interfaces$i_draggable.DragDisposition=DragDisposition$$module$build$src$core$interfaces$i_draggable;
|
|
1921
|
+
module$build$src$core$interfaces$i_draggable.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;var names$$module$build$src$core$shortcut_items;
|
|
1922
|
+
(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo";a.MENU="menu";a.FOCUS_WORKSPACE="focus_workspace";a.FOCUS_TOOLBOX="focus_toolbox";a.START_MOVE="start_move";a.START_MOVE_STACK="start_move_stack";a.FINISH_MOVE="finish_move";a.ABORT_MOVE="abort_move";a.MOVE_UP="move_up";a.MOVE_DOWN="move_down";a.MOVE_LEFT="move_left";a.MOVE_RIGHT="move_right";a.NAVIGATE_RIGHT="right";a.NAVIGATE_LEFT="left";a.NAVIGATE_UP="up";a.NAVIGATE_DOWN="down";
|
|
1923
|
+
a.DISCONNECT="disconnect";a.NEXT_STACK="next_stack";a.PREVIOUS_STACK="previous_stack";a.INFORMATION="information";a.EXTENDED_INFORMATION="extended_information";a.PERFORM_ACTION="perform_action";a.DUPLICATE="duplicate";a.CLEANUP="cleanup";a.SHOW_TOOLTIP="show_tooltip";a.NEXT_HEADING="next_heading";a.PREVIOUS_HEADING="previous_heading";a.TOGGLE_SCREENREADER="toggle_screenreader"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));
|
|
1924
|
+
var resolveWorkspace$$module$build$src$core$shortcut_items=a=>{if(a.isFlyout){let c=a.targetWorkspace;if(c)return resolveWorkspace$$module$build$src$core$shortcut_items(c)}var b;return(b=a.getRootWorkspace())!=null?b:a};registerDefaultShortcuts$$module$build$src$core$shortcut_items();registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items();registerScreenReaderShortcuts$$module$build$src$core$shortcut_items();var module$build$src$core$shortcut_items={};
|
|
1925
|
+
module$build$src$core$shortcut_items.names=names$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerArrowNavigation=registerArrowNavigation$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCleanup=registerCleanup$$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;
|
|
1926
|
+
module$build$src$core$shortcut_items.registerDefaultShortcuts=registerDefaultShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDelete=registerDelete$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDisconnectBlock=registerDisconnectBlock$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDuplicate=registerDuplicate$$module$build$src$core$shortcut_items;
|
|
1927
|
+
module$build$src$core$shortcut_items.registerEscape=registerEscape$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerFocusToolbox=registerFocusToolbox$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerFocusWorkspace=registerFocusWorkspace$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerHeadingNavigation=registerHeadingNavigation$$module$build$src$core$shortcut_items;
|
|
1928
|
+
module$build$src$core$shortcut_items.registerKeyboardNavigationShortcuts=registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerMovementShortcuts=registerMovementShortcuts$$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.registerPerformAction=registerPerformAction$$module$build$src$core$shortcut_items;
|
|
1929
|
+
module$build$src$core$shortcut_items.registerReadExtendedInformation=registerReadExtendedInformation$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerReadInformation=registerReadInformation$$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.registerScreenReaderShortcuts=registerScreenReaderShortcuts$$module$build$src$core$shortcut_items;
|
|
1930
|
+
module$build$src$core$shortcut_items.registerShowContextMenu=registerShowContextMenu$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerShowTooltip=registerShowTooltip$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerStackNavigation=registerStackNavigation$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerToggleScreenreaderMode=registerToggleScreenreaderMode$$module$build$src$core$shortcut_items;
|
|
1931
|
+
module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src$core$shortcut_items;var unconstrainedMoveHintId$$module$build$src$core$hints="unconstrainedMoveHint",constrainedMoveHintId$$module$build$src$core$hints="constrainedMoveHint",helpHintId$$module$build$src$core$hints="helpHint",blockNavigationHintId$$module$build$src$core$hints="blockNavigationHint",workspaceNavigationHintId$$module$build$src$core$hints="workspaceNavigationHint",flyoutLabelHintId$$module$build$src$core$hints="flyoutLabelHint",copiedHintId$$module$build$src$core$hints="copiedHint",cutHintId$$module$build$src$core$hints=
|
|
1932
|
+
"cutHint",screenreaderHintId$$module$build$src$core$hints="screenreaderHint",module$build$src$core$hints={};module$build$src$core$hints.clearMoveHints=clearMoveHints$$module$build$src$core$hints;module$build$src$core$hints.clearPasteHints=clearPasteHints$$module$build$src$core$hints;module$build$src$core$hints.showBlockNavigationHint=showBlockNavigationHint$$module$build$src$core$hints;module$build$src$core$hints.showConstrainedMovementHint=showConstrainedMovementHint$$module$build$src$core$hints;
|
|
1933
|
+
module$build$src$core$hints.showCopiedHint=showCopiedHint$$module$build$src$core$hints;module$build$src$core$hints.showCutHint=showCutHint$$module$build$src$core$hints;module$build$src$core$hints.showFlyoutLabelActionHint=showFlyoutLabelActionHint$$module$build$src$core$hints;module$build$src$core$hints.showHelpHint=showHelpHint$$module$build$src$core$hints;module$build$src$core$hints.showScreenreaderModeHint=showScreenreaderModeHint$$module$build$src$core$hints;
|
|
1934
|
+
module$build$src$core$hints.showUnconstrainedMoveHint=showUnconstrainedMoveHint$$module$build$src$core$hints;module$build$src$core$hints.showWorkspaceNavigationHint=showWorkspaceNavigationHint$$module$build$src$core$hints;var MoveMode$$module$build$src$core$dragging$block_drag_strategy;(function(a){a[a.CONSTRAINED=1]="CONSTRAINED";a[a.UNCONSTRAINED=2]="UNCONSTRAINED"})(MoveMode$$module$build$src$core$dragging$block_drag_strategy||(MoveMode$$module$build$src$core$dragging$block_drag_strategy={}));
|
|
1858
1935
|
var BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy=class{constructor(a){this.block=a;this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null;this.dragging=!1;this.allConnectionPairs=[];this.moveMode=MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED;this.originalEventGroup="";this.BLOCK_CONNECTION_OFFSET=10;this.workspace=a.workspace}isMovable(){var a;return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&
|
|
1859
1936
|
!this.workspace.isReadOnly()&&(!this.block.isInFlyout||this.block.isEnabled()&&!((a=this.block.workspace.targetWorkspace)==null?0:a.isReadOnly()))}positionNewBlock(a,b){a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(a.workspace,a.getRelativeToSurfaceXY());a=screenToWsCoordinates$$module$build$src$core$utils$svg_math(b.workspace,a);b.moveDuringDrag(a)}getTargetBlock(){if(this.block.isShadow()){var a=this.block.getParent();if(a)return a}else if(this.block.isInFlyout&&this.block.workspace.targetWorkspace&&
|
|
1860
1937
|
(a=this.block.getRootBlock(),a=save$$module$build$src$core$serialization$blocks(a)))return a=appendInternal$$module$build$src$core$serialization$blocks(a,this.block.workspace.targetWorkspace,{recordUndo:!0}),$.setRecordUndo$$module$build$src$core$events$utils(!1),this.positionNewBlock(this.block,a),$.setRecordUndo$$module$build$src$core$events$utils(!0),a;return this.block}announceMove(a=!1){if(this.connectionCandidate)a=computeMoveLabel$$module$build$src$core$block_aria_composer(this.connectionCandidate.local,
|
|
1861
1938
|
this.connectionCandidate.neighbour,this.hasMultipleCompatibleConnections.bind(this),a);else{let b=a?this.block.getStackBlocksCountLabel():"";a=$.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_WORKSPACE;a=a.replace("%1",b)}announceDynamicAriaState$$module$build$src$core$utils$aria(a.replace(/\s+/g," "))}hasMultipleCompatibleConnections(a=!0){var b=this.connectionCandidate;if(!b)return!1;var c=a?"local":"neighbour",d=a?"neighbour":"local";return this.allConnectionPairs.filter(e=>e[d]===b[d]&&e[c]!==b[c].getSourceBlock().nextConnection&&
|
|
1862
|
-
e[c].getSourceBlock().id===b[c].getSourceBlock().id).length>1}startDrag(a){var b=this.getTargetBlock();if(b!==this.block)return b.startDrag(a);this.dragging=!0;this.fireDragStartEvent();this.startLoc=this.block.getRelativeToSurfaceXY();this.connectionCandidate=null;this.connectionPreviewer=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,this.workspace.options))(this.block);startTextWidthCache$$module$build$src$core$utils$dom();
|
|
1863
|
-
disconnectUiStop$$module$build$src$core$block_animations();b=this.shouldHealStack(a);this.shouldDisconnect(b)&&this.disconnectBlock(b);this.block.setDragging(!0);
|
|
1864
|
-
|
|
1865
|
-
this.block.workspace.connectionChecker,b=[];this.allConnectionPairs=[];var c=this.getLocalConnections(this.block);for(let d of this.block.workspace.getTopBlocks(!0))b.push(...this.getAllConnections(d));for(let d of b)for(let e of c){let f;!a.canConnect(e,d,!0,Infinity)||((f=d.targetBlock())==null?0:f.isInsertionMarker())||
|
|
1866
|
-
b.bubbleIsVisible()).map(b=>b.getBubble()).filter(b=>!!b).sort((b,c)=>{b=b.getSvgRoot().compareDocumentPosition(c.getSvgRoot());return b&Node.DOCUMENT_POSITION_PRECEDING?1:b&Node.DOCUMENT_POSITION_FOLLOWING?-1:0})}shouldHealStack(a){return a instanceof PointerEvent?a.ctrlKey||a.metaKey:a instanceof KeyboardEvent
|
|
1867
|
-
this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}storeInitialConnections(a){var b=null,c=null,d;if((d=this.block.outputConnection)==null?0:d.isConnected())b=this.block.outputConnection,c=this.block.outputConnection.targetConnection;else{let e;if((e=this.block.previousConnection)==
|
|
1868
|
-
distance:0}:a&&(a=this.block.nextConnection,b=a==null?void 0:a.targetConnection,a&&b&&(this.connectionCandidate={local:a,neighbour:b,distance:0}),this.startChildConn=b!=null?b:null)}fireDragStartEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block
|
|
1869
|
-
!
|
|
1870
|
-
MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED;this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED&&this.block.moveDuringDrag(a);this.updateConnectionPreview(this.block,Coordinate$$module$build$src$core$utils$coordinate.difference(a,
|
|
1871
|
-
(d.x-c.x);b=this.startLoc.y+(d.y-c.y);let e=this.BLOCK_CONNECTION_OFFSET;c.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||c.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?(a+=e,b+=e):(a-=e,b-=e);this.block.moveDuringDrag(new Coordinate$$module$build$src$core$utils$coordinate(a,
|
|
1872
|
-
this.workspace.getAudioManager().playErrorBeep()
|
|
1873
|
-
if(
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
b)
|
|
1877
|
-
MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED?
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
this.
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
if(b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE||!c.length)return this.connectionCandidate;var d=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT||b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,
|
|
1885
|
-
|
|
1886
|
-
var c=a.workspace.getTopBlocks(!0),d=c.indexOf(a);b=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP?-1:1;var e=d+b;for(d=a.getConnections_(!1);e>=0&&e<c.length;e+=b){let f=c[e];for(let g of d)for(let h of f.getConnections_(!1))if(a.workspace.connectionChecker.canConnect(g,
|
|
1887
|
-
b);var {x:c,y:d}=a;return c<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:c>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:d<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:d>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:
|
|
1888
|
-
if(!a.isCollapsed())for(let c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);let d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&(b.push(a.nextConnection),(a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));
|
|
1939
|
+
e[c].getSourceBlock().id===b[c].getSourceBlock().id).length>1}startDrag(a){var b=this.getTargetBlock();if(b!==this.block)return b.startDrag(a);this.block.workspace.recordDragTargets();this.dragging=!0;this.fireDragStartEvent();this.startLoc=this.block.getRelativeToSurfaceXY();this.connectionCandidate=null;this.connectionPreviewer=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,this.workspace.options))(this.block);startTextWidthCache$$module$build$src$core$utils$dom();
|
|
1940
|
+
this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();b=this.shouldHealStack(a);this.storeInitialConnections(b);this.shouldDisconnect(b)&&this.disconnectBlock(b);this.block.setDragging(!0);if(a instanceof KeyboardEvent){this.cacheAllConnectionPairs();if(a=this.updateConnectionPreview(this.block,new Coordinate$$module$build$src$core$utils$coordinate(0,0)))a=a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT?new Coordinate$$module$build$src$core$utils$coordinate(a.x,
|
|
1941
|
+
a.y-this.block.getHeightWidth().height-this.BLOCK_CONNECTION_OFFSET):new Coordinate$$module$build$src$core$utils$coordinate(a.x+this.BLOCK_CONNECTION_OFFSET,a.y+this.BLOCK_CONNECTION_OFFSET),this.block.moveDuringDrag(a);this.allConnectionPairs.length?showConstrainedMovementHint$$module$build$src$core$hints(this.workspace):showUnconstrainedMoveHint$$module$build$src$core$hints(this.workspace)}else this.block.moveDuringDrag(this.startLoc);var c;(c=this.workspace.getLayerManager())==null||c.moveToDragLayer(this.block);
|
|
1942
|
+
this.getVisibleBubbles(this.block).forEach(d=>{var e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(d,!1)});this.announceMove(!0);return this.block}cacheAllConnectionPairs(){var a=this.block.workspace.connectionChecker,b=[];this.allConnectionPairs=[];var c=this.getLocalConnections(this.block);for(let d of this.block.workspace.getTopBlocks(!0))b.push(...this.getAllConnections(d));for(let d of b)for(let e of c){let f;!a.canConnect(e,d,!0,Infinity)||((f=d.targetBlock())==null?0:f.isInsertionMarker())||
|
|
1943
|
+
this.allConnectionPairs.push({local:e,neighbour:d})}}getVisibleBubbles(a){return a.getDescendants(!1).flatMap(b=>b.getIcons()).filter(b=>hasBubble$$module$build$src$core$interfaces$i_has_bubble(b)&&b.bubbleIsVisible()).map(b=>b.getBubble()).filter(b=>!!b).sort((b,c)=>{b=b.getSvgRoot().compareDocumentPosition(c.getSvgRoot());return b&Node.DOCUMENT_POSITION_PRECEDING?1:b&Node.DOCUMENT_POSITION_FOLLOWING?-1:0})}shouldHealStack(a){return a instanceof PointerEvent?a.ctrlKey||a.metaKey:a instanceof KeyboardEvent?
|
|
1944
|
+
!(a.shiftKey||!this.block.previousConnection):!1}shouldDisconnect(a){return!!(this.block.getParent()||a&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(a){this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}storeInitialConnections(a){var b=null,c=null,d;if((d=this.block.outputConnection)==null?0:d.isConnected())b=this.block.outputConnection,c=this.block.outputConnection.targetConnection;else{let e;if((e=this.block.previousConnection)==
|
|
1945
|
+
null?0:e.isConnected())b=this.block.previousConnection,c=this.block.previousConnection.targetConnection}this.startParentConn=c;b&&c?this.connectionCandidate={local:b,neighbour:c,distance:0}:a&&(a=this.block.nextConnection,b=a==null?void 0:a.targetConnection,a&&b&&(this.connectionCandidate={local:a,neighbour:b,distance:0}),this.startChildConn=b!=null?b:null)}fireDragStartEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block,
|
|
1946
|
+
!0,this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this.block);a.setReason(["drag"]);a.oldCoordinate=
|
|
1947
|
+
this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}drag(a,b){this.moveMode=b instanceof KeyboardEvent&&!b.ctrlKey&&!b.metaKey?MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED:MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED;this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED&&this.block.moveDuringDrag(a);b=!!this.connectionCandidate;this.updateConnectionPreview(this.block,Coordinate$$module$build$src$core$utils$coordinate.difference(a,
|
|
1948
|
+
this.startLoc));if(this.connectionCandidate){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){let {local:c,neighbour:d}=this.connectionCandidate;a=this.startLoc.x+(d.x-c.x);b=this.startLoc.y+(d.y-c.y);let e=this.BLOCK_CONNECTION_OFFSET;c.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||c.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?(a+=e,b+=e):(a-=e,b-=e);this.block.moveDuringDrag(new Coordinate$$module$build$src$core$utils$coordinate(a,
|
|
1949
|
+
b))}}else if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){this.allConnectionPairs.length||showUnconstrainedMoveHint$$module$build$src$core$hints(this.workspace,!0);b||this.workspace.getAudioManager().playErrorBeep();return}this.announceMove()}updateConnectionPreview(a,b){var c=this.connectionCandidate,d,e=(d=this.getInitialCandidate())!=null?d:this.getConnectionCandidate(b);if(e){var f=c&&this.currCandidateIsBetter(c,b,e)?c:e;this.connectionCandidate=f;
|
|
1950
|
+
var {local:g,neighbour:h}=f;f=g.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE||g.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT;var k,l=h.isConnected()&&!((k=h.targetBlock())==null?0:k.isInsertionMarker());if(f&&l&&!this.orphanCanConnectAtEnd(a,h.targetBlock(),g.type)){var m;(m=this.connectionPreviewer)==null||m.previewReplacement(g,h,h.targetBlock())}else{let p;(p=this.connectionPreviewer)==null||p.previewConnection(g,h)}return h}m=c==
|
|
1951
|
+
null?void 0:c.neighbour.getSourceBlock();var n;k=(n=m==null?void 0:m.getRootBlock())!=null?n:m;k===a&&(k=m);m=this.getDirectionToNewLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,b));if(k=(l=k)==null?void 0:l.getBoundingRectangle()){switch(m){case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:l=new Coordinate$$module$build$src$core$utils$coordinate(k.getOrigin().x,k.getOrigin().y-
|
|
1952
|
+
this.BLOCK_CONNECTION_OFFSET*2-a.getHeightWidth().height);break;default:l=new Coordinate$$module$build$src$core$utils$coordinate(k.getOrigin().x,k.getOrigin().y+k.getHeight()+this.BLOCK_CONNECTION_OFFSET*2)}a.moveDuringDrag(l);(f=this.connectionPreviewer)==null||f.hidePreview();this.connectionCandidate=null}}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:
|
|
1953
|
+
b.previousConnection)}currCandidateIsBetter(a,b,c){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED)return!1;var {local:d,neighbour:e}=a;a=new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y);var f=new Coordinate$$module$build$src$core$utils$coordinate(e.x,e.y);b=Coordinate$$module$build$src$core$utils$coordinate.distance(Coordinate$$module$build$src$core$utils$coordinate.sum(a,b),f);return c.distance>b-$.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(a){return this.moveMode===
|
|
1954
|
+
MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED?this.findTraversalCandidate(a):this.getClosestCandidate(this.block,a)}getClosestCandidate(a,b){var c=this.getSearchRadius();a=this.getLocalConnections(a);var d=null;for(let e of a){let {connection:f,radius:g}=e.closest(c,b);f&&(d={local:e,neighbour:f,distance:g},c=g)}return d}getSearchRadius(){return this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED?Infinity:this.connectionCandidate?$.config$$module$build$src$core$config.connectingSnapRadius:
|
|
1955
|
+
$.config$$module$build$src$core$config.snapRadius}getLocalConnections(a){var b=a.getConnections_(!1),c=a.lastConnectionInStack(!0);c&&c!==a.nextConnection&&b.push(c);a=[a.outputConnection,a.previousConnection,a.nextConnection].filter(d=>!!d);c=[];for(let d of b)a.includes(d)||c.push(d);c.reverse();return[...a,...c]}endDrag(a,b){b===DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE&&disposeUiEffect$$module$build$src$core$block_animations(this.block);this.originalEventGroup=$.getGroup$$module$build$src$core$events$utils();
|
|
1956
|
+
this.fireDragEndEvent();this.fireMoveEvent();stopTextWidthCache$$module$build$src$core$utils$dom();disconnectUiStop$$module$build$src$core$block_animations();var c;(c=this.connectionPreviewer)==null||c.hidePreview();if(!this.block.isDeadOrDying()&&this.dragging){let d;(d=this.workspace.getLayerManager())==null||d.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.getVisibleBubbles(this.block).forEach(e=>{var f;return(f=this.workspace.getLayerManager())==null?void 0:f.moveOffDragLayer(e,
|
|
1957
|
+
BUBBLE$$module$build$src$core$layers,!1)});this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):(b!==DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE&&this.workspace.getAudioManager().play("drop"),this.block.queueRender().then(()=>this.disposeStep()));this.allConnectionPairs=[]}disposeStep(){var a=$.getGroup$$module$build$src$core$events$utils();$.setGroup$$module$build$src$core$events$utils(this.originalEventGroup);
|
|
1958
|
+
this.block.snapToGrid();var b;(b=this.connectionPreviewer)==null||b.dispose();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(a)}applyConnections(a){var {local:b,neighbour:c}=a;b.connect(c);var d=b.isSuperior()?c:b,e=this.block.getRootBlock();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{connectionUiEffect$$module$build$src$core$block_animations(d.getSourceBlock());setTimeout(()=>{e.bringToFront()},0)})}revertDrag(){var a;(a=this.connectionPreviewer)==
|
|
1959
|
+
null||a.hidePreview();this.connectionCandidate=null;if(this.block.nextConnection){let b;(b=this.startChildConn)==null||b.connect(this.block.nextConnection)}if(this.startParentConn)switch(this.startParentConn.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:this.block.outputConnection&&this.startParentConn.connect(this.block.outputConnection);break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:this.block.previousConnection&&this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveDuringDrag(this.startLoc);
|
|
1960
|
+
let b;(b=this.workspace.getLayerManager())==null||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.getVisibleBubbles(this.block).forEach(c=>{var d;return(d=this.workspace.getLayerManager())==null?void 0:d.moveOffDragLayer(c,BUBBLE$$module$build$src$core$layers,!1)});bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null;this.block.setDragging(!1);
|
|
1961
|
+
this.dragging=!1;announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_CANCELED)}findTraversalCandidate(a){var b=this.getDirectionToNewLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,a)),c=this.allConnectionPairs;if(b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE||!c.length)return this.connectionCandidate;var d=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT||b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,
|
|
1962
|
+
e=c.findIndex(f=>{var g,h;return((g=this.connectionCandidate)==null?void 0:g.local)===f.local&&((h=this.connectionCandidate)==null?void 0:h.neighbour)===f.neighbour});b=this.block.workspace.getNavigator();return d?e===-1?(d=this.isInTerminalPosition(this.block,Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN),b.getNavigationLoops()?this.pairToCandidate(c[0]):d?null:this.getClosestCandidate(this.block,a)):e===c.length-1?null:this.pairToCandidate(c[e+1]):e===-1?(d=this.isInTerminalPosition(this.block,
|
|
1963
|
+
Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP),b.getNavigationLoops()?this.pairToCandidate(c[c.length-1]):d?null:this.getClosestCandidate(this.block,a)):e===0?null:this.pairToCandidate(c[e-1])}isInTerminalPosition(a,b){if(a.getParent())return!1;var c=a.workspace.getTopBlocks(!0),d=c.indexOf(a);b=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP?-1:1;var e=d+b;for(d=a.getConnections_(!1);e>=0&&e<c.length;e+=b){let f=c[e];for(let g of d)for(let h of f.getConnections_(!1))if(a.workspace.connectionChecker.canConnect(g,
|
|
1964
|
+
h,!0,Infinity))return!1}return!0}pairToCandidate(a){return Object.assign({},a,{distance:0})}getDirectionToNewLocation(a){var b=this.block.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,b);var {x:c,y:d}=a;return c<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:c>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:d<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:d>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:
|
|
1965
|
+
Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE}getAllConnections(a){if(a.isShadow())return[];var b=[];a.outputConnection&&b.push(a.outputConnection);a.previousConnection&&b.push(a.previousConnection);if(!a.isCollapsed())for(let c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);let d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&(b.push(a.nextConnection),(a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));
|
|
1966
|
+
return b}getInitialCandidate(){var a=this.workspace.getSvgGroup().querySelector(`.${FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME}`);if(!a||!a.id||a===this.block.getFocusableElement())return null;a=this.workspace.lookUpFocusableNode(a.id);if(!a)return null;var b=this.workspace.getNavigator().getSourceBlockFromNode(a);if(!b)return null;var c=null;if(b.getConnections_(!1).includes(a)){c=a;let f=this.block.workspace.connectionChecker;if(a=this.block.getConnections_(!1).find(g=>
|
|
1967
|
+
f.canConnect(g,c,!0,Infinity)))return{local:a,neighbour:c,distance:0}}if(a=this.allConnectionPairs.find(f=>f.neighbour.getSourceBlock()===b))return this.pairToCandidate(a);var d,e=(d=b.outputConnection)==null?void 0:d.targetConnection;return(d=this.allConnectionPairs.find(f=>f.neighbour===e))?this.pairToCandidate(d):null}},module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var TextBubble$$module$build$src$core$bubbles$text_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d,e){super(b,c,d,void 0,e);this.text=a;this.workspace=b;this.anchor=c;this.ownerRect=d;this.owner=e;this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize();addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextBubble")}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);
|
|
1889
1968
|
this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize()}stringToSvg(a,b){b=this.createParagraph(b);a=this.createTextFragments(b,a);this.workspace.RTL&&this.rightAlignTextFragments(b.getBBox().width,a);return b}createParagraph(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?
|
|
1890
1969
|
"rtl":"ltr"}`},a)}createTextFragments(a,b){var c=1;return b.split("\n").map(d=>{var e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{y:`${c}em`,x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);d=document.createTextNode(d);e.appendChild(d);c+=1;return e})}rightAlignTextFragments(a,b){for(let c of b)c.setAttribute("text-anchor","start"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){var a=
|
|
1891
1970
|
this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size(a.width+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2,a.height+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2),!0)}},module$build$src$core$bubbles$text_bubble={};module$build$src$core$bubbles$text_bubble.TextBubble=TextBubble$$module$build$src$core$bubbles$text_bubble;var SIZE$$module$build$src$core$icons$warning_icon=17,WarningIcon$$module$build$src$core$icons$warning_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textMap=new Map;this.textBubble=null}getType(){return WarningIcon$$module$build$src$core$icons$warning_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},
|
|
@@ -1897,7 +1976,7 @@ a,"warning"));b.recomputeAriaContext()}})}getBubble(){return this.textBubble}get
|
|
|
1897
1976
|
$.Msg$$module$build$src$core$msg.ICON_LABEL_WARNING_CLOSED}};WarningIcon$$module$build$src$core$icons$warning_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.WARNING;WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT=2;var module$build$src$core$icons$warning_icon={};module$build$src$core$icons$warning_icon.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;var BlockSvg$$module$build$src$core$block_svg=class extends Block$$module$build$src$core$block{constructor(a,b,c){super(a,b,c);this.childlessWidth=this.width=this.height=0;this.warningTextDb=new Map;this.mutator=null;this.rendered=!0;this.visuallyDisabled=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.translation="";this.dragging=!1;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.dragStrategy=new BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy(this);
|
|
1898
1977
|
if(!a.rendered)throw TypeError("Cannot create a rendered block in a headless workspace");this.workspace=a;this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});b&&addClass$$module$build$src$core$utils$dom(this.svgGroup,b);this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup,this.style);a=this.pathObject.svgPath;a.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(a);
|
|
1899
1978
|
this.svgGroup.setAttribute("data-id",this.id);a.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.doInit_()}initSvg(){if(!this.initialized){for(var a of this.inputList)a.init();for(let b of this.getIcons())b.initView(this.createIconPointerDownListener(b)),b.updateEditable();this.applyColour();this.pathObject.updateMovable(this.isMovable()||this.isInFlyout);(a=this.getSvgRoot())&&conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown);a.parentNode||
|
|
1900
|
-
this.workspace.getCanvas().appendChild(a);this.
|
|
1979
|
+
this.workspace.getCanvas().appendChild(a);this.recomputeAriaContext();this.initialized=!0}}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){this.addSelect();fireSelectedEvent$$module$build$src$core$common(this)}unselect(){this.removeSelect();fireSelectedEvent$$module$build$src$core$common(null)}setParent(a){var b=this.parentBlock_;if(a!==b){startTextWidthCache$$module$build$src$core$utils$dom();super.setParent(a);stopTextWidthCache$$module$build$src$core$utils$dom();
|
|
1901
1980
|
var c=this.getSvgRoot();if(!this.workspace.isClearing&&c){var d=this.getRelativeToSurfaceXY(),e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),f,g=this.getSvgRoot().contains((f=e==null?void 0:e.getFocusableElement())!=null?f:null);a?(a.getSvgRoot().appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)):b&&(a=this.workspace.getCanvas().querySelector(".blocklyDragging"),b=a==null?void 0:a.parentElement,f=this.workspace.getCanvas(),b===
|
|
1902
1981
|
f?f.insertBefore(c,a):(f.appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)),this.translate(d.x,d.y));this.applyColour()}}}getRelativeToSurfaceXY(){var a=this.workspace.getLayerManager();if(!a)throw Error("Cannot calculate position because the workspace has not been appended");var b=0,c=0,d=this.getSvgRoot();if(d){do{let e=getRelativeXY$$module$build$src$core$utils$svg_math(d);b+=e.x;c+=e.y;d=d.parentNode}while(d&&!a.hasLayer(d))}return new Coordinate$$module$build$src$core$utils$coordinate(b,
|
|
1903
1982
|
c)}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");var d=isEnabled$$module$build$src$core$events$utils(),e=null;d&&(e=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this),c&&e.setReason(c));a=new Coordinate$$module$build$src$core$utils$coordinate(a,b);b=this.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.sum(b,a);this.translate(a.x,a.y);this.updateComponentLocations(a);d&&e&&(e.recordNew(),fire$$module$build$src$core$events$utils(e));
|
|
@@ -1905,17 +1984,17 @@ this.workspace.resizeContents()}translate(a,b){this.translation=`translate(${a},
|
|
|
1905
1984
|
!this.getParent()&&!this.isInFlyout){var a=this.workspace.getGrid();if(a!=null&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}getBoundingRectangle(){return this.getBoundingRectangleWithDimensions(this.getHeightWidth())}getBoundingRectangleWithoutChildren(){return this.getBoundingRectangleWithDimensions({height:this.height,width:this.childlessWidth})}getBoundingRectangleWithDimensions(a){var b=this.getRelativeToSurfaceXY();if(this.RTL){var c=b.x-
|
|
1906
1985
|
a.width;var d=b.x}else c=b.x,d=b.x+a.width;return new Rect$$module$build$src$core$utils$rect(b.y,b.y+a.height,c,d)}markDirty(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(let a=0,b;b=this.inputList[a];a++)b.markDirty()}setCollapsed(a){this.collapsed_!==a&&(super.setCollapsed(a),this.updateCollapsed())}childHasWarning(){var a=this.getNextBlock();a=a?new Set(a.getDescendants(!1)):null;var b=this.getDescendants(!1);for(let c of b)if(c!==this&&(a==null||!a.has(c))&&c.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))return!0;
|
|
1907
1986
|
return!1}updateCollapsed(){var a=this.isCollapsed(),b=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,c=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;for(let e=0,f;f=this.inputList[e];e++)f.name!==b&&f.setVisible(!a);for(var d of this.getIcons())d.updateCollapsed();a?(addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyCollapsed"),this.childHasWarning()&&this.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID),
|
|
1908
|
-
a=this.toString(COLLAPSE_CHARS$$module$build$src$core$internal_constants),(d=this.getField(c))?d.setValue(a):((this.getInput(b)||this.appendDummyInput(b)).appendField(new FieldLabel$$module$build$src$core$field_label(a),c),this.
|
|
1987
|
+
a=this.toString(COLLAPSE_CHARS$$module$build$src$core$internal_constants),(d=this.getField(c))?d.setValue(a):((this.getInput(b)||this.appendDummyInput(b)).appendField(new FieldLabel$$module$build$src$core$field_label(a),c),this.recomputeAriaContext())):(this.updateDisabled(),this.removeInput(b),removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyCollapsed"),this.setWarningText(null,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID))}onMouseDown(a){if(!this.workspace.isReadOnly()){var b=
|
|
1909
1988
|
this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)}}showHelp(){var a=typeof this.helpUrl==="function"?this.helpUrl():this.helpUrl;a&&window.open(a)}generateContextMenu(a){if(this.workspace.isReadOnly()||!this.contextMenu)return null;a=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({block:this,focusedNode:this},a);this.customContextMenu&&this.customContextMenu(a);return a}calculateContextMenuLocation(a){if(a instanceof PointerEvent)return new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
|
|
1910
1989
|
a.clientY);a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY());var b,c,d=(b=this.inputList.filter(e=>e.isVisible()).flatMap(e=>e.fieldRow).find(e=>e.isVisible()))==null?void 0:(c=b.getSvgRoot())==null?void 0:c.getBoundingClientRect();return new Coordinate$$module$build$src$core$utils$coordinate(this.RTL?a.x-5:a.x+5,(d&&d.height?d.y+d.height:a.y+this.height)+5)}showContextMenu(a){var b=this.generateContextMenu(a),c=this.calculateContextMenuLocation(a);
|
|
1911
1990
|
b&&b.length&&(show$$module$build$src$core$contextmenu(a,b,this.RTL,this.workspace,c),setCurrentBlock$$module$build$src$core$contextmenu(this))}updateComponentLocations(a){this.dragging||this.updateConnectionLocations(a);this.updateIconLocations(a);this.updateFieldLocations(a);for(let b of this.getChildren(!1))b.updateComponentLocations(Coordinate$$module$build$src$core$utils$coordinate.sum(a,b.relativeCoords))}updateConnectionLocations(a){for(let b of this.getConnections_(!1))b.moveToOffset(a)}updateIconLocations(a){for(let b of this.getIcons())b.onLocationChange(a)}updateFieldLocations(a){for(let b of this.inputList)for(let c of b.fieldRow)c.onLocationChange(a)}addClass(a){addClass$$module$build$src$core$utils$dom(this.svgGroup,
|
|
1912
1991
|
a)}removeClass(a){removeClass$$module$build$src$core$utils$dom(this.svgGroup,a)}setDragging(a){(this.dragging=a)?(this.translation="",draggingConnections$$module$build$src$core$common.push(...this.getConnections_(!0)),this.addClass("blocklyDragging")):(draggingConnections$$module$build$src$core$common.length=0,this.removeClass("blocklyDragging"));for(let b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)}isDragging(){return this.dragging}setMovable(a){super.setMovable(a);this.pathObject.updateMovable(a)}setEditable(a){super.setEditable(a);
|
|
1913
|
-
a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable");a=this.getIcons();for(let b=0;b<a.length;b++)a[b].updateEditable()}setShadow(a){super.setShadow(a);this.applyColour();this.
|
|
1914
|
-
var a=this.workspace.getAllBlocks(!1).filter(e=>!e.isDeadOrDying()),b=null,c=Number.MAX_SAFE_INTEGER,d=this.getRelativeToSurfaceXY();for(let e of a)a=e.getRelativeToSurfaceXY(),a=Math.sqrt(Math.pow(a.x-d.x,2)+Math.pow(a.y-d.y,2)),a<c&&(b=e,c=a);return b}dispose(a,b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));
|
|
1915
|
-
|
|
1916
|
-
c.focusTree(this.workspace)},0)}}disposeInternal(){this.disposing=!0;super.disposeInternal();$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===this&&this.workspace.cancelCurrentGesture();[...this.warningTextDb.values()].forEach(a=>clearTimeout(a));this.warningTextDb.clear();this.getIcons().forEach(a=>a.dispose())}checkAndDelete(){this.workspace.isFlyout||($.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?
|
|
1917
|
-
this.dispose(!0,!0),$.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(a=!1){return this.isInsertionMarker_?null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,addNextBlocks:a,saveIds:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;(b=(a=this.pathObject).applyColour)==null||b.call(a,this);a=this.getIcons();for(b=
|
|
1918
|
-
for(let c of this.getFields())c.applyColour()}updateDisabled(){var a=!this.isEnabled()||this.getInheritedDisabled();if(this.visuallyDisabled===a){let b;(b=this.getNextBlock())==null||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(let b of this.getChildren(!1))b.updateDisabled();this.
|
|
1992
|
+
a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable");a=this.getIcons();for(let b=0;b<a.length;b++)a[b].updateEditable()}setShadow(a){super.setShadow(a);this.applyColour();this.recomputeAriaContext()}setInsertionMarker(a){this.isInsertionMarker_!==a&&(this.isInsertionMarker_=a)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))}getSvgRoot(){return this.svgGroup}getNearestNeighbour(){if(!this.workspace.rendered)return null;
|
|
1993
|
+
var a=this.workspace.getAllBlocks(!1).filter(e=>!e.isDeadOrDying()),b=null,c=Number.MAX_SAFE_INTEGER,d=this.getRelativeToSurfaceXY();for(let e of a)a=e.getRelativeToSurfaceXY(),a=Math.sqrt(Math.pow(a.x-d.x,2)+Math.pow(a.y-d.y,2)),a<c&&(b=e,c=a);return b}dispose(a,b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));var c=$.getFocusManager$$module$build$src$core$focus_manager(),
|
|
1994
|
+
d,e;b=(e=(d=c.getFocusedNode())==null?void 0:d.getFocusableElement())!=null?e:null;super.dispose(!!a);removeNode$$module$build$src$core$utils$dom(this.svgGroup);if(this.getSvgRoot().contains(b)){let f=this.getParent();if(!f){let g;if(a=(g=this.outputConnection)!=null?g:this.previousConnection){let h;f=(h=a.closest(0,new Coordinate$$module$build$src$core$utils$coordinate(0,0)).connection)==null?void 0:h.getSourceBlock()}}setTimeout(()=>{if(this.workspace.rendered)if(f)c.focusNode(f);else{let g=this.getNearestNeighbour();
|
|
1995
|
+
g?c.focusNode(g):c.focusTree(this.workspace)}},0)}}disposeInternal(){this.disposing=!0;super.disposeInternal();$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===this&&this.workspace.cancelCurrentGesture();[...this.warningTextDb.values()].forEach(a=>clearTimeout(a));this.warningTextDb.clear();this.getIcons().forEach(a=>a.dispose())}checkAndDelete(){this.workspace.isFlyout||($.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?
|
|
1996
|
+
this.dispose(!1,!0):this.dispose(!0,!0),$.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(a=!1){return this.isInsertionMarker_?null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,addNextBlocks:a,saveIds:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;(b=(a=this.pathObject).applyColour)==null||b.call(a,this);a=this.getIcons();for(b=
|
|
1997
|
+
0;b<a.length;b++)a[b].applyColour();for(let c of this.getFields())c.applyColour()}updateDisabled(){var a=!this.isEnabled()||this.getInheritedDisabled();if(this.visuallyDisabled===a){let b;(b=this.getNextBlock())==null||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(let b of this.getChildren(!1))b.updateDisabled();this.recomputeAriaContext()}}setWarningText(a,b=""){if(b)this.warningTextDb.has(b)&&(clearTimeout(this.warningTextDb.get(b)),this.warningTextDb.delete(b));else{for(var c of this.warningTextDb.values())clearTimeout(c);
|
|
1919
1998
|
this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(b,setTimeout(()=>{this.isDeadOrDying()||(this.warningTextDb.delete(b),this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;for(;d;)d.isCollapsed()&&(e=d),d=d.getSurroundParent();e&&e.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID);
|
|
1920
1999
|
c?c.addMessage(a,b):this.addIcon((new WarningIcon$$module$build$src$core$icons$warning_icon(this)).addMessage(a,b))}else c&&(b?(c.addMessage("",b),c.getText()||this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)):this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))}setMutator(a){this.removeIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);a&&this.addIcon(a)}addIcon(a){super.addIcon(a);a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&
|
|
1921
2000
|
(this.mutator=a);a.initView(this.createIconPointerDownListener(a));a.applyColour();a.updateEditable();this.queueRender();return a}createIconPointerDownListener(a){return b=>{!this.isDeadOrDying()&&(b=this.workspace.getGesture(b))&&(this.bringToFront(),b.setStartIcon(a),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a))}}removeIcon(a){var b=super.removeIcon(a);a.equals($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null);this.queueRender();return b}setDisabledReason(a,
|
|
@@ -1929,11 +2008,12 @@ this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||a.is
|
|
|
1929
2008
|
c){if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){let d=b.x;b=b.y;d+=c.x-a.getOffsetInBlock().x;b+=c.y-a.getOffsetInBlock().y;this.moveBy(d,b)}}getChildren(a){return super.getChildren(a)}queueRender(){return queueRender$$module$build$src$core$render_management(this)}render(){this.queueRender();triggerQueuedRenders$$module$build$src$core$render_management()}renderEfficiently(){startTextWidthCache$$module$build$src$core$utils$dom();
|
|
1930
2009
|
this.isCollapsed()&&this.updateCollapsed();this.isEnabled()||this.updateDisabled();this.workspace.getRenderer().render(this);this.tightenChildrenEfficiently();stopTextWidthCache$$module$build$src$core$utils$dom()}tightenChildrenEfficiently(){for(let a of this.inputList){let b=a.connection;b&&b.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}getHeightWidth(){var a=this.height,b=this.width,c=this.getNextBlock();if(c){c=c.getHeightWidth();let d=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;
|
|
1931
2010
|
a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}}fadeForReplacement(a){var b,c;(c=(b=this.pathObject).updateReplacing)==null||c.call(b,a)}getDragStrategy(){return this.dragStrategy}setDragStrategy(a){this.dragStrategy=a}isCopyable(){return this.isOwnDeletable()&&this.isOwnMovable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(a){return this.dragStrategy.startDrag(a)}drag(a,b){this.dragStrategy.drag(a,b)}endDrag(a,b){this.dragStrategy.endDrag(a,b)}revertDrag(){this.dragStrategy.revertDrag()}toFlyoutInfo(){var a=
|
|
1932
|
-
Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),b=new Set(["id","height","width","pinned","enabled"]),c=function(d){for(let e in d)b.has(e)?delete d[e]:typeof d[e]==="object"&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}
|
|
1933
|
-
|
|
1934
|
-
c.isFullBlockField()){c.showEditor();return}this.workspace.getNavigator().getInNode(this)?showBlockNavigationHint$$module$build$src$core$hints(this.workspace):showHelpHint$$module$build$src$core$hints(this.workspace)}}getParents(){for(var a=new Set,b=this.getParent();b;)a.add(b),b=b.getParent();return a}getOutputParents(){var a=new Set;a.add(this);for(var b,c=(b=this.outputConnection)==null?
|
|
1935
|
-
b,c=(a=this.outputConnection)==null?void 0:(b=a.targetConnection)==null?void 0:b.getParentInput();return c?c.getRowId():this.id}
|
|
1936
|
-
1,b=this.getNextBlock();b;)a++,b=b.getNextBlock();return a<=1?this
|
|
2011
|
+
Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),b=new Set(["id","height","width","pinned","enabled"]),c=function(d){for(let e in d)b.has(e)?delete d[e]:typeof d[e]==="object"&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getNestingLevel(){var a=this.getSurroundParent();return a?a.getNestingLevel()+1:0}getFocusableElement(){var a=this.getFullBlockField();return a?a.getFocusableElement():
|
|
2012
|
+
this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.recomputeAriaContext();this.select();var a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();a&&a!==this&&finishQueuedRenders$$module$build$src$core$render_management().then(()=>{this.workspace.scrollBoundsIntoView(this.getBoundingRectangleWithoutChildren())})}onNodeBlur(){this.unselect()}canBeFocused(){return!0}performAction(a){if(this.workspace.isFlyout)KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.startMove(this,
|
|
2013
|
+
a);else{if(this.isSimpleReporter())for(let b of this.inputList)for(let c of b.fieldRow)if(c.isClickable()&&c.isFullBlockField()){c.showEditor();return}this.workspace.getNavigator().getInNode(this)?showBlockNavigationHint$$module$build$src$core$hints(this.workspace):showHelpHint$$module$build$src$core$hints(this.workspace)}}getParents(){for(var a=new Set,b=this.getParent();b;)a.add(b),b=b.getParent();return a}getOutputParents(){var a=new Set;a.add(this);for(var b,c=(b=this.outputConnection)==null?
|
|
2014
|
+
void 0:b.targetBlock();c;){a.add(c);let d;c=(d=c.outputConnection)==null?void 0:d.targetBlock()}return a}getRowId(){var a,b,c=(a=this.outputConnection)==null?void 0:(b=a.targetConnection)==null?void 0:b.getParentInput();return c?c.getRowId():this.id}recomputeAriaContext(){this.getFullBlockField()||(setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.LABEL,this.getAriaLabel(Verbosity$$module$build$src$core$utils$aria.STANDARD)),configureAriaRole$$module$build$src$core$block_aria_composer(this))}getAriaLabel(a){return computeAriaLabel$$module$build$src$core$block_aria_composer(this,
|
|
2015
|
+
a,!1)}getStackBlocksCountLabel(){for(var a=1,b=this.getNextBlock();b;)a++,b=b.getNextBlock();return a<=1?computeAriaLabel$$module$build$src$core$block_aria_composer(this,Verbosity$$module$build$src$core$utils$aria.TERSE):$.Msg$$module$build$src$core$msg.BLOCK_LABEL_STACK_BLOCKS.replace("%1",a.toString())}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};
|
|
2016
|
+
module$build$src$core$block_svg.BlockSvg=BlockSvg$$module$build$src$core$block_svg;var DragTarget$$module$build$src$core$drag_target=class{constructor(){}onDragEnter(a){}onDragOver(a){}onDragExit(a){}onDrop(a){}getClientRect(){return null}shouldPreventMove(a){return!1}},module$build$src$core$drag_target={};module$build$src$core$drag_target.DragTarget=DragTarget$$module$build$src$core$drag_target;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()?this.updateWouldDelete_(!1):a instanceof BlockSvg$$module$build$src$core$block_svg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a)):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}updateWouldDelete_(a){this.wouldDelete_=
|
|
1937
2017
|
a}},module$build$src$core$delete_area={};module$build$src$core$delete_area.DeleteArea=DeleteArea$$module$build$src$core$delete_area;var FlyoutItem$$module$build$src$core$flyout_item=class{constructor(a,b){this.element=a;this.type=b}getElement(){return this.element}getType(){return this.type}},module$build$src$core$flyout_item={};module$build$src$core$flyout_item.FlyoutItem=FlyoutItem$$module$build$src$core$flyout_item;var MetricsManager$$module$build$src$core$metrics_manager=class{constructor(a){this.workspace_=a}getDimensionsPx_(a){var b=0,c=0;a&&(b=a.getWidth(),c=a.getHeight());return new Size$$module$build$src$core$utils$size(b,c)}getFlyoutMetrics(a){a=this.getDimensionsPx_(this.workspace_.getFlyout(a));return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){var a=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){var a=
|
|
1938
2018
|
0,b=0,c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox(),f,g=!((f=this.workspace_.getFlyout())==null?0:f.autoClose);f=e?c.position:d.position;var h=f===Position$$module$build$src$core$utils$toolbox.TOP;f===Position$$module$build$src$core$utils$toolbox.LEFT&&(e&&(a+=c.width),g&&(a+=d.width));h&&(e&&(b+=c.height),g&&(b+=d.height));return{top:b,left:a}}getViewMetrics(a){a=a?this.workspace_.scale:1;var b=this.getSvgMetrics(),c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),
|
|
1939
2019
|
e=!!this.workspace_.getToolbox(),f,g=!((f=this.workspace_.getFlyout())==null?0:f.autoClose);f=e?c.position:d.position;var h=f===Position$$module$build$src$core$utils$toolbox.LEFT||f===Position$$module$build$src$core$utils$toolbox.RIGHT;if(f===Position$$module$build$src$core$utils$toolbox.TOP||f===Position$$module$build$src$core$utils$toolbox.BOTTOM)e&&(b.height-=c.height),g&&(b.height-=d.height);h&&(e&&(b.width-=c.width),g&&(b.width-=d.width));return{height:b.height/a,width:b.width/a,top:-this.workspace_.scrollY/
|
|
@@ -1943,19 +2023,7 @@ c.top:b.top;var e=c.left!==void 0?c.left:b.left;return{top:d/a,left:e/a,width:((
|
|
|
1943
2023
|
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}}};
|
|
1944
2024
|
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(){try{var a=this.workspace_.getCanvas().getBBox()}catch(b){a={height:0,y:0,width:0,x:0}}return a}getContentMetrics(a){var 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*
|
|
1945
2025
|
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 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");
|
|
1946
|
-
}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
|
|
1947
|
-
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());if(!this.isFlyoutLabel){var 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);setRole$$module$build$src$core$utils$aria(e,
|
|
1948
|
-
Role$$module$build$src$core$utils$aria.PRESENTATION)}a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"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);setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.PRESENTATION);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,
|
|
1949
|
-
{"class":this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);c=replaceMessageReferences$$module$build$src$core$utils$parsing(this.text);this.workspace.RTL&&(c+="\u200f");b.textContent=c;this.isFlyoutLabel&&(this.svgText=b,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));setRole$$module$build$src$core$utils$aria(b,Role$$module$build$src$core$utils$aria.PRESENTATION);d=`${c}, ${this.isFlyoutLabel?$.Msg$$module$build$src$core$msg.ARIA_LABEL_HEADING:
|
|
1950
|
-
$.Msg$$module$build$src$core$msg.ARIA_LABEL_BUTTON}`;setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.LABEL,d);setRole$$module$build$src$core$utils$aria(this.getFocusableElement(),Role$$module$build$src$core$utils$aria.LISTITEM);d=getComputedStyle$$module$build$src$core$utils$style(b,"fontSize");var f=getComputedStyle$$module$build$src$core$utils$style(b,"fontWeight"),g=getComputedStyle$$module$build$src$core$utils$style(b,"fontFamily");
|
|
1951
|
-
this.width=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(b,d,f,g);c=measureFontMetrics$$module$build$src$core$utils$dom(c,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;(h=e)==null||h.setAttribute("width",String(this.width));let k;(k=e)==null||k.setAttribute("height",String(this.height))}a.setAttribute("width",
|
|
1952
|
-
String(this.width));a.setAttribute("height",String(this.height));b.setAttribute("x",String(this.width/2));b.setAttribute("y",String(this.height/2-c.height/2+c.baseline));this.updateTransform();this.onMouseDownWrapper=conditionalBind$$module$build$src$core$browser_events(this.svgGroup,"pointerdown",this,this.onMouseDown);this.onMouseUpWrapper=conditionalBind$$module$build$src$core$browser_events(this.svgGroup,"pointerup",this,this.onMouseUp)}createDom(){return this.svgGroup}show(){this.updateTransform();
|
|
1953
|
-
this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(a,b){this.position.x=a;this.position.y=b;this.updateTransform()}moveBy(a,b,c){this.moveTo(this.position.x+a,this.position.y+b)}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.position.y,this.position.y+this.height,this.position.x,this.position.x+
|
|
1954
|
-
this.width)}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){unbind$$module$build$src$core$browser_events(this.onMouseDownWrapper);unbind$$module$build$src$core$browser_events(this.onMouseUpWrapper);this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup);this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(a){a?this.svgGroup&&(this.svgGroup.appendChild(a),this.cursorSvg=
|
|
1955
|
-
a):this.cursorSvg=null}onMouseUp(a){(a=this.targetWorkspace.getGesture(a))&&a.cancel();this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(a=this.targetWorkspace.getButtonCallback(this.callbackKey))&&a(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}onMouseDown(a){var b=this.targetWorkspace.getGesture(a),
|
|
1956
|
-
c=this.targetWorkspace.getFlyout();b&&c&&b.handleFlyoutStart(a,c)}getSvgRoot(){return this.svgGroup}getFocusableElement(){return this.svgGroup}getFocusableTree(){return this.workspace}onNodeFocus(){var a=this.getPosition();a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.height,a.x,a.x+this.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}getId(){return this.id}performAction(){if(!this.isFlyoutLabel){let a=this.targetWorkspace.getButtonCallback(this.callbackKey);
|
|
1957
|
-
a&&a(this)}}};FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X=5;FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y=2;FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS=4;register$$module$build$src$core$css("\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n@media (hover: hover) {\n .blocklyFlyoutButton:hover {\n fill: #aaa;\n }\n}\n\n.blocklyFlyoutButton:active {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n");
|
|
1958
|
-
var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.FlyoutButton=FlyoutButton$$module$build$src$core$flyout_button;var FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getWorkspace()}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(a){return a.getId()}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof FlyoutButton$$module$build$src$core$flyout_button}},module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy={};
|
|
2026
|
+
}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 FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getWorkspace()}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(a){return a.getId()}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof FlyoutButton$$module$build$src$core$flyout_button}},module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy={};
|
|
1959
2027
|
module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy;var FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(){return"error"}isNavigable(a){return!1}isApplicable(a){return a instanceof FlyoutSeparator$$module$build$src$core$flyout_separator}},module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy={};
|
|
1960
2028
|
module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=class{getFirstChild(a){return getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a)[0]}getParent(a){var b;if((b=a.previousConnection)==null?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if((c=a.outputConnection)==null?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){if(a.nextConnection){let c;
|
|
1961
2029
|
return(c=a.nextConnection.targetBlock())!=null?c:a.nextConnection}var b;return((b=a.outputConnection)==null?0:b.targetConnection)?(b=this.getParent(a),navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(b,a,1)):null}getPreviousSibling(a){var b;if((b=a.previousConnection)==null?0:b.targetBlock())return a.previousConnection;var c;return((c=a.outputConnection)==null?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.outputConnection.targetBlock(),
|
|
@@ -1976,11 +2044,10 @@ var Navigator$$module$build$src$core$keyboard_nav$navigators$navigator=class{con
|
|
|
1976
2044
|
new IconNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy,new WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy,new CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy,new BubbleNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$bubble_navigation_policy,new CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy];
|
|
1977
2045
|
this.navigationLoops=!0}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>b.isApplicable(a))}getFirstChild(a){var b,c=(b=this.get(a))==null?void 0:b.getFirstChild(a);return c?this.isNavigable(c)?c:this.getFirstChild(c)||this.getNextSibling(c):null}getParent(a){var b,c=(b=this.get(a))==null?void 0:b.getParent(a);return c?this.isNavigable(c)?c:this.getParent(c):null}getNextSibling(a){var b,c=(b=this.get(a))==null?void 0:b.getNextSibling(a);return c?this.isNavigable(c)?c:this.getNextSibling(c):
|
|
1978
2046
|
null}getPreviousSibling(a){var b,c=(b=this.get(a))==null?void 0:b.getPreviousSibling(a);return c?this.isNavigable(c)?c:this.getPreviousSibling(c):null}getPreviousNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){if(!a)return null;var b=this.getPreviousNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.PREVIOUS);if(!b||b===a.getFocusableTree()){b=this.navigateStacks(a,-1);if(!b)return null;b=this.getLastNodeInStack(b,a)}return this.getLeftmostSibling(b)}getOutNode(a=
|
|
1979
|
-
$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
return b?this.getTopLevelItems(b).slice(-1)[0]:null}transitionAllowed(a,b,c){switch(c){case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.IN:case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT:return this.getRowId(a)===this.getRowId(b);case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT:case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.PREVIOUS:return this.getRowId(a)!==
|
|
2047
|
+
$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){return this.getPreviousNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT)}getNextNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){var b=this.getNextNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT);return a&&b===null?this.navigateStacks(a,1):b}getInNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){return this.getNextNodeImpl(a,
|
|
2048
|
+
a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.IN)}getPreviousNodeImpl(a,b,c,d=new Set){if(!b||!a||d.has(b))return null;var e=this.getRightMostChild(this.getPreviousSibling(b),b)||this.getParent(b);return e&&this.transitionAllowed(a,e,c)?e:e?(d.add(b),this.getPreviousNodeImpl(a,e,c,d)):null}getNextNodeImpl(a,b,c,d=new Set){if(!b||!a||d.has(b))return null;for(var e=this.getFirstChild(b)||this.getNextSibling(b),f=b;f&&!e;){f=this.getParent(f);if(!f)break;e=this.getNextSibling(f)}return e&&
|
|
2049
|
+
this.transitionAllowed(a,e,c)?e:e?(d.add(b),this.getNextNodeImpl(a,e,c,d)):null}getRightMostChild(a,b){if(!a)return a;var c=this.getFirstChild(a);if(!c||c===b)return a;for(a=c;a&&a!==b;a=this.getNextSibling(c))c=a;return this.getRightMostChild(c,b)}setNavigationLoops(a){this.navigationLoops=a}getNavigationLoops(){return this.navigationLoops}getFirstNode(){var a,b=(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:a.getRootFocusableNode();return b?this.getTopLevelItems(b)[0]:
|
|
2050
|
+
null}getLastNode(){var a,b=(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:a.getRootFocusableNode();return b?this.getTopLevelItems(b).slice(-1)[0]:null}transitionAllowed(a,b,c){switch(c){case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.IN:case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT:return this.getRowId(a)===this.getRowId(b);case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT:case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.PREVIOUS:return this.getRowId(a)!==
|
|
1984
2051
|
this.getRowId(b)}}getLeftmostSibling(a){if(!a)return null;for(var b;b=this.getPreviousNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT);)a=b;return a}getLastNodeInStack(a,b){for(var c;(c=this.getNextNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT))&&c!==b;)a=c;return a}getRowId(a){var b;return(b=this.get(a))==null?void 0:b.getRowId(a)}navigateStacks(a,b){var c=this.getTopLevelItems(a),d,e,f=(e=(d=this.getSourceBlockFromNode(a))==
|
|
1985
2052
|
null?void 0:d.getRootBlock())!=null?e:a;a=c.indexOf(f)+b;b=null;a>=0&&a<c.length?b=c[a]:a<0&&this.getNavigationLoops()?b=c[c.length-1]:a>=c.length&&this.getNavigationLoops()&&(b=c[0]);return b}getTopLevelItems(a){return a.getFocusableTree().getTopBoundedElements(!0)}isNavigable(a){var b;return(b=this.get(a))==null?void 0:b.isNavigable(a)}getSourceBlockFromNode(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?a:a instanceof Field$$module$build$src$core$field||a instanceof RenderedConnection$$module$build$src$core$rendered_connection||
|
|
1986
2053
|
a instanceof Icon$$module$build$src$core$icons$icon?a.getSourceBlock():null}},module$build$src$core$keyboard_nav$navigators$navigator={};module$build$src$core$keyboard_nav$navigators$navigator.NavigationDirection=NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator;module$build$src$core$keyboard_nav$navigators$navigator.Navigator=Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;var module$build$src$core$interfaces$i_collapsible_toolbox_item={};module$build$src$core$interfaces$i_collapsible_toolbox_item.isCollapsibleToolboxItem=isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item;var ToolboxItemNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy=class{getFirstChild(a){return isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item(a)?a.getChildToolboxItems()[0]:null}getParent(a){return a.getParent()}getNextSibling(a){var b=a.getParentToolbox().getToolboxItems();a=b.indexOf(a);var c;return(c=b[a+1])!=null?c:null}getPreviousSibling(a){var b=a.getParentToolbox().getToolboxItems();a=b.indexOf(a);
|
|
@@ -2018,7 +2085,7 @@ var b=(a=(b=this.targetWorkspace.getToolbox())==null?void 0:b.getSelectedItem())
|
|
|
2018
2085
|
[],c=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(let 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,this.horizontalLayout?"x":"y"),SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater));
|
|
2019
2086
|
return this.normalizeSeparators(b)}normalizeSeparators(a){for(let b=a.length-1;b>0;b--){let 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);if(typeof a!=="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");
|
|
2020
2087
|
return a(this.workspace_.targetWorkspace)}clearOldBlocks(){this.getContents().forEach(b=>{var c;(c=this.getInflaterForType(b.getType()))==null||c.disposeItem(b)});var a;(a=this.workspace_.getPotentialVariableMap())==null||a.clear()}onMouseDown(a){var b=this.targetWorkspace.getGesture(a);b&&b.handleFlyoutStart(a,this)}reflow(){this.inhibitReflowWrapper=!0;this.reflowInternal_();this.inhibitReflowWrapper=!1}isScrollable(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1}getInflaterForType(a){if(this.inflaters.has(a)){var b;
|
|
2021
|
-
return(b=this.inflaters.get(a))!=null?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}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;var
|
|
2088
|
+
return(b=this.inflaters.get(a))!=null?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}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;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)}startDrag(){}endDrag(a){this.drag(a)}drag(a){a=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startScrollXY_,a);if(this.horizontalScrollEnabled&&this.verticalScrollEnabled)this.workspace.scroll(a.x,
|
|
2022
2089
|
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=
|
|
2023
2090
|
!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(let a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);
|
|
2024
2091
|
this.boundEvents.length=0}updateFromEvent(a){var 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)>
|
|
@@ -2062,10 +2129,11 @@ this.bubbleSize.width):b.x,a.y=b.y);return a}return null}loadState(a){var b;this
|
|
|
2062
2129
|
{f&&g&&(f=this.sourceBlock.workspace.RTL?this.sourceBlock.workspace.getWidth()-(f+this.bubbleSize.width):f,this.setBubbleLocation(new Coordinate$$module$build$src$core$utils$coordinate(f,g)))})}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var a=this.textInputBubble.getText();this.text!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,
|
|
2063
2130
|
"comment",null,this.text,a)),this.text=a)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}onBubbleLocationChange(){this.textInputBubble&&(this.bubbleLocation=this.textInputBubble.getRelativeToSurfaceXY())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(a){var b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){b.bubbleVisiblity!==a&&(b.bubbleVisiblity=a,yield finishQueuedRenders$$module$build$src$core$render_management(),
|
|
2064
2131
|
!b.sourceBlock.rendered||b.sourceBlock.isInFlyout||b.sourceBlock.isInsertionMarker()||(a?(b.sourceBlock.isEditable()?b.showEditableBubble():b.showNonEditableBubble(),b.applyColour()):b.hideBubble(),fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"comment")),b.svgRoot&&b.recomputeAriaContext()))})}getBubble(){return this.textInputBubble}showEditableBubble(){this.createBubble();var a;(a=
|
|
2065
|
-
this.textInputBubble)==null||a.addTextChangeListener(()=>this.onTextChange());var b;(b=this.textInputBubble)==null||b.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();var a;(a=this.textInputBubble)==null||a.setEditable(!1)}createBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect(),this);this.textInputBubble.
|
|
2066
|
-
|
|
2067
|
-
null}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}getAriaLabel(){return this.bubbleIsVisible()?$.Msg$$module$build$src$core$msg.ICON_LABEL_COMMENT_OPEN
|
|
2068
|
-
CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3;register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);var module$build$src$core$icons$comment_icon={};
|
|
2132
|
+
this.textInputBubble)==null||a.addTextChangeListener(()=>this.onTextChange());var b;(b=this.textInputBubble)==null||b.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();var a;(a=this.textInputBubble)==null||a.setEditable(!1)}createBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect(),this);this.textInputBubble.getEditor().setParent(this.sourceBlock);
|
|
2133
|
+
this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,!0);this.bubbleLocation&&this.textInputBubble.moveDuringDrag(this.bubbleLocation);this.textInputBubble.addTextChangeListener(()=>this.onTextChange());this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange());this.textInputBubble.addLocationChangeListener(()=>this.onBubbleLocationChange());this.textInputBubble.setAriaLabelProvider(()=>$.Msg$$module$build$src$core$msg.BUBBLE_LABEL_COMMENT.replace("%1",
|
|
2134
|
+
this.getText()))}hideBubble(){var a;(a=this.textInputBubble)==null||a.dispose();this.textInputBubble=null}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}getAriaLabel(){return this.bubbleIsVisible()?$.Msg$$module$build$src$core$msg.ICON_LABEL_COMMENT_OPEN:
|
|
2135
|
+
$.Msg$$module$build$src$core$msg.ICON_LABEL_COMMENT_CLOSED}};CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3;register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);var module$build$src$core$icons$comment_icon={};
|
|
2136
|
+
module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var module$build$src$core$icons={};module$build$src$core$icons.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;module$build$src$core$icons.Icon=Icon$$module$build$src$core$icons$icon;module$build$src$core$icons.IconType=IconType$$module$build$src$core$icons$icon_types;module$build$src$core$icons.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;module$build$src$core$icons.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;
|
|
2069
2137
|
module$build$src$core$icons.exceptions=module$build$src$core$icons$exceptions;module$build$src$core$icons.registry=module$build$src$core$icons$registry;var module$build$src$core$interfaces$i_procedure_block={};module$build$src$core$interfaces$i_procedure_block.isProcedureBlock=isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block;$.Names$$module$build$src$core$names=class{constructor(a,b){this.db=new Map;this.dbReverse=new Set;this.variableMap=null;this.variablePrefix=b||"";this.reservedWords=new Set(a?a.split(","):[])}reset(){this.db.clear();this.dbReverse.clear();this.variableMap=null}setVariableMap(a){this.variableMap=a}getNameForUserVariable(a){return this.variableMap?(a=this.variableMap.getVariableById(a))?a.getName():null:(console.warn("Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:\nBlockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());"),
|
|
2070
2138
|
null)}populateVariables(a){a=$.allUsedVarModels$$module$build$src$core$variables(a);for(let b=0;b<a.length;b++)this.getName(a[b].getId(),$.NameType$$module$build$src$core$names.VARIABLE)}populateProcedures(a){throw Error("The implementation of populateProcedures should be monkey-patched in by blockly.ts");}getName(a,b){var c=a;b===$.NameType$$module$build$src$core$names.VARIABLE&&(a=this.getNameForUserVariable(a))&&(c=a);a=c.toLowerCase();var d=b===$.NameType$$module$build$src$core$names.VARIABLE||
|
|
2071
2139
|
b===$.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE?this.variablePrefix:"";this.db.has(b)||this.db.set(b,new Map);var e=this.db.get(b);if(e.has(a))return d+e.get(a);b=this.getDistinctName(c,b);e.set(a,b.substr(d.length));return b}getUserNames(a){var b;return(a=(b=this.db.get(a))==null?void 0:b.keys())?Array.from(a):[]}getDistinctName(a,b){a=this.safeName(a);for(var c=null,d,e;this.dbReverse.has(a+((d=c)!=null?d:""))||this.reservedWords.has(a+((e=c)!=null?e:""));)c=c?c+1:2;var f;a+=(f=c)!=
|
|
@@ -2208,66 +2276,69 @@ new (this.getVariableMapClass())(this,!0)}getVariableMap(){return this.variableM
|
|
|
2208
2276
|
this.options,!0);if(!a)throw Error("No variable map is registered.");return a}isReadOnly(){return this.readOnly}setIsReadOnly(a){this.readOnly=a;this.options.readOnly=a}};Workspace$$module$build$src$core$workspace.SCAN_ANGLE=3;var module$build$src$core$workspace={};module$build$src$core$workspace.Workspace=Workspace$$module$build$src$core$workspace;var SOUND_LIMIT$$module$build$src$core$workspace_audio=100,WorkspaceAudio$$module$build$src$core$workspace_audio=class{constructor(a){this.parentWorkspace=a;this.sounds=new Map;this.lastSound=null;this.muted=!1;window.AudioContext&&(this.context=new AudioContext)}dispose(){this.sounds.clear();var a;(a=this.context)==null||a.close()}load(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(a.length){var d=yield(yield fetch(a[0])).arrayBuffer(),e;(e=c.context)==null||
|
|
2209
2277
|
e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()&&b!==0){var d=c.sounds.get(a);if(d){yield c.prepareToPlay();let e=c.context.createBufferSource(),f=c.context.createGain();f.gain.value=b!=null?b:1;f.connect(c.context.destination);e.buffer=d;e.connect(f);e.addEventListener("ended",()=>{e.disconnect();f.disconnect()});e.start()}else c.parentWorkspace&&c.parentWorkspace.getAudioManager().play(a,
|
|
2210
2278
|
b)}})}beep(a,b=.2){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()){yield c.prepareToPlay();var d=c.context.createOscillator();d.type="sine";d.frequency.setValueAtTime(a,c.context.currentTime);var e=c.context.createGain();e.gain.setValueAtTime(0,c.context.currentTime);e.gain.linearRampToValueAtTime(.5,c.context.currentTime+.01);e.gain.linearRampToValueAtTime(0,c.context.currentTime+b);d.connect(e);e.connect(c.context.destination);d.start(c.context.currentTime);
|
|
2211
|
-
d.stop(c.context.currentTime+b)}})}playErrorBeep(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){return a.beep(260)})}
|
|
2212
|
-
a
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
new
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
this.
|
|
2221
|
-
a
|
|
2222
|
-
a
|
|
2223
|
-
a
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
this.
|
|
2230
|
-
|
|
2231
|
-
this.
|
|
2232
|
-
a
|
|
2233
|
-
|
|
2234
|
-
b)
|
|
2235
|
-
this.
|
|
2236
|
-
(
|
|
2237
|
-
|
|
2238
|
-
this.
|
|
2239
|
-
|
|
2240
|
-
this)
|
|
2241
|
-
this.
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
"
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2279
|
+
d.stop(c.context.currentTime+b)}})}playErrorBeep(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){return a.beep(260)})}maybePlayScopeChangeAudioCue(a){if(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.getScopeChangeAudioCuesEnabled()){var b=this.parentWorkspace.getNavigator(),c=b.getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());a=b.getSourceBlockFromNode(a);b=0;c&&a&&c.getNestingLevel()!==
|
|
2280
|
+
(b=a.getNestingLevel())&&this.beep(400+b*60)}}isPlayingAllowed(){var a=new Date;return this.getMuted()||!this.context||this.lastSound!==null&&a.getTime()-this.lastSound.getTime()<SOUND_LIMIT$$module$build$src$core$workspace_audio?!1:!0}prepareToPlay(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){a.lastSound=new Date;a.context.state==="suspended"&&(yield a.context.resume())})}setMuted(a){this.muted=a}getMuted(){return this.muted}},module$build$src$core$workspace_audio=
|
|
2281
|
+
{};module$build$src$core$workspace_audio.WorkspaceAudio=WorkspaceAudio$$module$build$src$core$workspace_audio;var ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg=20,WorkspaceSvg$$module$build$src$core$workspace_svg=class extends Workspace$$module$build$src$core$workspace{constructor(a){super(a);this.resizeHandlerWrapper=null;this.resizesEnabled=this.visible=this.rendered=!0;this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0;this.oldScale=this.scale=1;this.oldLeft=this.oldTop=0;this.inverseScreenCTM=this.targetWorkspace=this.dummyWheelListener=this.configureContextMenu=this.lastRecordedPageScroll=
|
|
2282
|
+
this.injectionDiv=this.currentGesture_=this.toolbox=this.flyout=this.scrollbar=this.trashcan=null;this.inverseScreenCTMDirty=!0;this.highlightedBlocks=[];this.toolboxCategoryCallbacks=new Map;this.flyoutButtonCallbacks=new Map;this.cachedParentSvg=null;this.topBoundedElements=[];this.dragTargetAreas=[];this.workspaceSelectionRing=this.workspaceFocusRing=this.zoomControls_=this.layerManager=null;this.navigator=new Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;this.metricsManager=
|
|
2283
|
+
new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,a,!0))(this);this.getMetrics=a.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager);this.setMetrics=a.setMetrics||WorkspaceSvg$$module$build$src$core$workspace_svg.setTopLevelWorkspaceMetrics;this.componentManager=new ComponentManager$$module$build$src$core$component_manager;this.connectionDBList=ConnectionDB$$module$build$src$core$connection_db.init(this.connectionChecker);
|
|
2284
|
+
var b;this.audioManager=new WorkspaceAudio$$module$build$src$core$workspace_audio((b=a.parentWorkspace)!=null?b:this);this.grid=this.options.gridPattern?new Grid$$module$build$src$core$grid(this.options.gridPattern,a.gridOptions):null;module$build$src$core$variables&&internalFlyoutCategory$$module$build$src$core$variables&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables,internalFlyoutCategory$$module$build$src$core$variables);module$build$src$core$variables_dynamic&&
|
|
2285
|
+
internalFlyoutCategory$$module$build$src$core$variables_dynamic&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables_dynamic,internalFlyoutCategory$$module$build$src$core$variables_dynamic);module$build$src$core$procedures&&internalFlyoutCategory$$module$build$src$core$procedures&&(this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$procedures,internalFlyoutCategory$$module$build$src$core$procedures),this.addChangeListener(mutatorOpenListener$$module$build$src$core$procedures));
|
|
2286
|
+
this.addChangeListener(this.variableChangeCallback.bind(this));this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new ThemeManager$$module$build$src$core$theme_manager(this,this.options.theme||Classic$$module$build$src$core$theme$classic);this.themeManager_.subscribeWorkspace(this);var c;this.renderer=init$$module$build$src$core$renderers$common$block_rendering(this.options.renderer||"geras",this.getTheme(),(c=this.options.rendererOverrides)!=null?c:void 0);
|
|
2287
|
+
this.cachedParentSvgSize=new Size$$module$build$src$core$utils$size(0,0)}getMetricsManager(){return this.metricsManager}setMetricsManager(a){this.metricsManager=a;this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}getRenderer(){return this.renderer}getThemeManager(){return this.themeManager_}getTheme(){return this.themeManager_.getTheme()}setTheme(a){a||(a=Classic$$module$build$src$core$theme$classic);this.themeManager_.setTheme(a)}refreshTheme(){if(this.svgGroup_){var a=
|
|
2288
|
+
this.options.parentWorkspace===null;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=
|
|
2289
|
+
0,c;c=a[b];b++){let d=c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){let 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){var b=0,c=0,d=1;if(this.getCanvas().contains(a)||this.getBubbleCanvas().contains(a))d=this.scale;do{let e=getRelativeXY$$module$build$src$core$utils$svg_math(a);
|
|
2290
|
+
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(){var 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_;
|
|
2291
|
+
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}setInitialAriaContext(){if(!this.svgGroup_)throw Error("Must initialize svgGroup_ by calling `createDom` before calling setAriaContext");this.isFlyout||(setRole$$module$build$src$core$utils$aria(this.svgGroup_,Role$$module$build$src$core$utils$aria.REGION),
|
|
2292
|
+
this.isMutator?setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE):this.updateAriaLabel())}updateAriaLabel(){var a=this.getTopBlocks(!1).length;a==1?setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_1_STACK):setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,
|
|
2293
|
+
$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MANY_STACKS.replace("%1",String(a)))}createDom(a,b){this.injectionDiv||(this.injectionDiv=b!=null?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace",id:this.id});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_),a==="blocklyMainBackground"&&this.grid?
|
|
2294
|
+
this.svgBackground_.style.fill="var(--blocklyGridPattern)":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill"));this.workspaceSelectionRing=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{fill:"none",class:"blocklyWorkspaceSelectionRing"},this.svgGroup_);this.workspaceFocusRing=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{fill:"none",class:"blocklyWorkspaceFocusRing"},this.svgGroup_);
|
|
2295
|
+
this.layerManager=new LayerManager$$module$build$src$core$layer_manager(this);this.svgBlockCanvas_=this.layerManager.getBlockLayer();this.svgBubbleCanvas_=this.layerManager.getBubbleLayer();this.setInitialAriaContext();this.isFlyout||(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener,{passive:!0}),conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,
|
|
2296
|
+
"wheel",this,this.onMouseWheel,!1,{passive:!1}));this.options.hasCategories&&(this.toolbox=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,this.options,!0))(this));this.grid&&this.grid.update(this.scale);this.recordDragTargets();a=this.options.parentWorkspace===null;this.renderer.createDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0);$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!!this.injectionDiv||
|
|
2297
|
+
this.isFlyout);return this.svgGroup_}dispose(){this.rendered=!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();
|
|
2298
|
+
this.grid&&(this.grid=null);this.renderer.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){let c=this.getParentSvg();c&&c.parentNode&&removeNode$$module$build$src$core$utils$dom(c.parentNode)}this.resizeHandlerWrapper&&
|
|
2299
|
+
(unbind$$module$build$src$core$browser_events(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null);this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null);var a;(a=this.workspaceFocusRing)==null||a.remove();var b;(b=this.workspaceSelectionRing)==null||b.remove();$.getFocusManager$$module$build$src$core$focus_manager().isRegistered(this)&&$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}addTrashcan(){this.trashcan=
|
|
2300
|
+
WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan(this);var a=this.trashcan.createDom();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);var a=this.zoomControls_.createDom();this.svgGroup_.appendChild(a)}copyOptionsForFlyout(){return new Options$$module$build$src$core$options({parentWorkspace:this,
|
|
2301
|
+
rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,plugins:this.options.plugins,modalInputs:this.options.modalInputs,move:{scrollbars:!0}})}addFlyout(a){var 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,
|
|
2302
|
+
this.options,!0))(b):new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,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&&
|
|
2303
|
+
this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox?this.toolbox.position():this.flyout&&this.flyout.position();var 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);let f=e.getBoundingRectangle();f&&c.push(f)}this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations();
|
|
2304
|
+
this.workspaceFocusRing&&this.workspaceSelectionRing&&(this.resizeWorkspaceRing(this.workspaceSelectionRing,5),this.resizeWorkspaceRing(this.workspaceFocusRing,0))}resizeWorkspaceRing(a,b){var c=this.getMetrics();a.setAttribute("x",`${c.absoluteLeft+b}`);a.setAttribute("y",`${c.absoluteTop+b}`);a.setAttribute("width",`${Math.max(0,c.viewWidth-b*2)}`);a.setAttribute("height",`${Math.max(0,c.svgHeight-b*2)}`)}updateScreenCalculationsIfScrolled(){var a=getDocumentScroll$$module$build$src$core$utils$svg_math();
|
|
2305
|
+
Coordinate$$module$build$src$core$utils$coordinate.equals(this.lastRecordedPageScroll,a)||(this.lastRecordedPageScroll=a,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(a,b){var c=this.getParentSvg();a!=null&&(this.cachedParentSvgSize.width=a,c.setAttribute("data-cached-width",`${a}`));b!=null&&(this.cachedParentSvgSize.height=b,c.setAttribute("data-cached-height",`${b}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let a=
|
|
2306
|
+
this.svgGroup_;for(;a;){if(a.tagName==="svg"){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&&Math.abs(b-this.oldTop)<1&&Math.abs(c-this.oldLeft)<1)){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=
|
|
2307
|
+
b;this.oldLeft=c;fire$$module$build$src$core$events$utils(d)}}}translate(a,b){var c;(c=this.layerManager)==null||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);var d;(d=this.grid)==null||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){var 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),
|
|
2308
|
+
this.getParentSvg().style.display=a?"block":"none",this.toolbox&&this.toolbox.setVisible(a),a||this.hideChaff(!0))}render(){var a=this.getAllBlocks(!1);for(let b=a.length-1;b>=0;b--)a[b].queueRender();this.getTopBlocks().flatMap(b=>b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender())}highlightBlock(a,b){if(b===void 0){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=b===void 0||b)?this.highlightedBlocks.includes(a)||
|
|
2309
|
+
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(){var a=this.isFlyout?this.targetWorkspace:
|
|
2310
|
+
this;a&&!a.currentGesture_&&a.toolbox&&a.toolbox.getFlyout()&&a.toolbox.refreshSelection()}recordDragTargets(){var 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++){let 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");}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");
|
|
2311
|
+
}getDragTarget(a){a=a instanceof Coordinate$$module$build$src$core$utils$coordinate?wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,a):new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);for(let b=0,c;c=this.dragTargetAreas[b];b++)if(c.clientRect.contains(a.x,a.y))return c.component;return null}onMouseDown(a){var 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,
|
|
2312
|
+
a)}isDragging(){return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()||this.currentGesture_!==null&&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||
|
|
2313
|
+
this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollVertically())}onMouseWheel(a){if(Gesture$$module$build$src$core$gesture.inProgress())a.preventDefault(),a.stopPropagation();else{var b=this.options.zoomOptions&&this.options.zoomOptions.wheel,c=this.options.moveOptions&&this.options.moveOptions.wheel;
|
|
2314
|
+
if(b||c){var d=getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(MAC$$module$build$src$core$utils$useragent)var e=a.metaKey;b&&(a.ctrlKey||e||!c)?(d=-d.y/50,b=mouseToSvg$$module$build$src$core$browser_events(a,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(b.x,b.y,d)):(b=this.scrollX-d.x,c=this.scrollY-d.y,a.shiftKey&&!d.x&&(b=this.scrollX-d.y,c=this.scrollY),this.scroll(b,c));a.preventDefault()}}}getBlocksBoundingBox(){var a=this.getTopBoundedElements();if(!a.length)return new Rect$$module$build$src$core$utils$rect(0,
|
|
2315
|
+
0,0,0);var b=a[0].getBoundingRectangle();for(let d=1;d<a.length;d++){var c=a[d];if(c.isInsertionMarker&&c.isInsertionMarker())continue;c=c.getBoundingRectangle();c.top<b.top&&(b.top=c.top);c.bottom>b.bottom&&(b.bottom=c.bottom);c.left<b.left&&(b.left=c.left);c.right>b.right&&(b.right=c.right)}return b}cleanUp(){this.setResizesEnabled(!1);var a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=this.getTopBlocks(!0),c=b.filter(g=>g.isMovable()),
|
|
2316
|
+
d=b.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());b=function(g){for(let h of d)if(g.intersects(h))return h;return null};var e=0,f=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(let g of c){c=g.getBoundingRectangle();g.moveBy(-c.left,e-c.top,["cleanup"]);g.snapToGrid();c=g.getBoundingRectangle();for(e=b(c);e!=null;)e=e.top+e.getHeight()+f,g.moveBy(0,e-c.top,["cleanup"]),g.snapToGrid(),c=g.getBoundingRectangle(),e=b(c);e=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+f}$.setGroup$$module$build$src$core$events$utils(a);
|
|
2317
|
+
this.setResizesEnabled(!0)}showContextMenu(a){if(!this.isReadOnly()&&!this.isFlyout){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({workspace:this,focusedNode:this},a);this.configureContextMenu&&this.configureContextMenu(b,a);if(a instanceof PointerEvent)var c=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);else c=this.RTL?this.getWidth()-5:5,c=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,new Coordinate$$module$build$src$core$utils$coordinate(c,
|
|
2318
|
+
5));show$$module$build$src$core$contextmenu(a,b,this.RTL,this,c)}}updateToolbox(a){if(a=convertToolboxDefToJson$$module$build$src$core$utils$toolbox(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(hasCategories$$module$build$src$core$utils$toolbox(a)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox.render(a)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");
|
|
2319
|
+
this.options.languageTree=a;this.flyout.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);var d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:
|
|
2320
|
+
d<this.options.zoomOptions.minScale&&(c=this.options.zoomOptions.minScale/this.scale);var e=this.getCanvas().getCTM(),f=this.getParentSvg().createSVGPoint();f.x=a;f.y=b;f=f.matrixTransform(e.inverse());a=f.x;b=f.y;e=e.translate(a*(1-c),b*(1-c)).scale(c);this.scrollX=e.e;this.scrollY=e.f;this.setScale(d)}}zoomCenter(a){var b=this.getMetrics();if(this.flyout){var c=b.svgWidth?b.svgWidth/2:0;b=b.svgHeight?b.svgHeight/2:0}else c=b.viewWidth/2+b.absoluteLeft,b=b.viewHeight/2+b.absoluteTop;this.zoom(c,
|
|
2321
|
+
b,a)}zoomToFit(){if(this.isMovable()){var a=this.getMetrics(),b=a.viewWidth;a=a.viewHeight;var c=this.getBlocksBoundingBox(),d=ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg*2,e=c.right-c.left+d;c=c.bottom-c.top+d;if(e){this.flyout&&(this.horizontalLayout?(a+=this.flyout.getHeight(),c+=this.flyout.getHeight()/this.scale):(b+=this.flyout.getWidth(),e+=this.flyout.getWidth()/this.scale));b/=e;a/=c;$.disable$$module$build$src$core$events$utils();try{this.setScale(Math.min(b,a)),this.scrollCenter()}finally{$.enable$$module$build$src$core$events$utils()}this.maybeFireViewportChangeEvent()}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}beginCanvasTransition(){addClass$$module$build$src$core$utils$dom(this.getCanvas(),
|
|
2322
|
+
"blocklyCanvasTransitioning");addClass$$module$build$src$core$utils$dom(this.getBubbleCanvas(),"blocklyCanvasTransitioning")}endCanvasTransition(){removeClass$$module$build$src$core$utils$dom(this.getCanvas(),"blocklyCanvasTransitioning");removeClass$$module$build$src$core$utils$dom(this.getBubbleCanvas(),"blocklyCanvasTransitioning")}scrollCenter(){if(this.isMovable()){var a=this.getMetrics(),b=(a.scrollWidth-a.viewWidth)/2,c=(a.scrollHeight-a.viewHeight)/2;b=-b-a.scrollLeft;c=-c-a.scrollTop;this.scroll(b,
|
|
2323
|
+
c)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}centerOnBlock(a,b){if(this.isMovable()){var c=a?this.getBlockById(a):null;if(c){a=c.getRelativeToSurfaceXY();c=b?{height:c.height,width:c.width}:c.getHeightWidth();var d=this.scale;b=(a.x+(this.RTL?-1:1)*c.width/2)*d;a=(a.y+c.height/2)*d;c=this.getMetrics();this.scroll(-(b-c.viewWidth/2),-(a-c.viewHeight/2))}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}setScale(a){this.options.zoomOptions.maxScale&&
|
|
2324
|
+
a>this.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&a<this.options.zoomOptions.minScale&&(a=this.options.zoomOptions.minScale);this.scale=a;this.hideChaff(!1);(a=this.getFlyout(!1))&&a.isVisible()&&(a.reflow(),this.recordDragTargets());this.grid&&this.grid.update(this.scale);a=this.getMetrics();this.scrollX-=a.absoluteLeft;this.scrollY-=a.absoluteTop;a.viewLeft+=a.absoluteLeft;a.viewTop+=a.absoluteTop;this.scroll(this.scrollX,this.scrollY);this.scrollbar&&
|
|
2325
|
+
(this.flyout?this.scrollbar.resizeView(a):this.scrollbar.resizeContent(a))}getScale(){return this.scale}getAbsoluteScale(){var a=c=>{if(c.isFlyout){let d,e=(d=c.targetWorkspace)==null?void 0:d.getFlyout();if(e instanceof Flyout$$module$build$src$core$flyout_base)return e.getFlyoutScale()}return c.getScale()},b=(c,d)=>c.options.parentWorkspace&&c.options.parentWorkspace.getSvgGroup().contains(c.getSvgGroup())?b(c.options.parentWorkspace,d*a(c)):d*a(c);return b(this,1)}scroll(a,b){this.hideChaff(!0);
|
|
2326
|
+
var c=this.getMetrics();a=Math.min(a,-c.scrollLeft);b=Math.min(b,-c.scrollTop);var d=c.scrollTop+Math.max(0,c.scrollHeight-c.viewHeight);a=Math.max(a,-(c.scrollLeft+Math.max(0,c.scrollWidth-c.viewWidth)));b=Math.max(b,-d);this.scrollX=a;this.scrollY=b;this.scrollbar&&this.scrollbar.set(-(a+c.scrollLeft),-(b+c.scrollTop),!1);a+=c.absoluteLeft;b+=c.absoluteTop;this.translate(a,b)}getBlockById(a){return super.getBlockById(a)}getAllBlocks(a=!1){return super.getAllBlocks(a)}getTopBlocks(a=!1){return super.getTopBlocks(a)}addTopBlock(a){this.addTopBoundedElement(a);
|
|
2327
|
+
super.addTopBlock(a)}removeTopBlock(a){this.removeTopBoundedElement(a);super.removeTopBlock(a)}addTopComment(a){this.addTopBoundedElement(a);super.addTopComment(a)}removeTopComment(a){this.removeTopBoundedElement(a);super.removeTopComment(a)}getTopComments(a=!1){return super.getTopComments(a)}getCommentById(a){return super.getCommentById(a)}getRootWorkspace(){return super.getRootWorkspace()}addTopBoundedElement(a){this.topBoundedElements.push(a)}removeTopBoundedElement(a){removeElem$$module$build$src$core$utils$array(this.topBoundedElements,
|
|
2328
|
+
a)}getTopBoundedElements(a=!1){var b=[].concat(this.topBoundedElements);a&&b.sort(this.sortByOrigin.bind(this));return b}setResizesEnabled(a){var b=!this.resizesEnabled&&a;this.resizesEnabled=a;b&&this.resizeContents()}clear(){this.setResizesEnabled(!1);super.clear();this.topBoundedElements=[];this.setResizesEnabled(!0)}registerButtonCallback(a,b){if(typeof b!=="function")throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks.set(a,b)}getButtonCallback(a){var b;return(b=
|
|
2329
|
+
this.flyoutButtonCallbacks.get(a))!=null?b:null}removeButtonCallback(a){this.flyoutButtonCallbacks.delete(a)}registerToolboxCategoryCallback(a,b){if(typeof b!=="function")throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks.set(a,b)}getToolboxCategoryCallback(a){return this.toolboxCategoryCallbacks.get(a)||null}removeToolboxCategoryCallback(a){this.toolboxCategoryCallbacks.delete(a)}getGesture(a){if(KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving())return a==
|
|
2330
|
+
null||a.preventDefault(),a==null||a.stopPropagation(),null;var b=(a==null?void 0:a.type)==="pointerdown",c;b&&((c=this.currentGesture_)==null?0:c.hasStarted())&&(console.warn("Tried to start the same gesture twice."),this.currentGesture_.cancel());!this.currentGesture_&&b&&(this.currentGesture_=new Gesture$$module$build$src$core$gesture(a,this));return this.currentGesture_}clearGesture(){this.currentGesture_=null}cancelCurrentGesture(){this.currentGesture_&&this.currentGesture_.cancel()}getAudioManager(){return this.audioManager}getGrid(){return this.grid}hideChaff(a=
|
|
2331
|
+
!1){hide$$module$build$src$core$tooltip();hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this);hideWithoutAnimation$$module$build$src$core$dropdowndiv();this.hideComponents(a)}hideComponents(a=!1){this.getComponentManager().getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,!0).forEach(b=>b.autoHide(a))}static setTopLevelWorkspaceMetrics(a){var b=this.getMetrics();typeof a.x==="number"&&(this.scrollX=-(b.scrollLeft+(b.scrollWidth-b.viewWidth)*
|
|
2332
|
+
a.x));typeof a.y==="number"&&(this.scrollY=-(b.scrollTop+(b.scrollHeight-b.viewHeight)*a.y));this.translate(this.scrollX+b.absoluteLeft,this.scrollY+b.absoluteTop)}addClass(a){this.injectionDiv&&addClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}removeClass(a){this.injectionDiv&&removeClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}setIsReadOnly(a){super.setIsReadOnly(a);a?this.addClass("blocklyReadOnly"):this.removeClass("blocklyReadOnly")}scrollBoundsIntoView(a,b=10){if(!Gesture$$module$build$src$core$gesture.inProgress()){var c=
|
|
2262
2333
|
this.getScale(),d=this.getMetricsManager().getViewMetrics(!0);d=new Rect$$module$build$src$core$utils$rect(d.top,d.top+d.height,d.left,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=
|
|
2263
|
-
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.isMutator&&this.options.parentWorkspace||this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(a)return null;var b;a=(b=this.targetWorkspace)==null?void 0:b.getFlyout();if(this.isFlyout&&a){let d,e;return(e=(d=a.getContents().find(f=>
|
|
2264
|
-
f.canBeFocused()}))==null?void 0:d.getElement())!=null?e:null}var c;return(c=this.getTopBlocks(!0)[0])!=null?c:null}getNestedTrees(){var a=this.getAllBlocks().map(c=>c.getIcons()).flat().filter(c=>c instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&c.bubbleIsVisible()).map(c=>{var d;return(d=c.getBubble())==null?void 0:d.getWorkspace()}).filter(c=>!!c),b=this.getFlyout(!0);b&&a.push(b.getWorkspace());
|
|
2265
|
-
RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment&&b.canBeFocused()&&b.getFocusableElement().id===a)return b}lookUpFocusableNode(a){var b,c=(b=this.targetWorkspace)==null?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===
|
|
2266
|
-
d);if(e=this.getBlockById(e))for(var f of e.getFields())if(f.canBeFocused()&&f.getFocusableElement().id===a)return f;return null}if(b!==-1){e=a.substring(0,b);if(e=this.getBlockById(e))for(let k of e.getConnections_(!0))if(k.id===a)return k;return null}f=Math.max(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor),a.indexOf(COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button),
|
|
2267
|
-
if(f!==-1&&(f=a.substring(0,f),f=this.searchForWorkspaceComment(f))){if(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor)>-1)return f.getEditorFocusableNode();var g;return(g=f.view.getCommentBarButtons().find(k=>k.getFocusableElement().id.includes(a)))!=null?g:null}if((g=this.getAllBlocks(!1).find(k=>k.getFocusableElement().id===a))||(g=this.searchForWorkspaceComment(a)))return g;
|
|
2268
|
-
k.getFocusableElement().id===a)return k;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(k)){if((g=k.getBubble())&&g.canBeFocused()&&g.getFocusableElement().id===a)return g;if(g instanceof TextInputBubble$$module$build$src$core$bubbles$textinput_bubble&&g.getEditor().getFocusableElement().id===a)return g.getEditor()}}var h;return((h=this.trashcan)==null?void 0:h.getGloballyUniqueId())===a?this.trashcan:
|
|
2269
|
-
this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()){var b=this.targetWorkspace.getToolbox();b&&a===b||isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&b.autoHide(!1)}}performAction(){showWorkspaceNavigationHint$$module$build$src$core$hints(this)}getNavigator(){return this.navigator}setNavigator(a){this.navigator=
|
|
2270
|
-
module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;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(){var 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,
|
|
2334
|
+
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.isMutator&&this.options.parentWorkspace||this}onNodeFocus(){this.isFlyout||this.isMutator||this.updateAriaLabel()}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(a)return null;var b;a=(b=this.targetWorkspace)==null?void 0:b.getFlyout();if(this.isFlyout&&a){let d,e;return(e=(d=a.getContents().find(f=>
|
|
2335
|
+
{f=f.getElement();return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(f)&&f.canBeFocused()}))==null?void 0:d.getElement())!=null?e:null}var c;return(c=this.getTopBlocks(!0)[0])!=null?c:null}getNestedTrees(){var a=this.getAllBlocks().map(c=>c.getIcons()).flat().filter(c=>c instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&c.bubbleIsVisible()).map(c=>{var d;return(d=c.getBubble())==null?void 0:d.getWorkspace()}).filter(c=>!!c),b=this.getFlyout(!0);b&&a.push(b.getWorkspace());
|
|
2336
|
+
return a}searchForWorkspaceComment(a){for(let b of this.getTopComments())if(b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment&&b.canBeFocused()&&b.getFocusableElement().id===a)return b}lookUpFocusableNode(a){var b,c=(b=this.targetWorkspace)==null?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===
|
|
2337
|
+
a)return b;d=a.indexOf("_field_");b=a.indexOf("_connection_");if(d!==-1){var e=a.substring(0,d);if(e=this.getBlockById(e))for(var f of e.getFields())if(f.canBeFocused()&&f.getFocusableElement().id===a)return f;return null}if(b!==-1){e=a.substring(0,b);if(e=this.getBlockById(e))for(let k of e.getConnections_(!0))if(k.id===a)return k;return null}f=Math.max(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor),a.indexOf(COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button),
|
|
2338
|
+
a.indexOf(COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button));if(f!==-1&&(f=a.substring(0,f),f=this.searchForWorkspaceComment(f))){if(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor)>-1)return f.getEditorFocusableNode();var g;return(g=f.view.getCommentBarButtons().find(k=>k.getFocusableElement().id.includes(a)))!=null?g:null}if((g=this.getAllBlocks(!1).find(k=>k.getFocusableElement().id===a))||(g=this.searchForWorkspaceComment(a)))return g;
|
|
2339
|
+
g=this.getAllBlocks().map(k=>k.getIcons()).flat();for(let k of g){if(k.canBeFocused()&&k.getFocusableElement().id===a)return k;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(k)){if((g=k.getBubble())&&g.canBeFocused()&&g.getFocusableElement().id===a)return g;if(g instanceof TextInputBubble$$module$build$src$core$bubbles$textinput_bubble&&g.getEditor().getFocusableElement().id===a)return g.getEditor()}}var h;return((h=this.trashcan)==null?void 0:h.getGloballyUniqueId())===a?this.trashcan:
|
|
2340
|
+
(h=(e=this.zoomControls_)==null?void 0:e.getControlWithId(a))?h:null}onTreeFocus(a,b){}onTreeBlur(a){if(this.isFlyout&&this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()){var b=this.targetWorkspace.getToolbox();b&&a===b||isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&b.autoHide(!1)}}performAction(){showWorkspaceNavigationHint$$module$build$src$core$hints(this)}getNavigator(){return this.navigator}setNavigator(a){this.navigator=
|
|
2341
|
+
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 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(){var 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,
|
|
2271
2342
|
a.type,a.id);b.getVariableMap().addVariable(a);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(a))}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry,VariableModel$$module$build$src$core$variable_model);var module$build$src$core$variable_model={};module$build$src$core$variable_model.VariableModel=VariableModel$$module$build$src$core$variable_model;var VariableMap$$module$build$src$core$variable_map=class{constructor(a,b=!1){this.workspace=a;this.potentialMap=b;this.variableMap=new Map}clear(){for(let a of this.variableMap.values())for(let b of a.values())this.deleteVariable(b);if(this.variableMap.size!==0)throw Error("Non-empty variable map");}renameVariable(a,b){if(a.getName()===b)return a;var c=a.getType();c=this.getVariable(b,c);var d=this.workspace.getAllBlocks(!1),e="";this.potentialMap||(e=$.getGroup$$module$build$src$core$events$utils())||
|
|
2272
2343
|
$.setGroup$$module$build$src$core$events$utils(!0);try{c&&c.getId()!==a.getId()?this.renameVariableWithConflict(a,b,c,d):this.renameVariableAndUses(a,b,d)}finally{this.potentialMap||$.setGroup$$module$build$src$core$events$utils(e)}return a}changeVariableType(a,b){var c=a.getType();if(c===b)return a;var d=this.variableMap.get(c);d==null||d.delete(a.getId());(d==null?void 0:d.size)===0&&this.variableMap.delete(c);a.setType(b);var e;d=(e=this.variableMap.get(b))!=null?e:new Map;d.set(a.getId(),a);this.variableMap.has(b)||
|
|
2273
2344
|
this.variableMap.set(b,d);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE))(a,c,b));return a}renameVariableById(a,b){$.warn$$module$build$src$core$utils$deprecation("VariableMap.renameVariableById","v12","v13","VariableMap.renameVariable");var c=this.getVariableById(a);if(!c)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.renameVariable(c,b)}renameVariableAndUses(a,b,c){this.potentialMap||
|
|
@@ -2280,37 +2351,26 @@ a)))!=null?c:null}getVariableById(a){for(let b of this.variableMap.values())if(b
|
|
|
2280
2351
|
var a=[];for(let b of this.variableMap.values())for(let c of b.values())a.push(c.getName());return a}getVariableUsesById(a){$.warn$$module$build$src$core$utils$deprecation("VariableMap.getVariableUsesById","v12","v13","Blockly.Variables.getVariableUsesById");return getVariableUsesById$$module$build$src$core$variables(this.workspace,a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,DEFAULT$$module$build$src$core$registry,VariableMap$$module$build$src$core$variable_map);
|
|
2281
2352
|
var module$build$src$core$variable_map={};module$build$src$core$variable_map.VariableMap=VariableMap$$module$build$src$core$variable_map;var Trashcan$$module$build$src$core$trashcan=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.workspace=a;this.id="trashcan";this.uniqueId=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.contents=[];this.flyout=null;this.isLidOpen=!1;this.svgGroup=null;this.top=this.left=0;this.initialized=!1;this.workspace.options.maxTrashcanContents<=0||(a=this.workspace.copyOptionsForFlyout(),this.workspace.horizontalLayout?(a.toolboxPosition=this.workspace.toolboxPosition===
|
|
2282
2353
|
Position$$module$build$src$core$utils$toolbox.TOP?Position$$module$build$src$core$utils$toolbox.BOTTOM:Position$$module$build$src$core$utils$toolbox.TOP,this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(a)):(a.toolboxPosition=this.workspace.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT?Position$$module$build$src$core$utils$toolbox.LEFT:Position$$module$build$src$core$utils$toolbox.RIGHT,
|
|
2283
|
-
this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(a)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyTrash",tabindex:"0",id:this.uniqueId});
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
b);
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
0
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
this.
|
|
2298
|
-
this.workspace.options.maxTrashcanContents;)this.contents.pop();var b;(b=this.svgGroup)==null||b.classList.add(TRASH_FULL$$module$build$src$core$trashcan)}}}cleanBlockJson(a){function b(c){if(c){delete c.id;
|
|
2299
|
-
a=JSON.parse(JSON.stringify(a));b(a);return Object.assign({},{kind:"BLOCK"},a)}getFocusableElement(){if(!this.svgGroup)throw Error("Tried to focus uninitialized trashcan");return this.svgGroup}getFocusableTree(){return this.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!!this.svgGroup}performAction(){this.click()}getGloballyUniqueId(){return this.uniqueId}},
|
|
2300
|
-
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,TRASH_FULL$$module$build$src$core$trashcan="blocklyTrashFull",TRASH_OPEN$$module$build$src$core$trashcan="blocklyTrashOpen";
|
|
2301
|
-
|
|
2302
|
-
module$build$src$core$
|
|
2303
|
-
module$build$src$core$clipboard.setLastCopiedLocation=setLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.setLastCopiedWorkspace=setLastCopiedWorkspace$$module$build$src$core$clipboard;var module$build$src$core$comments={};module$build$src$core$comments.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;module$build$src$core$comments.CommentBarButton=CommentBarButton$$module$build$src$core$comments$comment_bar_button;module$build$src$core$comments.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;module$build$src$core$comments.CommentView=CommentView$$module$build$src$core$comments$comment_view;
|
|
2304
|
-
module$build$src$core$comments.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;module$build$src$core$comments.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;module$build$src$core$comments.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;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;
|
|
2305
|
-
(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo";a.MENU="menu";a.FOCUS_WORKSPACE="focus_workspace";a.FOCUS_TOOLBOX="focus_toolbox";a.START_MOVE="start_move";a.START_MOVE_STACK="start_move_stack";a.FINISH_MOVE="finish_move";a.ABORT_MOVE="abort_move";a.MOVE_UP="move_up";a.MOVE_DOWN="move_down";a.MOVE_LEFT="move_left";a.MOVE_RIGHT="move_right";a.NAVIGATE_RIGHT="right";a.NAVIGATE_LEFT="left";a.NAVIGATE_UP="up";a.NAVIGATE_DOWN="down";
|
|
2306
|
-
a.DISCONNECT="disconnect";a.NEXT_STACK="next_stack";a.PREVIOUS_STACK="previous_stack";a.INFORMATION="information";a.PERFORM_ACTION="perform_action";a.DUPLICATE="duplicate";a.CLEANUP="cleanup";a.SHOW_TOOLTIP="show_tooltip"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));
|
|
2307
|
-
var resolveWorkspace$$module$build$src$core$shortcut_items=a=>{if(a.isFlyout){let c=a.targetWorkspace;if(c)return resolveWorkspace$$module$build$src$core$shortcut_items(c)}var b;return(b=a.getRootWorkspace())!=null?b:a};registerDefaultShortcuts$$module$build$src$core$shortcut_items();registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items();registerScreenReaderShortcuts$$module$build$src$core$shortcut_items();var module$build$src$core$shortcut_items={};
|
|
2308
|
-
module$build$src$core$shortcut_items.names=names$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerArrowNavigation=registerArrowNavigation$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCleanup=registerCleanup$$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;
|
|
2309
|
-
module$build$src$core$shortcut_items.registerDefaultShortcuts=registerDefaultShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDelete=registerDelete$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDisconnectBlock=registerDisconnectBlock$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDuplicate=registerDuplicate$$module$build$src$core$shortcut_items;
|
|
2310
|
-
module$build$src$core$shortcut_items.registerEscape=registerEscape$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerFocusToolbox=registerFocusToolbox$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerFocusWorkspace=registerFocusWorkspace$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerKeyboardNavigationShortcuts=registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items;
|
|
2311
|
-
module$build$src$core$shortcut_items.registerMovementShortcuts=registerMovementShortcuts$$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.registerPerformAction=registerPerformAction$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerRedo=registerRedo$$module$build$src$core$shortcut_items;
|
|
2312
|
-
module$build$src$core$shortcut_items.registerScreenReaderShortcuts=registerScreenReaderShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerShowContextMenu=registerShowContextMenu$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerShowTooltip=registerShowTooltip$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerStackNavigation=registerStackNavigation$$module$build$src$core$shortcut_items;
|
|
2313
|
-
module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerWorkspaceOverview=registerWorkspaceOverview$$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){var c=b.getProcedureMap();for(let d of a)c.add(loadProcedure$$module$build$src$core$serialization$procedures(this.procedureModelClass,
|
|
2354
|
+
this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(a)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyTrash",tabindex:"0",id:this.uniqueId});createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan+
|
|
2355
|
+
8,height:BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan+8,x:-4,y:-4,rx:2,ry:2,fill:"none","class":"blocklyFocusRing"},this.svgGroup);setRole$$module$build$src$core$utils$aria(this.svgGroup,Role$$module$build$src$core$utils$aria.BUTTON);setState$$module$build$src$core$utils$aria(this.svgGroup,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.OPEN_TRASH);var a=String(Math.random()).substring(2);var b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,
|
|
2356
|
+
{id:"blocklyTrashBodyClipPath"+a},this.svgGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan,height:BODY_HEIGHT$$module$build$src$core$trashcan,y:LID_HEIGHT$$module$build$src$core$trashcan},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,x:-SPRITE_LEFT$$module$build$src$core$trashcan,height:SPRITE$$module$build$src$core$sprites.height,
|
|
2357
|
+
y:-SPRITE_TOP$$module$build$src$core$trashcan,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyTrashLidClipPath"+a},this.svgGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan,
|
|
2358
|
+
height:LID_HEIGHT$$module$build$src$core$trashcan},b);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyTrashLid"},this.svgGroup);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{viewBox:`0 ${SPRITE_TOP$$module$build$src$core$trashcan} ${WIDTH$$module$build$src$core$trashcan} ${LID_HEIGHT$$module$build$src$core$trashcan}`,width:WIDTH$$module$build$src$core$trashcan,height:LID_HEIGHT$$module$build$src$core$trashcan},
|
|
2359
|
+
b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,href:this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url},b);bind$$module$build$src$core$browser_events(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable);bind$$module$build$src$core$browser_events(this.svgGroup,"pointerup",this,this.click);return this.svgGroup}init(){if(this.workspace.options.maxTrashcanContents>
|
|
2360
|
+
0){let a=this.flyout.createDom(Svg$$module$build$src$core$utils$svg.SVG);addClass$$module$build$src$core$utils$dom(a,"blocklyTrashcanFlyout");insertAfter$$module$build$src$core$utils$dom(a,this.workspace.getParentSvg());this.flyout.init(this.workspace)}this.workspace.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TRASHCAN_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,
|
|
2361
|
+
ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET,ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE]});this.initialized=!0;this.setLidOpen(!1)}dispose(){this.workspace.getComponentManager().removeComponent("trashcan");this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup)}hasContents(){return!!this.contents.length}contentsIsOpen(){return!!this.flyout&&
|
|
2362
|
+
this.flyout.isVisible()}openFlyout(){if(!this.contentsIsOpen()){var a=this.contents.map(function(c){return JSON.parse(c)}),b=this.workspace.getParentSvg().style;b.cursor="wait";setTimeout(()=>{var c;(c=this.flyout)==null||c.show(a);b.cursor="";var d;(d=this.workspace.scrollbar)==null||d.setVisible(!1);if(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.getIsActive()){let e,f;(c=(f=(e=this.flyout)==null?void 0:e.getWorkspace())==null?void 0:f.getNavigator().getFirstNode())&&
|
|
2363
|
+
$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c)}},10);this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var a;(a=this.flyout)==null||a.hide();var b;(b=this.workspace.scrollbar)==null||b.setVisible(!0);this.fireUiEvent(!1);this.workspace.recordDragTargets()}}autoHide(a){!a&&this.flyout&&this.closeFlyout()}emptyContents(){if(this.hasContents()){this.contents.length=0;var a;(a=this.svgGroup)==null||a.classList.remove(TRASH_FULL$$module$build$src$core$trashcan);this.closeFlyout()}}position(a,
|
|
2364
|
+
b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace,a);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(WIDTH$$module$build$src$core$trashcan,BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan),MARGIN_HORIZONTAL$$module$build$src$core$trashcan,MARGIN_VERTICAL$$module$build$src$core$trashcan,a,this.workspace);b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,
|
|
2365
|
+
MARGIN_VERTICAL$$module$build$src$core$trashcan,c.vertical===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN:bumpDirection$$module$build$src$core$positionable_helpers.UP,b);this.top=b.top;this.left=b.left;var d;(d=this.svgGroup)==null||d.setAttribute("transform","translate("+this.left+","+this.top+")");var e;(e=this.flyout)==null||e.position()}}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.top,
|
|
2366
|
+
this.top+BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan,this.left,this.left+WIDTH$$module$build$src$core$trashcan)}getClientRect(){if(!this.svgGroup)return null;var a=this.svgGroup.getBoundingClientRect(),b=a.top+SPRITE_TOP$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan;a=a.left+SPRITE_LEFT$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan;return new Rect$$module$build$src$core$utils$rect(b,b+LID_HEIGHT$$module$build$src$core$trashcan+
|
|
2367
|
+
BODY_HEIGHT$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan,a,a+WIDTH$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan)}onDragOver(a){KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()||this.setLidOpen(this.wouldDelete_)}onDragExit(a){KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()||this.setLidOpen(!1)}onDrop(a){KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()||
|
|
2368
|
+
setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(a){if(this.isLidOpen!==a){this.isLidOpen=a;var b;(b=this.svgGroup)==null||b.classList.toggle(TRASH_OPEN$$module$build$src$core$trashcan,a)}}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(a){a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.TRASHCAN_OPEN))(a,this.workspace.id);fire$$module$build$src$core$events$utils(a)}blockMouseDownWhenOpenable(a){!this.contentsIsOpen()&&
|
|
2369
|
+
this.hasContents()&&a.stopPropagation()}onDelete(a){if(!(this.workspace.options.maxTrashcanContents<=0||!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();var b;(b=this.svgGroup)==null||b.classList.add(TRASH_FULL$$module$build$src$core$trashcan)}}}cleanBlockJson(a){function b(c){if(c){delete c.id;
|
|
2370
|
+
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];let 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)}getFocusableElement(){if(!this.svgGroup)throw Error("Tried to focus uninitialized trashcan");return this.svgGroup}getFocusableTree(){return this.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!!this.svgGroup}performAction(){this.click()}getGloballyUniqueId(){return this.uniqueId}},
|
|
2371
|
+
WIDTH$$module$build$src$core$trashcan=47,BODY_HEIGHT$$module$build$src$core$trashcan=44,LID_HEIGHT$$module$build$src$core$trashcan=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,TRASH_FULL$$module$build$src$core$trashcan="blocklyTrashFull",TRASH_OPEN$$module$build$src$core$trashcan="blocklyTrashOpen";
|
|
2372
|
+
register$$module$build$src$core$css("\n .blocklyTrash {\n opacity: 0.4;\n transition: opacity 0.08 ease-out;\n }\n\n .blocklyTrashLid {\n transition: rotate 0.08s ease-out;\n transform-origin: 46px 12px;\n rotate: 0deg;\n pointer-events: none;\n }\n\n .blocklyRTL .blocklyTrashLid {\n transform-origin: 0px 12px;\n }\n\n .blocklyTrash.blocklyTrashFull .blocklyTrashLid {\n rotate: 5deg;\n }\n\n .blocklyRTL .blocklyTrash.blocklyTrashFull .blocklyTrashLid {\n rotate: -5deg;\n }\n\n .blocklyTrash.blocklyTrashOpen,\n .blocklyTrash:hover,\n .blocklyTrash:focus {\n opacity: 0.8;\n }\n\n .blocklyTrash.blocklyTrashFull.blocklyTrashOpen .blocklyTrashLid,\n .blocklyTrash.blocklyTrashFull:hover .blocklyTrashLid,\n .blocklyTrash.blocklyTrashFull:focus .blocklyTrashLid {\n rotate: 45deg;\n }\n\n .blocklyRTL .blocklyTrash.blocklyTrashFull.blocklyTrashOpen .blocklyTrashLid,\n .blocklyRTL .blocklyTrash.blocklyTrashFull:hover .blocklyTrashLid,\n .blocklyRTL .blocklyTrash.blocklyTrashFull:focus .blocklyTrashLid {\n rotate: -45deg;\n }\n");
|
|
2373
|
+
var module$build$src$core$trashcan={};module$build$src$core$trashcan.Trashcan=Trashcan$$module$build$src$core$trashcan;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){var c=b.getProcedureMap();for(let d of a)c.add(loadProcedure$$module$build$src$core$serialization$procedures(this.procedureModelClass,
|
|
2314
2374
|
this.parameterModelClass,d,b))}clear(a){a.getProcedureMap().clear()}},module$build$src$core$serialization$procedures={};module$build$src$core$serialization$procedures.ProcedureSerializer=ProcedureSerializer$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.loadProcedure=loadProcedure$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.saveProcedure=saveProcedure$$module$build$src$core$serialization$procedures;var VariableSerializer$$module$build$src$core$serialization$variables=class{constructor(){this.priority=VARIABLES$$module$build$src$core$serialization$priorities}save(a){a=a.getVariableMap().getAllVariables().map(b=>b.save());return a.length?a:null}load(a,b){var c=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry);a.forEach(d=>{c==null||c.load(d,b)})}clear(a){a.getVariableMap().clear()}};
|
|
2315
2375
|
register$$module$build$src$core$serialization$registry("variables",new VariableSerializer$$module$build$src$core$serialization$variables);var module$build$src$core$serialization$variables={};module$build$src$core$serialization$variables.VariableSerializer=VariableSerializer$$module$build$src$core$serialization$variables;var module$build$src$core$serialization$workspaces={};module$build$src$core$serialization$workspaces.load=load$$module$build$src$core$serialization$workspaces;module$build$src$core$serialization$workspaces.save=save$$module$build$src$core$serialization$workspaces;var module$build$src$core$serialization={blocks:module$build$src$core$serialization$blocks,exceptions:module$build$src$core$serialization$exceptions,priorities:module$build$src$core$serialization$priorities,procedures:module$build$src$core$serialization$procedures,registry:module$build$src$core$serialization$registry,variables:module$build$src$core$serialization$variables,workspaceComments:module$build$src$core$serialization$workspace_comments,workspaces:module$build$src$core$serialization$workspaces};"Blockly"in globalThis||(globalThis.Blockly={Msg:module$build$src$core$msg});var module$build$src$core$main={};var LABEL_TYPE$$module$build$src$core$label_flyout_inflater="label",LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater=class{load(a,b){a=new FlyoutButton$$module$build$src$core$flyout_button(b.getWorkspace(),b.targetWorkspace,a,!0);a.show();return new FlyoutItem$$module$build$src$core$flyout_item(a,LABEL_TYPE$$module$build$src$core$label_flyout_inflater)}gapForItem(a,b){return b}disposeItem(a){a=a.getElement();a instanceof FlyoutButton$$module$build$src$core$flyout_button&&a.dispose()}getType(){return LABEL_TYPE$$module$build$src$core$label_flyout_inflater}};
|
|
2316
2376
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,LABEL_TYPE$$module$build$src$core$label_flyout_inflater,LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater);var module$build$src$core$label_flyout_inflater={};module$build$src$core$label_flyout_inflater.LabelFlyoutInflater=LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater;var ConstantProvider$$module$build$src$core$renderers$zelos$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(a){super();this.GRID_UNIT=4;this.CURSOR_COLOUR="#ffa200";this.CURSOR_RADIUS=5;this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0;this.START_HAT_HEIGHT=22;this.START_HAT_WIDTH=96;this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5};this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},
|
|
@@ -2348,28 +2408,28 @@ if(c<=0||b<=0)throw Error("Height and width values of an image field must be gre
|
|
|
2348
2408
|
a.flipRtl&&(this.flipRtl=a.flipRtl);a.alt&&(this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(a.alt))}initView(){this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_);this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_);this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,
|
|
2349
2409
|
"blocklyImageField");this.clickHandler&&(this.imageElement.style.cursor="pointer");this.recomputeAriaContext()}updateSize_(){}doClassValidation_(a){return typeof a!=="string"?null:a}doValueUpdate_(a){this.value_=a;this.imageElement&&this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_);this.recomputeAriaContext()}getFlipRtl(){return this.flipRtl}setAlt(a){a!==this.altText&&(this.altText=a||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}isClickable(){return super.isClickable()&&
|
|
2350
2410
|
!!this.clickHandler}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(a){this.clickHandler=a}getText_(){return this.altText}static fromJson(a){if(!a.src||!a.width||!a.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(a.src,a.width,a.height,void 0,void 0,void 0,a)}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_IMAGE}getAriaValue(){return this.altText||
|
|
2351
|
-
null}
|
|
2352
|
-
|
|
2353
|
-
this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.spellcheck!==void 0&&(this.spellcheck_=a.spellcheck)}initView(){if(!this.getSourceBlock())throw new UnattachedFieldError$$module$build$src$core$field;
|
|
2354
|
-
this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyInputField");this.recomputeAriaContext()}isFullBlockField(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;var b;return this.fullBlockClickTarget_=!((b=this.getConstants())==null||!b.FULL_BLOCK_FIELDS)&&
|
|
2355
|
-
isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&b&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,a,this.value_)));this.recomputeAriaContext()}doValueUpdate_(a){this.isTextValid_=
|
|
2356
|
-
this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",a.getColourTertiary())):
|
|
2357
|
-
if(this.isBeingEdited_){var a=this.htmlInput_;this.isTextValid_?(removeClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,
|
|
2358
|
-
a.applyColour()}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b=!1,c=!0){this.workspace_=this.sourceBlock_.workspace;!b&&this.workspace_.options.modalInputs&&(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||
|
|
2359
|
-
this.getText(),a=>{a!==null&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a,b){var c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;show$$module$build$src$core$widgetdiv(this,c.RTL,this.widgetDispose_.bind(this),
|
|
2360
|
-
this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;$.setGroup$$module$build$src$core$events$utils(!0);var b=getDiv$$module$build$src$core$widgetdiv(),c=this.getClickTarget_();if(!c)throw Error("A click target has not been set.");addClass$$module$build$src$core$utils$dom(c,
|
|
2361
|
-
d+"pt";b.style.fontSize=e;c.style.fontSize=e;e=FieldInput$$module$build$src$core$field_input.BORDERRADIUS*d+"px";this.isFullBlockField()&&(e=this.getScaledBBox(),e=(e.bottom-e.top)/2+"px",a=a.getParent()?a.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),c.style.border=
|
|
2362
|
-
e;b.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.setAttribute("data-untyped-default-value",String(this.value_));this.resizeEditor_();this.bindInputEvents_(c);return c}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
e!==this.getSourceBlock();b=this;do b=a.shiftKey?c==null?void 0:c.getOutNode(b):c==null?void 0:c.getInNode(b);while(b&&!d(b));b=b instanceof
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
b){var
|
|
2371
|
-
|
|
2372
|
-
b);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,b)}}
|
|
2411
|
+
null}computeAriaLabel(a){return this.isClickable()?"":super.computeAriaLabel(a)}recomputeAriaContext(){if(!super.recomputeAriaContext())return!1;var a=this.getFocusableElement();if(!this.isClickable())return setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.PRESENTATION),clearState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL),!1;var b=this.getAriaValue()||"";setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,
|
|
2412
|
+
b);return!0}};FieldImage$$module$build$src$core$field_image.Y_PADDING=1;register$$module$build$src$core$field_registry("field_image",FieldImage$$module$build$src$core$field_image);FieldImage$$module$build$src$core$field_image.prototype.DEFAULT_VALUE="";var module$build$src$core$field_image={};module$build$src$core$field_image.FieldImage=FieldImage$$module$build$src$core$field_image;var MINIMUM_WIDTH$$module$build$src$core$field_input=14,FieldInput$$module$build$src$core$field_input=class extends Field$$module$build$src$core$field{set size_(a){super.size_=a}get size_(){var a=super.size_;a.width<MINIMUM_WIDTH$$module$build$src$core$field_input&&(a.width=MINIMUM_WIDTH$$module$build$src$core$field_input);return a}constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.spellcheck_=!0;this.htmlInput_=null;this.isTextValid_=this.isBeingEdited_=!1;this.onInputWrapper=
|
|
2413
|
+
this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.spellcheck!==void 0&&(this.spellcheck_=a.spellcheck)}initView(){if(!this.getSourceBlock())throw new UnattachedFieldError$$module$build$src$core$field;this.isFullBlockField()||this.createBorderRect_();this.createTextElement_();
|
|
2414
|
+
this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField");this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot());this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyInputField");this.recomputeAriaContext()}isFullBlockField(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;var b;return this.fullBlockClickTarget_=!((b=this.getConstants())==null||!b.FULL_BLOCK_FIELDS)&&
|
|
2415
|
+
a.isSimpleReporter()}doValueInvalid_(a,b=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,a=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&b&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,a,this.value_)));this.recomputeAriaContext()}doValueUpdate_(a){this.isTextValid_=
|
|
2416
|
+
this.isDirty_=!0;this.value_=a;this.recomputeAriaContext()}applyColour(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",a.getColourTertiary())):a.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR))}getSize(){var a;if((a=this.getConstants())==
|
|
2417
|
+
null?0:a.FULL_BLOCK_FIELDS)this.render_(),this.isDirty_=!1;return super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){super.render_();if(this.isBeingEdited_){var a=this.htmlInput_;this.isTextValid_?(removeClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,
|
|
2418
|
+
State$$module$build$src$core$utils$aria.INVALID,!0))}a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&a.applyColour()}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b=!1,c=!0){this.workspace_=this.sourceBlock_.workspace;!b&&this.workspace_.options.modalInputs&&(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||
|
|
2419
|
+
IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor():this.showInlineEditor(b,c)}showPromptEditor(){prompt$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{a!==null&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a,b){var c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;show$$module$build$src$core$widgetdiv(this,c.RTL,this.widgetDispose_.bind(this),
|
|
2420
|
+
this.workspace_,b);this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;this.valueWhenEditorWasOpened_=this.value_;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;$.setGroup$$module$build$src$core$events$utils(!0);var b=getDiv$$module$build$src$core$widgetdiv(),c=this.getClickTarget_();if(!c)throw Error("A click target has not been set.");addClass$$module$build$src$core$utils$dom(c,
|
|
2421
|
+
"blocklyEditing");c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.spellcheck_);var d=this.workspace_.getAbsoluteScale(),e=this.getConstants().FIELD_TEXT_FONTSIZE*d+"pt";b.style.fontSize=e;c.style.fontSize=e;e=FieldInput$$module$build$src$core$field_input.BORDERRADIUS*d+"px";this.isFullBlockField()&&(e=this.getScaledBBox(),e=(e.bottom-e.top)/2+"px",a=a.getParent()?a.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),c.style.border=
|
|
2422
|
+
1*d+"px solid "+a,b.style.borderRadius=e,b.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(b.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*d+"px"));c.style.borderRadius=e;b.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.setAttribute("data-untyped-default-value",String(this.value_));this.resizeEditor_();this.bindInputEvents_(c);return c}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);
|
|
2423
|
+
this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null);$.setGroup$$module$build$src$core$events$utils(!1);this.unbindInputEvents_();
|
|
2424
|
+
var a=getDiv$$module$build$src$core$widgetdiv().style;a.width="auto";a.height="auto";a.fontSize="";a.transition="";a.boxShadow="";this.htmlInput_=null;a=this.getClickTarget_();if(!a)throw Error("A click target has not been set.");removeClass$$module$build$src$core$utils$dom(a,"blocklyEditing")}onFinishEditing_(a){}bindInputEvents_(a){this.onKeyDownWrapper=conditionalBind$$module$build$src$core$browser_events(a,"keydown",this,this.onHtmlInputKeyDown_);this.onInputWrapper=conditionalBind$$module$build$src$core$browser_events(a,
|
|
2425
|
+
"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(unbind$$module$build$src$core$browser_events(this.onKeyDownWrapper),this.onKeyDownWrapper=null);this.onInputWrapper&&(unbind$$module$build$src$core$browser_events(this.onInputWrapper),this.onInputWrapper=null)}onHtmlInputKeyDown_(a){if(a.key==="Enter")hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Escape")this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),
|
|
2426
|
+
!1),hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Tab"){a.preventDefault();var b;let c=(b=this.workspace_)==null?void 0:b.getNavigator(),d=e=>(e instanceof FieldInput$$module$build$src$core$field_input||e instanceof BlockSvg$$module$build$src$core$block_svg&&e.isSimpleReporter())&&e!==this.getSourceBlock();b=this;do b=a.shiftKey?c==null?void 0:c.getOutNode(b):c==null?void 0:c.getInNode(b);while(b&&!d(b));b=b instanceof
|
|
2427
|
+
BlockSvg$$module$build$src$core$block_svg&&b.isSimpleReporter()?b.getFields().next().value:b;b instanceof FieldInput$$module$build$src$core$field_input&&(hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv(),a=b.getSourceBlock(),b.isFullBlockField()&&a&&a instanceof BlockSvg$$module$build$src$core$block_svg?$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a):$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b),
|
|
2428
|
+
b.showEditor())}}onHtmlInputChange(a){a=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,this.name||null,a,this.value_))}setEditorValue_(a,b=!0){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=
|
|
2429
|
+
this.getEditorText_(a));this.setValue(a,b)}resizeEditor_(){finishQueuedRenders$$module$build$src$core$render_management().then(()=>{var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;var b=getDiv$$module$build$src$core$widgetdiv(),c=this.getScaledBBox();b.style.width=c.right-c.left+"px";b.style.height=c.bottom-c.top+"px";a=a.RTL?c.right-b.offsetWidth:c.left;c=c.top;var d=b==null?void 0:b.parentElement;d&&(d=d.getBoundingClientRect(),a-=d.left+window.scrollX,
|
|
2430
|
+
c-=d.top+window.scrollY);b.style.left=`${a}px`;b.style.top=`${c}px`})}repositionForWindowResize(){var a,b=(a=this.getSourceBlock())==null?void 0:a.getRootBlock();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),b)||this.resizeEditor_();return!0}positionTextElement_(a,b){var c=a*2+b;super.positionTextElement_(a+(c<MINIMUM_WIDTH$$module$build$src$core$field_input?
|
|
2431
|
+
(MINIMUM_WIDTH$$module$build$src$core$field_input-c)/2:0),b)}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(a){return`${a}`}getValueFromEditorText_(a){return a}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_INPUT}getAriaValue(){return this.getText()||$.Msg$$module$build$src$core$msg.FIELD_LABEL_EMPTY}recomputeAriaContext(){if(!super.recomputeAriaContext())return!1;var a=this.getFocusableElement(),b=this.computeAriaLabel(!0),
|
|
2432
|
+
c;!this.isCurrentlyEditable()||((c=this.getSourceBlock())==null?0:c.isInFlyout)||(b=$.Msg$$module$build$src$core$msg.FIELD_LABEL_EDIT_PREFIX.replace("%1",b));setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,b);return!0}};FieldInput$$module$build$src$core$field_input.BORDERRADIUS=4;var module$build$src$core$field_input={};module$build$src$core$field_input.FieldInput=FieldInput$$module$build$src$core$field_input;$.FieldTextInput$$module$build$src$core$field_textinput=class extends FieldInput$$module$build$src$core$field_input{constructor(a,b,c){super(a,b,c)}initView(){super.initView();this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyTextInputField")}doClassValidation_(a){return a===void 0?null:`${a}`}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_TEXT_INPUT}};
|
|
2373
2433
|
register$$module$build$src$core$field_registry("field_input",$.FieldTextInput$$module$build$src$core$field_textinput);$.FieldTextInput$$module$build$src$core$field_textinput.prototype.DEFAULT_VALUE="";var module$build$src$core$field_textinput={};module$build$src$core$field_textinput.FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput;var BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row=class extends BottomRow$$module$build$src$core$renderers$measurables$bottom_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){return!!a.outputConnection}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$bottom_row={};module$build$src$core$renderers$zelos$measurables$bottom_row.BottomRow=BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row;var StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs=class extends StatementInput$$module$build$src$core$renderers$measurables$statement_input{constructor(a,b){super(a,b);this.connectedBottomNextConnection=!1;if(this.connectedBlock){for(a=this.connectedBlock;b=a.getNextBlock();)a=b;a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},module$build$src$core$renderers$zelos$measurables$inputs={};
|
|
2374
2434
|
module$build$src$core$renderers$zelos$measurables$inputs.StatementInput=StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs;var RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements=class extends Measurable$$module$build$src$core$renderers$measurables$base{constructor(a){super(a);this.width=this.height=0;this.type|=Types$$module$build$src$core$renderers$measurables$types.getType("RIGHT_CONNECTION")}},module$build$src$core$renderers$zelos$measurables$row_elements={};module$build$src$core$renderers$zelos$measurables$row_elements.RightConnectionShape=RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements;var TopRow$$module$build$src$core$renderers$zelos$measurables$top_row=class extends TopRow$$module$build$src$core$renderers$measurables$top_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){var b=(a.hat?a.hat==="cap":this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$top_row=
|
|
2375
2435
|
{};module$build$src$core$renderers$zelos$measurables$top_row.TopRow=TopRow$$module$build$src$core$renderers$zelos$measurables$top_row;var RenderInfo$$module$build$src$core$renderers$zelos$info=class extends RenderInfo$$module$build$src$core$renderers$common$info{constructor(a,b){super(a,b);this.isInline=!0;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.topRow=new TopRow$$module$build$src$core$renderers$zelos$measurables$top_row(this.constants_);this.bottomRow=new BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row(this.constants_);this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=
|
|
@@ -2449,9 +2509,9 @@ void 0,void 0,a)}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build
|
|
|
2449
2509
|
var module$build$src$core$field_label_serializable={};module$build$src$core$field_label_serializable.FieldLabelSerializable=FieldLabelSerializable$$module$build$src$core$field_label_serializable;var FieldCheckbox$$module$build$src$core$field_checkbox=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.SERIALIZABLE=!0;this.value_=this.value_;this.checkChar=FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.checkCharacter&&(this.checkChar=a.checkCharacter)}saveState(){var a=
|
|
2450
2510
|
this.saveLegacyState(FieldCheckbox$$module$build$src$core$field_checkbox);return a!==null?a:this.getValueBoolean()}initView(){super.initView();var a=this.getTextElement();addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyCheckboxField");a.style.display=this.value_?"block":"none";this.recomputeAriaContext()}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(a){this.checkChar=
|
|
2451
2511
|
a||FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR;this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(a){return a===!0||a==="TRUE"?"TRUE":a===!1||a==="FALSE"?"FALSE":null}doValueUpdate_(a){this.value_=this.convertValueToBool(a);this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none");this.recomputeAriaContext()}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(a){return typeof a===
|
|
2452
|
-
"string"?a==="TRUE":!!a}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_CHECKBOX}getAriaValue(){return this.convertValueToBool(this.value_)?$.Msg$$module$build$src$core$msg.FIELD_LABEL_CHECKBOX_CHECKED:$.Msg$$module$build$src$core$msg.FIELD_LABEL_CHECKBOX_UNCHECKED}static fromJson(a){return new this(a.checked,void 0,a)}recomputeAriaContext(){
|
|
2453
|
-
State$$module$build$src$core$utils$aria.HIDDEN,!
|
|
2454
|
-
|
|
2512
|
+
"string"?a==="TRUE":!!a}getAriaTypeName(){return this.ariaTypeName||$.Msg$$module$build$src$core$msg.ARIA_TYPE_FIELD_CHECKBOX}getAriaValue(){return this.convertValueToBool(this.value_)?$.Msg$$module$build$src$core$msg.FIELD_LABEL_CHECKBOX_CHECKED:$.Msg$$module$build$src$core$msg.FIELD_LABEL_CHECKBOX_UNCHECKED}static fromJson(a){return new this(a.checked,void 0,a)}recomputeAriaContext(){if(!super.recomputeAriaContext())return!1;var a=this.getFocusableElement();setState$$module$build$src$core$utils$aria(a,
|
|
2513
|
+
State$$module$build$src$core$utils$aria.HIDDEN,!1);setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.CHECKBOX);var b=this.convertValueToBool(this.value_);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.CHECKED,b);b=this.getAriaTypeName();setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,b);return!0}};FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR="\u2713";
|
|
2514
|
+
register$$module$build$src$core$field_registry("field_checkbox",FieldCheckbox$$module$build$src$core$field_checkbox);FieldCheckbox$$module$build$src$core$field_checkbox.prototype.DEFAULT_VALUE=!1;var module$build$src$core$field_checkbox={};module$build$src$core$field_checkbox.FieldCheckbox=FieldCheckbox$$module$build$src$core$field_checkbox;var Dragger$$module$build$src$core$dragging$dragger=class{constructor(a){this.draggable=a;this.dragTarget=null;this.startLoc=a.getRelativeToSurfaceXY()}onDragStart(a){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);this.draggable=this.draggable.startDrag(a);this.startLoc=this.draggable.getRelativeToSurfaceXY();return this.draggable}onDrag(a,b){this.moveDraggable(a,b);isDeletable$$module$build$src$core$interfaces$i_deletable(this.draggable)&&this.draggable.setDeleteStyle(this.wouldDeleteDraggable(this.draggable.getRelativeToSurfaceXY(),
|
|
2455
2515
|
this.draggable));this.updateDragTarget(this.draggable.getRelativeToSurfaceXY())}updateDragTarget(a){a=this.draggable.workspace.getDragTarget(a);if(this.dragTarget!==a){let b;(b=this.dragTarget)==null||b.onDragExit(this.draggable);a==null||a.onDragEnter(this.draggable)}a==null||a.onDragOver(this.draggable);this.dragTarget=a}moveDraggable(a,b){b=this.pixelsToWorkspaceUnits(b);b=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,b);this.draggable.drag(b,a)}wouldDeleteDraggable(a,b){return(a=
|
|
2456
2516
|
this.draggable.workspace.getDragTarget(a))&&this.draggable.workspace.getComponentManager().hasCapability(a.id,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA)?a.wouldDelete(b):!1}onDragEnd(a){var b=$.getGroup$$module$build$src$core$events$utils();if(this.draggable.workspace.getDragTarget(this.draggable.getRelativeToSurfaceXY())){var c;(c=this.dragTarget)==null||c.onDrop(this.draggable)}c=!1;this.shouldReturnToStart(this.draggable.getRelativeToSurfaceXY(),this.draggable)&&
|
|
2457
2517
|
(c=!0,this.draggable.revertDrag());var d=isDeletable$$module$build$src$core$interfaces$i_deletable(this.draggable)&&this.wouldDeleteDraggable(this.draggable.getRelativeToSurfaceXY(),this.draggable);d&&isDeletable$$module$build$src$core$interfaces$i_deletable(this.draggable)?(this.draggable.endDrag(a,DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE),$.setGroup$$module$build$src$core$events$utils(b),this.draggable.dispose()):this.draggable.endDrag(a,c?DragDisposition$$module$build$src$core$interfaces$i_draggable.REVERT:
|
|
@@ -2559,7 +2619,7 @@ b.style.display="none";var c=this.cssConfig_.contents;c&&addClass$$module$build$
|
|
|
2559
2619
|
"none";this.closeIcon_(this.iconDom_)}setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.EXPANDED,a);this.parentToolbox_.handleToolboxItemResize()}}setVisible_(a){this.htmlDiv_.style.display=a?"block":"none";var b=this.getChildToolboxItems();for(let c=0;c<b.length;c++)b[c].setVisible_(a);this.isHidden_=!a;this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}isExpanded(){return this.expanded_}isCollapsible(){return!0}onClick(a){this.toggleExpanded()}toggleExpanded(){this.setExpanded(!this.expanded_)}getDiv(){return this.htmlDiv_}getChildToolboxItems(){return this.toolboxItems_}};
|
|
2560
2620
|
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={};
|
|
2561
2621
|
module$build$src$core$toolbox$collapsible_category.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;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.mouseDown=!1;this.navigator=new ToolboxNavigator$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this);this.workspace_=a;this.toolboxDef_=
|
|
2562
|
-
a.options.languageTree||{contents:[]};this.horizontalLayout=a.options.horizontalLayout;this.RTL=a.options.RTL;this.toolboxPosition=a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_,b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);var c=this.flyout.createDom("svg");
|
|
2622
|
+
a.options.languageTree||{contents:[]};this.horizontalLayout=a.options.horizontalLayout;this.RTL=a.options.RTL;this.toolboxPosition=a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_,b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);var c=this.flyout.createDom("svg");a.getInjectionDiv().insertBefore(c,b);addClass$$module$build$src$core$utils$dom(c,"blocklyToolboxFlyout");this.setVisible(!0);this.flyout.init(a);this.render(this.toolboxDef_);
|
|
2563
2623
|
a=a.getThemeManager();a.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color");a.subscribe(this.HtmlDiv,"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]});
|
|
2564
2624
|
$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!0)}createDom_(a){a=a.getParentSvg();var b=this.createContainer_();b.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();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_);var c;(c=a.parentNode)==null||c.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b}createContainer_(){var a=
|
|
2565
2625
|
document.createElement("div");a.setAttribute("layout",this.isHorizontal()?"h":"v");addClass$$module$build$src$core$utils$dom(a,"blocklyToolbox");a.setAttribute("dir",this.RTL?"RTL":"LTR");return a}createContentsContainer_(){var a=document.createElement("div");addClass$$module$build$src$core$utils$dom(a,"blocklyToolboxCategoryGroup");this.isHorizontal()&&(a.style.flexDirection="row");return a}attachEvents_(a,b){var c=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onClick_,
|
|
@@ -2580,7 +2640,7 @@ null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEv
|
|
|
2580
2640
|
b.isCollapsible())&&((c=this.selectedItem_)==null?void 0:c.isExpanded())!==a?(this.selectedItem_.toggleExpanded(),!0):!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");var a;(a=this.flyout)==null||a.dispose();this.contents.forEach(b=>b.dispose());for(a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));
|
|
2581
2641
|
$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return(b=this.getToolboxItems().find(c=>c.isSelectable()))!=null?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,
|
|
2582
2642
|
b){a!==this?this.getSelectedItem()===a||this.mouseDown||this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){var b;a&&a===((b=this.flyout)==null?void 0:b.getWorkspace())||this.autoHide(!1)}getNavigator(){return this.navigator}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n box-sizing: border-box;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
|
|
2583
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="13.0.0-beta.
|
|
2643
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="13.0.0-beta.5",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,
|
|
2584
2644
|
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=
|
|
2585
2645
|
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,
|
|
2586
2646
|
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,
|