blockly 13.0.0-beta.5 → 13.0.0-beta.6
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 +213 -152
- package/blockly_compressed.js +65 -60
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +97 -90
- package/blocks_compressed.js.map +1 -1
- package/core/dragging/block_drag_strategy.d.ts +8 -0
- package/core/inputs/input.d.ts +5 -2
- package/core/toolbox/category.d.ts +6 -0
- package/core/workspace_svg.d.ts +5 -0
- package/msg/ab.js +51 -2
- package/msg/ab.mjs +49 -0
- package/msg/ace.js +51 -2
- package/msg/ace.mjs +49 -0
- package/msg/af.js +51 -2
- package/msg/af.mjs +49 -0
- package/msg/am.js +51 -2
- package/msg/am.mjs +49 -0
- package/msg/ar.js +51 -2
- package/msg/ar.mjs +49 -0
- package/msg/ast.js +51 -2
- package/msg/ast.mjs +49 -0
- package/msg/az.js +51 -2
- package/msg/az.mjs +49 -0
- package/msg/ba.js +51 -2
- package/msg/ba.mjs +49 -0
- package/msg/bcc.js +51 -2
- package/msg/bcc.mjs +49 -0
- package/msg/be-tarask.js +51 -2
- package/msg/be-tarask.mjs +49 -0
- package/msg/be.js +51 -2
- package/msg/be.mjs +49 -0
- package/msg/bg.js +51 -2
- package/msg/bg.mjs +49 -0
- package/msg/bn.js +51 -2
- package/msg/bn.mjs +49 -0
- package/msg/br.js +51 -2
- package/msg/br.mjs +49 -0
- package/msg/bs.js +51 -2
- package/msg/bs.mjs +49 -0
- package/msg/ca.js +51 -2
- package/msg/ca.mjs +49 -0
- package/msg/ce.js +51 -2
- package/msg/ce.mjs +49 -0
- package/msg/cs.js +51 -2
- package/msg/cs.mjs +49 -0
- package/msg/da.js +51 -2
- package/msg/da.mjs +49 -0
- package/msg/de.js +51 -2
- package/msg/de.mjs +49 -0
- package/msg/diq.js +51 -2
- package/msg/diq.mjs +49 -0
- package/msg/dtp.js +51 -2
- package/msg/dtp.mjs +49 -0
- package/msg/dty.js +51 -2
- package/msg/dty.mjs +49 -0
- package/msg/ee.js +51 -2
- package/msg/ee.mjs +49 -0
- package/msg/el.js +51 -2
- package/msg/el.mjs +49 -0
- package/msg/en-gb.js +51 -2
- package/msg/en-gb.mjs +49 -0
- package/msg/en.js +51 -2
- package/msg/en.mjs +49 -0
- package/msg/eo.js +51 -2
- package/msg/eo.mjs +49 -0
- package/msg/es.js +51 -2
- package/msg/es.mjs +49 -0
- package/msg/et.js +51 -2
- package/msg/et.mjs +49 -0
- package/msg/eu.js +51 -2
- package/msg/eu.mjs +49 -0
- package/msg/fa.js +51 -2
- package/msg/fa.mjs +49 -0
- package/msg/fi.js +51 -2
- package/msg/fi.mjs +49 -0
- package/msg/fo.js +51 -2
- package/msg/fo.mjs +49 -0
- package/msg/fr.js +51 -2
- package/msg/fr.mjs +49 -0
- package/msg/frr.js +51 -2
- package/msg/frr.mjs +49 -0
- package/msg/ga.js +51 -2
- package/msg/ga.mjs +49 -0
- package/msg/gl.js +51 -2
- package/msg/gl.mjs +49 -0
- package/msg/gn.js +51 -2
- package/msg/gn.mjs +49 -0
- package/msg/gor.js +51 -2
- package/msg/gor.mjs +49 -0
- package/msg/ha.js +51 -2
- package/msg/ha.mjs +49 -0
- package/msg/hak.js +51 -2
- package/msg/hak.mjs +49 -0
- package/msg/he.js +51 -2
- package/msg/he.mjs +49 -0
- package/msg/hi.js +51 -2
- package/msg/hi.mjs +49 -0
- package/msg/hr.js +51 -2
- package/msg/hr.mjs +49 -0
- package/msg/hrx.js +51 -2
- package/msg/hrx.mjs +49 -0
- package/msg/hsb.js +51 -2
- package/msg/hsb.mjs +49 -0
- package/msg/hu.js +51 -2
- package/msg/hu.mjs +49 -0
- package/msg/hy.js +51 -2
- package/msg/hy.mjs +49 -0
- package/msg/ia.js +51 -2
- package/msg/ia.mjs +49 -0
- package/msg/id.js +51 -2
- package/msg/id.mjs +49 -0
- package/msg/ig.js +51 -2
- package/msg/ig.mjs +49 -0
- package/msg/inh.js +51 -2
- package/msg/inh.mjs +49 -0
- package/msg/is.js +51 -2
- package/msg/is.mjs +49 -0
- package/msg/it.js +51 -2
- package/msg/it.mjs +49 -0
- package/msg/ja.js +51 -2
- package/msg/ja.mjs +49 -0
- package/msg/ka.js +51 -2
- package/msg/ka.mjs +49 -0
- package/msg/kab.js +51 -2
- package/msg/kab.mjs +49 -0
- package/msg/kbd-cyrl.js +51 -2
- package/msg/kbd-cyrl.mjs +49 -0
- package/msg/km.js +51 -2
- package/msg/km.mjs +49 -0
- package/msg/kn.js +51 -2
- package/msg/kn.mjs +49 -0
- package/msg/ko.js +51 -2
- package/msg/ko.mjs +49 -0
- package/msg/krc.js +51 -2
- package/msg/krc.mjs +49 -0
- package/msg/ksh.js +51 -2
- package/msg/ksh.mjs +49 -0
- package/msg/ku-latn.js +51 -2
- package/msg/ku-latn.mjs +49 -0
- package/msg/ky.js +51 -2
- package/msg/ky.mjs +49 -0
- package/msg/la.js +51 -2
- package/msg/la.mjs +49 -0
- package/msg/lb.js +51 -2
- package/msg/lb.mjs +49 -0
- package/msg/lki.js +51 -2
- package/msg/lki.mjs +49 -0
- package/msg/lo.js +51 -2
- package/msg/lo.mjs +49 -0
- package/msg/lrc.js +51 -2
- package/msg/lrc.mjs +49 -0
- package/msg/lt.js +51 -2
- package/msg/lt.mjs +49 -0
- package/msg/lv.js +51 -2
- package/msg/lv.mjs +49 -0
- package/msg/mg.js +51 -2
- package/msg/mg.mjs +49 -0
- package/msg/mk.js +51 -2
- package/msg/mk.mjs +49 -0
- package/msg/ml.js +51 -2
- package/msg/ml.mjs +49 -0
- package/msg/mnw.js +51 -2
- package/msg/mnw.mjs +49 -0
- package/msg/ms.js +51 -2
- package/msg/ms.mjs +49 -0
- package/msg/my.js +51 -2
- package/msg/my.mjs +49 -0
- package/msg/mzn.js +51 -2
- package/msg/mzn.mjs +49 -0
- package/msg/nb.js +51 -2
- package/msg/nb.mjs +49 -0
- package/msg/ne.js +51 -2
- package/msg/ne.mjs +49 -0
- package/msg/nl.js +51 -2
- package/msg/nl.mjs +49 -0
- package/msg/oc.js +51 -2
- package/msg/oc.mjs +49 -0
- package/msg/olo.js +51 -2
- package/msg/olo.mjs +49 -0
- package/msg/pa.js +51 -2
- package/msg/pa.mjs +49 -0
- package/msg/pl.js +51 -2
- package/msg/pl.mjs +49 -0
- package/msg/pms.js +51 -2
- package/msg/pms.mjs +49 -0
- package/msg/ps.js +51 -2
- package/msg/ps.mjs +49 -0
- package/msg/pt-br.js +51 -2
- package/msg/pt-br.mjs +49 -0
- package/msg/pt.js +51 -2
- package/msg/pt.mjs +49 -0
- package/msg/ro.js +51 -2
- package/msg/ro.mjs +49 -0
- package/msg/ru.js +51 -2
- package/msg/ru.mjs +49 -0
- package/msg/sc.js +51 -2
- package/msg/sc.mjs +49 -0
- package/msg/sco.js +51 -2
- package/msg/sco.mjs +49 -0
- package/msg/sd.js +51 -2
- package/msg/sd.mjs +49 -0
- package/msg/shn.js +51 -2
- package/msg/shn.mjs +49 -0
- package/msg/si.js +51 -2
- package/msg/si.mjs +49 -0
- package/msg/sk.js +51 -2
- package/msg/sk.mjs +49 -0
- package/msg/skr-arab.js +51 -2
- package/msg/skr-arab.mjs +49 -0
- package/msg/sl.js +51 -2
- package/msg/sl.mjs +49 -0
- package/msg/smn.js +51 -2
- package/msg/smn.mjs +49 -0
- package/msg/sq.js +51 -2
- package/msg/sq.mjs +49 -0
- package/msg/sr-latn.js +51 -2
- package/msg/sr-latn.mjs +49 -0
- package/msg/sr.js +51 -2
- package/msg/sr.mjs +49 -0
- package/msg/sv.js +51 -2
- package/msg/sv.mjs +49 -0
- package/msg/sw.js +51 -2
- package/msg/sw.mjs +49 -0
- package/msg/ta.js +51 -2
- package/msg/ta.mjs +49 -0
- package/msg/tcy.js +51 -2
- package/msg/tcy.mjs +49 -0
- package/msg/tdd.js +51 -2
- package/msg/tdd.mjs +49 -0
- package/msg/te.js +51 -2
- package/msg/te.mjs +49 -0
- package/msg/th.js +51 -2
- package/msg/th.mjs +49 -0
- package/msg/ti.js +51 -2
- package/msg/ti.mjs +49 -0
- package/msg/tl.js +51 -2
- package/msg/tl.mjs +49 -0
- package/msg/tlh.js +51 -2
- package/msg/tlh.mjs +49 -0
- package/msg/tr.js +51 -2
- package/msg/tr.mjs +49 -0
- package/msg/ug-arab.js +51 -2
- package/msg/ug-arab.mjs +49 -0
- package/msg/uk.js +51 -2
- package/msg/uk.mjs +49 -0
- package/msg/ur.js +51 -2
- package/msg/ur.mjs +49 -0
- package/msg/uz.js +51 -2
- package/msg/uz.mjs +49 -0
- package/msg/vi.js +51 -2
- package/msg/vi.mjs +49 -0
- package/msg/xmf.js +51 -2
- package/msg/xmf.mjs +49 -0
- package/msg/yo.js +51 -2
- package/msg/yo.mjs +49 -0
- package/msg/zgh.js +51 -2
- package/msg/zgh.mjs +49 -0
- package/msg/zh-hans.js +51 -2
- package/msg/zh-hans.mjs +49 -0
- package/msg/zh-hant.js +51 -2
- package/msg/zh-hant.mjs +49 -0
- package/package.json +1 -1
package/blockly_compressed.js
CHANGED
|
@@ -131,8 +131,8 @@ getBlockTypeCounts$$module$build$src$core$common=function(a,b){var c=Object.crea
|
|
|
131
131
|
defineBlocksWithJsonArrayInternal$$module$build$src$core$common=function(a){$.defineBlocks$$module$build$src$core$common($.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(a))};$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(a){var b={};for(let c=0;c<a.length;c++){let d=a[c];if(!d){console.warn(`Block definition #${c} in JSON array is ${d}. Skipping`);continue}let e=d.type;e?b[e]={init:jsonInitFactory$$module$build$src$core$common(d)}:console.warn(`Block definition #${c} in JSON array is missing a type attribute. Skipping.`)}return b};
|
|
132
132
|
$.defineBlocks$$module$build$src$core$common=function(a){for(let b of Object.keys(a)){let c=a[b];b in Blocks$$module$build$src$core$blocks&&console.warn(`Block definition "${b}" overwrites previous definition.`);Blocks$$module$build$src$core$blocks[b]=c}};
|
|
133
133
|
globalShortcutHandler$$module$build$src$core$common=function(a){var b=getMainWorkspace$$module$build$src$core$common(),c=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree();for(let d of getAllWorkspaces$$module$build$src$core$common())if(c===d){b=d;break}if(!isTargetInput$$module$build$src$core$browser_events(a)&&b&&(!b.rendered||b.isFlyout||b.isVisible()))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.onKeyDown(b,a)};
|
|
134
|
-
removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(b===-1)return!1;a.splice(b,1);return!0};register$$module$build$src$core$css=function(a){
|
|
135
|
-
inject$$module$build$src$core$css=function(a,b,c){
|
|
134
|
+
removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(b===-1)return!1;a.splice(b,1);return!0};register$$module$build$src$core$css=function(a){registeredCss$$module$build$src$core$css.push(a)};
|
|
135
|
+
inject$$module$build$src$core$css=function(a,b,c){b&&typeof window!=="undefined"&&(a=a.getRootNode(),injectionSites$$module$build$src$core$css.has(a)||(injectionSites$$module$build$src$core$css.add(a),c=c.replace(/[\\/]$/,""),c=[content$$module$build$src$core$css,...registeredCss$$module$build$src$core$css].join("\n").replace(/<<<PATH>>>/g,c),b=document.createElement("style"),b.id="blockly-common-style",b.textContent=c,(a instanceof ShadowRoot?a:document.head).prepend(b)))};
|
|
136
136
|
getSize$$module$build$src$core$utils$style=function(a){return TEST_ONLY$$module$build$src$core$utils$style.getSizeInternal(a)};
|
|
137
137
|
getSizeInternal$$module$build$src$core$utils$style=function(a){if(getComputedStyle$$module$build$src$core$utils$style(a,"display")!=="none")return getSizeWithDisplay$$module$build$src$core$utils$style(a);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";var f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new Size$$module$build$src$core$utils$size(f,a)};
|
|
138
138
|
getSizeWithDisplay$$module$build$src$core$utils$style=function(a){return new Size$$module$build$src$core$utils$size(a.offsetWidth,a.offsetHeight)};getComputedStyle$$module$build$src$core$utils$style=function(a,b){a=window.getComputedStyle(a);return a[b]||a.getPropertyValue(b)};
|
|
@@ -359,7 +359,7 @@ removeNode$$module$build$src$core$utils$dom(d))}return a};domToText$$module$buil
|
|
|
359
359
|
domToPrettyText$$module$build$src$core$xml=function(a){a=domToText$$module$build$src$core$xml(a).split("<");var b="";for(let c=1;c<a.length;c++){let d=a[c];d[0]==="/"&&(b=b.substring(2));a[c]=b+"<"+d;d[0]!=="/"&&d.slice(-2)!=="/>"&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1</$2>");return a.replace(/^\n/,"")};
|
|
360
360
|
clearWorkspaceAndLoadFromXml$$module$build$src$core$xml=function(a,b){b.setResizesEnabled(!1);b.clear();a=$.domToWorkspace$$module$build$src$core$xml(a,b);b.setResizesEnabled(!0);return a};
|
|
361
361
|
$.domToWorkspace$$module$build$src$core$xml=function(a,b){var c=0;b.RTL&&(c=b.getWidth());var d=[];startTextWidthCache$$module$build$src$core$utils$dom();var e=$.getGroup$$module$build$src$core$events$utils();e||$.setGroup$$module$build$src$core$events$utils(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);var f=!0;try{for(let g=0,h;h=a.childNodes[g];g++){let k=h.nodeName.toLowerCase(),l=h;if(k==="block"||k==="shadow"&&!getRecordUndo$$module$build$src$core$events$utils()){let m=domToBlockInternal$$module$build$src$core$xml(l,
|
|
362
|
-
b);d.push(m.id);let n,p=parseInt((n=l.getAttribute("x"))!=null?n:"10",10),r
|
|
362
|
+
b);d.push(m.id);let n,p=parseInt((n=l.getAttribute("x"))!=null?n:"10",10),q,r=parseInt((q=l.getAttribute("y"))!=null?q:"10",10);isNaN(p)||isNaN(r)||m.moveBy(b.RTL?c-p:p,r,["create"]);f=!1}else{if(k==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(k==="comment")loadWorkspaceComment$$module$build$src$core$xml(l,b);else if(k==="variables"){if(f)domToVariables$$module$build$src$core$xml(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");
|
|
363
363
|
f=!1}}}}finally{$.setGroup$$module$build$src$core$events$utils(e),b.setResizesEnabled&&b.setResizesEnabled(!0),b.rendered&&triggerQueuedRenders$$module$build$src$core$render_management(),stopTextWidthCache$$module$build$src$core$utils$dom()}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.FINISHED_LOADING))(b));return d};
|
|
364
364
|
loadWorkspaceComment$$module$build$src$core$xml=function(a,b){var c,d=(c=a.getAttribute("id"))!=null?c:void 0;c=b.rendered?new RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment(b,d):new WorkspaceComment$$module$build$src$core$comments$workspace_comment(b,d);var e;c.setText((e=a.textContent)!=null?e:"");var f;e=parseInt((f=a.getAttribute("x"))!=null?f:"",10);var g;f=parseInt((g=a.getAttribute("y"))!=null?g:"",10);isNaN(e)||isNaN(f)||(e=b.RTL?b.getWidth()-e:e,c.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(e,
|
|
365
365
|
f)));var h;b=parseInt((h=a.getAttribute("w"))!=null?h:"",10);var k;h=parseInt((k=a.getAttribute("h"))!=null?k:"",10);isNaN(b)||isNaN(h)||c.setSize(new Size$$module$build$src$core$utils$size(b,h));a.getAttribute("collapsed")==="true"&&c.setCollapsed(!0);a.getAttribute("editable")==="false"&&c.setEditable(!1);a.getAttribute("movable")==="false"&&c.setMovable(!1);a.getAttribute("deletable")==="false"&&c.setDeletable(!1);return c};
|
|
@@ -370,8 +370,8 @@ e.length-1;f>=0;f--)e[f].initModel()}}finally{$.enable$$module$build$src$core$ev
|
|
|
370
370
|
domToVariables$$module$build$src$core$xml=function(a,b){for(let d=0;d<a.children.length;d++){var c=a.children[d];let e=c.getAttribute("type"),f=c.getAttribute("id");c=c.textContent;if(!c)break;b.getVariableMap().createVariable(c,e!=null?e:void 0,f)}};
|
|
371
371
|
mapSupportedXmlTags$$module$build$src$core$xml=function(a){var b={mutation:[],comment:[],data:[],field:[],input:[],next:[]};for(let c=0;c<a.children.length;c++){let d=a.children[c];if(d.nodeType!==NodeType$$module$build$src$core$utils$dom.TEXT_NODE)switch(d.nodeName.toLowerCase()){case "mutation":b.mutation.push(d);break;case "comment":b.comment.push(d);break;case "data":b.data.push(d);break;case "title":case "field":b.field.push(d);break;case "value":case "statement":b.input.push(d);break;case "next":b.next.push(d);
|
|
372
372
|
break;default:console.warn("Ignoring unknown tag: "+d.nodeName)}}return b};applyMutationTagNodes$$module$build$src$core$xml=function(a,b){var c=!1;for(let d=0;d<a.length;d++){let e=a[d];b.domToMutation&&(b.domToMutation(e),b.initSvg&&(c=!0))}return c};
|
|
373
|
-
applyCommentTagNodes$$module$build$src$core$xml=function(a,b){for(let c=0;c<a.length;c++){let d=a[c],e=d.textContent,f=d.getAttribute("pinned")==="true",g,h=parseInt((g=d.getAttribute("w"))!=null?g:"50",10),k,l=parseInt((k=d.getAttribute("h"))!=null?k:"50",10),m,n=parseInt((m=d.getAttribute("x"))!=null?m:"",10),p,
|
|
374
|
-
l));
|
|
373
|
+
applyCommentTagNodes$$module$build$src$core$xml=function(a,b){for(let c=0;c<a.length;c++){let d=a[c],e=d.textContent,f=d.getAttribute("pinned")==="true",g,h=parseInt((g=d.getAttribute("w"))!=null?g:"50",10),k,l=parseInt((k=d.getAttribute("h"))!=null?k:"50",10),m,n=parseInt((m=d.getAttribute("x"))!=null?m:"",10),p,q=parseInt((p=d.getAttribute("y"))!=null?p:"",10);b.setCommentText(e);let r=b.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);isNaN(h)||isNaN(l)||r.setBubbleSize(new Size$$module$build$src$core$utils$size(h,
|
|
374
|
+
l));r.setBubbleVisible(f);setTimeout(()=>{isNaN(n)||isNaN(q)||(n=b.workspace.RTL?b.workspace.getWidth()-(n+h):n,r.setBubbleLocation(new Coordinate$$module$build$src$core$utils$coordinate(n,q)));r.setBubbleVisible(f)},1)}};applyDataTagNodes$$module$build$src$core$xml=function(a,b){for(let c=0;c<a.length;c++)b.data=a[c].textContent};
|
|
375
375
|
applyFieldTagNodes$$module$build$src$core$xml=function(a,b){for(let c=0;c<a.length;c++){let d=a[c],e=d.getAttribute("name");e?domToField$$module$build$src$core$xml(b,e,d):console.warn(`Ignoring unnamed field in block ${b.type}`)}};
|
|
376
376
|
findChildBlocks$$module$build$src$core$xml=function(a){var b=null,c=null;for(let d=0;d<a.childNodes.length;d++){let e=a.childNodes[d];isElement$$module$build$src$core$xml(e)&&(e.nodeName.toLowerCase()==="block"?b=e:e.nodeName.toLowerCase()==="shadow"&&(c=e))}return{childBlockElement:b,childShadowElement:c}};
|
|
377
377
|
applyInputTagNodes$$module$build$src$core$xml=function(a,b,c,d){for(let f=0;f<a.length;f++){var e=a[f];let g=e.getAttribute("name"),h=g?c.getInput(g):null;if(!h){console.warn("Ignoring non-existent input "+g+" in block "+d);break}e=findChildBlocks$$module$build$src$core$xml(e);if(e.childBlockElement){if(!h.connection)throw TypeError("Input connection does not exist.");domToBlockHeadless$$module$build$src$core$xml(e.childBlockElement,b,h.connection,!1)}if(e.childShadowElement){let k;(k=h.connection)==
|
|
@@ -412,8 +412,8 @@ a.outputConnection?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_VALUE:$.Msg$$mod
|
|
|
412
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
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
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.
|
|
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)})};
|
|
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.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,c)})};
|
|
417
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
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};
|
|
419
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",
|
|
@@ -750,7 +750,7 @@ a+'" has not been added to the ComponentManager');if(this.hasCapability(a,b))con
|
|
|
750
750
|
b),removeElem$$module$build$src$core$utils$array(this.capabilityToComponentIds.get(b),a)):console.warn('Plugin "'+a+"doesn't have capability \""+b+'" to remove')}hasCapability(a,b){b=`${b}`.toLowerCase();return this.componentData.has(a)&&this.componentData.get(a).capabilities.includes(b)}getComponent(a){var b;return(b=this.componentData.get(a))==null?void 0:b.component}getComponents(a,b){a=`${a}`.toLowerCase();a=this.capabilityToComponentIds.get(a);if(!a)return[];var c=[];if(b){let d=[];a.forEach(e=>
|
|
751
751
|
{d.push(this.componentData.get(e))});d.sort(function(e,f){return e.weight-f.weight});d.forEach(function(e){c.push(e.component)})}else a.forEach(d=>{c.push(this.componentData.get(d).component)});return c}};ComponentManager$$module$build$src$core$component_manager.Capability=Capability$$module$build$src$core$component_manager;
|
|
752
752
|
(function(a){a=a.ComponentWeight||(a.ComponentWeight={});a[a.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT";a[a.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT";a[a.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT";a[a.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(ComponentManager$$module$build$src$core$component_manager||(ComponentManager$$module$build$src$core$component_manager={}));
|
|
753
|
-
var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injectionSites$$module$build$src$core$css=new WeakSet,
|
|
753
|
+
var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injectionSites$$module$build$src$core$css=new WeakSet,registeredCss$$module$build$src$core$css=[],content$$module$build$src$core$css=`
|
|
754
754
|
:is(
|
|
755
755
|
.injectionDiv,
|
|
756
756
|
.blocklyWidgetDiv,
|
|
@@ -1725,8 +1725,8 @@ a.MAC_WK_CMD_LEFT:a.CTRL]="CTRL_CMD"})(KeyCodes$$module$build$src$core$utils$key
|
|
|
1725
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={}));
|
|
1726
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,
|
|
1727
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,
|
|
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,
|
|
1729
|
-
this.isMoving(),callback:()=>{this.finishMove();return!1},keyCodes:a,allowCollision:!0},!0);this.scrollCurrentElementIntoView();this.moveIndicator=new MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator(this.draggable.workspace);this.repositionMoveIndicator();return!0}move(a,b){switch(a){case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:this.totalDelta.y-=this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:this.totalDelta.y+=
|
|
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.SPACE,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,
|
|
1729
|
+
preconditionFn:()=>this.isMoving(),callback:()=>{this.finishMove();return!1},keyCodes:a,allowCollision:!0},!0);this.scrollCurrentElementIntoView();this.moveIndicator=new MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator(this.draggable.workspace);this.repositionMoveIndicator();return!0}move(a,b){switch(a){case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:this.totalDelta.y-=this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:this.totalDelta.y+=
|
|
1730
1730
|
this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:this.totalDelta.x-=this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:this.totalDelta.x+=this.stepDistance}var c;(c=this.dragger)==null||c.onDrag(b,this.totalPixelDelta());this.updateTotalDelta();this.scrollCurrentElementIntoView();this.repositionMoveIndicator();return!0}finishMove(a){this.preDragEndCleanup();var b;(b=this.dragger)==null||b.onDragEnd(a,this.totalPixelDelta());
|
|
1731
1731
|
this.postDragEndCleanup();return!0}abortMove(a){this.preDragEndCleanup();var b;(b=this.dragger)==null||b.onDragRevert(a,this.totalPixelDelta());this.postDragEndCleanup();return!0}setMoveDistance(a){this.stepDistance=a}getAllowedShortcuts(){return this.allowedShortcuts}setAllowedShortcuts(a){this.allowedShortcuts=a}repositionMoveIndicator(){finishQueuedRenders$$module$build$src$core$render_management().then(()=>{var a,b=(a=this.draggable)==null?void 0:a.getBoundingRectangle();this.draggable&&"getBoundingRectangleWithoutChildren"in
|
|
1732
1732
|
this.draggable&&(b=this.positionForBlockMoveIndicator(this.draggable));if(b){var c,d;(d=this.moveIndicator)==null||d.moveTo(((c=this.draggable)==null?0:c.workspace.RTL)?b.left:b.right,b.top)}})}positionForBlockMoveIndicator(a){for(var b=a.workspace.getNavigator(),c=a,d;d=b.getInNode(c);)c=d;b=b.getSourceBlockFromNode(c);c=a.getBoundingRectangleWithoutChildren().getOrigin().y;for(var e;((e=b)==null?void 0:e.getBoundingRectangleWithoutChildren().getOrigin().y)!==c;){let h,k;b=(k=(h=b)==null?void 0:
|
|
@@ -1737,9 +1737,9 @@ module$build$src$core$keyboard_nav$keyboard_mover.KeyboardMover=KeyboardMover$$m
|
|
|
1737
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&&
|
|
1738
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"},
|
|
1739
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;
|
|
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
|
|
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=
|
|
1742
|
-
this.hasCss=
|
|
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 q=a.css;q===void 0&&(q=!0);var r="https://static.blockly.com/media/";a.media&&(r=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=r;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=q;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||
|
|
1743
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=
|
|
1744
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=
|
|
1745
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={};
|
|
@@ -1850,9 +1850,9 @@ module$build$src$core$rendered_connection.RenderedConnection=RenderedConnection$
|
|
|
1850
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=
|
|
1851
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():
|
|
1852
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.");
|
|
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?
|
|
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;return this}getAriaLabelText(){return this.ariaLabelProvider?typeof this.ariaLabelProvider==="string"?replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaLabelProvider):this.ariaLabelProvider(this):null}initModel(){for(let a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?
|
|
1854
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
|
|
1855
|
+
d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}getLabel(a=Verbosity$$module$build$src$core$utils$aria.STANDARD,b=!0){if(!this.isVisible())return"";var c=computeFieldRowLabel$$module$build$src$core$block_aria_composer(this,!1,a),d;((d=this.connection)==null?void 0:d.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&(d=this.connection.targetBlock())&&!d.isInsertionMarker()&&c.push(getInputLabels$$module$build$src$core$block_aria_composer(d,a,b).join(", "));return c.join(", ")}getIndex(){var a=
|
|
1856
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={};
|
|
1857
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={};
|
|
1858
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=
|
|
@@ -1932,39 +1932,42 @@ module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src
|
|
|
1932
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
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
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={}));
|
|
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()
|
|
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)
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
this.
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
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.WORKSPACE_MARGIN=this.BLOCK_CONNECTION_OFFSET=10;this.workspace=a.workspace}isMovable(){var a;return this.block.isOwnMovable()&&
|
|
1936
|
+
!this.block.isDeadOrDying()&&!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);if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){var c=b.workspace,
|
|
1937
|
+
d=this.WORKSPACE_MARGIN;a=this.WORKSPACE_MARGIN;var e=Math.max($.config$$module$build$src$core$config.connectingSnapRadius,$.config$$module$build$src$core$config.snapRadius)+2,f=c.getTopBlocks(!0).filter(p=>p.id!==b.id).map(p=>{p=p.getBoundingRectangle();return new Rect$$module$build$src$core$utils$rect(p.top-e,p.bottom+e,p.left-e,p.right+e)}),g,h=(g=c.getToolbox())==null?void 0:g.getWidth();g=c.getParentSvg().clientWidth-(h!=null?h:0);c.getParentSvg();({width:h}=b.getHeightWidth());var k=function(p){for(let q of f)if(p.intersects(q))return q;
|
|
1938
|
+
return null},l=a;c=c.getRenderer().getConstants().MIN_BLOCK_HEIGHT;var m=b.getBoundingRectangle();b.moveBy(l-m.left,d-m.top,["cleanup"]);m=b.getBoundingRectangle();for(var n=k(m);n!=null;)l=n.left+n.getWidth()+80,n=n.top+n.getHeight()+c,l+h<=g||(d=n,l=a),b.moveBy(l-m.left,d-m.top,["cleanup"]),m=b.getBoundingRectangle(),n=k(m)}}getTargetBlock(){if(this.block.isShadow()){var a=this.block.getParent();if(a)return a}else if(this.block.isInFlyout&&this.block.workspace.targetWorkspace&&(a=this.block.getRootBlock(),
|
|
1939
|
+
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,this.connectionCandidate.neighbour,
|
|
1940
|
+
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&&
|
|
1941
|
+
e[c].getSourceBlock().id===b[c].getSourceBlock().id).length>1}startDrag(a){this.updateMoveMode(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);
|
|
1942
|
+
startTextWidthCache$$module$build$src$core$utils$dom();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?
|
|
1943
|
+
new Coordinate$$module$build$src$core$utils$coordinate(a.x,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;
|
|
1944
|
+
(c=this.workspace.getLayerManager())==null||c.moveToDragLayer(this.block);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;
|
|
1945
|
+
!a.canConnect(e,d,!0,Infinity)||((f=d.targetBlock())==null?0:f.isInsertionMarker())||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
|
|
1946
|
+
PointerEvent?a.ctrlKey||a.metaKey:a instanceof KeyboardEvent?!(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;
|
|
1947
|
+
else{let e;if((e=this.block.previousConnection)==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
1948
|
!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.
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
var
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1949
|
+
this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}drag(a,b){this.updateMoveMode(b);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,this.startLoc));if(this.connectionCandidate){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){let {local:c,
|
|
1950
|
+
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,b))}}else if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED&&(this.allConnectionPairs.length||
|
|
1951
|
+
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;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;
|
|
1952
|
+
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 n;(n=this.connectionPreviewer)==null||n.previewConnection(g,h)}return h}if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){m=c==null?void 0:c.neighbour.getSourceBlock();let n;k=(n=m==null?void 0:m.getRootBlock())!=null?n:m;k===
|
|
1953
|
+
a&&(k=m);m=this.getDirectionToNewLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,b));k=(l=k)==null?void 0:l.getBoundingRectangle();if(!k)return;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-this.BLOCK_CONNECTION_OFFSET*2-a.getHeightWidth().height);break;default:l=new Coordinate$$module$build$src$core$utils$coordinate(k.getOrigin().x,
|
|
1954
|
+
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:b.previousConnection)}currCandidateIsBetter(a,b,c){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED)return!1;
|
|
1955
|
+
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===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED?this.findTraversalCandidate(a):
|
|
1956
|
+
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:$.config$$module$build$src$core$config.snapRadius}getLocalConnections(a){var b=
|
|
1957
|
+
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();this.fireDragEndEvent();this.fireMoveEvent();
|
|
1958
|
+
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,BUBBLE$$module$build$src$core$layers,
|
|
1959
|
+
!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);this.block.snapToGrid();var b;
|
|
1960
|
+
(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)==null||a.hidePreview();
|
|
1961
|
+
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
1962
|
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
1963
|
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
1964
|
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)
|
|
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:
|
|
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),
|
|
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;
|
|
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}
|
|
1965
|
+
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){let h=this.getAllConnections(f);
|
|
1966
|
+
for(let k of h)if(a.workspace.connectionChecker.canConnect(g,k,!0,Infinity))return!1}}return!0}pairToCandidate(a){return Object.assign({},a,{distance:0})}getDirectionToNewLocation(a){var b=this.block.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,b);var {x:c,y:d}=a;return c<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:c>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:d<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:
|
|
1967
|
+
d>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE}getAllConnections(a){if(a.isShadow())return[];var b=[];a.outputConnection&&b.push(a.outputConnection);a.previousConnection&&b.push(a.previousConnection);if(!a.isCollapsed())for(let c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);let d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&(b.push(a.nextConnection),
|
|
1968
|
+
(a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));return b}getInitialCandidate(){var a=this.workspace.getSvgGroup().querySelector(`.${FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME}`);if(!a||!a.id||a===this.block.getFocusableElement())return null;a=this.workspace.lookUpFocusableNode(a.id);if(!a)return null;var b=this.workspace.getNavigator().getSourceBlockFromNode(a);if(!b)return null;var c=null;if(b.getConnections_(!1).includes(a)){c=a;
|
|
1969
|
+
let f=this.block.workspace.connectionChecker;if(a=this.block.getConnections_(!1).find(g=>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}updateMoveMode(a){this.moveMode=a instanceof KeyboardEvent&&!a.ctrlKey&&!a.metaKey?MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED:
|
|
1970
|
+
MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED}},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);
|
|
1968
1971
|
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?
|
|
1969
1972
|
"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=
|
|
1970
1973
|
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"},
|
|
@@ -2189,11 +2192,12 @@ a));return{width:a,height:a,pathTop:b,pathBottom:c}}makeOutsideCorners(){var a=t
|
|
|
2189
2192
|
{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},a);this.embossFilterId=a.id;this.embossFilter=a;a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:10,height:10,fill:"#aaa"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,
|
|
2190
2193
|
{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},a);this.disabledPatternId=a.id;this.disabledPattern=a;this.createDebugFilter();c&&(c.style.setProperty("--blocklyEmbossFilter",`url(#${this.embossFilterId})`),c.style.setProperty("--blocklyDisabledPattern",`url(#${this.disabledPatternId})`),c.style.setProperty("--blocklyDebugFilter",`url(#${this.debugFilterId})`))}createDebugFilter(){if(!this.debugFilter){let a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,
|
|
2191
2194
|
{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs),b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER,{result:"outBlur"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFLOOD,{"flood-color":"#ff0000",
|
|
2192
|
-
"flood-opacity":.5,result:"outColor"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);this.debugFilterId=a.id;this.debugFilter=a}}injectCSS_(a,b){
|
|
2193
|
-
var d;c=(d=injectionSites$$module$build$src$core$renderers$common$constants.get(b))!=null?d:new WeakSet;c.add(a);injectionSites$$module$build$src$core$renderers$common$constants.set(b,c)}}getCSS_(a){return[`${a}.injectionDiv {`,"--blockly-active-node-color: #fc3;","}",`${a} .blocklyText, `,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyText {`,
|
|
2194
|
-
|
|
2195
|
-
"}",`${a} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${a} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${a} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${a} .blocklyReplaceable .blocklyPathLight,`,`${a} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,
|
|
2196
|
-
module$build$src$core$renderers$common$constants
|
|
2195
|
+
"flood-opacity":.5,result:"outColor"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);this.debugFilterId=a.id;this.debugFilter=a}}injectCSS_(a,b){if(typeof window!=="undefined"){var c;if((c=injectionSites$$module$build$src$core$renderers$common$constants.get(b))==null||!c.has(a)){c=document.createElement("style");c.className="blockly-renderer-style";c.textContent=this.getCSS_(b).join("\n");
|
|
2196
|
+
(a instanceof ShadowRoot?a:document.head).prepend(c);var d;c=(d=injectionSites$$module$build$src$core$renderers$common$constants.get(b))!=null?d:new WeakSet;c.add(a);injectionSites$$module$build$src$core$renderers$common$constants.set(b,c)}}}getCSS_(a){return[`${a}.injectionDiv {`,"--blockly-active-node-color: #fc3;","}",`${a} .blocklyText, `,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyText {`,
|
|
2197
|
+
"fill: #fff;","}",`${a} .blocklyNonEditableField>rect,`,`${a} .blocklyEditableField>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text {`,"fill: #000;","}",`${a} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${a} .blocklyEditableField:not(.blocklyEditing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,
|
|
2198
|
+
`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${a} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${a} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${a} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${a} .blocklyReplaceable .blocklyPathLight,`,`${a} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,
|
|
2199
|
+
"stroke: none;","}"]}},module$build$src$core$renderers$common$constants={};module$build$src$core$renderers$common$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isDynamicShape=isDynamicShape$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isNotch=isNotch$$module$build$src$core$renderers$common$constants;
|
|
2200
|
+
module$build$src$core$renderers$common$constants.isPuzzleTab=isPuzzleTab$$module$build$src$core$renderers$common$constants;var Drawer$$module$build$src$core$renderers$common$drawer=class{constructor(a,b){this.inlinePath_=this.outlinePath_="";this.block_=a;this.info_=b;this.topLeft_=a.getRelativeToSurfaceXY();this.constants_=b.getRenderer().getConstants()}draw(){this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();this.block_.pathObject.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&this.block_.pathObject.flipRTL();this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=
|
|
2197
2201
|
this.info_.height;this.block_.width=this.info_.widthWithChildren;this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let a=1;a<this.info_.rows.length-1;a++){let b=this.info_.rows[a];b.hasJaggedEdge?this.drawJaggedEdge_(b):b.hasStatement?this.drawStatementInput_(b):b.hasExternalInput?this.drawValueInput_(b):this.drawRightSideRow_(b)}this.drawBottom_();this.drawLeft_()}drawTop_(){var a=this.info_.topRow,b=a.elements;this.positionPreviousConnection_();this.outlinePath_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos,
|
|
2198
2202
|
this.info_.startY);for(let c=0,d;d=b[c];c++)Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topLeft:Types$$module$build$src$core$renderers$measurables$types.isRightRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topRight:Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(d)?this.outlinePath_+=d.shape.pathLeft:Types$$module$build$src$core$renderers$measurables$types.isHat(d)?
|
|
2199
2203
|
this.outlinePath_+=this.constants_.START_HAT.path:Types$$module$build$src$core$renderers$measurables$types.isSpacer(d)&&(this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("h",d.width));this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("v",a.height-a.ascenderHeight)}drawJaggedEdge_(a){this.outlinePath_+=this.constants_.JAGGED_TEETH.path+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a.height-this.constants_.JAGGED_TEETH.height)}drawValueInput_(a){var b=
|
|
@@ -2331,14 +2335,15 @@ null||a.preventDefault(),a==null||a.stopPropagation(),null;var b=(a==null?void 0
|
|
|
2331
2335
|
!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
2336
|
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=
|
|
2333
2337
|
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=
|
|
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()
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
a)return b
|
|
2338
|
-
a
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2338
|
+
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();WorkspaceSvg$$module$build$src$core$workspace_svg.everFocused||this.options.parentWorkspace||(announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.SCREENREADER_HINT.replace("%1",getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting(names$$module$build$src$core$shortcut_items.TOGGLE_SCREENREADER))),
|
|
2339
|
+
WorkspaceSvg$$module$build$src$core$workspace_svg.everFocused=!0)}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=>{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])!=
|
|
2340
|
+
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());return a}searchForWorkspaceComment(a){for(let b of this.getTopComments())if(b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment&&b.canBeFocused()&&
|
|
2341
|
+
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===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===
|
|
2342
|
+
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),a.indexOf(COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button));if(f!==-1&&(f=a.substring(0,
|
|
2343
|
+
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;g=this.getAllBlocks().map(k=>k.getIcons()).flat();for(let k of g){if(k.canBeFocused()&&k.getFocusableElement().id===
|
|
2344
|
+
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:(h=(e=this.zoomControls_)==null?void 0:e.getControlWithId(a))?h:null}onTreeFocus(a,b){}onTreeBlur(a){if(this.isFlyout&&
|
|
2345
|
+
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=a}};WorkspaceSvg$$module$build$src$core$workspace_svg.everFocused=!1;var module$build$src$core$workspace_svg={};
|
|
2346
|
+
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,
|
|
2342
2347
|
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())||
|
|
2343
2348
|
$.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)||
|
|
2344
2349
|
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||
|
|
@@ -2601,8 +2606,8 @@ State$$module$build$src$core$utils$aria.SELECTED,!1);setState$$module$build$src$
|
|
|
2601
2606
|
Role$$module$build$src$core$utils$aria.PRESENTATION);this.rowContents_.appendChild(this.iconDom_);this.labelDom_=this.createLabelDom_(this.name_);this.rowContents_.appendChild(this.labelDom_);var a=this.labelDom_.getAttribute("id");a&&setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.LABELLEDBY,a);this.addColourBorder_(this.colour_);return this.htmlDiv_}createContainer_(){var a=document.createElement("div");a.tabIndex=-1;a.id=this.getId();var b=this.cssConfig_.container;
|
|
2602
2607
|
b&&addClass$$module$build$src$core$utils$dom(a,b);return a}createRowContainer_(){var a=document.createElement("div"),b=this.cssConfig_.row;b&&addClass$$module$build$src$core$utils$dom(a,b);b=`${ToolboxCategory$$module$build$src$core$toolbox$category.nestedPadding*this.getLevel()}px`;this.workspace_.RTL?a.style.paddingRight=b:a.style.paddingLeft=b;return a}createRowContentsContainer_(){var a=document.createElement("div"),b=this.cssConfig_.rowcontentcontainer;b&&addClass$$module$build$src$core$utils$dom(a,
|
|
2603
2608
|
b);return a}createIconDom_(){var a=document.createElement("span");if(!this.parentToolbox_.isHorizontal()){let b=this.cssConfig_.icon;b&&addClass$$module$build$src$core$utils$dom(a,b)}a.style.display="inline-block";return a}createLabelDom_(a){var b=document.createElement("span");b.setAttribute("id",this.getId()+".label");b.textContent=a;(a=this.cssConfig_.label)&&addClass$$module$build$src$core$utils$dom(b,a);return b}refreshTheme(){this.colour_=this.getColour_(this.toolboxItemDef_);this.addColourBorder_(this.colour_)}addColourBorder_(a){a&&
|
|
2604
|
-
(a=ToolboxCategory$$module$build$src$core$toolbox$category.borderWidth+"px solid "+(a||"#ddd"),this.workspace_.RTL?this.rowDiv_.style.borderRight=a:this.rowDiv_.style.borderLeft=a)}getColour_(a){var b=a.categorystyle||a.categoryStyle;if((a=a.colour)&&b)console.warn('Toolbox category "'+this.name_+'" must not have both a style and a colour');else{if(b)return this.getColourfromStyle(b);if(a)return this.parseColour(a)}return""}getColourfromStyle(a){var b=this.workspace_.getTheme();
|
|
2605
|
-
b.colour)return this.parseColour(b.colour);console.warn('Style "'+a+'" must exist and contain a colour value')}return""}getClickTarget(){return this.rowDiv_}parseColour(a){a=replaceMessageReferences$$module$build$src$core$utils$parsing(a);if(a==null||a==="")return"";var b=Number(a);if(isNaN(b)){if(b=parse$$module$build$src$core$utils$colour(a))return b;console.warn('Toolbox category "'+this.name_+'" has unrecognized colour attribute: '+a);return""}return hueToHex$$module$build$src$core$utils$colour(b)}openIcon_(a){if(a){var b=
|
|
2609
|
+
(a=ToolboxCategory$$module$build$src$core$toolbox$category.borderWidth+"px solid "+(a||"#ddd"),this.workspace_.RTL?this.rowDiv_.style.borderRight=a:this.rowDiv_.style.borderLeft=a)}getColour_(a){var b=a.categorystyle||a.categoryStyle;if((a=a.colour)&&b)console.warn('Toolbox category "'+this.name_+'" must not have both a style and a colour');else{if(b)return this.getColourfromStyle(b);if(a)return this.parseColour(a)}return""}getColour(){return this.colour_}getColourfromStyle(a){var b=this.workspace_.getTheme();
|
|
2610
|
+
if(a&&b){if((b=b.categoryStyles[a])&&b.colour)return this.parseColour(b.colour);console.warn('Style "'+a+'" must exist and contain a colour value')}return""}getClickTarget(){return this.rowDiv_}parseColour(a){a=replaceMessageReferences$$module$build$src$core$utils$parsing(a);if(a==null||a==="")return"";var b=Number(a);if(isNaN(b)){if(b=parse$$module$build$src$core$utils$colour(a))return b;console.warn('Toolbox category "'+this.name_+'" has unrecognized colour attribute: '+a);return""}return hueToHex$$module$build$src$core$utils$colour(b)}openIcon_(a){if(a){var b=
|
|
2606
2611
|
this.cssConfig_.closedicon;b&&removeClasses$$module$build$src$core$utils$dom(a,b);(b=this.cssConfig_.openicon)&&addClass$$module$build$src$core$utils$dom(a,b)}}closeIcon_(a){if(a){var b=this.cssConfig_.openicon;b&&removeClasses$$module$build$src$core$utils$dom(a,b);(b=this.cssConfig_.closedicon)&&addClass$$module$build$src$core$utils$dom(a,b)}}setVisible_(a){this.htmlDiv_.style.display=a?"block":"none";this.isHidden_=!a;this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}hide(){this.setVisible_(!1)}show(){this.setVisible_(!0)}isVisible(){return!this.isHidden_&&
|
|
2607
2612
|
this.allAncestorsExpanded_()}allAncestorsExpanded_(){for(var a=this;a.getParent();)if(a=a.getParent(),!a.isExpanded())return!1;return!0}isSelectable(){return this.isVisible()&&!this.isDisabled_}onClick(a){}setSelected(a){if(this.rowDiv_){var b=this.cssConfig_.selected;if(a){let c=this.parseColour(ToolboxCategory$$module$build$src$core$toolbox$category.defaultBackgroundColour);this.rowDiv_.style.backgroundColor=this.colour_||c;b&&addClass$$module$build$src$core$utils$dom(this.rowDiv_,b)}else this.rowDiv_.style.backgroundColor=
|
|
2608
2613
|
"",b&&removeClass$$module$build$src$core$utils$dom(this.rowDiv_,b);setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.SELECTED,a)}}setDisabled(a){this.isDisabled_=a;this.getDiv().setAttribute("disabled",`${a}`);a?this.getDiv().setAttribute("disabled","true"):this.getDiv().removeAttribute("disabled")}getName(){return this.name_}getParent(){return this.parent_}getDiv(){return this.htmlDiv_}onNodeFocus(){this.getParentToolbox().getSelectedItem()!==this&&
|
|
@@ -2640,7 +2645,7 @@ null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEv
|
|
|
2640
2645
|
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));
|
|
2641
2646
|
$.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,
|
|
2642
2647
|
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');
|
|
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.
|
|
2648
|
+
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.6",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,
|
|
2644
2649
|
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=
|
|
2645
2650
|
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,
|
|
2646
2651
|
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,
|