blockly 12.1.0-beta.0 → 12.2.0-beta.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 +132 -132
- package/blockly_compressed.js +123 -113
- package/blockly_compressed.js.map +1 -1
- package/core/block_svg.d.ts +2 -0
- package/core/comments/comment_editor.d.ts +62 -0
- package/core/comments/comment_view.d.ts +13 -19
- package/core/comments/rendered_workspace_comment.d.ts +8 -1
- package/core/comments.d.ts +1 -0
- package/core/focus_manager.d.ts +4 -0
- package/core/icons/mutator_icon.d.ts +2 -2
- package/core/interfaces/i_comment_icon.d.ts +1 -1
- package/core/interfaces/i_copyable.d.ts +8 -1
- package/core/interfaces/i_focusable_node.d.ts +2 -2
- package/core/interfaces/i_focusable_tree.d.ts +2 -2
- package/core/interfaces/i_legacy_procedure_blocks.d.ts +2 -2
- package/core/interfaces/i_selectable.d.ts +1 -1
- package/core/keyboard_nav/icon_navigation_policy.d.ts +2 -2
- package/core/keyboard_nav/line_cursor.d.ts +1 -1
- package/core/workspace_svg.d.ts +7 -0
- package/msg/ab.js +9 -19
- package/msg/ab.mjs +4 -14
- package/msg/ace.js +9 -19
- package/msg/ace.mjs +4 -14
- package/msg/af.js +9 -19
- package/msg/af.mjs +4 -14
- package/msg/am.js +9 -19
- package/msg/am.mjs +4 -14
- package/msg/ar.js +9 -19
- package/msg/ar.mjs +4 -14
- package/msg/ast.js +9 -19
- package/msg/ast.mjs +4 -14
- package/msg/az.js +9 -19
- package/msg/az.mjs +4 -14
- package/msg/ba.js +9 -19
- package/msg/ba.mjs +4 -14
- package/msg/bcc.js +9 -19
- package/msg/bcc.mjs +4 -14
- package/msg/be-tarask.js +9 -19
- package/msg/be-tarask.mjs +4 -14
- package/msg/be.js +9 -19
- package/msg/be.mjs +4 -14
- package/msg/bg.js +9 -19
- package/msg/bg.mjs +4 -14
- package/msg/bn.js +9 -19
- package/msg/bn.mjs +4 -14
- package/msg/br.js +9 -19
- package/msg/br.mjs +4 -14
- package/msg/bs.js +9 -19
- package/msg/bs.mjs +4 -14
- package/msg/ca.js +9 -19
- package/msg/ca.mjs +4 -14
- package/msg/cdo.js +9 -19
- package/msg/cdo.mjs +4 -14
- package/msg/ce.js +9 -19
- package/msg/ce.mjs +4 -14
- package/msg/cs.js +9 -19
- package/msg/cs.mjs +4 -14
- package/msg/da.js +9 -19
- package/msg/da.mjs +4 -14
- package/msg/de.js +9 -19
- package/msg/de.mjs +4 -14
- package/msg/diq.js +9 -19
- package/msg/diq.mjs +4 -14
- package/msg/dtp.js +9 -19
- package/msg/dtp.mjs +4 -14
- package/msg/dty.js +9 -19
- package/msg/dty.mjs +4 -14
- package/msg/ee.js +9 -19
- package/msg/ee.mjs +4 -14
- package/msg/el.js +9 -19
- package/msg/el.mjs +4 -14
- package/msg/en-gb.js +9 -19
- package/msg/en-gb.mjs +4 -14
- package/msg/en.js +9 -19
- package/msg/en.mjs +4 -14
- package/msg/eo.js +9 -19
- package/msg/eo.mjs +4 -14
- package/msg/es.js +9 -19
- package/msg/es.mjs +4 -14
- package/msg/et.js +9 -19
- package/msg/et.mjs +4 -14
- package/msg/eu.js +9 -19
- package/msg/eu.mjs +4 -14
- package/msg/fa.js +9 -19
- package/msg/fa.mjs +4 -14
- package/msg/fi.js +9 -19
- package/msg/fi.mjs +4 -14
- package/msg/fo.js +9 -19
- package/msg/fo.mjs +4 -14
- package/msg/fr.js +9 -19
- package/msg/fr.mjs +4 -14
- package/msg/frr.js +9 -19
- package/msg/frr.mjs +4 -14
- package/msg/gl.js +9 -19
- package/msg/gl.mjs +4 -14
- package/msg/gn.js +9 -19
- package/msg/gn.mjs +4 -14
- package/msg/gor.js +9 -19
- package/msg/gor.mjs +4 -14
- package/msg/ha.js +9 -19
- package/msg/ha.mjs +4 -14
- package/msg/hak.js +9 -19
- package/msg/hak.mjs +4 -14
- package/msg/he.js +9 -19
- package/msg/he.mjs +4 -14
- package/msg/hi.js +9 -19
- package/msg/hi.mjs +4 -14
- package/msg/hr.js +9 -19
- package/msg/hr.mjs +4 -14
- package/msg/hrx.js +9 -19
- package/msg/hrx.mjs +4 -14
- package/msg/hsb.js +9 -19
- package/msg/hsb.mjs +4 -14
- package/msg/hu.js +9 -19
- package/msg/hu.mjs +4 -14
- package/msg/hy.js +9 -19
- package/msg/hy.mjs +4 -14
- package/msg/ia.js +9 -19
- package/msg/ia.mjs +4 -14
- package/msg/id.js +9 -19
- package/msg/id.mjs +4 -14
- package/msg/ig.js +9 -19
- package/msg/ig.mjs +4 -14
- package/msg/inh.js +9 -19
- package/msg/inh.mjs +4 -14
- package/msg/is.js +9 -19
- package/msg/is.mjs +4 -14
- package/msg/it.js +9 -19
- package/msg/it.mjs +4 -14
- package/msg/ja.js +9 -19
- package/msg/ja.mjs +4 -14
- package/msg/ka.js +9 -19
- package/msg/ka.mjs +4 -14
- package/msg/kab.js +9 -19
- package/msg/kab.mjs +4 -14
- package/msg/kbd-cyrl.js +9 -19
- package/msg/kbd-cyrl.mjs +4 -14
- package/msg/km.js +9 -19
- package/msg/km.mjs +4 -14
- package/msg/kn.js +9 -19
- package/msg/kn.mjs +4 -14
- package/msg/ko.js +9 -19
- package/msg/ko.mjs +4 -14
- package/msg/ksh.js +9 -19
- package/msg/ksh.mjs +4 -14
- package/msg/ku-latn.js +9 -19
- package/msg/ku-latn.mjs +4 -14
- package/msg/ky.js +9 -19
- package/msg/ky.mjs +4 -14
- package/msg/la.js +9 -19
- package/msg/la.mjs +4 -14
- package/msg/lb.js +9 -19
- package/msg/lb.mjs +4 -14
- package/msg/lki.js +9 -19
- package/msg/lki.mjs +4 -14
- package/msg/lo.js +9 -19
- package/msg/lo.mjs +4 -14
- package/msg/lrc.js +9 -19
- package/msg/lrc.mjs +4 -14
- package/msg/lt.js +9 -19
- package/msg/lt.mjs +4 -14
- package/msg/lv.js +9 -19
- package/msg/lv.mjs +4 -14
- package/msg/mg.js +9 -19
- package/msg/mg.mjs +4 -14
- package/msg/mk.js +9 -19
- package/msg/mk.mjs +4 -14
- package/msg/ml.js +9 -19
- package/msg/ml.mjs +4 -14
- package/msg/mnw.js +9 -19
- package/msg/mnw.mjs +4 -14
- package/msg/ms.js +9 -19
- package/msg/ms.mjs +4 -14
- package/msg/my.js +9 -19
- package/msg/my.mjs +4 -14
- package/msg/mzn.js +9 -19
- package/msg/mzn.mjs +4 -14
- package/msg/nb.js +9 -19
- package/msg/nb.mjs +4 -14
- package/msg/ne.js +9 -19
- package/msg/ne.mjs +4 -14
- package/msg/nl.js +9 -19
- package/msg/nl.mjs +4 -14
- package/msg/oc.js +9 -19
- package/msg/oc.mjs +4 -14
- package/msg/olo.js +9 -19
- package/msg/olo.mjs +4 -14
- package/msg/pa.js +9 -19
- package/msg/pa.mjs +4 -14
- package/msg/pl.js +9 -19
- package/msg/pl.mjs +4 -14
- package/msg/pms.js +9 -19
- package/msg/pms.mjs +4 -14
- package/msg/ps.js +9 -19
- package/msg/ps.mjs +4 -14
- package/msg/pt-br.js +9 -19
- package/msg/pt-br.mjs +4 -14
- package/msg/pt.js +9 -19
- package/msg/pt.mjs +4 -14
- package/msg/ro.js +9 -19
- package/msg/ro.mjs +4 -14
- package/msg/ru.js +9 -19
- package/msg/ru.mjs +4 -14
- package/msg/sc.js +9 -19
- package/msg/sc.mjs +4 -14
- package/msg/sco.js +9 -19
- package/msg/sco.mjs +4 -14
- package/msg/sd.js +9 -19
- package/msg/sd.mjs +4 -14
- package/msg/shn.js +9 -19
- package/msg/shn.mjs +4 -14
- package/msg/si.js +9 -19
- package/msg/si.mjs +4 -14
- package/msg/sk.js +9 -19
- package/msg/sk.mjs +4 -14
- package/msg/skr-arab.js +9 -19
- package/msg/skr-arab.mjs +4 -14
- package/msg/sl.js +9 -19
- package/msg/sl.mjs +4 -14
- package/msg/smn.js +9 -19
- package/msg/smn.mjs +4 -14
- package/msg/sq.js +9 -19
- package/msg/sq.mjs +4 -14
- package/msg/sr-latn.js +9 -19
- package/msg/sr-latn.mjs +4 -14
- package/msg/sr.js +9 -19
- package/msg/sr.mjs +4 -14
- package/msg/sv.js +9 -19
- package/msg/sv.mjs +4 -14
- package/msg/sw.js +9 -19
- package/msg/sw.mjs +4 -14
- package/msg/ta.js +9 -19
- package/msg/ta.mjs +4 -14
- package/msg/tcy.js +9 -19
- package/msg/tcy.mjs +4 -14
- package/msg/tdd.js +9 -19
- package/msg/tdd.mjs +4 -14
- package/msg/te.js +9 -19
- package/msg/te.mjs +4 -14
- package/msg/th.js +9 -19
- package/msg/th.mjs +4 -14
- package/msg/ti.js +9 -19
- package/msg/ti.mjs +4 -14
- package/msg/tl.js +9 -19
- package/msg/tl.mjs +4 -14
- package/msg/tlh.js +9 -19
- package/msg/tlh.mjs +4 -14
- package/msg/tr.js +9 -19
- package/msg/tr.mjs +4 -14
- package/msg/ug-arab.js +9 -19
- package/msg/ug-arab.mjs +4 -14
- package/msg/uk.js +9 -19
- package/msg/uk.mjs +4 -14
- package/msg/ur.js +9 -19
- package/msg/ur.mjs +4 -14
- package/msg/uz.js +9 -19
- package/msg/uz.mjs +4 -14
- package/msg/vi.js +9 -19
- package/msg/vi.mjs +4 -14
- package/msg/xmf.js +9 -19
- package/msg/xmf.mjs +4 -14
- package/msg/yo.js +9 -19
- package/msg/yo.mjs +4 -14
- package/msg/zgh.js +9 -19
- package/msg/zgh.mjs +4 -14
- package/msg/zh-hans.js +9 -19
- package/msg/zh-hans.mjs +4 -14
- package/msg/zh-hant.js +9 -19
- package/msg/zh-hant.mjs +4 -14
- package/package.json +1 -1
package/blockly.min.js
CHANGED
|
@@ -52,13 +52,14 @@ register$$module$build$src$core$icons$registry,unregister$$module$build$src$core
|
|
|
52
52
|
flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures,mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants,isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,register$$module$build$src$core$renderers$common$block_rendering,
|
|
53
53
|
unregister$$module$build$src$core$renderers$common$block_rendering,init$$module$build$src$core$renderers$common$block_rendering,stringButtonClickHandler$$module$build$src$core$variables_dynamic,numberButtonClickHandler$$module$build$src$core$variables_dynamic,colourButtonClickHandler$$module$build$src$core$variables_dynamic,internalFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategory$$module$build$src$core$variables_dynamic,xmlFlyoutCategory$$module$build$src$core$variables_dynamic,
|
|
54
54
|
flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,copyInternal$$module$build$src$core$clipboard,paste$$module$build$src$core$clipboard,pasteFromData$$module$build$src$core$clipboard,duplicateInternal$$module$build$src$core$clipboard,isCopyable$$module$build$src$core$interfaces$i_copyable,registerEscape$$module$build$src$core$shortcut_items,registerDelete$$module$build$src$core$shortcut_items,isCopyable$$module$build$src$core$shortcut_items,
|
|
55
|
-
registerCopy$$module$build$src$core$shortcut_items,registerCut$$module$build$src$core$shortcut_items,registerPaste$$module$build$src$core$shortcut_items,registerUndo$$module$build$src$core$shortcut_items,registerRedo$$module$build$src$core$shortcut_items,registerDefaultShortcuts$$module$build$src$core$shortcut_items,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,
|
|
56
|
-
inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
isCuttable$$module$build$src$core$shortcut_items,registerCopy$$module$build$src$core$shortcut_items,registerCut$$module$build$src$core$shortcut_items,registerPaste$$module$build$src$core$shortcut_items,registerUndo$$module$build$src$core$shortcut_items,registerRedo$$module$build$src$core$shortcut_items,registerDefaultShortcuts$$module$build$src$core$shortcut_items,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,
|
|
56
|
+
load$$module$build$src$core$serialization$workspaces,inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,
|
|
57
|
+
registerCollapse$$module$build$src$core$contextmenu_items,registerExpand$$module$build$src$core$contextmenu_items,addDeletableBlocks_$$module$build$src$core$contextmenu_items,getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items,registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,
|
|
58
|
+
registerInline$$module$build$src$core$contextmenu_items,registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,registerDisable$$module$build$src$core$contextmenu_items,registerDelete$$module$build$src$core$contextmenu_items,registerHelp$$module$build$src$core$contextmenu_items,registerCommentDelete$$module$build$src$core$contextmenu_items,registerCommentDuplicate$$module$build$src$core$contextmenu_items,registerCommentCreate$$module$build$src$core$contextmenu_items,pixelsToWorkspaceCoords$$module$build$src$core$contextmenu_items,
|
|
59
|
+
registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,
|
|
60
|
+
$jscomp;
|
|
61
|
+
register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&"string"!==typeof a||""===`${a}`.trim())throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if("string"!==typeof b||""===b.trim())throw Error('Invalid name "'+b+'". The name must be a non-empty string.');const e=b.toLowerCase();if(!c)throw Error("Can not register a null value");let f=typeMap$$module$build$src$core$registry[a],g=
|
|
62
|
+
nameMap$$module$build$src$core$registry[a];f||(f=typeMap$$module$build$src$core$registry[a]=Object.create(null),g=nameMap$$module$build$src$core$registry[a]=Object.create(null));validate$$module$build$src$core$registry(a,c);if(!d&&f[e]&&f[e]!==c)throw Error('Name "'+e+'" with type "'+a+'" already registered.');f[e]=c;g[e]=b};
|
|
62
63
|
validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if("function"!==typeof b.fromJson)throw Error('Type "'+a+'" must have a fromJson function');}};
|
|
63
64
|
unregister$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();const c=typeMap$$module$build$src$core$registry[a];c&&c[b]?(delete typeMap$$module$build$src$core$registry[a][b],delete nameMap$$module$build$src$core$registry[a][b]):console.warn("Unable to unregister ["+b+"]["+a+"] from the registry.")};
|
|
64
65
|
getItem$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();b=b.toLowerCase();const d=typeMap$$module$build$src$core$registry[a];if(!d||!d[b]){b="Unable to find ["+b+"]["+a+"] in the registry.";if(c)throw Error(b+" You must require or register a "+a+" plugin.");console.warn(b);return null}return d[b]};hasItem$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();return(a=typeMap$$module$build$src$core$registry[a])?!!a[b]:!1};
|
|
@@ -102,8 +103,8 @@ getFastTextWidth$$module$build$src$core$utils$dom=function(a,b,c,d){return getFa
|
|
|
102
103
|
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?
|
|
103
104
|
(canvasContext$$module$build$src$core$utils$dom.font=c+" "+b+" "+d,f=canvasContext$$module$build$src$core$utils$dom.measureText(e).width):f=0;cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[a]=f);return f};
|
|
104
105
|
measureFontMetrics$$module$build$src$core$utils$dom=function(a,b,c,d){const e=document.createElement("span");e.style.font=c+" "+b+" "+d;e.textContent=a;a=document.createElement("div");a.style.width="1px";a.style.height="0";b=document.createElement("div");b.style.display="flex";b.style.position="fixed";b.style.top="0";b.style.left="0";b.appendChild(e);b.appendChild(a);document.body.appendChild(b);c={height:0,baseline:0};try{b.style.alignItems="baseline",c.baseline=a.offsetTop-e.offsetTop,b.style.alignItems=
|
|
105
|
-
"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&&"
|
|
106
|
-
isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return"string"===typeof a.id&&
|
|
106
|
+
"flex-end",c.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(b)}return c};$.getFocusManager$$module$build$src$core$focus_manager=function(){return FocusManager$$module$build$src$core$focus_manager.getFocusManager()};isFocusableNode$$module$build$src$core$interfaces$i_focusable_node=function(a){return a&&"function"===typeof a.getFocusableElement&&"function"===typeof a.getFocusableTree&&"function"===typeof a.onNodeFocus&&"function"===typeof a.onNodeBlur&&"function"===typeof a.canBeFocused};
|
|
107
|
+
isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&"string"===typeof a.id&&"object"===typeof a.workspace&&"function"===typeof a.select&&"function"===typeof a.unselect};
|
|
107
108
|
deepMerge$$module$build$src$core$utils$object=function(a,b){for(const c in b)null!==b[c]&&Array.isArray(b[c])?a[c]=deepMerge$$module$build$src$core$utils$object(a[c]||[],b[c]):a[c]=null!==b[c]&&"object"===typeof b[c]?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};
|
|
108
109
|
getAllWorkspaces$$module$build$src$core$common=function(){const a=[];for(const b in WorkspaceDB_$$module$build$src$core$common)a.push(WorkspaceDB_$$module$build$src$core$common[b]);return a};registerWorkspace$$module$build$src$core$common=function(a){WorkspaceDB_$$module$build$src$core$common[a.id]=a};unregisterWorkpace$$module$build$src$core$common=function(a){delete WorkspaceDB_$$module$build$src$core$common[a.id]};getMainWorkspace$$module$build$src$core$common=function(){return mainWorkspace$$module$build$src$core$common};
|
|
109
110
|
setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a};getSelected$$module$build$src$core$common=function(){const a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();return a&&isSelectable$$module$build$src$core$interfaces$i_selectable(a)?a:null};setSelected$$module$build$src$core$common=function(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)};
|
|
@@ -114,8 +115,8 @@ getBlockTypeCounts$$module$build$src$core$common=function(a,b){const c=Object.cr
|
|
|
114
115
|
defineBlocksWithJsonArrayInternal$$module$build$src$core$common=function(a){$.defineBlocks$$module$build$src$core$common($.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(a))};
|
|
115
116
|
$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(a){const b={};for(let c=0;c<a.length;c++){const d=a[c];if(!d){console.warn(`Block definition #${c} in JSON array is ${d}. Skipping`);continue}const e=d.type;e?b[e]={init:jsonInitFactory$$module$build$src$core$common(d)}:console.warn(`Block definition #${c} in JSON array is missing a type attribute. `+"Skipping.")}return b};
|
|
116
117
|
$.defineBlocks$$module$build$src$core$common=function(a){for(const b of Object.keys(a)){const c=a[b];b in Blocks$$module$build$src$core$blocks&&console.warn(`Block definition "${b}" overwrites previous definition.`);Blocks$$module$build$src$core$blocks[b]=c}};
|
|
117
|
-
globalShortcutHandler$$module$build$src$core$common=function(a){
|
|
118
|
-
register$$module$build$src$core$css=function(a){if(injected$$module$build$src$core$css)throw Error("CSS already injected");content$$module$build$src$core$css+="\n"+a};
|
|
118
|
+
globalShortcutHandler$$module$build$src$core$common=function(a){let b=getMainWorkspace$$module$build$src$core$common();const c=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree();for(const 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)};
|
|
119
|
+
removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(-1===b)return!1;a.splice(b,1);return!0};register$$module$build$src$core$css=function(a){if(injected$$module$build$src$core$css)throw Error("CSS already injected");content$$module$build$src$core$css+="\n"+a};
|
|
119
120
|
inject$$module$build$src$core$css=function(a,b){injected$$module$build$src$core$css||(injected$$module$build$src$core$css=!0,a&&(a=b.replace(/[\\/]$/,""),b=content$$module$build$src$core$css.replace(/<<<PATH>>>/g,a),content$$module$build$src$core$css="",a=document.createElement("style"),a.id="blockly-common-style",b=document.createTextNode(b),a.appendChild(b),document.head.insertBefore(a,document.head.firstChild)))};getSize$$module$build$src$core$utils$style=function(a){return TEST_ONLY$$module$build$src$core$utils$style.getSizeInternal(a)};
|
|
120
121
|
getSizeInternal$$module$build$src$core$utils$style=function(a){if("none"!==getComputedStyle$$module$build$src$core$utils$style(a,"display"))return getSizeWithDisplay$$module$build$src$core$utils$style(a);const b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";const f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new Size$$module$build$src$core$utils$size(f,a)};
|
|
121
122
|
getSizeWithDisplay$$module$build$src$core$utils$style=function(a){return new Size$$module$build$src$core$utils$size(a.offsetWidth,a.offsetHeight)};getComputedStyle$$module$build$src$core$utils$style=function(a,b){a=window.getComputedStyle(a);return a[b]||a.getPropertyValue(b)};
|
|
@@ -153,7 +154,7 @@ a.height){e=c.getSize();let f,g;c.setSize(new Size$$module$build$src$core$utils$
|
|
|
153
154
|
register$$module$build$src$core$clipboard$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a,b)};unregister$$module$build$src$core$clipboard$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a)};
|
|
154
155
|
moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster=function(a){const b=a.workspace,c=a.getRelativeToSurfaceXY(),d=new Coordinate$$module$build$src$core$utils$coordinate(0,0),e=b.getTopComments(!1).filter(f=>f.id!==a.id).map(f=>f.getRelativeToSurfaceXY());for(;commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster(Coordinate$$module$build$src$core$utils$coordinate.sum(c,d),e);)d.translate(b.RTL?-30:30,30);a.moveTo(Coordinate$$module$build$src$core$utils$coordinate.sum(c,
|
|
155
156
|
d))};commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster=function(a,b){return b.some(c=>1>=Math.abs(c.x-a.x)&&1>=Math.abs(c.y-a.y))};setRole$$module$build$src$core$utils$aria=function(a,b){a.setAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria,b)};setState$$module$build$src$core$utils$aria=function(a,b,c){Array.isArray(c)&&(c=c.join(" "));a.setAttribute(ARIA_PREFIX$$module$build$src$core$utils$aria+b,`${c}`)};
|
|
156
|
-
isSerializable$$module$build$src$core$interfaces$i_serializable=function(a){return
|
|
157
|
+
isSerializable$$module$build$src$core$interfaces$i_serializable=function(a){return a&&"function"===typeof a.saveState&&"function"===typeof a.loadState};
|
|
157
158
|
queueRender$$module$build$src$core$render_management=function(a){queueBlock$$module$build$src$core$render_management(a);if(alwaysImmediatelyRender$$module$build$src$core$render_management())return doRenders$$module$build$src$core$render_management(),Promise.resolve();afterRendersPromise$$module$build$src$core$render_management||(afterRendersPromise$$module$build$src$core$render_management=new Promise(b=>{afterRendersResolver$$module$build$src$core$render_management=b;animationRequestId$$module$build$src$core$render_management=
|
|
158
159
|
window.requestAnimationFrame(()=>{doRenders$$module$build$src$core$render_management();b()})}));return afterRendersPromise$$module$build$src$core$render_management};finishQueuedRenders$$module$build$src$core$render_management=function(){return afterRendersPromise$$module$build$src$core$render_management?afterRendersPromise$$module$build$src$core$render_management:Promise.resolve()};
|
|
159
160
|
triggerQueuedRenders$$module$build$src$core$render_management=function(a){a||window.cancelAnimationFrame(animationRequestId$$module$build$src$core$render_management);doRenders$$module$build$src$core$render_management(a);!a&&afterRendersResolver$$module$build$src$core$render_management&&afterRendersResolver$$module$build$src$core$render_management()};alwaysImmediatelyRender$$module$build$src$core$render_management=function(){return JavaFx$$module$build$src$core$utils$useragent};
|
|
@@ -164,7 +165,7 @@ dequeueBlock$$module$build$src$core$render_management=function(a){rootBlocks$$mo
|
|
|
164
165
|
renderBlock$$module$build$src$core$render_management=function(a){if(dirtyBlocks$$module$build$src$core$render_management.has(a)&&a.initialized){for(const b of a.getChildren(!1))renderBlock$$module$build$src$core$render_management(b);a.renderEfficiently()}};alert$$module$build$src$core$dialog=function(a,b){alertImplementation$$module$build$src$core$dialog(a,b)};
|
|
165
166
|
setAlert$$module$build$src$core$dialog=function(a=defaultAlert$$module$build$src$core$dialog){alertImplementation$$module$build$src$core$dialog=a};confirm$$module$build$src$core$dialog=function(a,b){confirmImplementation$$module$build$src$core$dialog(a,b)};setConfirm$$module$build$src$core$dialog=function(a=defaultConfirm$$module$build$src$core$dialog){confirmImplementation$$module$build$src$core$dialog=a};
|
|
166
167
|
prompt$$module$build$src$core$dialog=function(a,b,c){promptImplementation$$module$build$src$core$dialog(a,b,c)};setPrompt$$module$build$src$core$dialog=function(a=defaultPrompt$$module$build$src$core$dialog){promptImplementation$$module$build$src$core$dialog=a};toast$$module$build$src$core$dialog=function(a,b){toastImplementation$$module$build$src$core$dialog(a,b)};
|
|
167
|
-
setToast$$module$build$src$core$dialog=function(a=defaultToast$$module$build$src$core$dialog){toastImplementation$$module$build$src$core$dialog=a};isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return
|
|
168
|
+
setToast$$module$build$src$core$dialog=function(a=defaultToast$$module$build$src$core$dialog){toastImplementation$$module$build$src$core$dialog=a};isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return a&&"function"===typeof a.getProcedureDef};isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return a&&"function"===typeof a.getProcedureCall&&"function"===typeof a.renameProcedure};
|
|
168
169
|
isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model=function(a){return void 0!==a.getVariableModel};warn$$module$build$src$core$utils$deprecation=function(a,b,c,d){a=a+" was deprecated in "+b+" and will be deleted in "+c+".";d&&(a+="\nUse "+d+" instead.");previousWarnings$$module$build$src$core$utils$deprecation.has(a)||(previousWarnings$$module$build$src$core$utils$deprecation.add(a),console.warn(a))};
|
|
169
170
|
$.allUsedVarModels$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);const b=new Set;for(let c=0;c<a.length;c++){const d=a[c].getVarModels();if(d)for(let e=0;e<d.length;e++){const f=d[e];f.getId()&&b.add(f)}}return Array.from(b.values())};$.allDeveloperVariables$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);const b=new Set;for(let d=0,e;e=a[d];d++){var c=e.getDeveloperVariables;if(c){c=c();for(let f=0;f<c.length;f++)b.add(c[f])}}return Array.from(b.values())};
|
|
170
171
|
internalFlyoutCategory$$module$build$src$core$variables=function(a){return flyoutCategory$$module$build$src$core$variables(a,!1)};
|
|
@@ -216,7 +217,7 @@ loadIcons$$module$build$src$core$serialization$blocks=function(a,b){if(b.icons){
|
|
|
216
217
|
loadFields$$module$build$src$core$serialization$blocks=function(a,b){if(b.fields){var c=Object.keys(b.fields);for(let d=0;d<c.length;d++){const e=c[d],f=b.fields[e],g=a.getField(e);g?g.loadState(f):console.warn(`Ignoring non-existant field ${e} in block ${a.type}`)}}};
|
|
217
218
|
loadInputBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.inputs){var c=Object.keys(b.inputs);for(let d=0;d<c.length;d++){const e=c[d],f=a.getInput(e);if(!f||!f.connection)throw new MissingConnection$$module$build$src$core$serialization$exceptions(e,a,b);loadConnection$$module$build$src$core$serialization$blocks(f.connection,b.inputs[e])}}};
|
|
218
219
|
loadNextBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.next){if(!a.nextConnection)throw new MissingConnection$$module$build$src$core$serialization$exceptions("next",a,b);loadConnection$$module$build$src$core$serialization$blocks(a.nextConnection,b.next)}};loadConnection$$module$build$src$core$serialization$blocks=function(a,b){b.shadow&&a.setShadowState(b.shadow);b.block&&appendPrivate$$module$build$src$core$serialization$blocks(b.block,a.getSourceBlock().workspace,{parentConnection:a})};
|
|
219
|
-
initBlock$$module$build$src$core$serialization$blocks=function(a,b){if(b){a.setConnectionTracking(!1);a.initSvg();a.queueRender();for(const c of a.getIcons())c.onLocationChange(a.getRelativeToSurfaceXY())}else a.initModel()};hasBubble$$module$build$src$core$interfaces$i_has_bubble=function(a){return
|
|
220
|
+
initBlock$$module$build$src$core$serialization$blocks=function(a,b){if(b){a.setConnectionTracking(!1);a.initSvg();a.queueRender();for(const c of a.getIcons())c.onLocationChange(a.getRelativeToSurfaceXY())}else a.initModel()};hasBubble$$module$build$src$core$interfaces$i_has_bubble=function(a){return"function"===typeof a.bubbleIsVisible&&"function"===typeof a.setBubbleVisible&&"function"===typeof a.getBubble};toRadians$$module$build$src$core$utils$math=function(a){return a*Math.PI/180};
|
|
220
221
|
toDegrees$$module$build$src$core$utils$math=function(a){return 180*a/Math.PI};clamp$$module$build$src$core$utils$math=function(a,b,c){if(c<a){const d=c;c=a;a=d}return Math.max(a,Math.min(b,c))};
|
|
221
222
|
createDom$$module$build$src$core$dropdowndiv=function(){document.querySelector(".blocklyDropDownDiv")||(div$$module$build$src$core$dropdowndiv=document.createElement("div"),div$$module$build$src$core$dropdowndiv.className="blocklyDropDownDiv",div$$module$build$src$core$dropdowndiv.tabIndex=-1,(getParentContainer$$module$build$src$core$common()||document.body).appendChild(div$$module$build$src$core$dropdowndiv),content$$module$build$src$core$dropdowndiv=document.createElement("div"),content$$module$build$src$core$dropdowndiv.className=
|
|
222
223
|
"blocklyDropDownContent",div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$core$dropdowndiv),keydownListener$$module$build$src$core$dropdowndiv=conditionalBind$$module$build$src$core$browser_events(content$$module$build$src$core$dropdowndiv,"keydown",null,globalShortcutHandler$$module$build$src$core$common),arrow$$module$build$src$core$dropdowndiv=document.createElement("div"),arrow$$module$build$src$core$dropdowndiv.className="blocklyDropDownArrow",div$$module$build$src$core$dropdowndiv.appendChild(arrow$$module$build$src$core$dropdowndiv),
|
|
@@ -358,8 +359,9 @@ $.buildTooltipWithFieldText$$module$build$src$core$extensions=function(a,b){retu
|
|
|
358
359
|
point$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+","+b+" "};curve$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+b.join("")};moveTo$$module$build$src$core$utils$svg_paths=function(a,b){return" M "+a+","+b+" "};moveBy$$module$build$src$core$utils$svg_paths=function(a,b){return" m "+a+","+b+" "};lineTo$$module$build$src$core$utils$svg_paths=function(a,b){return" l "+a+","+b+" "};line$$module$build$src$core$utils$svg_paths=function(a){return" l"+a.join("")};
|
|
359
360
|
lineOnAxis$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+" "+b+" "};arc$$module$build$src$core$utils$svg_paths=function(a,b,c,d){return a+" "+c+" "+c+" "+b+d};connectReciprocally$$module$build$src$core$connection=function(a,b){if(!a||!b)throw Error("Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a};
|
|
360
361
|
getSingleConnection$$module$build$src$core$connection=function(a,b){let c=null;b=b.outputConnection;const d=null==b?void 0:b.getConnectionChecker();for(let e=0,f;f=a.inputList[e];e++){const g=f.connection;let h;if(g&&(null==(h=d)?0:h.canConnect(b,g,!1))){if(c)return null;c=g}}return c};getConnectionForOrphanedOutput$$module$build$src$core$connection=function(a,b){let c;for(;c=getSingleConnection$$module$build$src$core$connection(a,b);)if(a=c.targetBlock(),!a||a.isShadow())return c;return null};
|
|
361
|
-
isIcon$$module$build$src$core$interfaces$i_icon=function(a){return
|
|
362
|
-
|
|
362
|
+
isIcon$$module$build$src$core$interfaces$i_icon=function(a){return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&"function"===typeof a.getType&&"function"===typeof a.initView&&"function"===typeof a.dispose&&"function"===typeof a.getWeight&&"function"===typeof a.getSize&&"function"===typeof a.applyColour&&"function"===typeof a.hideForInsertionMarker&&"function"===typeof a.updateEditable&&"function"===typeof a.updateCollapsed&&"function"===typeof a.isShownWhenCollapsed&&"function"===
|
|
363
|
+
typeof a.setOffsetInBlock&&"function"===typeof a.onLocationChange&&"function"===typeof a.onClick};
|
|
364
|
+
isCommentIcon$$module$build$src$core$interfaces$i_comment_icon=function(a){return isIcon$$module$build$src$core$interfaces$i_icon(a)&&hasBubble$$module$build$src$core$interfaces$i_has_bubble(a)&&isSerializable$$module$build$src$core$interfaces$i_serializable(a)&&"function"===typeof a.setText&&"function"===typeof a.getText&&"function"===typeof a.setBubbleSize&&"function"===typeof a.getBubbleSize&&"function"===typeof a.setBubbleLocation&&"function"===typeof a.getBubbleLocation&&a.getType()===IconType$$module$build$src$core$icons$icon_types.COMMENT};
|
|
363
365
|
disposeUiEffect$$module$build$src$core$block_animations=function(a){if(!(100<a.getDescendants(!1).length)){var b=a.workspace,c=a.getSvgRoot();b.getAudioManager().play("delete");var d=a.getRelativeToSurfaceXY(),e=c.cloneNode(!0);e.setAttribute("transform","translate("+d.x+","+d.y+")");var f;null==(f=b.getLayerManager())||f.appendToAnimationLayer({getSvgRoot:()=>e});disposeUiStep$$module$build$src$core$block_animations(e,{x:d.x,y:d.y,width:a.width,height:a.height},b.RTL,new Date)}};
|
|
364
366
|
disposeUiStep$$module$build$src$core$block_animations=function(a,b,c,d){const e=((new Date).getTime()-d.getTime())/150;1<e?removeNode$$module$build$src$core$utils$dom(a):(a.setAttribute("transform","translate("+(b.x+(c?-1:1)*b.width/2*e)+","+(b.y+b.height/2*e)+") scale("+(1-e)+")"),setTimeout(disposeUiStep$$module$build$src$core$block_animations,10,a,b,c,d))};
|
|
365
367
|
connectionUiEffect$$module$build$src$core$block_animations=function(a){var b=a.workspace;const c=b.scale;b.getAudioManager().play("click");if(!(1>c)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);var e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.ANIMATE,
|
|
@@ -375,12 +377,13 @@ bumpObjectIntoBounds$$module$build$src$core$bump_objects=function(a,b,c){const d
|
|
|
375
377
|
bumpIntoBoundsHandler$$module$build$src$core$bump_objects=function(a){return b=>{var c=a.getMetricsManager();if(c.hasFixedEdges()&&!a.isDragging()){var d;if(BUMP_EVENTS$$module$build$src$core$events$type.includes(null!=(d=b.type)?d:"")){d=c.getScrollMetrics(!0);const e=extractObjectFromEvent$$module$build$src$core$bump_objects(a,b);e&&(c=$.getGroup$$module$build$src$core$events$utils()||!1,$.setGroup$$module$build$src$core$events$utils(b.group),bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,
|
|
376
378
|
d,e)&&!b.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),$.setGroup$$module$build$src$core$events$utils(c))}else isViewportChange$$module$build$src$core$events$predicates(b)&&b.scale&&b.oldScale&&b.scale>b.oldScale&&bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)}}};
|
|
377
379
|
extractObjectFromEvent$$module$build$src$core$bump_objects=function(a,b){let c=null;switch(b.type){case EventType$$module$build$src$core$events$type.BLOCK_CREATE:case EventType$$module$build$src$core$events$type.BLOCK_MOVE:(c=a.getBlockById(b.blockId))&&(c=c.getRootBlock());break;case EventType$$module$build$src$core$events$type.COMMENT_CREATE:case EventType$$module$build$src$core$events$type.COMMENT_MOVE:case EventType$$module$build$src$core$events$type.COMMENT_RESIZE:c=a.getCommentById(b.commentId)}return c};
|
|
378
|
-
bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);var c=a.getTopBoundedElements();for(let d=0,e;e=c[d];d++)bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,b,e)}};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return
|
|
379
|
-
getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a){const
|
|
380
|
-
navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){const c=a.workspace.getTopBlocks(!0);a=c.indexOf(a.getRootBlock())+b;let d=null;0<=a&&a<c.length?d=c[a]:0>a?d=c[c.length-1]:a>=c.length&&(d=c[0]);if(0>b&&d){let e,f;return null!=(f=null==(e=d.lastConnectionInStack(!1))?void 0:e.getSourceBlock())?f:d}return d};
|
|
381
|
-
navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){var c=a instanceof BlockSvg$$module$build$src$core$block_svg?a.outputConnection.targetBlock():a.getSourceBlock();if(!(
|
|
382
|
-
isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return
|
|
383
|
-
|
|
380
|
+
bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);var c=a.getTopBoundedElements();for(let d=0,e;e=c[d];d++)bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,b,e)}};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return a&&"function"===typeof a.isDeletable&&"function"===typeof a.dispose&&"function"===typeof a.setDeleteStyle};
|
|
381
|
+
getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){const c=a.getIcons();for(const d of a.inputList){if(!d.isVisible())continue;c.push(...d.fieldRow);let e;if(null==(e=d.connection)?0:e.targetBlock())if(a=d.connection.targetBlock(),d.connection.type!==ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||b)c.push(a);else{let f;(a=null==(f=a.lastConnectionInStack(!1))?void 0:f.getSourceBlock())&&c.push(a)}else{let f;(null==(f=d.connection)?
|
|
382
|
+
void 0:f.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&c.push(d.connection)}}return c};navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){const c=a.workspace.getTopBlocks(!0);a=c.indexOf(a.getRootBlock())+b;let d=null;0<=a&&a<c.length?d=c[a]:0>a?d=c[c.length-1]:a>=c.length&&(d=c[0]);if(0>b&&d){let e,f;return null!=(f=null==(e=d.lastConnectionInStack(!1))?void 0:e.getSourceBlock())?f:d}return d};
|
|
383
|
+
navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){var c;let d;const e=a instanceof BlockSvg$$module$build$src$core$block_svg?null!=(d=null==(c=a.outputConnection)?void 0:c.targetBlock())?d:a.getSurroundParent():a.getSourceBlock();if(!(e instanceof BlockSvg$$module$build$src$core$block_svg))return null;c=getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(e,0<b);a=c.indexOf(a);if(-1===a)return null;b=a+b;return 0<=b&&b<c.length?
|
|
384
|
+
c[b]:null};isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return a&&"function"===typeof a.getRelativeToSurfaceXY&&"function"===typeof a.isMovable&&"function"===typeof a.startDrag&&"function"===typeof a.drag&&"function"===typeof a.endDrag&&"function"===typeof a.revertDrag};isAutoHideable$$module$build$src$core$interfaces$i_autohideable=function(a){return a&&"function"===typeof a.autoHide};
|
|
385
|
+
register$$module$build$src$core$icons$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a.toString(),b)};unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)};isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return"function"===typeof a.getProcedureModel&&"function"===typeof a.doProcedureUpdate&&"function"===typeof a.isProcedureDef};
|
|
386
|
+
isObservable$$module$build$src$core$interfaces$i_observable=function(a){return a&&"function"===typeof a.startPublishing&&"function"===typeof a.stopPublishing};
|
|
384
387
|
allProcedures$$module$build$src$core$procedures=function(a){const b=a.getProcedureMap().getProcedures().filter(d=>!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!1]);a.getBlocksByType("procedures_defnoreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&b.push(d.getProcedureDef())});const c=a.getProcedureMap().getProcedures().filter(d=>
|
|
385
388
|
!!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!0]);a.getBlocksByType("procedures_defreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&c.push(d.getProcedureDef())});b.sort(procTupleComparator$$module$build$src$core$procedures);c.sort(procTupleComparator$$module$build$src$core$procedures);return[b,c]};
|
|
386
389
|
procTupleComparator$$module$build$src$core$procedures=function(a,b){return a[0].localeCompare(b[0],void 0,{sensitivity:"base"})};$.findLegalName$$module$build$src$core$procedures=function(a,b){if(b.isInFlyout)return a;for(a=a||$.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!isLegalName$$module$build$src$core$procedures(a,b.workspace,b);){const c=a.match(/^(.*?)(\d+)$/);a=c?c[1]+(parseInt(c[2])+1):a+"2"}return a};
|
|
@@ -419,25 +422,26 @@ for(let d=0,e;e=a[d];d++)c=$.createElement$$module$build$src$core$utils$xml("blo
|
|
|
419
422
|
copyInternal$$module$build$src$core$clipboard=function(a){const b=a.toCopyData();stashedCopyData$$module$build$src$core$clipboard=b;let c;stashedWorkspace$$module$build$src$core$clipboard=null!=(c=a.workspace)?c:null;return b};
|
|
420
423
|
paste$$module$build$src$core$clipboard=function(a,b,c){return a&&b?pasteFromData$$module$build$src$core$clipboard(a,b,c):stashedCopyData$$module$build$src$core$clipboard&&stashedWorkspace$$module$build$src$core$clipboard?pasteFromData$$module$build$src$core$clipboard(stashedCopyData$$module$build$src$core$clipboard,stashedWorkspace$$module$build$src$core$clipboard):null};
|
|
421
424
|
pasteFromData$$module$build$src$core$clipboard=function(a,b,c){let d;b=b.isMutator?b:null!=(d=b.getRootWorkspace())?d:b;let e,f;return null!=(f=null==(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a.paster,!1))?void 0:e.paste(a,b,c))?f:null};duplicateInternal$$module$build$src$core$clipboard=function(a){const b=a.toCopyData();return b?paste$$module$build$src$core$clipboard(b,a.workspace):null};
|
|
422
|
-
isCopyable$$module$build$src$core$interfaces$i_copyable=function(a){return
|
|
423
|
-
registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;return!a.isReadOnly()&&null!=b&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!Gesture$$module$build$src$core$gesture.inProgress()},callback(a,b,c,d){b.preventDefault();
|
|
424
|
-
a.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),a.dispose(),$.setGroup$$module$build$src$core$events$utils(!1));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE]})};
|
|
425
|
-
isCopyable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.
|
|
425
|
+
isCopyable$$module$build$src$core$interfaces$i_copyable=function(a){return a&&"function"===typeof a.toCopyData};registerEscape$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.ESCAPE,preconditionFn(a){return!a.isReadOnly()},callback(a){a.hideChaff();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ESC]})};
|
|
426
|
+
registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;return!a.isReadOnly()&&null!=b&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!Gesture$$module$build$src$core$gesture.inProgress()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(a,b,c,d){b.preventDefault();
|
|
427
|
+
a=d.focusedNode;a instanceof BlockSvg$$module$build$src$core$block_svg?a.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),a.dispose(),$.setGroup$$module$build$src$core$events$utils(!1));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE]})};
|
|
428
|
+
isCopyable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&isDraggable$$module$build$src$core$interfaces$i_draggable(a)?a.isCopyable?a.isCopyable():a instanceof BlockSvg$$module$build$src$core$block_svg||a instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment?a.isOwnDeletable()&&a.isOwnMovable():a.isDeletable()&&a.isMovable():!1};
|
|
429
|
+
isCuttable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$shortcut_items(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()};
|
|
426
430
|
registerCopy$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.COPY,
|
|
427
|
-
preconditionFn(c,d){d=d.focusedNode;return
|
|
428
|
-
d.
|
|
431
|
+
preconditionFn(c,d){d=d.focusedNode;c=c.isFlyout?c.targetWorkspace:c;return!!d&&!!c&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&isCopyable$$module$build$src$core$shortcut_items(d)},callback(c,d,e,f){d.preventDefault();d=f.focusedNode;if(!d||!isCopyable$$module$build$src$core$interfaces$i_copyable(d)||!isCopyable$$module$build$src$core$shortcut_items(d))return!1;c=c.isFlyout?c.targetWorkspace:c;if(!c)return!1;d.workspace.isFlyout||c.hideChaff();
|
|
432
|
+
copyData$$module$build$src$core$shortcut_items=d.toCopyData();copyCoords$$module$build$src$core$shortcut_items=isDraggable$$module$build$src$core$interfaces$i_draggable(d)&&d.workspace==c?d.getRelativeToSurfaceXY():null;return!!copyData$$module$build$src$core$shortcut_items},keyCodes:[a,b]})};
|
|
429
433
|
registerCut$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CUT,
|
|
430
|
-
preconditionFn(c,d){d=d.focusedNode;return
|
|
431
|
-
|
|
434
|
+
preconditionFn(c,d){d=d.focusedNode;return!!d&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&isCuttable$$module$build$src$core$shortcut_items(d)},callback(c,d,e,f){c=f.focusedNode;if(!c||!isCuttable$$module$build$src$core$shortcut_items(c)||!isCopyable$$module$build$src$core$interfaces$i_copyable(c))return!1;copyData$$module$build$src$core$shortcut_items=c.toCopyData();copyCoords$$module$build$src$core$shortcut_items=isDraggable$$module$build$src$core$interfaces$i_draggable(c)?
|
|
435
|
+
c.getRelativeToSurfaceXY():null;c instanceof BlockSvg$$module$build$src$core$block_svg?c.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(c)&&c.dispose();return!!copyData$$module$build$src$core$shortcut_items},keyCodes:[a,b]})};
|
|
432
436
|
registerPaste$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PASTE,
|
|
433
|
-
preconditionFn(c){return
|
|
434
|
-
|
|
435
|
-
|
|
437
|
+
preconditionFn(c){c=c.isFlyout?c.targetWorkspace:c;return!!copyData$$module$build$src$core$shortcut_items&&!!c&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){if(!copyData$$module$build$src$core$shortcut_items)return!1;c=c.isFlyout?c.targetWorkspace:c;if(!c||c.isReadOnly())return!1;if(d instanceof PointerEvent)return d=screenToWsCoordinates$$module$build$src$core$utils$svg_math(c,new Coordinate$$module$build$src$core$utils$coordinate(d.clientX,
|
|
438
|
+
d.clientY)),!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,c,d);if(!copyCoords$$module$build$src$core$shortcut_items)return!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,c);const {left:e,top:f,width:g,height:h}=c.getMetricsManager().getViewMetrics(!0);if((new Rect$$module$build$src$core$utils$rect(f,f+h,e,e+g)).contains(copyCoords$$module$build$src$core$shortcut_items.x,copyCoords$$module$build$src$core$shortcut_items.y))return!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,
|
|
439
|
+
c);d=new Coordinate$$module$build$src$core$utils$coordinate(e+g/2,f+h/2);return!!paste$$module$build$src$core$clipboard(copyData$$module$build$src$core$shortcut_items,c,d)},keyCodes:[a,b]})};
|
|
436
440
|
registerUndo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.UNDO,
|
|
437
|
-
preconditionFn(c){return!c.isReadOnly()&&!Gesture$$module$build$src$core$gesture.inProgress()},callback(c,d){c.hideChaff();c.undo(!1);d.preventDefault();return!0},keyCodes:[a,b]})};
|
|
438
|
-
registerRedo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.
|
|
439
|
-
KeyCodes$$module$build$src$core$utils$keycodes.
|
|
440
|
-
d.undo(!0);e.preventDefault();return!0},keyCodes:[a,b,c]})};registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){registerEscape$$module$build$src$core$shortcut_items();registerDelete$$module$build$src$core$shortcut_items();registerCopy$$module$build$src$core$shortcut_items();registerCut$$module$build$src$core$shortcut_items();registerPaste$$module$build$src$core$shortcut_items();registerUndo$$module$build$src$core$shortcut_items();registerRedo$$module$build$src$core$shortcut_items()};
|
|
441
|
+
preconditionFn(c){return!c.isReadOnly()&&!Gesture$$module$build$src$core$gesture.inProgress()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){c.hideChaff();c.undo(!1);d.preventDefault();return!0},keyCodes:[a,b]})};
|
|
442
|
+
registerRedo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL,KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.META,
|
|
443
|
+
KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]),c=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Y,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.REDO,preconditionFn(d){return!Gesture$$module$build$src$core$gesture.inProgress()&&!d.isReadOnly()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},
|
|
444
|
+
callback(d,e){d.hideChaff();d.undo(!0);e.preventDefault();return!0},keyCodes:[a,b,c]})};registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){registerEscape$$module$build$src$core$shortcut_items();registerDelete$$module$build$src$core$shortcut_items();registerCopy$$module$build$src$core$shortcut_items();registerCut$$module$build$src$core$shortcut_items();registerPaste$$module$build$src$core$shortcut_items();registerUndo$$module$build$src$core$shortcut_items();registerRedo$$module$build$src$core$shortcut_items()};
|
|
441
445
|
saveProcedure$$module$build$src$core$serialization$procedures=function(a){const b=a.saveState();if(!a.getParameters().length)return b;b.parameters=a.getParameters().map(c=>c.saveState());return b};loadProcedure$$module$build$src$core$serialization$procedures=function(a,b,c,d){a=a.loadState(c,d);if(!c.parameters)return a;for(const [e,f]of c.parameters.entries())a.insertParameter(b.loadState(f,d),e);return a};
|
|
442
446
|
save$$module$build$src$core$serialization$workspaces=function(a){const b=Object.create(null),c=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);for(const d in c){let e;const f=null==(e=c[d])?void 0:e.save(a);f&&(b[d]=f)}return b};
|
|
443
447
|
load$$module$build$src$core$serialization$workspaces=function(a,b,{recordUndo:c=!1}={}){var d=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);if(d){d=Object.entries(d).sort((f,g)=>g[1].priority-f[1].priority);var e=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(c);(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);startTextWidthCache$$module$build$src$core$utils$dom();
|
|
@@ -492,9 +496,9 @@ b.moveTo(pixelsToWorkspaceCoords$$module$build$src$core$contextmenu_items(new Co
|
|
|
492
496
|
pixelsToWorkspaceCoords$$module$build$src$core$contextmenu_items=function(a,b){var c=b.getInjectionDiv().getBoundingClientRect();a=new Coordinate$$module$build$src$core$utils$coordinate(a.x-c.left,a.y-c.top);c=b.getOriginOffsetInPixels();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,c);a.scale(1/b.scale);return a};
|
|
493
497
|
registerBlockOptions_$$module$build$src$core$contextmenu_items=function(){registerDuplicate$$module$build$src$core$contextmenu_items();registerComment$$module$build$src$core$contextmenu_items();registerInline$$module$build$src$core$contextmenu_items();registerCollapseExpandBlock$$module$build$src$core$contextmenu_items();registerDisable$$module$build$src$core$contextmenu_items();registerDelete$$module$build$src$core$contextmenu_items();registerHelp$$module$build$src$core$contextmenu_items()};
|
|
494
498
|
registerCommentOptions$$module$build$src$core$contextmenu_items=function(){registerCommentDuplicate$$module$build$src$core$contextmenu_items();registerCommentDelete$$module$build$src$core$contextmenu_items();registerCommentCreate$$module$build$src$core$contextmenu_items()};registerDefaultOptions$$module$build$src$core$contextmenu_items=function(){registerWorkspaceOptions_$$module$build$src$core$contextmenu_items();registerBlockOptions_$$module$build$src$core$contextmenu_items()};
|
|
495
|
-
isPaster$$module$build$src$core$interfaces$i_paster=function(a){return
|
|
496
|
-
isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree=function(a){return a&&"
|
|
497
|
-
$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
|
|
499
|
+
isPaster$$module$build$src$core$interfaces$i_paster=function(a){return a&&"function"===typeof a.paste};isRenderedElement$$module$build$src$core$interfaces$i_rendered_element=function(a){return a&&"function"===typeof a.getSvgRoot};isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item=function(a){return a.isSelectable()};hideChaff$$module$build$src$core$blockly=function(a){getMainWorkspace$$module$build$src$core$common().hideChaff(a)};
|
|
500
|
+
isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree=function(a){return a&&"function"===typeof a.getRootFocusableNode&&"function"===typeof a.getRestoredFocusableNode&&"function"===typeof a.getNestedTrees&&"function"===typeof a.lookUpFocusableNode&&"function"===typeof a.onTreeFocus&&"function"===typeof a.onTreeBlur};$jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
|
501
|
+
$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
|
|
498
502
|
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
|
|
499
503
|
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b,c){if(!c||null!=a){c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]}};$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};
|
|
500
504
|
$jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
|
|
@@ -563,12 +567,12 @@ b;return null!=(b=null==(a=this.focusedNode)?void 0:a.getFocusableTree())?b:null
|
|
|
563
567
|
const b=!this.currentlyHoldsEphemeralFocus;b&&(this.isUpdatingFocusedNode=!0);var c,d=(null==(c=this.focusedNode)?void 0:c.getFocusableElement())!==document.activeElement;if(this.focusedNode!==a||d)if(a.canBeFocused()){d=a.getFocusableTree();if(!this.isRegistered(d))throw Error(`Attempted to focus unregistered node: ${a}.`);var e=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a.getFocusableElement(),d);c=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(d);
|
|
564
568
|
var f=a;if(e!==a){f=d.getRestoredFocusableNode(c);a=d.getRootFocusableNode();var g;f=null!=(g=null!=f?f:c)?g:a}a=this.focusedNode;g=null==a?void 0:a.getFocusableTree();a&&this.passivelyFocusNode(a,d);d=d.getRootFocusableNode();c&&this.removeHighlight(c);d!==f&&this.removeHighlight(d);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(f,null!=g?g:null);this.updateFocusedNode(f)}else console.warn("Trying to focus a node that can't be focused.");b&&(this.isUpdatingFocusedNode=!1)}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();
|
|
565
569
|
if(this.currentlyHoldsEphemeralFocus)throw Error("Attempted to take ephemeral focus when it's already held, "+`with new element: ${a}.`);this.currentlyHoldsEphemeralFocus=!0;this.focusedNode&&this.passivelyFocusNode(this.focusedNode,null);a.focus();let b=!1;return()=>{if(b)throw Error("Attempted to finish ephemeral focus twice for element: "+`${a}.`);b=!0;this.currentlyHoldsEphemeralFocus=!1;if(this.focusedNode){this.activelyFocusNode(this.focusedNode,null);const c=this.focusedNode;setTimeout(()=>
|
|
566
|
-
{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback.");}updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&!this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,
|
|
567
|
-
b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree(),d=a.getFocusableElement();let e;const f=null==(e=this.lookUpRegistration(c))?void 0:e.rootShouldBeAutoTabbable;c!==b&&(c.onTreeFocus(a,b),f&&(c.getRootFocusableNode().getFocusableElement().tabIndex=-1));a.onNodeFocus();this.lockFocusStateChanges=!1;f&&a===c.getRootFocusableNode()||d.hasAttribute("tabindex")||(d.tabIndex=-1);this.setNodeToVisualActiveFocus(a);d.focus()}passivelyFocusNode(a,
|
|
568
|
-
if(c!==b){c.onTreeBlur(b);let d;if(null==(d=this.lookUpRegistration(c))?0:d.rootShouldBeAutoTabbable)c.getRootFocusableNode().getFocusableElement().tabIndex=0}a.onNodeBlur();this.lockFocusStateChanges=!1;c!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a=a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,
|
|
569
|
-
a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}removeHighlight(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);
|
|
570
|
-
FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}static getFocusManager(){FocusManager$$module$build$src$core$focus_manager.focusManager||(FocusManager$$module$build$src$core$focus_manager.focusManager=new FocusManager$$module$build$src$core$focus_manager(document.addEventListener));return FocusManager$$module$build$src$core$focus_manager.focusManager}};
|
|
571
|
-
FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusManager$$module$build$src$core$focus_manager.focusManager=null;var module$build$src$core$focus_manager={};module$build$src$core$focus_manager.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$focus_manager.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;var module$build$src$core$interfaces$i_focusable_node={};module$build$src$core$interfaces$i_focusable_node.isFocusableNode=isFocusableNode$$module$build$src$core$interfaces$i_focusable_node;var module$build$src$core$interfaces$i_selectable={};module$build$src$core$interfaces$i_selectable.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;var ShortcutRegistry$$module$build$src$core$shortcut_registry=class{constructor(){this.shortcuts=new Map;this.keyMap=new Map;this.reset()}reset(){this.shortcuts.clear();this.keyMap.clear()}register(a,b){if(this.shortcuts.get(a.name)&&!b)throw Error(`Shortcut named "${a.name}" already exists.`);this.shortcuts.set(a.name,a);b=a.keyCodes;if(null==b?0:b.length)for(const c of b)this.addKeyMapping(c,a.name,!!a.allowCollision)}unregister(a){if(!this.shortcuts.get(a))return console.warn(`Keyboard shortcut named "${a}" not found.`),
|
|
570
|
+
{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ephemeralFocusTaken(){return this.currentlyHoldsEphemeralFocus}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback.");}updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&!this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,
|
|
571
|
+
null),this.updateFocusedNode(null))}activelyFocusNode(a,b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree(),d=a.getFocusableElement();let e;const f=null==(e=this.lookUpRegistration(c))?void 0:e.rootShouldBeAutoTabbable;c!==b&&(c.onTreeFocus(a,b),f&&(c.getRootFocusableNode().getFocusableElement().tabIndex=-1));a.onNodeFocus();this.lockFocusStateChanges=!1;f&&a===c.getRootFocusableNode()||d.hasAttribute("tabindex")||(d.tabIndex=-1);this.setNodeToVisualActiveFocus(a);d.focus()}passivelyFocusNode(a,
|
|
572
|
+
b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree();if(c!==b){c.onTreeBlur(b);let d;if(null==(d=this.lookUpRegistration(c))?0:d.rootShouldBeAutoTabbable)c.getRootFocusableNode().getFocusableElement().tabIndex=0}a.onNodeBlur();this.lockFocusStateChanges=!1;c!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a=a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,
|
|
573
|
+
FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}setNodeToVisualPassiveFocus(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}removeHighlight(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);
|
|
574
|
+
removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}static getFocusManager(){FocusManager$$module$build$src$core$focus_manager.focusManager||(FocusManager$$module$build$src$core$focus_manager.focusManager=new FocusManager$$module$build$src$core$focus_manager(document.addEventListener));return FocusManager$$module$build$src$core$focus_manager.focusManager}};
|
|
575
|
+
FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyActiveFocus";FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusManager$$module$build$src$core$focus_manager.focusManager=null;var module$build$src$core$focus_manager={};module$build$src$core$focus_manager.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$focus_manager.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;var module$build$src$core$interfaces$i_focusable_node={};module$build$src$core$interfaces$i_focusable_node.isFocusableNode=isFocusableNode$$module$build$src$core$interfaces$i_focusable_node;var module$build$src$core$interfaces$i_selectable={};module$build$src$core$interfaces$i_selectable.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;var ShortcutRegistry$$module$build$src$core$shortcut_registry=class{constructor(){this.shortcuts=new Map;this.keyMap=new Map;this.reset()}reset(){this.shortcuts.clear();this.keyMap.clear()}register(a,b){if(this.shortcuts.get(a.name)&&!b)throw Error(`Shortcut named "${a.name}" already exists.`);this.shortcuts.set(a.name,a);b=a.keyCodes;if(null==b?0:b.length)for(const c of b)this.addKeyMapping(c,a.name,!!a.allowCollision)}unregister(a){if(!this.shortcuts.get(a))return console.warn(`Keyboard shortcut named "${a}" not found.`),
|
|
572
576
|
!1;this.removeAllKeyMappings(a);this.shortcuts.delete(a);return!0}addKeyMapping(a,b,c){a=`${a}`;const d=this.keyMap.get(a);if(d&&!c)throw Error(`Shortcut named "${b}" collides with shortcuts "${d}"`);d&&c?d.unshift(b):this.keyMap.set(a,[b])}removeKeyMapping(a,b,c){const d=this.keyMap.get(a);if(!d)return c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`),!1;const e=d.indexOf(b);if(-1<e)return d.splice(e,1),0===d.length&&this.keyMap.delete(a),!0;c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`);
|
|
573
577
|
return!1}removeAllKeyMappings(a){for(const b of this.keyMap.keys())this.removeKeyMapping(b,a,!0)}setKeyMap(a){this.keyMap.clear();for(const b in a)this.keyMap.set(b,a[b])}getKeyMap(){const a=Object.create(null);for(const [b,c]of this.keyMap)a[b]=c;return a}getRegistry(){const a=Object.create(null);for(const [b,c]of this.shortcuts)a[b]=c;return deepMerge$$module$build$src$core$utils$object(Object.create(null),a)}onKeyDown(a,b){var c=this.serializeKeyEvent(b);c=this.getShortcutNamesByKeyCode(c);if(!c)return!1;
|
|
574
578
|
for(const d of c){c=this.shortcuts.get(d);let e;if(!c||c.preconditionFn&&!c.preconditionFn(a,{focusedNode:null!=(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())?e:void 0}))continue;let f,g,h;if(null==(g=(f=c).callback)?0:g.call(f,a,b,c,{focusedNode:null!=(h=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())?h:void 0}))return!0}return!1}getShortcutNamesByKeyCode(a){let b;return(null==(b=this.keyMap.get(a))?void 0:b.slice())||[]}getKeyCodesByShortcutName(a){const b=
|
|
@@ -755,41 +759,44 @@ d.preconditionFn(a,b);if("hidden"===f)continue;const g="function"===typeof d.dis
|
|
|
755
759
|
module$build$src$core$contextmenu_registry.ContextMenuRegistry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry;module$build$src$core$contextmenu_registry.ScopeType=ScopeType$$module$build$src$core$contextmenu_registry;var BLOCK$$module$build$src$core$layers=50,BUBBLE$$module$build$src$core$layers=100,module$build$src$core$layers={BLOCK:BLOCK$$module$build$src$core$layers,BUBBLE:BUBBLE$$module$build$src$core$layers};var CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy=class{constructor(a){this.comment=a;this.startLoc=null;this.workspace=a.workspace}isMovable(){return this.comment.isOwnMovable()&&!this.comment.isDeadOrDying()&&!this.workspace.isReadOnly()}startDrag(){this.fireDragStartEvent();this.startLoc=this.comment.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;null==(a=this.workspace.getLayerManager())||a.moveToDragLayer(this.comment);this.comment.setDragging(!0)}drag(a){this.comment.moveDuringDrag(a)}endDrag(){this.fireDragEndEvent();
|
|
756
760
|
this.fireMoveEvent();let a;null==(a=this.workspace.getLayerManager())||a.moveOffDragLayer(this.comment,BLOCK$$module$build$src$core$layers);this.comment.setDragging(!1);this.comment.snapToGrid();this.workspace.setResizesEnabled(!0)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,!0);fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,
|
|
757
761
|
!1);fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.comment.isDeadOrDying()){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this.comment);a.setReason(["drag"]);a.oldCoordinate_=this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}revertDrag(){this.startLoc&&this.comment.moveDuringDrag(this.startLoc)}},module$build$src$core$dragging$comment_drag_strategy={};
|
|
758
|
-
module$build$src$core$dragging$comment_drag_strategy.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;var workspaceToDragDelta$$module$build$src$core$utils$drag=new WeakMap,module$build$src$core$utils$drag={};module$build$src$core$utils$drag.move=move$$module$build$src$core$utils$drag;module$build$src$core$utils$drag.start=start$$module$build$src$core$utils$drag;var
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
a)
|
|
763
|
-
|
|
764
|
-
"
|
|
765
|
-
this
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
this.
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
a.
|
|
773
|
-
|
|
774
|
-
1)}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
762
|
+
module$build$src$core$dragging$comment_drag_strategy.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;var workspaceToDragDelta$$module$build$src$core$utils$drag=new WeakMap,module$build$src$core$utils$drag={};module$build$src$core$utils$drag.move=move$$module$build$src$core$utils$drag;module$build$src$core$utils$drag.start=start$$module$build$src$core$utils$drag;var COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor="_comment_textarea_",CommentEditor$$module$build$src$core$comments$comment_editor=class{constructor(a,b,c){this.workspace=a;this.onFinishEditing=c;this.textChangeListeners=[];this.text="";this.foreignObject=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{"class":"blocklyCommentForeignObject"});a=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");
|
|
763
|
+
a.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);a.className="blocklyMinimalBody";this.textArea=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyCommentText");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyTextarea");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyText");a.appendChild(this.textArea);this.foreignObject.appendChild(a);b&&(this.id=b+COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor,
|
|
764
|
+
this.textArea.setAttribute("id",this.id));conditionalBind$$module$build$src$core$browser_events(this.textArea,"change",this,this.onTextChange);conditionalBind$$module$build$src$core$browser_events(this.textArea,"pointerdown",this,d=>{d.stopPropagation();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this);clearTouchIdentifier$$module$build$src$core$touch()});conditionalBind$$module$build$src$core$browser_events(this.textArea,"keydown",this,this.handleKeyDown)}getDom(){return this.foreignObject}getText(){return this.text}setText(a){this.textArea.value=
|
|
765
|
+
a;this.onTextChange()}onTextChange(){const a=this.text;this.text=this.textArea.value;for(let b=this.textChangeListeners.length-1;0<=b;b--)this.textChangeListeners[b](a,this.text)}handleKeyDown(a){if("Escape"===a.key||"Enter"===a.key&&(a.ctrlKey||a.metaKey)){if(this.onFinishEditing)this.onFinishEditing();a.stopPropagation()}}addTextChangeListener(a){this.textChangeListeners.push(a)}removeTextChangeListener(a){this.textChangeListeners.splice(this.textChangeListeners.indexOf(a),1)}setPlaceholderText(a){this.textArea.placeholder=
|
|
766
|
+
a}setEditable(a){a?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","true")}updateSize(a,b){this.foreignObject.setAttribute("height",`${a.height-b.height}`);this.foreignObject.setAttribute("width",`${a.width}`);this.foreignObject.setAttribute("y",`${b.height}`);this.workspace.RTL&&this.foreignObject.setAttribute("x",`${-a.width}`)}getFocusableElement(){return this.textArea}getFocusableTree(){return this.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return this.id?
|
|
767
|
+
!0:!1}},module$build$src$core$comments$comment_editor={COMMENT_EDITOR_FOCUS_IDENTIFIER:COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor};module$build$src$core$comments$comment_editor.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;var CommentView$$module$build$src$core$comments$comment_view=class{constructor(a,b){this.workspace=a;this.commentId=b;this.collapsed=!1;this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.sizeChangeListeners=[];this.disposeListeners=[];this.collapseChangeListeners=[];this.resizePointerMoveListener=this.resizePointerUpListener=null;this.disposed=this.disposing=!1;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
768
|
+
{"class":"blocklyComment blocklyEditable blocklyDraggable"});this.highlightRect=this.createHighlightRect(this.svgRoot);({topBarGroup:this.topBarGroup,topBarBackground:this.topBarBackground,deleteIcon:this.deleteIcon,foldoutIcon:this.foldoutIcon,textPreview:this.textPreview,textPreviewNode:this.textPreviewNode}=this.createTopBar(this.svgRoot,a));this.commentEditor=this.createTextArea();this.resizeHandle=this.createResizeHandle(this.svgRoot,a);let c;null==(c=a.getLayerManager())||c.append(this,BLOCK$$module$build$src$core$layers);
|
|
769
|
+
this.size=CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize;this.setSizeWithoutFiringEvents(this.size);this.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(0,0))}createHighlightRect(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentHighlight"},a)}createTopBar(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyCommentTopbar"},
|
|
770
|
+
a);const c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentTopbarBackground"},a),d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyDeleteIcon",href:`${b.options.pathToMedia}delete-icon.svg`},a);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyFoldoutIcon",href:`${b.options.pathToMedia}foldout-icon.svg`},a);
|
|
771
|
+
const e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyCommentPreview blocklyCommentText blocklyText"},a),f=document.createTextNode("");e.appendChild(f);conditionalBind$$module$build$src$core$browser_events(b,"pointerdown",this,this.onFoldoutDown);conditionalBind$$module$build$src$core$browser_events(d,"pointerdown",this,this.onDeleteDown);return{topBarGroup:a,topBarBackground:c,deleteIcon:d,foldoutIcon:b,textPreview:e,textPreviewNode:f}}createTextArea(){const a=
|
|
772
|
+
new CommentEditor$$module$build$src$core$comments$comment_editor(this.workspace,this.commentId,()=>this.svgRoot.focus());this.svgRoot.appendChild(a.getDom());a.addTextChangeListener((b,c)=>{this.updateTextPreview(c);this.setSize(this.size)});return a}getEditorFocusableNode(){return this.commentEditor}createResizeHandle(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},
|
|
773
|
+
a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}getSvgRoot(){return this.svgRoot}getSize(){return this.collapsed?this.topBarBackground.getBBox():this.size}setSizeWithoutFiringEvents(a){const b=this.topBarBackground.getBBox(),c=this.deleteIcon.getBBox(),d=this.foldoutIcon.getBBox(),e=this.textPreview.getBBox(),f=this.resizeHandle.getBBox();this.size=a=Size$$module$build$src$core$utils$size.max(a,this.calcMinSize(b,d,c));this.svgRoot.setAttribute("height",
|
|
774
|
+
`${a.height}`);this.svgRoot.setAttribute("width",`${a.width}`);this.updateHighlightRect(a);this.updateTopBarSize(a);this.commentEditor.updateSize(a,b);this.updateDeleteIconPosition(a,b,c);this.updateFoldoutIconPosition(b,d);this.updateTextPreviewSize(a,b,e,c,f);this.updateResizeHandlePosition(a,f)}setSize(a){const b=this.preResizeSize||this.size;this.setSizeWithoutFiringEvents(a);this.onSizeChange(b,this.size)}calcMinSize(a,b,c){var d;this.updateTextPreview(null!=(d=this.commentEditor.getText())?
|
|
775
|
+
d:"");d=getTextWidth$$module$build$src$core$utils$dom(this.textPreview);const e=this.calcFoldoutMargin(a,b),f=this.calcDeleteMargin(a,c);let g=d;this.foldoutIcon.checkVisibility()?g+=b.width+2*e:d&&(g+=4);this.deleteIcon.checkVisibility()?g+=c.width+2*f:d&&(g+=4);return new Size$$module$build$src$core$utils$size(g,a.height+20)}calcDeleteMargin(a,b){return(a.height-b.height)/2}calcFoldoutMargin(a,b){return(a.height-b.height)/2}updateHighlightRect(a){this.highlightRect.setAttribute("height",`${a.height}`);
|
|
776
|
+
this.highlightRect.setAttribute("width",`${a.width}`);this.workspace.RTL&&this.highlightRect.setAttribute("x",`${-a.width}`)}updateTopBarSize(a){this.topBarBackground.setAttribute("width",`${a.width}`)}updateDeleteIconPosition(a,b,c){b=this.calcDeleteMargin(b,c);this.deleteIcon.setAttribute("y",`${b}`);this.deleteIcon.setAttribute("x",`${a.width-c.width-b}`)}updateFoldoutIconPosition(a,b){a=this.calcFoldoutMargin(a,b);this.foldoutIcon.setAttribute("y",`${a}`);this.foldoutIcon.setAttribute("x",`${a}`)}updateTextPreviewSize(a,
|
|
777
|
+
b,c,d,e){const f=(b.height-c.height)/2,g=this.calcDeleteMargin(b,d);b=this.calcFoldoutMargin(b,e);a=a.width-e.width-2*b-d.width-2*g;this.textPreview.setAttribute("x",`${e.width+2*b*(this.workspace.RTL?-1:1)}`);this.textPreview.setAttribute("y",`${f+c.height/2}`);this.textPreview.setAttribute("width",`${a}`)}updateResizeHandlePosition(a,b){this.resizeHandle.setAttribute("y",`${a.height-b.height}`);this.resizeHandle.setAttribute("x",`${a.width-b.width}`)}onSizeChange(a,b){for(let c=this.sizeChangeListeners.length-
|
|
778
|
+
1;0<=c;c--)this.sizeChangeListeners[c](a,b)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}removeSizeChangeListener(a){this.sizeChangeListeners.splice(this.sizeChangeListeners.indexOf(a),1)}onResizePointerDown(a){this.isEditable()&&(this.bringToFront(),isRightButton$$module$build$src$core$browser_events(a)||(this.preResizeSize=this.getSize(),start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:
|
|
779
|
+
this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),a.stopPropagation())}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),
|
|
780
|
+
this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null);this.setSize(this.size);this.preResizeSize=void 0}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSizeWithoutFiringEvents(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y))}isCollapsed(){return this.collapsed}setCollapsed(a){(this.collapsed=a)?addClass$$module$build$src$core$utils$dom(this.svgRoot,
|
|
781
|
+
"blocklyCollapsed"):removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCollapsed");this.setSizeWithoutFiringEvents(this.size);this.onCollapse()}onCollapse(){for(let a=this.collapseChangeListeners.length-1;0<=a;a--)this.collapseChangeListeners[a](this.collapsed)}addOnCollapseListener(a){this.collapseChangeListeners.push(a)}removeOnCollapseListener(a){this.collapseChangeListeners.splice(this.collapseChangeListeners.indexOf(a),1)}onFoldoutDown(a){clearTouchIdentifier$$module$build$src$core$touch();
|
|
782
|
+
this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(this.setCollapsed(!this.collapsed),this.workspace.hideChaff());a.stopPropagation()}isEditable(){return this.editable}setEditable(a){(this.editable=a)?(addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyEditable"),removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyReadonly")):(removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyEditable"),addClass$$module$build$src$core$utils$dom(this.svgRoot,
|
|
783
|
+
"blocklyReadonly"));this.commentEditor.setEditable(a)}getRelativeToSurfaceXY(){return this.location}moveTo(a){this.location=a;this.svgRoot.setAttribute("transform",`translate(${a.x}, ${a.y})`)}getText(){return this.commentEditor.getText()}setText(a){this.commentEditor.setText(a)}setPlaceholderText(a){this.commentEditor.setPlaceholderText(a)}addTextChangeListener(a){this.commentEditor.addTextChangeListener(a)}removeTextChangeListener(a){this.commentEditor.removeTextChangeListener(a)}updateTextPreview(a){this.textPreviewNode.textContent=
|
|
784
|
+
this.truncateText(a)}truncateText(a){return 12<=a.length?`${a.substring(0,9)}...`:a}bringToFront(){const a=this.svgRoot.parentNode,b=a.childNodes;b[b.length-1]!==this.svgRoot&&a.appendChild(this.svgRoot)}onDeleteDown(a){clearTouchIdentifier$$module$build$src$core$touch();isRightButton$$module$build$src$core$browser_events(a)||this.dispose();a.stopPropagation()}dispose(){this.disposing=!0;removeNode$$module$build$src$core$utils$dom(this.svgRoot);for(let a=this.disposeListeners.length-1;0<=a;a--)this.disposeListeners[a]();
|
|
785
|
+
this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||this.disposed}addDisposeListener(a){this.disposeListeners.push(a)}removeDisposeListener(a){this.disposeListeners.splice(this.disposeListeners.indexOf(a),1)}};CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize=new Size$$module$build$src$core$utils$size(120,100);register$$module$build$src$core$css("\n.injectionDiv {\n --commentFillColour: #FFFCC7;\n --commentBorderColour: #F2E49B;\n}\n\n.blocklyComment .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 1px solid var(--commentBorderColour);\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n\n.blocklyReadonly.blocklyComment .blocklyTextarea {\n cursor: inherit;\n}\n\n.blocklyDeleteIcon {\n width: 20px;\n height: 20px;\n display: none;\n cursor: pointer;\n}\n\n.blocklyFoldoutIcon {\n width: 20px;\n height: 20px;\n transform-origin: 12px 12px;\n cursor: pointer;\n}\n.blocklyResizeHandle {\n width: 12px;\n height: 12px;\n cursor: se-resize;\n}\n.blocklyReadonly.blocklyComment .blocklyResizeHandle {\n cursor: inherit;\n}\n\n.blocklyCommentTopbarBackground {\n fill: var(--commentBorderColour);\n height: 24px;\n}\n\n.blocklyComment .blocklyCommentPreview.blocklyText {\n fill: #000;\n dominant-baseline: middle;\n visibility: hidden;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyCommentPreview {\n visibility: visible;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyCommentForeignObject,\n.blocklyCollapsed.blocklyComment .blocklyResizeHandle {\n display: none;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyFoldoutIcon {\n transform: rotate(-90deg);\n}\n\n.blocklyRTL .blocklyCommentTopbar {\n transform: scale(-1, 1);\n}\n\n.blocklyRTL .blocklyCommentForeignObject {\n direction: rtl;\n}\n\n.blocklyRTL .blocklyCommentPreview {\n /* Revert the scale and control RTL using direction instead. */\n transform: scale(-1, 1);\n direction: rtl;\n}\n\n.blocklyRTL .blocklyResizeHandle {\n transform: scale(-1, 1);\n cursor: sw-resize;\n}\n\n.blocklyCommentHighlight {\n fill: none;\n}\n\n.blocklyCommentText.blocklyActiveFocus {\n border-color: #fc3;\n border-width: 2px;\n}\n\n.blocklySelected .blocklyCommentHighlight {\n stroke: #fc3;\n stroke-width: 3px;\n}\n\n.blocklyCollapsed.blocklySelected .blocklyCommentHighlight {\n stroke: none;\n}\n\n.blocklyCollapsed.blocklySelected .blocklyCommentTopbarBackground {\n stroke: #fc3;\n stroke-width: 3px;\n}\n");
|
|
779
786
|
var module$build$src$core$comments$comment_view={};module$build$src$core$comments$comment_view.CommentView=CommentView$$module$build$src$core$comments$comment_view;var WorkspaceComment$$module$build$src$core$comments$workspace_comment=class{constructor(a,b){this.workspace=a;this.text="";this.collapsed=!1;this.deletable=this.movable=this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.disposing=this.disposed=!1;this.id=b&&!a.getCommentById(b)?b:genUid$$module$build$src$core$utils$idgenerator();this.size=CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize;a.addTopComment(this);this.fireCreateEvent()}fireCreateEvent(){isEnabled$$module$build$src$core$events$utils()&&
|
|
780
787
|
fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CREATE))(this))}fireDeleteEvent(){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DELETE))(this))}fireChangeEvent(a,b){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CHANGE))(this,
|
|
781
788
|
a,b))}fireCollapseEvent(a){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE))(this,a))}setText(a){const b=this.text;this.text=a;this.fireChangeEvent(b,a)}getText(){return this.text}setSize(a){const b=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_RESIZE))(this);this.size=a;b.recordCurrentSizeAsNewSize();
|
|
782
|
-
fire$$module$build$src$core$events$utils(b)}getSize(){return this.size}setCollapsed(a){this.collapsed=a;this.fireCollapseEvent(a)}isCollapsed(){return this.collapsed}setEditable(a){this.editable=a}isEditable(){return this.isOwnEditable()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setMovable(a){this.movable=a}isMovable(){return this.isOwnMovable()&&!this.workspace.isReadOnly()}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&&
|
|
783
|
-
!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnDeletable(){return this.deletable}moveTo(a,b){const c=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this);b&&c.setReason(b);this.location=a;c.recordNew();fire$$module$build$src$core$events$utils(c)}getRelativeToSurfaceXY(){return this.location}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||
|
|
784
|
-
this.disposed}},module$build$src$core$comments$workspace_comment={};module$build$src$core$comments$workspace_comment.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment=class extends WorkspaceComment$$module$build$src$core$comments$workspace_comment{constructor(a,b){super(a,b);this.dragStrategy=new CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy(this);this.workspace=a;this.view=new CommentView$$module$build$src$core$comments$comment_view(a);this.view.setSize(this.getSize());this.view.setEditable(this.isEditable());this.view.getSvgRoot().setAttribute("data-id",
|
|
789
|
+
fire$$module$build$src$core$events$utils(b)}getSize(){return this.size}setCollapsed(a){this.collapsed=a;this.fireCollapseEvent(a)}isCollapsed(){return this.collapsed}setEditable(a){this.editable=a}isEditable(){return this.isOwnEditable()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setMovable(a){this.movable=a}isMovable(){return this.isOwnMovable()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&&
|
|
790
|
+
!this.isDeadOrDying()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnDeletable(){return this.deletable}moveTo(a,b){const c=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this);b&&c.setReason(b);this.location=a;c.recordNew();fire$$module$build$src$core$events$utils(c)}getRelativeToSurfaceXY(){return this.location}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||
|
|
791
|
+
this.disposed}},module$build$src$core$comments$workspace_comment={};module$build$src$core$comments$workspace_comment.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment=class extends WorkspaceComment$$module$build$src$core$comments$workspace_comment{constructor(a,b){super(a,b);this.dragStrategy=new CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy(this);this.workspace=a;this.view=new CommentView$$module$build$src$core$comments$comment_view(a,this.id);this.view.setSize(this.getSize());this.view.setEditable(this.isEditable());this.view.getSvgRoot().setAttribute("data-id",
|
|
785
792
|
this.id);this.view.getSvgRoot().setAttribute("id",this.id);this.addModelUpdateBindings();conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"pointerdown",this,this.startGesture);conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"wheel",this,c=>{c.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));this.view.addOnCollapseListener(()=>
|
|
786
793
|
void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(a){this.view.setText(a)}setPlaceholderText(a){this.view.setPlaceholderText(a)}setSize(a){this.view.setSize(a)}setCollapsed(a){this.view.setCollapsed(a)}setEditable(a){super.setEditable(a);this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const a=this.getRelativeToSurfaceXY();var b,
|
|
787
794
|
c;const d=null!=(c=null==(b=this.view)?void 0:b.getSize())?c:this.getSize();this.workspace.RTL?(b=a.x-d.width,c=a.x):(b=a.x,c=a.x+d.width);return new Rect$$module$build$src$core$utils$rect(a.y,a.y+d.height,b,c)}moveBy(a,b,c){const d=this.getRelativeToSurfaceXY();a=new Coordinate$$module$build$src$core$utils$coordinate(d.x+a,d.y+b);this.moveTo(a,c)}moveTo(a,b){super.moveTo(a,b);this.view.moveTo(a)}moveDuringDrag(a){this.location=a;this.view.moveTo(a)}setDragging(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
788
|
-
"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;const a=$.getFocusManager$$module$build$src$core$focus_manager();a.getFocusedNode()===this&&setTimeout(()=>a.focusTree(this.workspace),0);this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(
|
|
789
|
-
addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
790
|
-
"blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,
|
|
791
|
-
a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,
|
|
792
|
-
let a;null==(a=this.workspace.getLayerManager())||a.append(this,BLOCK$$module$build$src$core$layers)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={};module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
|
|
795
|
+
"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;const a=$.getFocusManager$$module$build$src$core$focus_manager();a.getFocusedNode()===this&&setTimeout(()=>a.focusTree(this.workspace),0);this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?
|
|
796
|
+
addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isCopyable(){return this.isOwnMovable()&&this.isOwnDeletable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
797
|
+
"blocklySelected");fireSelectedEvent$$module$build$src$core$common(this)}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,
|
|
798
|
+
focusedNode:this},a);let c;c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,
|
|
799
|
+
["snap"])}}}getEditorFocusableNode(){return this.view.getEditorFocusableNode()}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();let a;null==(a=this.workspace.getLayerManager())||a.append(this,BLOCK$$module$build$src$core$layers)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={};module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
|
|
793
800
|
module$build$src$core$xml.domToBlock=$.domToBlock$$module$build$src$core$xml;module$build$src$core$xml.domToBlockInternal=domToBlockInternal$$module$build$src$core$xml;module$build$src$core$xml.domToPrettyText=domToPrettyText$$module$build$src$core$xml;module$build$src$core$xml.domToText=domToText$$module$build$src$core$xml;module$build$src$core$xml.domToVariables=domToVariables$$module$build$src$core$xml;module$build$src$core$xml.domToWorkspace=$.domToWorkspace$$module$build$src$core$xml;
|
|
794
801
|
module$build$src$core$xml.loadWorkspaceComment=loadWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.saveWorkspaceComment=saveWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.variablesToDom=variablesToDom$$module$build$src$core$xml;module$build$src$core$xml.workspaceToDom=workspaceToDom$$module$build$src$core$xml;var BlockCreate$$module$build$src$core$events$events_block_create=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.xml=blockToDomWithXY$$module$build$src$core$xml(a),this.ids=getDescendantIds$$module$build$src$core$events$utils(a),this.json=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0}))}toJson(){const a=super.toJson();
|
|
795
802
|
if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,
|
|
@@ -861,11 +868,12 @@ Bubble$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS=1;Bubble$$module$bui
|
|
|
861
868
|
this.contentContainer);a.parentWorkspace=this.workspace;this.miniWorkspace=this.newWorkspaceSvg(new Options$$module$build$src$core$options(a));this.miniWorkspace.internalIsMutator=!0;a=this.miniWorkspace.createDom("blocklyMutatorBackground");this.svgDialog.appendChild(a);b.languageTree&&(a.insertBefore(this.miniWorkspace.addFlyout(Svg$$module$build$src$core$utils$svg.G),this.miniWorkspace.getCanvas()),a=this.miniWorkspace.getFlyout(),null==a||a.init(this.miniWorkspace),null==a||a.show(b.languageTree));
|
|
862
869
|
addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMiniWorkspaceBubble");this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let e,f;null==(e=this.miniWorkspace.getFlyout())||null==(f=e.getWorkspace())||f.addChangeListener(this.onWorkspaceChange.bind(this));this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose();super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(a){this.miniWorkspace.addChangeListener(a)}validateWorkspaceOptions(a){if(a.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");
|
|
863
870
|
if(a.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(a.zoomOptions.controls||a.zoomOptions.wheel||a.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(a.moveOptions.scrollbars||a.moveOptions.wheel||a.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(a.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts");}onWorkspaceChange(){this.bumpBlocksIntoBounds();
|
|
864
|
-
this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const a of this.miniWorkspace.getTopBlocks(!1)){const b=a.getRelativeToSurfaceXY();20>b.y&&a.moveBy(0,20-b.y);if(a.RTL){let c=-20;const d=this.miniWorkspace.getFlyout();d&&(c-=d.getWidth());b.x>c&&a.moveBy(c-b.x,0)}else 20>b.x&&a.moveBy(20-b.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){
|
|
865
|
-
Math.abs(a.height-b.height)<MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE||(this.svgDialog.setAttribute("width",`${b.width}px`),this.svgDialog.setAttribute("height",`${b.height}px`),this.miniWorkspace.setCachedParentSvgSize(b.width,b.height),
|
|
866
|
-
b.height+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var a=this.miniWorkspace.getCanvas().getBBox();let b=a.width+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;
|
|
867
|
-
a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core$utils$size(b,a)}updateBlockStyles(){for(var a of this.miniWorkspace.getAllBlocks(!1))a.setStyle(a.getStyleName());let b;if(a=null==(b=this.miniWorkspace.getFlyout())?void 0:b.getWorkspace())for(const c of a.getAllBlocks(!1))c.setStyle(c.getStyleName())}moveDuringDrag(a){super.moveDuringDrag(a);
|
|
868
|
-
}};MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE=10;MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN=3*Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;var module$build$src$core$bubbles$mini_workspace_bubble={};
|
|
871
|
+
this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging()||this.miniWorkspace.keyboardMoveInProgress)for(const a of this.miniWorkspace.getTopBlocks(!1)){const b=a.getRelativeToSurfaceXY();20>b.y&&a.moveBy(0,20-b.y);if(a.RTL){let c=-20;const d=this.miniWorkspace.getFlyout();d&&(c-=d.getWidth());b.x>c&&a.moveBy(c-b.x,0)}else 20>b.x&&a.moveBy(20-b.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()||this.miniWorkspace.keyboardMoveInProgress){this.autoLayout&&(this.autoLayout=
|
|
872
|
+
!this.miniWorkspace.keyboardMoveInProgress);var a=this.getSize(),b=this.calculateWorkspaceSize();Math.abs(a.width-b.width)<MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE&&Math.abs(a.height-b.height)<MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE||(this.svgDialog.setAttribute("width",`${b.width}px`),this.svgDialog.setAttribute("height",`${b.height}px`),this.miniWorkspace.setCachedParentSvgSize(b.width,b.height),
|
|
873
|
+
this.miniWorkspace.RTL&&this.miniWorkspace.getCanvas().setAttribute("transform",`translate(${b.width}, 0)`),this.setSize(new Size$$module$build$src$core$utils$size(b.width+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,b.height+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var a=this.miniWorkspace.getCanvas().getBBox();let b=a.width+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;
|
|
874
|
+
a=a.height+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;const c=this.miniWorkspace.getFlyout();if(c){const d=c.getWorkspace().getMetricsManager().getScrollMetrics();a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core$utils$size(b,a)}updateBlockStyles(){for(var a of this.miniWorkspace.getAllBlocks(!1))a.setStyle(a.getStyleName());let b;if(a=null==(b=this.miniWorkspace.getFlyout())?void 0:b.getWorkspace())for(const c of a.getAllBlocks(!1))c.setStyle(c.getStyleName())}moveDuringDrag(a){super.moveDuringDrag(a);
|
|
875
|
+
this.autoLayout=!1}moveTo(a,b){super.moveTo(a,b);this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(a){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts");}};MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE=10;MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN=3*Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;var module$build$src$core$bubbles$mini_workspace_bubble={};
|
|
876
|
+
module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;var Icon$$module$build$src$core$icons$icon=class{constructor(a){this.sourceBlock=a;this.offsetInBlock=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspaceLocation=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.svgRoot=null;this.tooltip=a;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}getType(){throw Error("Icons must implement getType");}initView(a){if(!this.svgRoot){var b=this.sourceBlock;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
869
877
|
{"class":"blocklyIconGroup",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot)}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,0)}setTooltip(a){this.tooltip=
|
|
870
878
|
null!=a?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){let a;
|
|
871
879
|
null==(a=this.svgRoot)||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){const a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getSourceBlock(){return this.sourceBlock}},
|
|
@@ -944,8 +952,8 @@ c.targetConnection){if(a)return null;a=c}}return a}unplugFromStack(a){let b=null
|
|
|
944
952
|
this.previousConnection&&a.push(this.previousConnection);this.nextConnection&&a.push(this.nextConnection);for(let b=0,c;c=this.inputList[b];b++)c.connection&&a.push(c.connection);return a}lastConnectionInStack(a){let b=this.nextConnection;for(;b;){const c=b.targetBlock();if(!c||a&&c.isShadow())return b;b=c.nextConnection}return null}bumpNeighbours(){}getParent(){return this.parentBlock_}getInputWithBlock(a){for(let b=0,c;c=this.inputList[b];b++)if(c.connection&&c.connection.targetBlock()===a)return c;
|
|
945
953
|
return null}getSurroundParent(){let a=this,b;do if(b=a,a=a.getParent(),!a)return null;while(a.getNextBlock()===b);return a}getNextBlock(){return this.nextConnection&&this.nextConnection.targetBlock()}getPreviousBlock(){return this.previousConnection&&this.previousConnection.targetBlock()}getRootBlock(){let a,b=this;do a=b,b=a.parentBlock_;while(b);return a}getTopStackBlock(){let a=this,b;do b=a.getPreviousBlock();while(b&&b.getNextBlock()===a&&(a=b));return a}getChildren(a){if(!a)return this.childBlocks_;
|
|
946
954
|
a=[];for(let c=0,d;d=this.inputList[c];c++)if(d.connection){var b=d.connection.targetBlock();b&&a.push(b)}(b=this.getNextBlock())&&a.push(b);return a}setParent(a){if(a!==this.parentBlock_){var b=this.previousConnection&&this.previousConnection.targetBlock()||this.outputConnection&&this.outputConnection.targetBlock(),c=!!b;if(c&&a&&b!==a)throw Error("Block connected to superior one that is not new parent.");if(!c&&a)throw Error("Block not connected to new parent.");if(c&&!a)throw Error("Cannot set parent to null while block is still connected to superior block.");
|
|
947
|
-
this.parentBlock_?removeElem$$module$build$src$core$utils$array(this.parentBlock_.childBlocks_,this):this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}}getDescendants(a){const b=[this],c=this.getChildren(a);for(let d,e=0;d=c[e];e++)b.push(...d.getDescendants(a));return b}isDeletable(){return this.deletable&&!this.shadow&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnDeletable(){return this.deletable}setDeletable(a){this.deletable=
|
|
948
|
-
a}isMovable(){return this.movable&&!this.shadow&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnMovable(){return this.movable}setMovable(a){this.movable=a}isDuplicatable(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(getBlockTypeCounts$$module$build$src$core$common(this,!0)):!0}isShadow(){return this.shadow}setShadow(a){this.shadow=a}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(a){this.isInsertionMarker_=a}isEditable(){return this.editable&&
|
|
955
|
+
this.parentBlock_?removeElem$$module$build$src$core$utils$array(this.parentBlock_.childBlocks_,this):this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}}getDescendants(a){const b=[this],c=this.getChildren(a);for(let d,e=0;d=c[e];e++)b.push(...d.getDescendants(a));return b}isDeletable(){return this.deletable&&!this.isInFlyout&&!this.shadow&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnDeletable(){return this.deletable}setDeletable(a){this.deletable=
|
|
956
|
+
a}isMovable(){return this.movable&&!this.isInFlyout&&!this.shadow&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnMovable(){return this.movable}setMovable(a){this.movable=a}isDuplicatable(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(getBlockTypeCounts$$module$build$src$core$common(this,!0)):!0}isShadow(){return this.shadow}setShadow(a){this.shadow=a}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(a){this.isInsertionMarker_=a}isEditable(){return this.editable&&
|
|
949
957
|
!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setEditable(a){this.editable=a;for(const b of this.getFields())b.updateEditable()}isDisposed(){return this.disposed}isSimpleReporter(){if(!this.outputConnection)return!1;for(const a of this.inputList)if(a.connection||1<a.fieldRow.length)return!1;return!0}getMatchingConnection(a,b){const c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!==a.length)throw Error("Connection lists did not match in length.");
|
|
950
958
|
for(let d=0;d<a.length;d++)if(a[d]===b)return c[d];return null}setHelpUrl(a){this.helpUrl=a}setTooltip(a){this.tooltip=a}getTooltip(){return getTooltipOfObject$$module$build$src$core$tooltip(this)}getColour(){return this.colour_}getStyleName(){return this.styleName_}getHue(){return this.hue}setColour(a){a=parseBlockColour$$module$build$src$core$utils$parsing(a);this.hue=a.hue;this.colour_=a.hex}setStyle(a){this.styleName_=a}setOnChange(a){if(a&&"function"!==typeof a)throw Error("onchange must be a function.");
|
|
951
959
|
this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.onchange=a;this.onchangeWrapper=a.bind(this);this.workspace.addChangeListener(this.onchangeWrapper)}getField(a){if("string"!==typeof a)throw TypeError("Block.prototype.getField expects a string with the field name but received "+(void 0===a?"nothing":a+" of type "+typeof a)+" instead");for(const b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(const a of this.inputList)for(const b of a.fieldRow)yield b}getVars(){const a=
|
|
@@ -1033,8 +1041,8 @@ return b}lastConnectionInStack(a){return super.lastConnectionInStack(a)}getMatch
|
|
|
1033
1041
|
null==(c=b.targetBlock())||c.bumpNeighbours()}for(const c of b.neighbours($.config$$module$build$src$core$config.snapRadius))c.getSourceBlock().getRootBlock()!==a&&(b.isConnected()&&c.isConnected()||(b.isSuperior()?c.bumpAwayFrom(b,!1):b.bumpAwayFrom(c,!0)))}}scheduleSnapAndBump(){this.snapToGrid();this.bumpNeighbours()}positionNearConnection(a,b,c){if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){let d=
|
|
1034
1042
|
b.x;b=b.y;d+=c.x-a.getOffsetInBlock().x;b+=c.y-a.getOffsetInBlock().y;this.moveBy(d,b)}}getChildren(a){return super.getChildren(a)}queueRender(){return queueRender$$module$build$src$core$render_management(this)}render(){this.queueRender();triggerQueuedRenders$$module$build$src$core$render_management()}renderEfficiently(){startTextWidthCache$$module$build$src$core$utils$dom();this.isCollapsed()&&this.updateCollapsed();this.isEnabled()||this.updateDisabled();this.workspace.getRenderer().render(this);
|
|
1035
1043
|
this.tightenChildrenEfficiently();stopTextWidthCache$$module$build$src$core$utils$dom()}tightenChildrenEfficiently(){for(const a of this.inputList){const b=a.connection;b&&b.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}getHeightWidth(){let a=this.height,b=this.width;var c=this.getNextBlock();if(c){c=c.getHeightWidth();const d=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}}fadeForReplacement(a){this.pathObject.updateReplacementFade(a)}highlightShapeForInput(a,
|
|
1036
|
-
b){this.pathObject.updateShapeForInputHighlight(a,b)}getDragStrategy(){return this.dragStrategy}setDragStrategy(a){this.dragStrategy=a}isMovable(){return this.dragStrategy.isMovable()}startDrag(a){this.dragStrategy.startDrag(a)}drag(a,b){this.dragStrategy.drag(a,b)}endDrag(a){this.dragStrategy.endDrag(a)}revertDrag(){this.dragStrategy.revertDrag()}toFlyoutInfo(){const a=Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),
|
|
1037
|
-
"enabled"]),c=function(d){for(const e in d)b.has(e)?delete d[e]:"object"===typeof d[e]&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getFocusableElement(){return this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.select()}onNodeBlur(){this.unselect()}canBeFocused(){return!0}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;
|
|
1044
|
+
b){this.pathObject.updateShapeForInputHighlight(a,b)}getDragStrategy(){return this.dragStrategy}setDragStrategy(a){this.dragStrategy=a}isCopyable(){return this.isOwnDeletable()&&this.isOwnMovable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(a){this.dragStrategy.startDrag(a)}drag(a,b){this.dragStrategy.drag(a,b)}endDrag(a){this.dragStrategy.endDrag(a)}revertDrag(){this.dragStrategy.revertDrag()}toFlyoutInfo(){const a=Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),
|
|
1045
|
+
b=new Set(["id","height","width","pinned","enabled"]),c=function(d){for(const e in d)b.has(e)?delete d[e]:"object"===typeof d[e]&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getFocusableElement(){return this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.select()}onNodeBlur(){this.unselect()}canBeFocused(){return!0}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;
|
|
1038
1046
|
BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};module$build$src$core$block_svg.BlockSvg=BlockSvg$$module$build$src$core$block_svg;var DragTarget$$module$build$src$core$drag_target=class{constructor(){}onDragEnter(a){}onDragOver(a){}onDragExit(a){}onDrop(a){}getClientRect(){return null}shouldPreventMove(a){return!1}},module$build$src$core$drag_target={};module$build$src$core$drag_target.DragTarget=DragTarget$$module$build$src$core$drag_target;var module$build$src$core$interfaces$i_deletable={};module$build$src$core$interfaces$i_deletable.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){a instanceof BlockSvg$$module$build$src$core$block_svg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a)):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}updateWouldDelete_(a){this.wouldDelete_=a}},module$build$src$core$delete_area={};
|
|
1039
1047
|
module$build$src$core$delete_area.DeleteArea=DeleteArea$$module$build$src$core$delete_area;var FlyoutItem$$module$build$src$core$flyout_item=class{constructor(a,b){this.element=a;this.type=b}getElement(){return this.element}getType(){return this.type}},module$build$src$core$flyout_item={};module$build$src$core$flyout_item.FlyoutItem=FlyoutItem$$module$build$src$core$flyout_item;var MetricsManager$$module$build$src$core$metrics_manager=class{constructor(a){this.workspace_=a}getDimensionsPx_(a){let b=0,c=0;a&&(b=a.getWidth(),c=a.getHeight());return new Size$$module$build$src$core$utils$size(b,c)}getFlyoutMetrics(a){a=this.getDimensionsPx_(this.workspace_.getFlyout(a));return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const a=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let a=
|
|
1040
1048
|
0,b=0;const c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox();var f;const g=!(null==(f=this.workspace_.getFlyout())?0:f.autoClose);f=e?c.position:d.position;const h=f===Position$$module$build$src$core$utils$toolbox.TOP;f===Position$$module$build$src$core$utils$toolbox.LEFT&&(e&&(a+=c.width),g&&(a+=d.width));h&&(e&&(b+=c.height),g&&(b+=d.height));return{top:b,left:a}}getViewMetrics(a){a=a?this.workspace_.scale:1;const b=this.getSvgMetrics(),c=this.getToolboxMetrics(),
|
|
@@ -1058,18 +1066,18 @@ var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.F
|
|
|
1058
1066
|
module$build$src$core$keyboard_nav$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy;var FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy=class{constructor(a,b){this.policy=a;this.flyout=b}getFirstChild(a){return null}getParent(a){return this.policy.getParent(a)}getNextSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===a);if(-1===c)return null;c++;c>=b.length&&(c=0);return b[c].getElement()}getPreviousSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===
|
|
1059
1067
|
a);if(-1===c)return null;c--;0>c&&(c=b.length-1);return b[c].getElement()}isNavigable(a){return this.policy.isNavigable(a)}isApplicable(a){return this.policy.isApplicable(a)}},module$build$src$core$keyboard_nav$flyout_navigation_policy={};module$build$src$core$keyboard_nav$flyout_navigation_policy.FlyoutNavigationPolicy=FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy;var FlyoutSeparator$$module$build$src$core$flyout_separator=class{constructor(a,b){this.gap=a;this.axis=b;this.y=this.x=0}getBoundingRectangle(){switch(this.axis){case "x":return new Rect$$module$build$src$core$utils$rect(this.y,this.y,this.x,this.x+this.gap);case "y":return new Rect$$module$build$src$core$utils$rect(this.y,this.y+this.gap,this.x,this.x)}}moveBy(a,b,c){this.x+=a;this.y+=b}isNavigable(){return!1}getFocusableElement(){throw Error("Cannot be focused");}getFocusableTree(){throw Error("Cannot be focused");
|
|
1060
1068
|
}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}},module$build$src$core$flyout_separator={};module$build$src$core$flyout_separator.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;var FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return!1}isApplicable(a){return a instanceof FlyoutSeparator$$module$build$src$core$flyout_separator}},module$build$src$core$keyboard_nav$flyout_separator_navigation_policy={};
|
|
1061
|
-
module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){return getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(a)[0]}getParent(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if(null==(c=a.outputConnection)?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){let b;if(null==(b=a.nextConnection)?0:b.targetBlock()){let d;
|
|
1062
|
-
return null==(d=a.nextConnection)?void 0:d.targetBlock()}let c;return(null==(c=a.outputConnection)?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):null}getPreviousSibling(a){let b;
|
|
1063
|
-
return(null==(c=a.outputConnection)?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}},
|
|
1064
|
-
module$build$src$core$keyboard_nav$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateStacks=navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy=class{getFirstChild(a){return a.getParentInput()?a.targetConnection:null}getParent(a){return a.getSourceBlock()}getNextSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){const c=a.targetConnection;var b=a.getSourceBlock();if(!c&&b.getRootBlock().lastConnectionInStack(!1)===
|
|
1069
|
+
module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){return getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(a,!0)[0]}getParent(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if(null==(c=a.outputConnection)?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){let b;if(null==(b=a.nextConnection)?0:b.targetBlock()){let d;
|
|
1070
|
+
return null==(d=a.nextConnection)?void 0:d.targetBlock()}let c;return(null==(c=a.outputConnection)?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):a.getSurroundParent()?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a.getTopStackBlock(),1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):null}getPreviousSibling(a){let b;
|
|
1071
|
+
if(null==(b=a.previousConnection)?0:b.targetBlock()){let d;return null==(d=a.previousConnection)?void 0:d.targetBlock()}let c;return(null==(c=a.outputConnection)?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}},
|
|
1072
|
+
module$build$src$core$keyboard_nav$block_navigation_policy={};module$build$src$core$keyboard_nav$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateStacks=navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy=class{getFirstChild(a){return a.getParentInput()?a.targetConnection:null}getParent(a){return a.getSourceBlock()}getNextSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){const c=a.targetConnection;var b=a.getSourceBlock();if(!c&&b.getRootBlock().lastConnectionInStack(!1)===
|
|
1065
1073
|
a){a=b.workspace.getTopBlocks(!0);b=a.indexOf(b.getRootBlock())+1;b>=a.length&&(b=0);b=a[b];let d;return null!=(d=this.getParentConnection(b))?d:b}return c}return a.getSourceBlock()}getPreviousSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1);if(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE){const c=a.targetConnection&&
|
|
1066
1074
|
!a.targetConnection.getParentInput()?a.targetConnection:null;var b=a.getSourceBlock();if(!c&&this.getParentConnection(b.getRootBlock())===a){a=b.workspace.getTopBlocks(!0);b=a.indexOf(b.getRootBlock())-1;0>b&&(b=a.length-1);b=a[b];let d;return null!=(d=b.lastConnectionInStack(!1))?d:b}return c}return a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?a.getSourceBlock():null}getParentConnection(a){let b;return!a.outputConnection||(null==(b=a.previousConnection)?0:b.isConnected())?
|
|
1067
1075
|
a.previousConnection:a.outputConnection}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$connection_navigation_policy={};module$build$src$core$keyboard_nav$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){let b;return a.canBeFocused()&&a.isVisible()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?
|
|
1068
|
-
0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){
|
|
1069
|
-
{};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
|
|
1076
|
+
0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){if(a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===a){let b,c;return null!=(c=null==(b=a.getBubble())?void 0:b.getWorkspace())?c:null}return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,
|
|
1077
|
+
1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof Icon$$module$build$src$core$icons$icon}},module$build$src$core$keyboard_nav$icon_navigation_policy={};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()&&!a.isMutator}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
|
|
1070
1078
|
module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy,new IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>
|
|
1071
|
-
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))&&
|
|
1072
|
-
c:this.getNextSibling(c)}getPreviousSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getPreviousSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getPreviousSibling(c)}},module$build$src$core$navigator={};module$build$src$core$navigator.Navigator=Navigator$$module$build$src$core$navigator;var FlyoutNavigator$$module$build$src$core$flyout_navigator=class extends Navigator$$module$build$src$core$navigator{constructor(a){super();this.rules.push(new FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy,new FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy);this.rules=this.rules.map(b=>new FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy(b,a))}},module$build$src$core$flyout_navigator=
|
|
1079
|
+
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.getFirstChild(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))&&
|
|
1080
|
+
d.isNavigable(c)?c:this.getNextSibling(c)}getPreviousSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getPreviousSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getPreviousSibling(c)}},module$build$src$core$navigator={};module$build$src$core$navigator.Navigator=Navigator$$module$build$src$core$navigator;var FlyoutNavigator$$module$build$src$core$flyout_navigator=class extends Navigator$$module$build$src$core$navigator{constructor(a){super();this.rules.push(new FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy,new FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy);this.rules=this.rules.map(b=>new FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy(b,a))}},module$build$src$core$flyout_navigator=
|
|
1073
1081
|
{};module$build$src$core$flyout_navigator.FlyoutNavigator=FlyoutNavigator$$module$build$src$core$flyout_navigator;var ScrollbarPair$$module$build$src$core$scrollbar_pair=class{constructor(a,b,c,d,e){this.workspace=a;this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null;b=void 0===b?!0:b;c=void 0===c?!0:c;const f=b&&c;b&&(this.hScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!0,f,d,e));c&&(this.vScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!1,f,d,e));f&&(this.corner_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness,
|
|
1074
1082
|
width:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness,"class":"blocklyScrollbarBackground"}),insertAfter$$module$build$src$core$utils$dom(this.corner_,a.getBubbleCanvas()))}dispose(){removeNode$$module$build$src$core$utils$dom(this.corner_);this.oldHostMetrics=this.corner_=null;this.hScroll&&(this.hScroll.dispose(),this.hScroll=null);this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const a=this.workspace.getMetrics();if(a){var b=!1,c=!1;this.oldHostMetrics&&this.oldHostMetrics.viewWidth===
|
|
1075
1083
|
a.viewWidth&&this.oldHostMetrics.viewHeight===a.viewHeight&&this.oldHostMetrics.absoluteTop===a.absoluteTop&&this.oldHostMetrics.absoluteLeft===a.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===a.scrollWidth&&this.oldHostMetrics.viewLeft===a.viewLeft&&this.oldHostMetrics.scrollLeft===a.scrollLeft||(b=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===a.scrollHeight&&this.oldHostMetrics.viewTop===a.viewTop&&this.oldHostMetrics.scrollTop===a.scrollTop||(c=!0)):c=b=!0;if(b||
|
|
@@ -1128,19 +1136,19 @@ a;var b=this.spacing*a;this.pattern.setAttribute("width",`${b}`);this.pattern.se
|
|
|
1128
1136
|
f:0)){createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a);let g;null!=(g=b.length)&&g&&createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a)}else createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{},a);d&&d.style.setProperty("--blocklyGridPattern",`url(#${a.id})`);return a}},module$build$src$core$grid={};module$build$src$core$grid.Grid=Grid$$module$build$src$core$grid;var module$build$src$core$interfaces$i_autohideable={};module$build$src$core$interfaces$i_autohideable.isAutoHideable=isAutoHideable$$module$build$src$core$interfaces$i_autohideable;var LayerManager$$module$build$src$core$layer_manager=class{constructor(a){this.workspace=a;this.layers=new Map;if(a=a.getInjectionDiv())this.dragLayer=this.createDragLayer(a),this.animationLayer=this.createAnimationLayer(a);a=this.createLayer(BLOCK$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBlockCanvas");a=this.createLayer(BUBBLE$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBubbleCanvas")}createDragLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,
|
|
1129
1137
|
{"class":"blocklyBlockDragSurface",xmlns:SVG_NS$$module$build$src$core$utils$dom,"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}createAnimationLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{"class":"blocklyAnimationLayer",xmlns:SVG_NS$$module$build$src$core$utils$dom,
|
|
1130
1138
|
"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}appendToAnimationLayer(a){let b;const c=null==(b=this.dragLayer)?void 0:b.getAttribute("transform");if(c){let e;null==(e=this.animationLayer)||e.setAttribute("transform",c)}let d;null==(d=this.animationLayer)||d.appendChild(a.getSvgRoot())}translateLayers(a,b){a=
|
|
1131
|
-
`translate(${a.x}, ${a.y}) scale(${b})`;let c;null==(c=this.dragLayer)||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a){let b;null==(b=this.dragLayer)||b.appendChild(a.getSvgRoot())
|
|
1132
|
-
(c=this.layers.get(b))?void 0:c.lastChild)!==a){let d;null==(d=this.layers.get(b))||d.appendChild(a)}}createLayer(a){const b=this.workspace.getSvgGroup(),c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});let d=!1;const e=[...this.layers].sort((f,g)=>f[0]-g[0]);for(const [f,g]of e)if(a<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}},
|
|
1139
|
+
`translate(${a.x}, ${a.y}) scale(${b})`;let c;null==(c=this.dragLayer)||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a){let b;null==(b=this.dragLayer)||b.appendChild(a.getSvgRoot());a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}moveOffDragLayer(a,b){this.append(a,b);a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}append(a,b){this.layers.has(b)||this.createLayer(b);
|
|
1140
|
+
a=a.getSvgRoot();let c;if((null==(c=this.layers.get(b))?void 0:c.lastChild)!==a){let d;null==(d=this.layers.get(b))||d.appendChild(a)}}createLayer(a){const b=this.workspace.getSvgGroup(),c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});let d=!1;const e=[...this.layers].sort((f,g)=>f[0]-g[0]);for(const [f,g]of e)if(a<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}},
|
|
1133
1141
|
module$build$src$core$layer_manager={};module$build$src$core$layer_manager.LayerManager=LayerManager$$module$build$src$core$layer_manager;var MarkerManager$$module$build$src$core$marker_manager=class{constructor(a){this.workspace=a;this.cursor=null;this.markers=new Map}registerMarker(a,b){this.markers.has(a)&&this.unregisterMarker(a);this.markers.set(a,b)}unregisterMarker(a){const b=this.markers.get(a);if(b)b.dispose(),this.markers.delete(a);else throw Error("Marker with ID "+a+" does not exist. Can only unregister markers that exist.");}getCursor(){return this.cursor}getMarker(a){return this.markers.get(a)||null}setCursor(a){this.cursor=
|
|
1134
1142
|
a}dispose(){const a=Object.keys(this.markers);for(let b=0,c;c=a[b];b++)this.unregisterMarker(c);this.markers.clear();this.cursor&&(this.cursor.dispose(),this.cursor=null)}};MarkerManager$$module$build$src$core$marker_manager.LOCAL_MARKER="local_marker_1";var module$build$src$core$marker_manager={};module$build$src$core$marker_manager.MarkerManager=MarkerManager$$module$build$src$core$marker_manager;var TextInputBubble$$module$build$src$core$bubbles$textinput_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c){super(a,b,c,TextInputBubble$$module$build$src$core$bubbles$textinput_bubble.createTextArea());this.workspace=a;this.anchor=b;this.ownerRect=c;this.resizePointerMoveListener=this.resizePointerUpListener=null;this.textChangeListeners=[];this.sizeChangeListeners=[];this.locationChangeListeners=[];this.text="";this.DEFAULT_SIZE=new Size$$module$build$src$core$utils$size(160+
|
|
1135
1143
|
Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,80+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.MIN_SIZE=new Size$$module$build$src$core$utils$size(45+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,20+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.editable=!0;addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextInputBubble");this.textArea=this.getFocusableElement();this.inputRoot=this.createEditor(this.contentContainer,this.textArea);
|
|
1136
1144
|
this.resizeGroup=this.createResizeHandle(this.svgRoot,a);this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(a){this.text=a;this.textArea.value=a;this.onTextChange()}setEditable(a){(this.editable=a)?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","")}isEditable(){return this.editable}addTextChangeListener(a){this.textChangeListeners.push(a)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}addLocationChangeListener(a){this.locationChangeListeners.push(a)}static createTextArea(){const a=
|
|
1137
1145
|
document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");a.className="blocklyTextarea blocklyText";return a}createEditor(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);const c=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");c.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);
|
|
1138
|
-
c.className="blocklyMinimalBody";b.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");c.appendChild(b);a.appendChild(c);this.bindTextAreaEvents(b);return a}bindTextAreaEvents(a){conditionalBind$$module$build$src$core$browser_events(a,"wheel",this,b=>{b.stopPropagation()});conditionalBind$$module$build$src$core$browser_events(a,"
|
|
1139
|
-
href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}setSize(a,b=!1){a.width=Math.max(a.width,this.MIN_SIZE.width);a.height=Math.max(a.height,this.MIN_SIZE.height);const c=a.width-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,d=a.height-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;
|
|
1140
|
-
this.resizeGroup.setAttribute("y",`${d}`);this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${c}`);super.setSize(a,b);this.onSizeChange()}getSize(){return super.getSize()}moveDuringDrag(a){super.moveDuringDrag(a);this.onLocationChange()}setPositionRelativeToAnchor(a,b){super.setPositionRelativeToAnchor(a,b);
|
|
1141
|
-
0,0)){super.positionByRect(a);this.onLocationChange()}onResizePointerDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,
|
|
1142
|
-
conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff());a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),
|
|
1143
|
-
null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onTextChange(){this.text=this.textArea.value;for(const a of this.textChangeListeners)a()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}onLocationChange(){for(const a of this.locationChangeListeners)a()}};register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 0;\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n");
|
|
1146
|
+
c.className="blocklyMinimalBody";b.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");c.appendChild(b);a.appendChild(c);this.bindTextAreaEvents(b);return a}bindTextAreaEvents(a){conditionalBind$$module$build$src$core$browser_events(a,"wheel",this,b=>{b.stopPropagation()});conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,b=>{b.stopPropagation();clearTouchIdentifier$$module$build$src$core$touch()});conditionalBind$$module$build$src$core$browser_events(a,"change",this,this.onTextChange)}createResizeHandle(a,
|
|
1147
|
+
b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}setSize(a,b=!1){a.width=Math.max(a.width,this.MIN_SIZE.width);a.height=Math.max(a.height,this.MIN_SIZE.height);const c=a.width-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,d=a.height-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;
|
|
1148
|
+
this.inputRoot.setAttribute("width",`${c}`);this.inputRoot.setAttribute("height",`${d}`);this.resizeGroup.setAttribute("y",`${d}`);this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${c}`);super.setSize(a,b);this.onSizeChange()}getSize(){return super.getSize()}moveDuringDrag(a){super.moveDuringDrag(a);this.onLocationChange()}setPositionRelativeToAnchor(a,b){super.setPositionRelativeToAnchor(a,b);
|
|
1149
|
+
this.onLocationChange()}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){super.positionByRect(a);this.onLocationChange()}onResizePointerDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,
|
|
1150
|
+
"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff());a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),
|
|
1151
|
+
this.resizePointerMoveListener=null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onTextChange(){this.text=this.textArea.value;for(const a of this.textChangeListeners)a()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}onLocationChange(){for(const a of this.locationChangeListeners)a()}};register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 0;\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n");
|
|
1144
1152
|
var module$build$src$core$bubbles$textinput_bubble={};module$build$src$core$bubbles$textinput_bubble.TextInputBubble=TextInputBubble$$module$build$src$core$bubbles$textinput_bubble;var module$build$src$core$icons$registry={};module$build$src$core$icons$registry.register=register$$module$build$src$core$icons$registry;module$build$src$core$icons$registry.unregister=unregister$$module$build$src$core$icons$registry;var SIZE$$module$build$src$core$icons$comment_icon=17,DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon=160,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon=80,CommentIcon$$module$build$src$core$icons$comment_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textInputBubble=null;this.text="";this.bubbleSize=new Size$$module$build$src$core$utils$size(DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon);
|
|
1145
1153
|
this.bubbleVisiblity=!1}getType(){return CommentIcon$$module$build$src$core$icons$comment_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},
|
|
1146
1154
|
this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCommentIcon"))}dispose(){super.dispose();let a;null==(a=this.textInputBubble)||a.dispose()}getWeight(){return CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$comment_icon,
|
|
@@ -1345,11 +1353,13 @@ typeof b)throw TypeError("Toolbox category callbacks must be functions.");this.t
|
|
|
1345
1353
|
this.currentGesture_.cancel());!this.currentGesture_&&b&&(this.currentGesture_=new Gesture$$module$build$src$core$gesture(a,this));return this.currentGesture_}clearGesture(){this.currentGesture_=null}cancelCurrentGesture(){this.currentGesture_&&this.currentGesture_.cancel()}getAudioManager(){return this.audioManager}getGrid(){return this.grid}hideChaff(a=!1){hide$$module$build$src$core$tooltip();hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this);hideWithoutAnimation$$module$build$src$core$dropdowndiv();
|
|
1346
1354
|
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){const b=this.getMetrics();"number"===typeof a.x&&(this.scrollX=-(b.scrollLeft+(b.scrollWidth-b.viewWidth)*a.x));"number"===typeof a.y&&(this.scrollY=-(b.scrollTop+(b.scrollHeight-b.viewHeight)*a.y));this.translate(this.scrollX+b.absoluteLeft,this.scrollY+b.absoluteTop)}addClass(a){this.injectionDiv&&
|
|
1347
1355
|
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=this.getScale(),d=this.getMetricsManager().getViewMetrics(!0);d=new Rect$$module$build$src$core$utils$rect(d.top,d.top+d.height,d.left,
|
|
1348
|
-
d.left+d.width);if(!(a.left>=d.left&&a.top>=d.top&&a.right<=d.right&&a.bottom<=d.bottom)){a=a.clone();a.top-=b;a.bottom+=b;a.left-=b;a.right+=b;var e=b=0;a.left<d.left?b=this.RTL?Math.min(d.left-a.left,d.right-a.right):d.left-a.left:a.right>d.right&&(b=this.RTL?d.right-a.right:Math.max(d.right-a.right,d.left-a.left));a.top<d.top?e=d.top-a.top:a.bottom>d.bottom&&(e=Math.max(d.bottom-a.bottom,d.top-a.top));this.scroll(this.scrollX+b*c,this.scrollY+e*c)}}}getFocusableElement(){return this.svgGroup_}getFocusableTree(){return this
|
|
1349
|
-
let b;return null!=(b=this.getTopBlocks(!0)[0])?b:null}getNestedTrees(){
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1356
|
+
d.left+d.width);if(!(a.left>=d.left&&a.top>=d.top&&a.right<=d.right&&a.bottom<=d.bottom)){a=a.clone();a.top-=b;a.bottom+=b;a.left-=b;a.right+=b;var e=b=0;a.left<d.left?b=this.RTL?Math.min(d.left-a.left,d.right-a.right):d.left-a.left:a.right>d.right&&(b=this.RTL?d.right-a.right:Math.max(d.right-a.right,d.left-a.left));a.top<d.top?e=d.top-a.top:a.bottom>d.bottom&&(e=Math.max(d.bottom-a.bottom,d.top-a.top));this.scroll(this.scrollX+b*c,this.scrollY+e*c)}}}getFocusableElement(){return this.svgGroup_}getFocusableTree(){return this.isMutator&&
|
|
1357
|
+
this.options.parentWorkspace||this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(a)return null;let b;return null!=(b=this.getTopBlocks(!0)[0])?b:null}getNestedTrees(){const a=this.getAllBlocks().map(c=>c.getIcons()).flat().filter(c=>c instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&c.bubbleIsVisible()).map(c=>{let d;return null==(d=c.getBubble())?void 0:d.getWorkspace()}).filter(c=>!!c),b=this.getFlyout(!0);
|
|
1358
|
+
b&&a.push(b.getWorkspace());return a}searchForWorkspaceComment(a){for(const b of this.getTopComments())if(b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment&&b.canBeFocused()&&b.getFocusableElement().id===a)return b}lookUpFocusableNode(a){var b;const c=null==(b=this.targetWorkspace)?void 0:b.getFlyout();if(this.isFlyout&&c)for(var d of c.getContents())if(b=d.getElement(),isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(b)&&b.canBeFocused()&&
|
|
1359
|
+
b.getFocusableElement().id===a)return b;d=a.indexOf("_field_");b=a.indexOf("_connection_");if(-1!==d){var e=a.substring(0,d);if(e=this.getBlockById(e))for(var f of e.getFields())if(f.canBeFocused()&&f.getFocusableElement().id===a)return f;return null}if(-1!==b){e=a.substring(0,b);if(e=this.getBlockById(e))for(const g of e.getConnections_(!0))if(g.id===a)return g;return null}f=a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor);if(-1!==f&&(f=a.substring(0,f),f=
|
|
1360
|
+
this.searchForWorkspaceComment(f)))return f.getEditorFocusableNode();if((f=this.getAllBlocks(!1).find(g=>g.getFocusableElement().id===a))||(f=this.searchForWorkspaceComment(a)))return f;f=this.getAllBlocks().map(g=>g.getIcons()).flat();for(e of f){if(e.canBeFocused()&&e.getFocusableElement().id===a)return e;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&(f=e.getBubble())&&f.canBeFocused()&&f.getFocusableElement().id===a)return f}return null}onTreeFocus(a,b){}onTreeBlur(a){if(this.isFlyout&&
|
|
1361
|
+
this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()){var b=this.targetWorkspace.getFlyout(),c=this.targetWorkspace.getToolbox();c&&a===c||(c&&c.clearSelection(),b&&isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&b.autoHide(!1))}}getNavigator(){return this.navigator}setNavigator(a){this.navigator=a}},module$build$src$core$workspace_svg={};module$build$src$core$workspace_svg.WorkspaceSvg=WorkspaceSvg$$module$build$src$core$workspace_svg;
|
|
1362
|
+
module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;var VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank="undefined"===typeof a;a&&(this.varId=a.getId(),this.workspaceId=a.getWorkspace().id)}toJson(){const a=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");a.varId=this.varId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarBase$$module$build$src$core$events$events_var_base);
|
|
1353
1363
|
b.varId=a.varId;return b}},module$build$src$core$events$events_var_base={};module$build$src$core$events$events_var_base.VarBase=VarBase$$module$build$src$core$events$events_var_base;var VarCreate$$module$build$src$core$events$events_var_create=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_CREATE;a&&(this.varType=a.getType(),this.varName=a.getName())}toJson(){const a=super.toJson();if(void 0===this.varType)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");
|
|
1354
1364
|
a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarCreate$$module$build$src$core$events$events_var_create);b.varType=a.varType;b.varName=a.varName;return b}run(a){var b=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");b=b.getVariableMap();
|
|
1355
1365
|
a?b.createVariable(this.varName,this.varType,this.varId):(a=b.getVariableById(this.varId))&&b.deleteVariable(a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_CREATE,VarCreate$$module$build$src$core$events$events_var_create);var module$build$src$core$events$events_var_create={};module$build$src$core$events$events_var_create.VarCreate=VarCreate$$module$build$src$core$events$events_var_create;var VariableModel$$module$build$src$core$variable_model=class{constructor(a,b,c,d){this.workspace=a;this.name=b;this.type=c||"";this.id=d||genUid$$module$build$src$core$utils$idgenerator()}getId(){return this.id}getName(){return this.name}setName(a){this.name=a;return this}getType(){return this.type}setType(a){this.type=a;return this}getWorkspace(){return this.workspace}save(){const a={name:this.getName(),id:this.getId()},b=this.getType();b&&(a.type=b);return a}static load(a,b){a=new this(b,a.name,
|
|
@@ -1388,9 +1398,9 @@ this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(a){if(!(0>=this.work
|
|
|
1388
1398
|
delete c.x;delete c.y;delete c.enabled;delete c.disabledReasons;if(c.icons&&c.icons.comment){var d=c.icons.comment;delete d.height;delete d.width;delete d.pinned}d=c.inputs;for(var e in d){var f=d[e];const g=f.block;f=f.shadow;g&&b(g);f&&b(f)}c.next&&(e=c.next,c=e.block,e=e.shadow,c&&b(c),e&&b(e))}}a=JSON.parse(JSON.stringify(a));b(a);return Object.assign({},{kind:"BLOCK"},a)}},WIDTH$$module$build$src$core$trashcan=47,BODY_HEIGHT$$module$build$src$core$trashcan=44,LID_HEIGHT$$module$build$src$core$trashcan=
|
|
1389
1399
|
16,MARGIN_VERTICAL$$module$build$src$core$trashcan=20,MARGIN_HORIZONTAL$$module$build$src$core$trashcan=20,MARGIN_HOTSPOT$$module$build$src$core$trashcan=10,SPRITE_LEFT$$module$build$src$core$trashcan=0,SPRITE_TOP$$module$build$src$core$trashcan=32,HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan=.1,ANIMATION_LENGTH$$module$build$src$core$trashcan=80,ANIMATION_FRAMES$$module$build$src$core$trashcan=4,OPACITY_MIN$$module$build$src$core$trashcan=.4,OPACITY_MAX$$module$build$src$core$trashcan=.8,
|
|
1390
1400
|
MAX_LID_ANGLE$$module$build$src$core$trashcan=45,module$build$src$core$trashcan={};module$build$src$core$trashcan.Trashcan=Trashcan$$module$build$src$core$trashcan;var stashedCopyData$$module$build$src$core$clipboard=null,stashedWorkspace$$module$build$src$core$clipboard=null,TEST_ONLY$$module$build$src$core$clipboard={duplicateInternal:duplicateInternal$$module$build$src$core$clipboard,copyInternal:copyInternal$$module$build$src$core$clipboard},module$build$src$core$clipboard={};module$build$src$core$clipboard.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard.TEST_ONLY=TEST_ONLY$$module$build$src$core$clipboard;
|
|
1391
|
-
module$build$src$core$clipboard.paste=paste$$module$build$src$core$clipboard;module$build$src$core$clipboard.registry=module$build$src$core$clipboard$registry;var module$build$src$core$interfaces$i_copyable={};module$build$src$core$interfaces$i_copyable.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;var names$$module$build$src$core$shortcut_items;(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));var copyData$$module$build$src$core$shortcut_items=null,
|
|
1392
|
-
|
|
1393
|
-
module$build$src$core$shortcut_items.
|
|
1401
|
+
module$build$src$core$clipboard.paste=paste$$module$build$src$core$clipboard;module$build$src$core$clipboard.registry=module$build$src$core$clipboard$registry;var module$build$src$core$comments={};module$build$src$core$comments.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;module$build$src$core$comments.CommentView=CommentView$$module$build$src$core$comments$comment_view;module$build$src$core$comments.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;module$build$src$core$comments.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var module$build$src$core$interfaces$i_copyable={};module$build$src$core$interfaces$i_copyable.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;var names$$module$build$src$core$shortcut_items;(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));var copyData$$module$build$src$core$shortcut_items=null,copyCoords$$module$build$src$core$shortcut_items=null;registerDefaultShortcuts$$module$build$src$core$shortcut_items();var module$build$src$core$shortcut_items={};
|
|
1402
|
+
module$build$src$core$shortcut_items.names=names$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCopy=registerCopy$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCut=registerCut$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDefaultShortcuts=registerDefaultShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDelete=registerDelete$$module$build$src$core$shortcut_items;
|
|
1403
|
+
module$build$src$core$shortcut_items.registerEscape=registerEscape$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerPaste=registerPaste$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerRedo=registerRedo$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src$core$shortcut_items;var ProcedureSerializer$$module$build$src$core$serialization$procedures=class{constructor(a,b){this.procedureModelClass=a;this.parameterModelClass=b;this.priority=PROCEDURES$$module$build$src$core$serialization$priorities}save(a){a=a.getProcedureMap().getProcedures().map(b=>saveProcedure$$module$build$src$core$serialization$procedures(b));return a.length?a:null}load(a,b){const c=b.getProcedureMap();for(const d of a)c.add(loadProcedure$$module$build$src$core$serialization$procedures(this.procedureModelClass,
|
|
1394
1404
|
this.parameterModelClass,d,b))}clear(a){a.getProcedureMap().clear()}},module$build$src$core$serialization$procedures={};module$build$src$core$serialization$procedures.ProcedureSerializer=ProcedureSerializer$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.loadProcedure=loadProcedure$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.saveProcedure=saveProcedure$$module$build$src$core$serialization$procedures;var VariableSerializer$$module$build$src$core$serialization$variables=class{constructor(){this.priority=VARIABLES$$module$build$src$core$serialization$priorities}save(a){a=a.getAllVariables().map(b=>b.save());return a.length?a:null}load(a,b){const c=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry);a.forEach(d=>{null==c||c.load(d,b)})}clear(a){a.getVariableMap().clear()}};
|
|
1395
1405
|
register$$module$build$src$core$serialization$registry("variables",new VariableSerializer$$module$build$src$core$serialization$variables);var module$build$src$core$serialization$variables={};module$build$src$core$serialization$variables.VariableSerializer=VariableSerializer$$module$build$src$core$serialization$variables;var module$build$src$core$serialization$workspaces={};module$build$src$core$serialization$workspaces.load=load$$module$build$src$core$serialization$workspaces;module$build$src$core$serialization$workspaces.save=save$$module$build$src$core$serialization$workspaces;var module$build$src$core$serialization={blocks:module$build$src$core$serialization$blocks,exceptions:module$build$src$core$serialization$exceptions,priorities:module$build$src$core$serialization$priorities,procedures:module$build$src$core$serialization$procedures,registry:module$build$src$core$serialization$registry,variables:module$build$src$core$serialization$variables,workspaceComments:module$build$src$core$serialization$workspace_comments,workspaces:module$build$src$core$serialization$workspaces};"Blockly"in globalThis||(globalThis.Blockly={Msg:module$build$src$core$msg});var module$build$src$core$main={};var LABEL_TYPE$$module$build$src$core$label_flyout_inflater="label",LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater=class{load(a,b){a=new FlyoutButton$$module$build$src$core$flyout_button(b.getWorkspace(),b.targetWorkspace,a,!0);a.show();return new FlyoutItem$$module$build$src$core$flyout_item(a,LABEL_TYPE$$module$build$src$core$label_flyout_inflater)}gapForItem(a,b){return b}disposeItem(a){a=a.getElement();a instanceof FlyoutButton$$module$build$src$core$flyout_button&&a.dispose()}getType(){return LABEL_TYPE$$module$build$src$core$label_flyout_inflater}};
|
|
1396
1406
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,LABEL_TYPE$$module$build$src$core$label_flyout_inflater,LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater);var module$build$src$core$label_flyout_inflater={};module$build$src$core$label_flyout_inflater.LabelFlyoutInflater=LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater;var ConstantProvider$$module$build$src$core$renderers$zelos$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(a){super();this.GRID_UNIT=4;this.CURSOR_COLOUR="#ffa200";this.CURSOR_RADIUS=5;this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0;this.START_HAT_HEIGHT=22;this.START_HAT_WIDTH=96;this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5};this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},
|
|
@@ -1602,7 +1612,7 @@ module$build$src$core$renderers$zelos$zelos.TopRow=TopRow$$module$build$src$core
|
|
|
1602
1612
|
module$build$src$core$contextmenu_items.registerComment=registerComment$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerCommentCreate=registerCommentCreate$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerCommentDelete=registerCommentDelete$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerCommentDuplicate=registerCommentDuplicate$$module$build$src$core$contextmenu_items;
|
|
1603
1613
|
module$build$src$core$contextmenu_items.registerCommentOptions=registerCommentOptions$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerDefaultOptions=registerDefaultOptions$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerDelete=registerDelete$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerDeleteAll=registerDeleteAll$$module$build$src$core$contextmenu_items;
|
|
1604
1614
|
module$build$src$core$contextmenu_items.registerDisable=registerDisable$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerDuplicate=registerDuplicate$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerExpand=registerExpand$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerHelp=registerHelp$$module$build$src$core$contextmenu_items;
|
|
1605
|
-
module$build$src$core$contextmenu_items.registerInline=registerInline$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerRedo=registerRedo$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerUndo=registerUndo$$module$build$src$core$contextmenu_items;var
|
|
1615
|
+
module$build$src$core$contextmenu_items.registerInline=registerInline$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerRedo=registerRedo$$module$build$src$core$contextmenu_items;module$build$src$core$contextmenu_items.registerUndo=registerUndo$$module$build$src$core$contextmenu_items;var BUTTON_TYPE$$module$build$src$core$button_flyout_inflater="button",ButtonFlyoutInflater$$module$build$src$core$button_flyout_inflater=class{load(a,b){a=new FlyoutButton$$module$build$src$core$flyout_button(b.getWorkspace(),b.targetWorkspace,a,!1);a.show();return new FlyoutItem$$module$build$src$core$flyout_item(a,BUTTON_TYPE$$module$build$src$core$button_flyout_inflater)}gapForItem(a,b){return b}disposeItem(a){a=a.getElement();a instanceof FlyoutButton$$module$build$src$core$flyout_button&&a.dispose()}getType(){return BUTTON_TYPE$$module$build$src$core$button_flyout_inflater}};
|
|
1606
1616
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,BUTTON_TYPE$$module$build$src$core$button_flyout_inflater,ButtonFlyoutInflater$$module$build$src$core$button_flyout_inflater);var module$build$src$core$button_flyout_inflater={};module$build$src$core$button_flyout_inflater.ButtonFlyoutInflater=ButtonFlyoutInflater$$module$build$src$core$button_flyout_inflater;var module$build$src$core$bubbles={};module$build$src$core$bubbles.Bubble=Bubble$$module$build$src$core$bubbles$bubble;module$build$src$core$bubbles.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;module$build$src$core$bubbles.TextBubble=TextBubble$$module$build$src$core$bubbles$text_bubble;module$build$src$core$bubbles.TextInputBubble=TextInputBubble$$module$build$src$core$bubbles$textinput_bubble;var module$build$src$core$blockly_options={};var WORKSPACE_AT_BLOCK_CAPACITY_DISABLED_REASON$$module$build$src$core$block_flyout_inflater="WORKSPACE_AT_BLOCK_CAPACITY",BLOCK_TYPE$$module$build$src$core$block_flyout_inflater="block",BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater=class{constructor(){this.permanentlyDisabledBlocks=new Set;this.listeners=new Map;this.capacityWrapper=this.filterFlyoutBasedOnCapacity.bind(this)}load(a,b){this.setFlyout(b);a=this.createBlock(a,b.getWorkspace());a.isEnabled()?this.updateStateBasedOnCapacity(a):
|
|
1607
1617
|
this.permanentlyDisabledBlocks.add(a);a.getDescendants(!1).forEach(c=>c.isInFlyout=!0);this.addBlockListeners(a);return new FlyoutItem$$module$build$src$core$flyout_item(a,BLOCK_TYPE$$module$build$src$core$block_flyout_inflater)}createBlock(a,b){a.blockxml?(a="string"===typeof a.blockxml?$.textToDom$$module$build$src$core$utils$xml(a.blockxml):a.blockxml,b=domToBlockInternal$$module$build$src$core$xml(a,b)):(void 0===a.enabled&&(a.enabled="true"!==a.disabled&&!0!==a.disabled),void 0===a.disabledReasons&&
|
|
1608
1618
|
!1===a.enabled&&(a.disabledReasons=[MANUALLY_DISABLED$$module$build$src$core$constants]),"x"in a&&delete a.x,"y"in a&&delete a.y,b=appendInternal$$module$build$src$core$serialization$blocks(a,b));return b}gapForItem(a,b){let c;a.gap?c=parseInt(String(a.gap)):a.blockxml&&(a="string"===typeof a.blockxml?$.textToDom$$module$build$src$core$utils$xml(a.blockxml):a.blockxml,c=parseInt(a.getAttribute("gap")));return!c||isNaN(c)?b:c}disposeItem(a){a=a.getElement();a instanceof BlockSvg$$module$build$src$core$block_svg&&
|
|
@@ -1616,9 +1626,9 @@ module$build$src$core$keyboard_nav$marker={};module$build$src$core$keyboard_nav$
|
|
|
1616
1626
|
c=>{let d;return c instanceof BlockSvg$$module$build$src$core$block_svg&&!(null==(d=c.outputConnection)?0:d.targetBlock())},!0);return b===a}getNextNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;let d=this.workspace.getNavigator().getFirstChild(a)||this.workspace.getNavigator().getNextSibling(a);for(var e=a;e&&!d;){e=this.workspace.getNavigator().getParent(e);if(!e)break;d=this.workspace.getNavigator().getNextSibling(e)}return b(d)?d:d?(c.add(a),this.getNextNodeImpl(d,b,c)):null}getNextNode(a,
|
|
1617
1627
|
b,c){return!a||!c&&this.getLastNode()===a?null:this.getNextNodeImpl(a,b)}getPreviousNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;const d=this.getRightMostChild(this.workspace.getNavigator().getPreviousSibling(a),a)||this.workspace.getNavigator().getParent(a);return b(d)?d:d?(c.add(a),this.getPreviousNodeImpl(d,b,c)):null}getPreviousNode(a,b,c){return!a||!c&&this.getFirstNode()===a?null:this.getPreviousNodeImpl(a,b)}getRightMostChild(a,b){if(!a)return a;let c=this.workspace.getNavigator().getFirstChild(a);
|
|
1618
1628
|
if(!c||c===b)return a;for(a=c;a&&a!==b;a=this.workspace.getNavigator().getNextSibling(c))c=a;return this.getRightMostChild(c,b)}preDelete(a){var b=this.getCurNode();b=b?[b]:[];var c;let d,e;const f=null!=(e=null==(c=a.previousConnection)?void 0:c.targetConnection)?e:null==(d=a.outputConnection)?void 0:d.targetConnection;f&&b.push(f);(c=a.getNextBlock())&&b.push(c);(a=a.getParent())&&b.push(a);b.push(this.workspace);this.potentialNodes=b}postDelete(){const a=this.potentialNodes;this.potentialNodes=
|
|
1619
|
-
null;if(!a)throw Error("must call preDelete first");for(const b of a){let c;if(null==(c=this.getSourceBlockFromNode(b))||!c.disposed){this.setCurNode(b);return}}throw Error("no valid nodes in this.potentialNodes");}getCurNode(){
|
|
1620
|
-
|
|
1621
|
-
|
|
1629
|
+
null;if(!a)throw Error("must call preDelete first");for(const b of a){let c;if(null==(c=this.getSourceBlockFromNode(b))||!c.disposed){this.setCurNode(b);return}}throw Error("no valid nodes in this.potentialNodes");}getCurNode(){return $.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()}setCurNode(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a);a instanceof BlockSvg$$module$build$src$core$block_svg?a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren()):
|
|
1630
|
+
a instanceof Field$$module$build$src$core$field&&(a=a.getSourceBlock(),a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren()))}getFirstNode(){return this.workspace.getNavigator().getFirstChild(this.workspace)}getLastNode(){const a=this.getFirstNode();return this.getPreviousNode(a,()=>!0,!0)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,DEFAULT$$module$build$src$core$registry,LineCursor$$module$build$src$core$keyboard_nav$line_cursor);
|
|
1631
|
+
var module$build$src$core$keyboard_nav$line_cursor={};module$build$src$core$keyboard_nav$line_cursor.LineCursor=LineCursor$$module$build$src$core$keyboard_nav$line_cursor;var ConstantProvider$$module$build$src$core$renderers$geras$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(){super();this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(a){return super.getCSS_(a).concat([`${a} .blocklyInsertionMarker>.blocklyPathLight,`,`${a} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;",
|
|
1622
1632
|
"}"])}},module$build$src$core$renderers$geras$constants={};module$build$src$core$renderers$geras$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$geras$constants;var Highlighter$$module$build$src$core$renderers$geras$highlighter=class{constructor(a){this.inlineSteps_=this.steps_="";this.info_=a;this.RTL_=this.info_.RTL;a=a.getRenderer();this.constants_=a.getConstants();this.highlightConstants_=a.getHighlightConstants();this.highlightOffset=this.highlightConstants_.OFFSET;this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER;this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER;this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB;this.notchPaths_=
|
|
1623
1633
|
this.highlightConstants_.NOTCH;this.startPaths_=this.highlightConstants_.START_HAT;this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+"\n"+this.inlineSteps_}drawTopCorner(a){this.steps_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos,this.info_.startY);for(let b=0,c;c=a.elements[b];b++)Types$$module$build$src$core$renderers$measurables$types.isLeftSquareCorner(c)?this.steps_+=this.highlightConstants_.START_POINT:Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(c)?
|
|
1624
1634
|
this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(c)?this.steps_+=this.notchPaths_.pathLeft:Types$$module$build$src$core$renderers$measurables$types.isHat(c)?this.steps_+=this.startPaths_.path(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isSpacer(c)&&0!==c.width&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",c.xPos+c.width-this.highlightOffset));this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",
|
|
@@ -1728,7 +1738,7 @@ a.toggleExpanded();return!0}selectNext(){if(!this.selectedItem_)return!1;const a
|
|
|
1728
1738
|
!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.");
|
|
1729
1739
|
return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return null!=(b=this.getToolboxItems().find(c=>c.isSelectable()))?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){let b;a&&a===(null==(b=this.flyout)?
|
|
1730
1740
|
void 0:b.getWorkspace())||(this.clearSelection(),this.flyout&&isAutoHideable$$module$build$src$core$interfaces$i_autohideable(this.flyout)&&this.flyout.autoHide(!1))}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
|
|
1731
|
-
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.
|
|
1741
|
+
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.2.0-beta.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,
|
|
1732
1742
|
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=
|
|
1733
1743
|
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,
|
|
1734
1744
|
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,
|
|
@@ -1791,7 +1801,6 @@ return module$build$src$core$blockly;
|
|
|
1791
1801
|
|
|
1792
1802
|
var Blockly = Blockly || { Msg: Object.create(null) };
|
|
1793
1803
|
|
|
1794
|
-
Blockly.Msg["ABORT_MOVE"] = "Abort move";
|
|
1795
1804
|
Blockly.Msg["ADD_COMMENT"] = "Add Comment";
|
|
1796
1805
|
Blockly.Msg["ALT_KEY"] = "Alt";
|
|
1797
1806
|
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'";
|
|
@@ -1853,12 +1862,10 @@ Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while";
|
|
|
1853
1862
|
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements.";
|
|
1854
1863
|
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements.";
|
|
1855
1864
|
Blockly.Msg["CONTROL_KEY"] = "Ctrl";
|
|
1856
|
-
Blockly.Msg["COPY_SHORTCUT"] = "Copy
|
|
1857
|
-
Blockly.Msg["CUT_SHORTCUT"] = "Cut
|
|
1865
|
+
Blockly.Msg["COPY_SHORTCUT"] = "Copy";
|
|
1866
|
+
Blockly.Msg["CUT_SHORTCUT"] = "Cut";
|
|
1858
1867
|
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Delete all %1 blocks?";
|
|
1859
1868
|
Blockly.Msg["DELETE_BLOCK"] = "Delete Block";
|
|
1860
|
-
Blockly.Msg["DELETE_KEY"] = "Del";
|
|
1861
|
-
Blockly.Msg["DELETE_SHORTCUT"] = "Delete block (%1)";
|
|
1862
1869
|
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable";
|
|
1863
1870
|
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?";
|
|
1864
1871
|
Blockly.Msg["DELETE_X_BLOCKS"] = "Delete %1 Blocks";
|
|
@@ -1867,16 +1874,18 @@ Blockly.Msg["DIALOG_OK"] = "OK";
|
|
|
1867
1874
|
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block";
|
|
1868
1875
|
Blockly.Msg["DUPLICATE_BLOCK"] = "Duplicate";
|
|
1869
1876
|
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment";
|
|
1870
|
-
Blockly.Msg["EDIT_BLOCK_CONTENTS"] = "Edit Block contents
|
|
1877
|
+
Blockly.Msg["EDIT_BLOCK_CONTENTS"] = "Edit Block contents";
|
|
1871
1878
|
Blockly.Msg["ENABLE_BLOCK"] = "Enable Block";
|
|
1872
1879
|
Blockly.Msg["EXPAND_ALL"] = "Expand Blocks";
|
|
1873
1880
|
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block";
|
|
1874
1881
|
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs";
|
|
1875
|
-
Blockly.Msg["FINISH_MOVE"] = "Finish move";
|
|
1876
1882
|
Blockly.Msg["HELP"] = "Help";
|
|
1877
1883
|
Blockly.Msg["HELP_PROMPT"] = "Press %1 for help on keyboard controls";
|
|
1878
1884
|
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs";
|
|
1879
|
-
Blockly.Msg["
|
|
1885
|
+
Blockly.Msg["KEYBOARD_NAV_CONSTRAINED_MOVE_HINT"] = "Use the arrow keys to move, then %1 to accept the position";
|
|
1886
|
+
Blockly.Msg["KEYBOARD_NAV_COPIED_HINT"] = "Copied. Press %1 to paste.";
|
|
1887
|
+
Blockly.Msg["KEYBOARD_NAV_CUT_HINT"] = "Cut. Press %1 to paste.";
|
|
1888
|
+
Blockly.Msg["KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT"] = "Hold %1 and use arrow keys to move freely, then %2 to accept the position";
|
|
1880
1889
|
Blockly.Msg["LINUX"] = "Linux";
|
|
1881
1890
|
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
|
1882
1891
|
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list";
|
|
@@ -2077,15 +2086,7 @@ Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number.";
|
|
|
2077
2086
|
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian).";
|
|
2078
2087
|
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian).";
|
|
2079
2088
|
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian).";
|
|
2080
|
-
Blockly.Msg["MOVE_BLOCK"] = "Move Block
|
|
2081
|
-
Blockly.Msg["MOVE_DOWN_CONSTRAINED"] = "Move down constrained";
|
|
2082
|
-
Blockly.Msg["MOVE_DOWN_UNCONSTRAINED"] = "Move down, unconstrained";
|
|
2083
|
-
Blockly.Msg["MOVE_LEFT_CONSTRAINED"] = "Move left, constrained";
|
|
2084
|
-
Blockly.Msg["MOVE_LEFT_UNCONSTRAINED"] = "Move left, unconstrained";
|
|
2085
|
-
Blockly.Msg["MOVE_RIGHT_CONSTRAINED"] = "Move right constrained";
|
|
2086
|
-
Blockly.Msg["MOVE_RIGHT_UNCONSTRAINED"] = "Move right, unconstrained";
|
|
2087
|
-
Blockly.Msg["MOVE_UP_CONSTRAINED"] = "Move up, constrained";
|
|
2088
|
-
Blockly.Msg["MOVE_UP_UNCONSTRAINED"] = "Move up unconstrained";
|
|
2089
|
+
Blockly.Msg["MOVE_BLOCK"] = "Move Block";
|
|
2089
2090
|
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable...";
|
|
2090
2091
|
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable...";
|
|
2091
2092
|
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable...";
|
|
@@ -2094,7 +2095,7 @@ Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:";
|
|
|
2094
2095
|
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:";
|
|
2095
2096
|
Blockly.Msg["OPTION_KEY"] = "⌥ Option";
|
|
2096
2097
|
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = "";
|
|
2097
|
-
Blockly.Msg["PASTE_SHORTCUT"] = "Paste
|
|
2098
|
+
Blockly.Msg["PASTE_SHORTCUT"] = "Paste";
|
|
2098
2099
|
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements";
|
|
2099
2100
|
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:";
|
|
2100
2101
|
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";
|
|
@@ -2129,7 +2130,6 @@ Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:";
|
|
|
2129
2130
|
Blockly.Msg["SHORTCUTS_CODE_NAVIGATION"] = "Code navigation";
|
|
2130
2131
|
Blockly.Msg["SHORTCUTS_EDITING"] = "Editing";
|
|
2131
2132
|
Blockly.Msg["SHORTCUTS_GENERAL"] = "General";
|
|
2132
|
-
Blockly.Msg["START_MOVE"] = "Start move";
|
|
2133
2133
|
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
|
|
2134
2134
|
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2";
|
|
2135
2135
|
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'.";
|