blockly 12.0.0-beta.6 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +20 -19
- package/blockly_compressed.js +14 -14
- package/blockly_compressed.js.map +1 -1
- package/core/dropdowndiv.d.ts +3 -1
- package/core/field_input.d.ts +7 -1
- package/core/widgetdiv.d.ts +6 -1
- package/msg/ab.js +6 -5
- package/msg/ace.js +6 -5
- package/msg/af.js +6 -5
- package/msg/am.js +6 -5
- package/msg/ar.js +9 -8
- package/msg/ast.js +6 -5
- package/msg/az.js +9 -8
- package/msg/ba.js +6 -5
- package/msg/bcc.js +6 -5
- package/msg/be-tarask.js +12 -11
- package/msg/be.js +7 -6
- package/msg/bg.js +9 -8
- package/msg/bn.js +6 -5
- package/msg/br.js +6 -5
- package/msg/bs.js +6 -5
- package/msg/ca.js +6 -5
- package/msg/cdo.js +6 -5
- package/msg/ce.js +28 -27
- package/msg/cs.js +7 -6
- package/msg/da.js +6 -5
- package/msg/de.js +8 -7
- package/msg/diq.js +13 -12
- package/msg/dtp.js +6 -5
- package/msg/dty.js +6 -5
- package/msg/ee.js +6 -5
- package/msg/el.js +6 -5
- package/msg/en-gb.js +6 -5
- package/msg/en.js +6 -5
- package/msg/eo.js +6 -5
- package/msg/es.js +7 -6
- package/msg/et.js +14 -13
- package/msg/eu.js +6 -5
- package/msg/fa.js +6 -5
- package/msg/fi.js +6 -5
- package/msg/fo.js +6 -5
- package/msg/fr.js +8 -7
- package/msg/frr.js +6 -5
- package/msg/gl.js +6 -5
- package/msg/gn.js +6 -5
- package/msg/gor.js +6 -5
- package/msg/ha.js +6 -5
- package/msg/hak.js +6 -5
- package/msg/he.js +8 -7
- package/msg/hi.js +6 -5
- package/msg/hr.js +15 -14
- package/msg/hrx.js +6 -5
- package/msg/hsb.js +6 -5
- package/msg/hu.js +6 -5
- package/msg/hy.js +6 -5
- package/msg/ia.js +8 -7
- package/msg/id.js +9 -8
- package/msg/ig.js +6 -5
- package/msg/inh.js +6 -5
- package/msg/is.js +6 -5
- package/msg/it.js +6 -5
- package/msg/ja.js +7 -6
- package/msg/ka.js +6 -5
- package/msg/kab.js +6 -5
- package/msg/kbd-cyrl.js +6 -5
- package/msg/km.js +6 -5
- package/msg/kn.js +6 -5
- package/msg/ko.js +21 -20
- package/msg/ksh.js +6 -5
- package/msg/ku-latn.js +6 -5
- package/msg/ky.js +6 -5
- package/msg/la.js +6 -5
- package/msg/lb.js +7 -6
- package/msg/lki.js +6 -5
- package/msg/lo.js +6 -5
- package/msg/lrc.js +6 -5
- package/msg/lt.js +6 -5
- package/msg/lv.js +6 -5
- package/msg/mg.js +6 -5
- package/msg/mk.js +6 -5
- package/msg/ml.js +6 -5
- package/msg/mnw.js +6 -5
- package/msg/ms.js +6 -5
- package/msg/my.js +6 -5
- package/msg/mzn.js +6 -5
- package/msg/nb.js +7 -6
- package/msg/ne.js +6 -5
- package/msg/nl.js +8 -7
- package/msg/oc.js +6 -5
- package/msg/olo.js +6 -5
- package/msg/pa.js +16 -15
- package/msg/pl.js +7 -6
- package/msg/pms.js +7 -6
- package/msg/ps.js +6 -5
- package/msg/pt-br.js +8 -7
- package/msg/pt.js +7 -6
- package/msg/ro.js +6 -5
- package/msg/ru.js +6 -5
- package/msg/sc.js +6 -5
- package/msg/sco.js +6 -5
- package/msg/sd.js +7 -6
- package/msg/shn.js +6 -5
- package/msg/si.js +6 -5
- package/msg/sk.js +12 -11
- package/msg/skr-arab.js +6 -5
- package/msg/sl.js +6 -5
- package/msg/smn.js +6 -5
- package/msg/sq.js +6 -5
- package/msg/sr-latn.js +6 -5
- package/msg/sr.js +6 -5
- package/msg/sv.js +10 -9
- package/msg/sw.js +6 -5
- package/msg/ta.js +6 -5
- package/msg/tcy.js +8 -7
- package/msg/tdd.js +6 -5
- package/msg/te.js +6 -5
- package/msg/th.js +6 -5
- package/msg/ti.js +6 -5
- package/msg/tl.js +38 -37
- package/msg/tlh.js +6 -5
- package/msg/tr.js +7 -6
- package/msg/ug-arab.js +53 -52
- package/msg/uk.js +6 -5
- package/msg/ur.js +6 -5
- package/msg/uz.js +6 -5
- package/msg/vi.js +6 -5
- package/msg/xmf.js +9 -8
- package/msg/yo.js +6 -5
- package/msg/zgh.js +9 -8
- package/msg/zh-hans.js +9 -8
- package/msg/zh-hant.js +6 -5
- package/package.json +1 -1
package/blockly.min.js
CHANGED
|
@@ -89,8 +89,8 @@ insertAfter$$module$build$src$core$utils$dom=function(a,b){const c=b.nextSibling
|
|
|
89
89
|
startTextWidthCache$$module$build$src$core$utils$dom=function(){cacheReference$$module$build$src$core$utils$dom++;cacheWidths$$module$build$src$core$utils$dom||(cacheWidths$$module$build$src$core$utils$dom=Object.create(null))};stopTextWidthCache$$module$build$src$core$utils$dom=function(){cacheReference$$module$build$src$core$utils$dom--;cacheReference$$module$build$src$core$utils$dom||(cacheWidths$$module$build$src$core$utils$dom=null)};
|
|
90
90
|
getTextWidth$$module$build$src$core$utils$dom=function(a){const b=a.textContent+"\n"+a.className.baseVal;var c;if(cacheWidths$$module$build$src$core$utils$dom&&(c=cacheWidths$$module$build$src$core$utils$dom[b]))return c;c=window.getComputedStyle(a);c=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(a,c.fontSize,c.fontWeight,c.fontFamily);cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[b]=c);return c};
|
|
91
91
|
getFastTextWidth$$module$build$src$core$utils$dom=function(a,b,c,d){return getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(a,b+"pt",c,d)};
|
|
92
|
-
getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d){const e=a.textContent;a=e+"\n"+a.className.baseVal;var f;if(cacheWidths$$module$build$src$core$utils$dom&&(f=cacheWidths$$module$build$src$core$utils$dom[a]))return f;canvasContext$$module$build$src$core$utils$dom||(f=document.createElement("canvas"),f.className="blocklyComputeCanvas",document.body.appendChild(f),canvasContext$$module$build$src$core$utils$dom=f.getContext("2d"));canvasContext$$module$build$src$core$utils$dom
|
|
93
|
-
c+" "+b+" "+d
|
|
92
|
+
getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d){const e=a.textContent;a=e+"\n"+a.className.baseVal;var f;if(cacheWidths$$module$build$src$core$utils$dom&&(f=cacheWidths$$module$build$src$core$utils$dom[a]))return f;canvasContext$$module$build$src$core$utils$dom||(f=document.createElement("canvas"),f.className="blocklyComputeCanvas",document.body.appendChild(f),canvasContext$$module$build$src$core$utils$dom=f.getContext("2d"));e&&canvasContext$$module$build$src$core$utils$dom?
|
|
93
|
+
(canvasContext$$module$build$src$core$utils$dom.font=c+" "+b+" "+d,f=canvasContext$$module$build$src$core$utils$dom.measureText(e).width):f=0;cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[a]=f);return f};
|
|
94
94
|
measureFontMetrics$$module$build$src$core$utils$dom=function(a,b,c,d){const e=document.createElement("span");e.style.font=c+" "+b+" "+d;e.textContent=a;a=document.createElement("div");a.style.width="1px";a.style.height="0";b=document.createElement("div");b.style.display="flex";b.style.position="fixed";b.style.top="0";b.style.left="0";b.appendChild(e);b.appendChild(a);document.body.appendChild(b);c={height:0,baseline:0};try{b.style.alignItems="baseline",c.baseline=a.offsetTop-e.offsetTop,b.style.alignItems=
|
|
95
95
|
"flex-end",c.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(b)}return c};$.getFocusManager$$module$build$src$core$focus_manager=function(){return FocusManager$$module$build$src$core$focus_manager.getFocusManager()};isFocusableNode$$module$build$src$core$interfaces$i_focusable_node=function(a){return a&&"getFocusableElement"in a&&"getFocusableTree"in a&&"onNodeFocus"in a&&"onNodeBlur"in a&&"canBeFocused"in a};
|
|
96
96
|
isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return"string"===typeof a.id&&void 0!==a.workspace&&void 0!==a.select&&void 0!==a.unselect&&isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};
|
|
@@ -220,9 +220,9 @@ div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$cor
|
|
|
220
220
|
clearContent$$module$build$src$core$dropdowndiv=function(){div$$module$build$src$core$dropdowndiv.remove();createDom$$module$build$src$core$dropdowndiv()};setColour$$module$build$src$core$dropdowndiv=function(a,b){div$$module$build$src$core$dropdowndiv.style.backgroundColor=a;div$$module$build$src$core$dropdowndiv.style.borderColor=b};
|
|
221
221
|
showPositionedByBlock$$module$build$src$core$dropdowndiv=function(a,b,c,d){return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfBlock$$module$build$src$core$dropdowndiv(b),a,c,d)};showPositionedByField$$module$build$src$core$dropdowndiv=function(a,b,c){positionToField$$module$build$src$core$dropdowndiv=!0;return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfField$$module$build$src$core$dropdowndiv(a),a,b,c)};
|
|
222
222
|
getScaledBboxOfBlock$$module$build$src$core$dropdowndiv=function(a){var b=a.getSvgRoot();const c=a.workspace.scale,d=a.height*c;a=a.width*c;b=getPageOffset$$module$build$src$core$utils$style(b);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)};getScaledBboxOfField$$module$build$src$core$dropdowndiv=function(a){a=a.getScaledBBox();return new Rect$$module$build$src$core$utils$rect(a.top,a.bottom,a.left,a.right)};
|
|
223
|
-
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d){const
|
|
224
|
-
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=
|
|
225
|
-
renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv);return positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f)};
|
|
223
|
+
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e=!0){const f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();let h=d.workspace;for(;h.options.parentWorkspace;)h=h.options.parentWorkspace;setBoundsElement$$module$build$src$core$dropdowndiv(h.getParentSvg().parentNode);return show$$module$build$src$core$dropdowndiv(b,d.RTL,f,g,f,a,e,c)};
|
|
224
|
+
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=h||null;div$$module$build$src$core$dropdowndiv.style.direction=b?"rtl":"ltr";a=getMainWorkspace$$module$build$src$core$common();renderedClassName$$module$build$src$core$dropdowndiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$dropdowndiv=a.getTheme().getClassName();addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,
|
|
225
|
+
renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));return positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f)};
|
|
226
226
|
getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
|
|
227
227
|
getPositionAboveMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:d.height-2*BORDER_SIZE$$module$build$src$core$dropdowndiv-ARROW_SIZE$$module$build$src$core$dropdowndiv/2,arrowAtTop:!1,arrowVisible:!0}};
|
|
228
228
|
getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv=function(a,b,c){a=getPositionX$$module$build$src$core$dropdowndiv(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};
|
|
@@ -273,9 +273,9 @@ parseBlockColour$$module$build$src$core$utils$parsing=function(a){const b="strin
|
|
|
273
273
|
a+'")');throw Error(c);};getDiv$$module$build$src$core$widgetdiv=function(){return containerDiv$$module$build$src$core$widgetdiv};testOnly_setDiv$$module$build$src$core$widgetdiv=function(a){containerDiv$$module$build$src$core$widgetdiv=a;if(null===a){let b;null==(b=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv))||b.remove()}};
|
|
274
274
|
createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body;document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv)?containerDiv$$module$build$src$core$widgetdiv=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv):(containerDiv$$module$build$src$core$widgetdiv=document.createElement("div"),containerDiv$$module$build$src$core$widgetdiv.className=containerClassName$$module$build$src$core$widgetdiv);
|
|
275
275
|
a.appendChild(containerDiv$$module$build$src$core$widgetdiv)};
|
|
276
|
-
show$$module$build$src$core$widgetdiv=function(a,b,c,d){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let
|
|
277
|
-
rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
278
|
-
$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c)}};
|
|
276
|
+
show$$module$build$src$core$widgetdiv=function(a,b,c,d,e=!0){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let h;d=null==(h=a.getSourceBlock())?void 0:h.workspace}var f;ownerWorkspace$$module$build$src$core$widgetdiv=null!=(f=d)?f:null;var g;a=null!=(g=d)?g:getMainWorkspace$$module$build$src$core$common();
|
|
277
|
+
rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);e&&(returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
278
|
+
$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c))}};
|
|
279
279
|
hide$$module$build$src$core$widgetdiv=function(){if(isVisible$$module$build$src$core$widgetdiv()){owner$$module$build$src$core$widgetdiv=null;var a=containerDiv$$module$build$src$core$widgetdiv;a&&(a.style.display="none",a.style.left="",a.style.top="",dispose$$module$build$src$core$widgetdiv&&(dispose$$module$build$src$core$widgetdiv(),dispose$$module$build$src$core$widgetdiv=null),a.textContent="",rendererClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,
|
|
280
280
|
rendererClassName$$module$build$src$core$widgetdiv),rendererClassName$$module$build$src$core$widgetdiv=""),themeClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,themeClassName$$module$build$src$core$widgetdiv),themeClassName$$module$build$src$core$widgetdiv=""),getMainWorkspace$$module$build$src$core$common().markFocused(),returnEphemeralFocus$$module$build$src$core$widgetdiv&&(returnEphemeralFocus$$module$build$src$core$widgetdiv(),returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
281
281
|
null))}};isVisible$$module$build$src$core$widgetdiv=function(){return!!owner$$module$build$src$core$widgetdiv};hideIfOwner$$module$build$src$core$widgetdiv=function(a){owner$$module$build$src$core$widgetdiv===a&&hide$$module$build$src$core$widgetdiv()};hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv=function(a){let b=null===ownerWorkspace$$module$build$src$core$widgetdiv,c=a;for(;!b&&c;){if(c===a){b=!0;break}c=a.options.parentWorkspace}b&&hide$$module$build$src$core$widgetdiv()};
|
|
@@ -814,7 +814,7 @@ typeof HTMLElement&&a instanceof HTMLElement){let b,c;return null!=(c=null!=(b=a
|
|
|
814
814
|
return new this(a.options,void 0,a)}trimOptions(a){let b=!1;const c=a.map(g=>{if(g===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)return g;const [h,k]=g;if("string"===typeof h)return[replaceMessageReferences$$module$build$src$core$utils$parsing(h),k];b=!0;return[isImageProperties$$module$build$src$core$field_dropdown(h)?Object.assign({},h,{alt:replaceMessageReferences$$module$build$src$core$utils$parsing(h.alt)}):Object.assign({},h),k]});if(b||2>a.length)return{options:c};var d=c.map(([g])=>
|
|
815
815
|
g),e=shortestStringLength$$module$build$src$core$utils$string(d);a=commonWordPrefix$$module$build$src$core$utils$string(d,e);const f=commonWordSuffix$$module$build$src$core$utils$string(d,e);if(!a&&!f||e<=a+f)return{options:c};e=a?d[0].substring(0,a-1):void 0;d=f?d[0].substr(1-f):void 0;return{options:this.applyTrim(c,a,f),prefix:e,suffix:d}}applyTrim(a,b,c){return a.map(([d,e])=>[d.substring(b,d.length-c),e])}validateOptions(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");
|
|
816
816
|
if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");let b=!1;for(let c=0;c<a.length;c++){const d=a[c];Array.isArray(d)||d===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR?"string"!==typeof d[1]?(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option id must be a string.
|
|
817
|
-
Found ${d[1]} in: ${d}`)):!d[0]||"string"===typeof d[0]||isImageProperties$$module$build$src$core$field_dropdown(d[0])||d[0]instanceof HTMLElement||(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
817
|
+
Found ${d[1]} in: ${d}`)):!d[0]||"string"===typeof d[0]||isImageProperties$$module$build$src$core$field_dropdown(d[0])||"undefined"!==typeof HTMLElement&&d[0]instanceof HTMLElement||(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
818
818
|
label, image description, or HTML element. Found ${d[0]} in: ${d}`)):(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must be an array or
|
|
819
819
|
the string literal 'separator'. Found: ${d}`))}if(b)throw TypeError("Found invalid FieldDropdown options.");}};FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR="separator";FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR="\u25be";FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET=5;FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING=2*FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET;
|
|
820
820
|
register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;var Theme$$module$build$src$core$theme=class{constructor(a,b,c,d){this.name=a;this.startHats=!1;this.blockStyles=b||Object.create(null);this.categoryStyles=c||Object.create(null);this.componentStyles=d||Object.create(null);this.fontStyle=Object.create(null);register$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(a,b){this.blockStyles[a]=b}setCategoryStyle(a,b){this.categoryStyles[a]=b}getComponentStyle(a){a=
|
|
@@ -1052,7 +1052,7 @@ void 0:null==(d=c.getParentInput())?void 0:d.connection)?e:a}getNextSibling(a){i
|
|
|
1052
1052
|
a?d:(a=b.workspace.getTopBlocks(!0),b=a.indexOf(b.getRootBlock())+1,b>=a.length&&(b=0),b=a[b],null!=(c=this.getParentConnection(b))?c:b)):a.getSourceBlock()}getPreviousSibling(a){if(a.getParentInput()){var b=a.getParentInput(),c=null==b?void 0:b.getSourceBlock();if(!c||!b)return null;for(a=c.inputList.indexOf(b);0<=a;a--){var d=c.inputList[a];if(d.connection&&d!==b)return d.connection;d=d.fieldRow;if(d.length)return d[d.length-1]}}else{if(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||
|
|
1053
1053
|
a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return d=a.targetConnection&&!a.targetConnection.getParentInput()?a.targetConnection:null,c=a.getSourceBlock(),d||this.getParentConnection(c.getRootBlock())!==a?d:(a=c.workspace.getTopBlocks(!0),c=a.indexOf(c.getRootBlock())-1,0>c&&(c=a.length-1),c=a[c],null!=(b=c.lastConnectionInStack(!1))?b:c);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)return a.getSourceBlock()}return null}getParentConnection(a){let b;
|
|
1054
1054
|
return!a.outputConnection||(null==(b=a.previousConnection)?0:b.isConnected())?a.previousConnection:a.outputConnection}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$connection_navigation_policy={};module$build$src$core$keyboard_nav$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){var b=a.getParentInput();const c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;d<c.inputList.length;d++){b=c.inputList[d];const e=b.fieldRow;if(a<e.length)return e[a];a=0;let f;if(null==(f=b.connection)?0:f.targetBlock())return b.connection.targetBlock()}return null}getPreviousSibling(a){const b=
|
|
1055
|
-
a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let f;if((null==(f=e.connection)?0:f.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}return null}isNavigable(a){let b;return a.canBeFocused()&&a.isClickable()
|
|
1055
|
+
a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let f;if((null==(f=e.connection)?0:f.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}return null}isNavigable(a){let b;return a.canBeFocused()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?0:b.isSimpleReporter())&&a.isFullBlockField())&&
|
|
1056
1056
|
a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
|
|
1057
1057
|
module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>
|
|
1058
1058
|
b.isApplicable(a))}getFirstChild(a){let b;const c=null==(b=this.get(a))?void 0:b.getFirstChild(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getNextSibling(c)}getParent(a){let b;const c=null==(b=this.get(a))?void 0:b.getParent(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getParent(c)}getNextSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getNextSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?
|
|
@@ -1430,9 +1430,9 @@ Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setVa
|
|
|
1430
1430
|
this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;let b;return this.fullBlockClickTarget_=!(null==(b=this.getConstants())||!b.FULL_BLOCK_FIELDS)&&a.isSimpleReporter()}doValueInvalid_(a,b=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,a=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&b&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,
|
|
1431
1431
|
"field",this.name||null,a,this.value_)))}doValueUpdate_(a){this.isTextValid_=this.isDirty_=!0;this.value_=a}applyColour(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",a.getColourTertiary())):(this.borderRect_.style.display="none",a.pathObject.svgPath.setAttribute("fill",
|
|
1432
1432
|
this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let a;if(null==(a=this.getConstants())?0:a.FULL_BLOCK_FIELDS)this.render_(),this.isDirty_=!1;return super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){super.render_();if(this.isBeingEdited_){var a=this.htmlInput_;this.isTextValid_?(removeClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,
|
|
1433
|
-
"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0))}a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&a.applyColour()}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b=!1){this.workspace_=this.sourceBlock_.workspace;!b&&this.workspace_.options.modalInputs&&
|
|
1434
|
-
(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor():this.showInlineEditor(b)}showPromptEditor(){prompt$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{null!==a&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a){const
|
|
1435
|
-
show$$module$build$src$core$widgetdiv(this,
|
|
1433
|
+
"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0))}a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&a.applyColour()}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b=!1,c=!0){this.workspace_=this.sourceBlock_.workspace;!b&&this.workspace_.options.modalInputs&&
|
|
1434
|
+
(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor():this.showInlineEditor(b,c)}showPromptEditor(){prompt$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{null!==a&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a,b){const c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;
|
|
1435
|
+
show$$module$build$src$core$widgetdiv(this,c.RTL,this.widgetDispose_.bind(this),this.workspace_,b);this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;this.valueWhenEditorWasOpened_=this.value_;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;$.setGroup$$module$build$src$core$events$utils(!0);const b=getDiv$$module$build$src$core$widgetdiv();var c=this.getClickTarget_();
|
|
1436
1436
|
if(!c)throw Error("A click target has not been set.");addClass$$module$build$src$core$utils$dom(c,"blocklyEditing");c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.spellcheck_);const d=this.workspace_.getAbsoluteScale();var e=this.getConstants().FIELD_TEXT_FONTSIZE*d+"pt";b.style.fontSize=e;c.style.fontSize=e;e=FieldInput$$module$build$src$core$field_input.BORDERRADIUS*d+"px";this.isFullBlockField()&&(e=this.getScaledBBox(),e=(e.bottom-e.top)/2+"px",
|
|
1437
1437
|
a=a.getParent()?a.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),c.style.border=1*d+"px solid "+a,b.style.borderRadius=e,b.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(b.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*d+"px"));c.style.borderRadius=e;b.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.setAttribute("data-untyped-default-value",String(this.value_));this.resizeEditor_();this.bindInputEvents_(c);
|
|
1438
1438
|
return c}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&null!==this.valueWhenEditorWasOpened_&&this.valueWhenEditorWasOpened_!==this.value_&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),
|
|
@@ -1720,7 +1720,7 @@ d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}selectParent()
|
|
|
1720
1720
|
a.toggleExpanded();return!0}selectNext(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)+1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[++b];if(c&&c.isSelectable())return this.setSelectedItem(c),!0}return!1}selectPrevious(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)-1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[--b];if(c&&c.isSelectable())return this.setSelectedItem(c),
|
|
1721
1721
|
!0}return!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");this.flyout.dispose();this.contents.forEach(a=>a.dispose());for(let a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");
|
|
1722
1722
|
return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return null!=(b=this.getToolboxItems().find(c=>c.isSelectable()))?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
|
|
1723
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.0.0
|
|
1723
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.0.0",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
|
|
1724
1724
|
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=
|
|
1725
1725
|
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,
|
|
1726
1726
|
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,
|
|
@@ -2215,6 +2215,7 @@ Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
|
|
2215
2215
|
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
2216
2216
|
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
|
2217
2217
|
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
2218
|
+
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
|
2218
2219
|
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
2219
2220
|
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
2220
2221
|
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
|
@@ -2227,15 +2228,15 @@ Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_
|
|
|
2227
2228
|
Blockly.Msg["TEXT_APPEND_VARIABLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
2228
2229
|
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
2229
2230
|
|
|
2230
|
-
Blockly.Msg["
|
|
2231
|
+
Blockly.Msg["MATH_HUE"] = "230";
|
|
2232
|
+
Blockly.Msg["LOOPS_HUE"] = "120";
|
|
2231
2233
|
Blockly.Msg["LISTS_HUE"] = "260";
|
|
2232
2234
|
Blockly.Msg["LOGIC_HUE"] = "210";
|
|
2233
|
-
Blockly.Msg["
|
|
2234
|
-
Blockly.Msg["MATH_HUE"] = "230";
|
|
2235
|
-
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
|
2235
|
+
Blockly.Msg["VARIABLES_HUE"] = "330";
|
|
2236
2236
|
Blockly.Msg["TEXTS_HUE"] = "160";
|
|
2237
|
+
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
|
2238
|
+
Blockly.Msg["COLOUR_HUE"] = "20";
|
|
2237
2239
|
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
|
2238
|
-
Blockly.Msg["VARIABLES_HUE"] = "330";
|
|
2239
2240
|
return Blockly.Msg;
|
|
2240
2241
|
}));
|
|
2241
2242
|
|
package/blockly_compressed.js
CHANGED
|
@@ -89,8 +89,8 @@ insertAfter$$module$build$src$core$utils$dom=function(a,b){const c=b.nextSibling
|
|
|
89
89
|
startTextWidthCache$$module$build$src$core$utils$dom=function(){cacheReference$$module$build$src$core$utils$dom++;cacheWidths$$module$build$src$core$utils$dom||(cacheWidths$$module$build$src$core$utils$dom=Object.create(null))};stopTextWidthCache$$module$build$src$core$utils$dom=function(){cacheReference$$module$build$src$core$utils$dom--;cacheReference$$module$build$src$core$utils$dom||(cacheWidths$$module$build$src$core$utils$dom=null)};
|
|
90
90
|
getTextWidth$$module$build$src$core$utils$dom=function(a){const b=a.textContent+"\n"+a.className.baseVal;var c;if(cacheWidths$$module$build$src$core$utils$dom&&(c=cacheWidths$$module$build$src$core$utils$dom[b]))return c;c=window.getComputedStyle(a);c=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(a,c.fontSize,c.fontWeight,c.fontFamily);cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[b]=c);return c};
|
|
91
91
|
getFastTextWidth$$module$build$src$core$utils$dom=function(a,b,c,d){return getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(a,b+"pt",c,d)};
|
|
92
|
-
getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d){const e=a.textContent;a=e+"\n"+a.className.baseVal;var f;if(cacheWidths$$module$build$src$core$utils$dom&&(f=cacheWidths$$module$build$src$core$utils$dom[a]))return f;canvasContext$$module$build$src$core$utils$dom||(f=document.createElement("canvas"),f.className="blocklyComputeCanvas",document.body.appendChild(f),canvasContext$$module$build$src$core$utils$dom=f.getContext("2d"));canvasContext$$module$build$src$core$utils$dom
|
|
93
|
-
c+" "+b+" "+d
|
|
92
|
+
getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d){const e=a.textContent;a=e+"\n"+a.className.baseVal;var f;if(cacheWidths$$module$build$src$core$utils$dom&&(f=cacheWidths$$module$build$src$core$utils$dom[a]))return f;canvasContext$$module$build$src$core$utils$dom||(f=document.createElement("canvas"),f.className="blocklyComputeCanvas",document.body.appendChild(f),canvasContext$$module$build$src$core$utils$dom=f.getContext("2d"));e&&canvasContext$$module$build$src$core$utils$dom?
|
|
93
|
+
(canvasContext$$module$build$src$core$utils$dom.font=c+" "+b+" "+d,f=canvasContext$$module$build$src$core$utils$dom.measureText(e).width):f=0;cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[a]=f);return f};
|
|
94
94
|
measureFontMetrics$$module$build$src$core$utils$dom=function(a,b,c,d){const e=document.createElement("span");e.style.font=c+" "+b+" "+d;e.textContent=a;a=document.createElement("div");a.style.width="1px";a.style.height="0";b=document.createElement("div");b.style.display="flex";b.style.position="fixed";b.style.top="0";b.style.left="0";b.appendChild(e);b.appendChild(a);document.body.appendChild(b);c={height:0,baseline:0};try{b.style.alignItems="baseline",c.baseline=a.offsetTop-e.offsetTop,b.style.alignItems=
|
|
95
95
|
"flex-end",c.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(b)}return c};$.getFocusManager$$module$build$src$core$focus_manager=function(){return FocusManager$$module$build$src$core$focus_manager.getFocusManager()};isFocusableNode$$module$build$src$core$interfaces$i_focusable_node=function(a){return a&&"getFocusableElement"in a&&"getFocusableTree"in a&&"onNodeFocus"in a&&"onNodeBlur"in a&&"canBeFocused"in a};
|
|
96
96
|
isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return"string"===typeof a.id&&void 0!==a.workspace&&void 0!==a.select&&void 0!==a.unselect&&isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};
|
|
@@ -220,9 +220,9 @@ div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$cor
|
|
|
220
220
|
clearContent$$module$build$src$core$dropdowndiv=function(){div$$module$build$src$core$dropdowndiv.remove();createDom$$module$build$src$core$dropdowndiv()};setColour$$module$build$src$core$dropdowndiv=function(a,b){div$$module$build$src$core$dropdowndiv.style.backgroundColor=a;div$$module$build$src$core$dropdowndiv.style.borderColor=b};
|
|
221
221
|
showPositionedByBlock$$module$build$src$core$dropdowndiv=function(a,b,c,d){return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfBlock$$module$build$src$core$dropdowndiv(b),a,c,d)};showPositionedByField$$module$build$src$core$dropdowndiv=function(a,b,c){positionToField$$module$build$src$core$dropdowndiv=!0;return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfField$$module$build$src$core$dropdowndiv(a),a,b,c)};
|
|
222
222
|
getScaledBboxOfBlock$$module$build$src$core$dropdowndiv=function(a){var b=a.getSvgRoot();const c=a.workspace.scale,d=a.height*c;a=a.width*c;b=getPageOffset$$module$build$src$core$utils$style(b);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)};getScaledBboxOfField$$module$build$src$core$dropdowndiv=function(a){a=a.getScaledBBox();return new Rect$$module$build$src$core$utils$rect(a.top,a.bottom,a.left,a.right)};
|
|
223
|
-
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d){const
|
|
224
|
-
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=
|
|
225
|
-
renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv);return positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f)};
|
|
223
|
+
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e=!0){const f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();let h=d.workspace;for(;h.options.parentWorkspace;)h=h.options.parentWorkspace;setBoundsElement$$module$build$src$core$dropdowndiv(h.getParentSvg().parentNode);return show$$module$build$src$core$dropdowndiv(b,d.RTL,f,g,f,a,e,c)};
|
|
224
|
+
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=h||null;div$$module$build$src$core$dropdowndiv.style.direction=b?"rtl":"ltr";a=getMainWorkspace$$module$build$src$core$common();renderedClassName$$module$build$src$core$dropdowndiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$dropdowndiv=a.getTheme().getClassName();addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,
|
|
225
|
+
renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));return positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f)};
|
|
226
226
|
getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
|
|
227
227
|
getPositionAboveMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:d.height-2*BORDER_SIZE$$module$build$src$core$dropdowndiv-ARROW_SIZE$$module$build$src$core$dropdowndiv/2,arrowAtTop:!1,arrowVisible:!0}};
|
|
228
228
|
getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv=function(a,b,c){a=getPositionX$$module$build$src$core$dropdowndiv(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};
|
|
@@ -273,9 +273,9 @@ parseBlockColour$$module$build$src$core$utils$parsing=function(a){const b="strin
|
|
|
273
273
|
a+'")');throw Error(c);};getDiv$$module$build$src$core$widgetdiv=function(){return containerDiv$$module$build$src$core$widgetdiv};testOnly_setDiv$$module$build$src$core$widgetdiv=function(a){containerDiv$$module$build$src$core$widgetdiv=a;if(null===a){let b;null==(b=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv))||b.remove()}};
|
|
274
274
|
createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body;document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv)?containerDiv$$module$build$src$core$widgetdiv=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv):(containerDiv$$module$build$src$core$widgetdiv=document.createElement("div"),containerDiv$$module$build$src$core$widgetdiv.className=containerClassName$$module$build$src$core$widgetdiv);
|
|
275
275
|
a.appendChild(containerDiv$$module$build$src$core$widgetdiv)};
|
|
276
|
-
show$$module$build$src$core$widgetdiv=function(a,b,c,d){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let
|
|
277
|
-
rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
278
|
-
$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c)}};
|
|
276
|
+
show$$module$build$src$core$widgetdiv=function(a,b,c,d,e=!0){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let h;d=null==(h=a.getSourceBlock())?void 0:h.workspace}var f;ownerWorkspace$$module$build$src$core$widgetdiv=null!=(f=d)?f:null;var g;a=null!=(g=d)?g:getMainWorkspace$$module$build$src$core$common();
|
|
277
|
+
rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);e&&(returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
278
|
+
$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c))}};
|
|
279
279
|
hide$$module$build$src$core$widgetdiv=function(){if(isVisible$$module$build$src$core$widgetdiv()){owner$$module$build$src$core$widgetdiv=null;var a=containerDiv$$module$build$src$core$widgetdiv;a&&(a.style.display="none",a.style.left="",a.style.top="",dispose$$module$build$src$core$widgetdiv&&(dispose$$module$build$src$core$widgetdiv(),dispose$$module$build$src$core$widgetdiv=null),a.textContent="",rendererClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,
|
|
280
280
|
rendererClassName$$module$build$src$core$widgetdiv),rendererClassName$$module$build$src$core$widgetdiv=""),themeClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,themeClassName$$module$build$src$core$widgetdiv),themeClassName$$module$build$src$core$widgetdiv=""),getMainWorkspace$$module$build$src$core$common().markFocused(),returnEphemeralFocus$$module$build$src$core$widgetdiv&&(returnEphemeralFocus$$module$build$src$core$widgetdiv(),returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
281
281
|
null))}};isVisible$$module$build$src$core$widgetdiv=function(){return!!owner$$module$build$src$core$widgetdiv};hideIfOwner$$module$build$src$core$widgetdiv=function(a){owner$$module$build$src$core$widgetdiv===a&&hide$$module$build$src$core$widgetdiv()};hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv=function(a){let b=null===ownerWorkspace$$module$build$src$core$widgetdiv,c=a;for(;!b&&c;){if(c===a){b=!0;break}c=a.options.parentWorkspace}b&&hide$$module$build$src$core$widgetdiv()};
|
|
@@ -814,7 +814,7 @@ typeof HTMLElement&&a instanceof HTMLElement){let b,c;return null!=(c=null!=(b=a
|
|
|
814
814
|
return new this(a.options,void 0,a)}trimOptions(a){let b=!1;const c=a.map(g=>{if(g===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)return g;const [h,k]=g;if("string"===typeof h)return[replaceMessageReferences$$module$build$src$core$utils$parsing(h),k];b=!0;return[isImageProperties$$module$build$src$core$field_dropdown(h)?Object.assign({},h,{alt:replaceMessageReferences$$module$build$src$core$utils$parsing(h.alt)}):Object.assign({},h),k]});if(b||2>a.length)return{options:c};var d=c.map(([g])=>
|
|
815
815
|
g),e=shortestStringLength$$module$build$src$core$utils$string(d);a=commonWordPrefix$$module$build$src$core$utils$string(d,e);const f=commonWordSuffix$$module$build$src$core$utils$string(d,e);if(!a&&!f||e<=a+f)return{options:c};e=a?d[0].substring(0,a-1):void 0;d=f?d[0].substr(1-f):void 0;return{options:this.applyTrim(c,a,f),prefix:e,suffix:d}}applyTrim(a,b,c){return a.map(([d,e])=>[d.substring(b,d.length-c),e])}validateOptions(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");
|
|
816
816
|
if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");let b=!1;for(let c=0;c<a.length;c++){const d=a[c];Array.isArray(d)||d===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR?"string"!==typeof d[1]?(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option id must be a string.
|
|
817
|
-
Found ${d[1]} in: ${d}`)):!d[0]||"string"===typeof d[0]||isImageProperties$$module$build$src$core$field_dropdown(d[0])||d[0]instanceof HTMLElement||(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
817
|
+
Found ${d[1]} in: ${d}`)):!d[0]||"string"===typeof d[0]||isImageProperties$$module$build$src$core$field_dropdown(d[0])||"undefined"!==typeof HTMLElement&&d[0]instanceof HTMLElement||(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
818
818
|
label, image description, or HTML element. Found ${d[0]} in: ${d}`)):(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must be an array or
|
|
819
819
|
the string literal 'separator'. Found: ${d}`))}if(b)throw TypeError("Found invalid FieldDropdown options.");}};FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR="separator";FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR="\u25be";FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET=5;FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING=2*FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET;
|
|
820
820
|
register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;var Theme$$module$build$src$core$theme=class{constructor(a,b,c,d){this.name=a;this.startHats=!1;this.blockStyles=b||Object.create(null);this.categoryStyles=c||Object.create(null);this.componentStyles=d||Object.create(null);this.fontStyle=Object.create(null);register$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(a,b){this.blockStyles[a]=b}setCategoryStyle(a,b){this.categoryStyles[a]=b}getComponentStyle(a){a=
|
|
@@ -1052,7 +1052,7 @@ void 0:null==(d=c.getParentInput())?void 0:d.connection)?e:a}getNextSibling(a){i
|
|
|
1052
1052
|
a?d:(a=b.workspace.getTopBlocks(!0),b=a.indexOf(b.getRootBlock())+1,b>=a.length&&(b=0),b=a[b],null!=(c=this.getParentConnection(b))?c:b)):a.getSourceBlock()}getPreviousSibling(a){if(a.getParentInput()){var b=a.getParentInput(),c=null==b?void 0:b.getSourceBlock();if(!c||!b)return null;for(a=c.inputList.indexOf(b);0<=a;a--){var d=c.inputList[a];if(d.connection&&d!==b)return d.connection;d=d.fieldRow;if(d.length)return d[d.length-1]}}else{if(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||
|
|
1053
1053
|
a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return d=a.targetConnection&&!a.targetConnection.getParentInput()?a.targetConnection:null,c=a.getSourceBlock(),d||this.getParentConnection(c.getRootBlock())!==a?d:(a=c.workspace.getTopBlocks(!0),c=a.indexOf(c.getRootBlock())-1,0>c&&(c=a.length-1),c=a[c],null!=(b=c.lastConnectionInStack(!1))?b:c);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)return a.getSourceBlock()}return null}getParentConnection(a){let b;
|
|
1054
1054
|
return!a.outputConnection||(null==(b=a.previousConnection)?0:b.isConnected())?a.previousConnection:a.outputConnection}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$connection_navigation_policy={};module$build$src$core$keyboard_nav$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){var b=a.getParentInput();const c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;d<c.inputList.length;d++){b=c.inputList[d];const e=b.fieldRow;if(a<e.length)return e[a];a=0;let f;if(null==(f=b.connection)?0:f.targetBlock())return b.connection.targetBlock()}return null}getPreviousSibling(a){const b=
|
|
1055
|
-
a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let f;if((null==(f=e.connection)?0:f.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}return null}isNavigable(a){let b;return a.canBeFocused()&&a.isClickable()
|
|
1055
|
+
a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let f;if((null==(f=e.connection)?0:f.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}return null}isNavigable(a){let b;return a.canBeFocused()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?0:b.isSimpleReporter())&&a.isFullBlockField())&&
|
|
1056
1056
|
a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
|
|
1057
1057
|
module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>
|
|
1058
1058
|
b.isApplicable(a))}getFirstChild(a){let b;const c=null==(b=this.get(a))?void 0:b.getFirstChild(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getNextSibling(c)}getParent(a){let b;const c=null==(b=this.get(a))?void 0:b.getParent(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getParent(c)}getNextSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getNextSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?
|
|
@@ -1430,9 +1430,9 @@ Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setVa
|
|
|
1430
1430
|
this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;let b;return this.fullBlockClickTarget_=!(null==(b=this.getConstants())||!b.FULL_BLOCK_FIELDS)&&a.isSimpleReporter()}doValueInvalid_(a,b=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,a=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&b&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,
|
|
1431
1431
|
"field",this.name||null,a,this.value_)))}doValueUpdate_(a){this.isTextValid_=this.isDirty_=!0;this.value_=a}applyColour(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",a.getColourTertiary())):(this.borderRect_.style.display="none",a.pathObject.svgPath.setAttribute("fill",
|
|
1432
1432
|
this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let a;if(null==(a=this.getConstants())?0:a.FULL_BLOCK_FIELDS)this.render_(),this.isDirty_=!1;return super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){super.render_();if(this.isBeingEdited_){var a=this.htmlInput_;this.isTextValid_?(removeClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,
|
|
1433
|
-
"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0))}a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&a.applyColour()}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b=!1){this.workspace_=this.sourceBlock_.workspace;!b&&this.workspace_.options.modalInputs&&
|
|
1434
|
-
(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor():this.showInlineEditor(b)}showPromptEditor(){prompt$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{null!==a&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a){const
|
|
1435
|
-
show$$module$build$src$core$widgetdiv(this,
|
|
1433
|
+
"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0))}a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&a.applyColour()}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b=!1,c=!0){this.workspace_=this.sourceBlock_.workspace;!b&&this.workspace_.options.modalInputs&&
|
|
1434
|
+
(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor():this.showInlineEditor(b,c)}showPromptEditor(){prompt$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{null!==a&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a,b){const c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;
|
|
1435
|
+
show$$module$build$src$core$widgetdiv(this,c.RTL,this.widgetDispose_.bind(this),this.workspace_,b);this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;this.valueWhenEditorWasOpened_=this.value_;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;$.setGroup$$module$build$src$core$events$utils(!0);const b=getDiv$$module$build$src$core$widgetdiv();var c=this.getClickTarget_();
|
|
1436
1436
|
if(!c)throw Error("A click target has not been set.");addClass$$module$build$src$core$utils$dom(c,"blocklyEditing");c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.spellcheck_);const d=this.workspace_.getAbsoluteScale();var e=this.getConstants().FIELD_TEXT_FONTSIZE*d+"pt";b.style.fontSize=e;c.style.fontSize=e;e=FieldInput$$module$build$src$core$field_input.BORDERRADIUS*d+"px";this.isFullBlockField()&&(e=this.getScaledBBox(),e=(e.bottom-e.top)/2+"px",
|
|
1437
1437
|
a=a.getParent()?a.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),c.style.border=1*d+"px solid "+a,b.style.borderRadius=e,b.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(b.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*d+"px"));c.style.borderRadius=e;b.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.setAttribute("data-untyped-default-value",String(this.value_));this.resizeEditor_();this.bindInputEvents_(c);
|
|
1438
1438
|
return c}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&null!==this.valueWhenEditorWasOpened_&&this.valueWhenEditorWasOpened_!==this.value_&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),
|
|
@@ -1720,7 +1720,7 @@ d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}selectParent()
|
|
|
1720
1720
|
a.toggleExpanded();return!0}selectNext(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)+1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[++b];if(c&&c.isSelectable())return this.setSelectedItem(c),!0}return!1}selectPrevious(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)-1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[--b];if(c&&c.isSelectable())return this.setSelectedItem(c),
|
|
1721
1721
|
!0}return!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");this.flyout.dispose();this.contents.forEach(a=>a.dispose());for(let a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");
|
|
1722
1722
|
return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return null!=(b=this.getToolboxItems().find(c=>c.isSelectable()))?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
|
|
1723
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.0.0
|
|
1723
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.0.0",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
|
|
1724
1724
|
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=
|
|
1725
1725
|
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,
|
|
1726
1726
|
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,
|