pxt-core 10.0.2 → 10.0.4

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.
Files changed (191) hide show
  1. package/built/pxtblocks/blockDragger.d.ts +10 -0
  2. package/built/pxtblocks/breakpointIcon.d.ts +15 -0
  3. package/built/pxtblocks/builtins/functions.d.ts +2 -0
  4. package/built/pxtblocks/builtins/lists.d.ts +2 -0
  5. package/built/pxtblocks/builtins/logic.d.ts +2 -0
  6. package/built/pxtblocks/builtins/loops.d.ts +2 -0
  7. package/built/pxtblocks/builtins/math.d.ts +4 -0
  8. package/built/pxtblocks/builtins/misc.d.ts +1 -0
  9. package/built/pxtblocks/builtins/text.d.ts +1 -0
  10. package/built/pxtblocks/builtins/variables.d.ts +1 -0
  11. package/built/pxtblocks/codecardRenderer.d.ts +5 -0
  12. package/built/pxtblocks/compiler/compiler.d.ts +8 -0
  13. package/built/pxtblocks/compiler/environment.d.ts +97 -0
  14. package/built/pxtblocks/compiler/typeChecker.d.ts +25 -0
  15. package/built/pxtblocks/compiler/util.d.ts +15 -0
  16. package/built/pxtblocks/compiler/variables.d.ts +4 -0
  17. package/built/pxtblocks/composableMutations.d.ts +9 -0
  18. package/built/pxtblocks/constants.d.ts +4 -0
  19. package/built/pxtblocks/contextMenu/blockItems.d.ts +2 -0
  20. package/built/pxtblocks/contextMenu/contextMenu.d.ts +4 -0
  21. package/built/pxtblocks/contextMenu/index.d.ts +1 -0
  22. package/built/pxtblocks/contextMenu/workspaceItems.d.ts +2 -0
  23. package/built/pxtblocks/diff.d.ts +22 -0
  24. package/built/pxtblocks/external.d.ts +14 -0
  25. package/built/pxtblocks/fields/fieldEditorRegistry.d.ts +5 -0
  26. package/built/pxtblocks/fields/field_animation.d.ts +39 -0
  27. package/built/pxtblocks/fields/field_argumentvariable.d.ts +11 -0
  28. package/built/pxtblocks/fields/field_asset.d.ts +63 -0
  29. package/built/pxtblocks/fields/field_autocomplete.d.ts +32 -0
  30. package/built/pxtblocks/fields/field_base.d.ts +31 -0
  31. package/built/pxtblocks/fields/field_colorwheel.d.ts +32 -0
  32. package/built/pxtblocks/fields/field_colour.d.ts +38 -0
  33. package/built/pxtblocks/fields/field_dropdown.d.ts +5 -0
  34. package/built/pxtblocks/fields/field_gridpicker.d.ts +109 -0
  35. package/built/pxtblocks/fields/field_imagedropdown.d.ts +35 -0
  36. package/built/pxtblocks/fields/field_images.d.ts +20 -0
  37. package/built/pxtblocks/fields/field_kind.d.ts +12 -0
  38. package/built/pxtblocks/fields/field_ledmatrix.d.ts +52 -0
  39. package/built/pxtblocks/fields/field_melodySandbox.d.ts +89 -0
  40. package/built/pxtblocks/fields/field_musiceditor.d.ts +16 -0
  41. package/built/pxtblocks/fields/field_note.d.ts +117 -0
  42. package/built/pxtblocks/fields/field_numberdropdown.d.ts +28 -0
  43. package/built/pxtblocks/fields/field_position.d.ts +29 -0
  44. package/built/pxtblocks/fields/field_procedure.d.ts +12 -0
  45. package/built/pxtblocks/fields/field_protractor.d.ts +27 -0
  46. package/built/pxtblocks/fields/field_sound_effect.d.ts +37 -0
  47. package/built/pxtblocks/fields/field_speed.d.ts +32 -0
  48. package/built/pxtblocks/fields/field_sprite.d.ts +26 -0
  49. package/built/pxtblocks/fields/field_styledlabel.d.ts +11 -0
  50. package/built/pxtblocks/fields/field_textdropdown.d.ts +36 -0
  51. package/built/pxtblocks/fields/field_textinput.d.ts +6 -0
  52. package/built/pxtblocks/fields/field_tilemap.d.ts +30 -0
  53. package/built/pxtblocks/fields/field_tileset.d.ts +36 -0
  54. package/built/pxtblocks/fields/field_toggle.d.ts +48 -0
  55. package/built/pxtblocks/fields/field_toggle_downup.d.ts +7 -0
  56. package/built/pxtblocks/fields/field_toggle_highlow.d.ts +7 -0
  57. package/built/pxtblocks/fields/field_toggle_onoff.d.ts +7 -0
  58. package/built/pxtblocks/fields/field_toggle_updown.d.ts +7 -0
  59. package/built/pxtblocks/fields/field_toggle_winlose.d.ts +7 -0
  60. package/built/pxtblocks/fields/field_toggle_yesno.d.ts +7 -0
  61. package/built/pxtblocks/fields/field_tsexpression.d.ts +14 -0
  62. package/built/pxtblocks/fields/field_turnratio.d.ts +29 -0
  63. package/built/pxtblocks/fields/field_userenum.d.ts +12 -0
  64. package/built/pxtblocks/fields/field_utils.d.ts +64 -0
  65. package/built/pxtblocks/fields/index.d.ts +38 -0
  66. package/built/pxtblocks/help.d.ts +7 -0
  67. package/built/pxtblocks/importer.d.ts +38 -0
  68. package/built/pxtblocks/index.d.ts +24 -0
  69. package/built/pxtblocks/layout.d.ts +35 -0
  70. package/built/pxtblocks/legacyMutations.d.ts +42 -0
  71. package/built/pxtblocks/loader.d.ts +47 -0
  72. package/built/pxtblocks/monkeyPatches/blockSvg.d.ts +1 -0
  73. package/built/pxtblocks/monkeyPatches/index.d.ts +1 -0
  74. package/built/pxtblocks/plugins/arrays/createList.d.ts +35 -0
  75. package/built/pxtblocks/plugins/arrays/index.d.ts +1 -0
  76. package/built/pxtblocks/plugins/duplicateOnDrag/connectionChecker.d.ts +9 -0
  77. package/built/pxtblocks/plugins/duplicateOnDrag/duplicateOnDrag.d.ts +6 -0
  78. package/built/pxtblocks/plugins/duplicateOnDrag/index.d.ts +3 -0
  79. package/built/pxtblocks/plugins/duplicateOnDrag/variablesGetReporter.d.ts +11 -0
  80. package/built/pxtblocks/plugins/flyout/index.d.ts +1 -0
  81. package/built/pxtblocks/plugins/flyout/verticalFlyout.d.ts +51 -0
  82. package/built/pxtblocks/plugins/functions/blocks/argumentEditorBlocks.d.ts +11 -0
  83. package/built/pxtblocks/plugins/functions/blocks/argumentReporterBlocks.d.ts +13 -0
  84. package/built/pxtblocks/plugins/functions/blocks/functionCallBlocks.d.ts +1 -0
  85. package/built/pxtblocks/plugins/functions/blocks/functionDeclarationBlock.d.ts +17 -0
  86. package/built/pxtblocks/plugins/functions/blocks/functionDefinitionBlock.d.ts +12 -0
  87. package/built/pxtblocks/plugins/functions/commonFunctionMixin.d.ts +46 -0
  88. package/built/pxtblocks/plugins/functions/constants.d.ts +14 -0
  89. package/built/pxtblocks/plugins/functions/extensions.d.ts +5 -0
  90. package/built/pxtblocks/plugins/functions/fields/fieldArgumentEditor.d.ts +12 -0
  91. package/built/pxtblocks/plugins/functions/fields/fieldAutocapitalizeTextInput.d.ts +11 -0
  92. package/built/pxtblocks/plugins/functions/functionManager.d.ts +16 -0
  93. package/built/pxtblocks/plugins/functions/index.d.ts +11 -0
  94. package/built/pxtblocks/plugins/functions/msg.d.ts +21 -0
  95. package/built/pxtblocks/plugins/functions/svgs.d.ts +3 -0
  96. package/built/pxtblocks/plugins/functions/utils.d.ts +19 -0
  97. package/built/pxtblocks/plugins/logic/extensions.d.ts +1 -0
  98. package/built/pxtblocks/plugins/logic/ifElse.d.ts +59 -0
  99. package/built/pxtblocks/plugins/logic/index.d.ts +2 -0
  100. package/built/pxtblocks/plugins/math/fieldSlider.d.ts +21 -0
  101. package/built/pxtblocks/plugins/math/index.d.ts +2 -0
  102. package/built/pxtblocks/plugins/math/numberBlocks.d.ts +1 -0
  103. package/built/pxtblocks/plugins/newVariableField/fieldDropdownMixin.d.ts +2 -0
  104. package/built/pxtblocks/plugins/newVariableField/fieldVariable.d.ts +12 -0
  105. package/built/pxtblocks/plugins/newVariableField/index.d.ts +1 -0
  106. package/built/pxtblocks/plugins/renderer/collapsedInputRow.d.ts +7 -0
  107. package/built/pxtblocks/plugins/renderer/constants.d.ts +42 -0
  108. package/built/pxtblocks/plugins/renderer/drawer.d.ts +8 -0
  109. package/built/pxtblocks/plugins/renderer/index.d.ts +1 -0
  110. package/built/pxtblocks/plugins/renderer/info.d.ts +15 -0
  111. package/built/pxtblocks/plugins/renderer/pathObject.d.ts +14 -0
  112. package/built/pxtblocks/plugins/renderer/renderer.d.ts +16 -0
  113. package/built/pxtblocks/plugins/text/fieldString.d.ts +15 -0
  114. package/built/pxtblocks/plugins/text/index.d.ts +3 -0
  115. package/built/pxtblocks/plugins/text/join.d.ts +24 -0
  116. package/built/pxtblocks/plugins/text/text.d.ts +1 -0
  117. package/built/pxtblocks/render.d.ts +25 -0
  118. package/built/pxtblocks/sourceMap.d.ts +8 -0
  119. package/built/pxtblocks/toolbox.d.ts +14 -0
  120. package/built/pxtblocks/xml.d.ts +6 -0
  121. package/built/react-common/components/Notification.d.ts +18 -0
  122. package/built/react-common/components/animations/Confetti.d.ts +5 -0
  123. package/built/react-common/components/controls/Button.d.ts +29 -0
  124. package/built/react-common/components/controls/Card.d.ts +9 -0
  125. package/built/react-common/components/controls/Checkbox.d.ts +10 -0
  126. package/built/react-common/components/controls/DraggableGraph.d.ts +13 -0
  127. package/built/react-common/components/controls/Dropdown.d.ts +14 -0
  128. package/built/react-common/components/controls/EditorToggle.d.ts +18 -0
  129. package/built/react-common/components/controls/EmbedVideo.d.ts +8 -0
  130. package/built/react-common/components/controls/FocusList.d.ts +16 -0
  131. package/built/react-common/components/controls/FocusTrap.d.ts +10 -0
  132. package/built/react-common/components/controls/Input.d.ts +27 -0
  133. package/built/react-common/components/controls/LazyImage.d.ts +7 -0
  134. package/built/react-common/components/controls/Link.d.ts +7 -0
  135. package/built/react-common/components/controls/List.d.ts +4 -0
  136. package/built/react-common/components/controls/MenuBar.d.ts +4 -0
  137. package/built/react-common/components/controls/MenuDropdown.d.ts +18 -0
  138. package/built/react-common/components/controls/Modal.d.ts +25 -0
  139. package/built/react-common/components/controls/ProgressBar.d.ts +9 -0
  140. package/built/react-common/components/controls/RadioButtonGroup.d.ts +16 -0
  141. package/built/react-common/components/controls/TeachingBubble.d.ts +22 -0
  142. package/built/react-common/components/controls/Textarea.d.ts +18 -0
  143. package/built/react-common/components/controls/Tree.d.ts +15 -0
  144. package/built/react-common/components/controls/VerticalResizeContainer.d.ts +10 -0
  145. package/built/react-common/components/controls/VerticalSlider.d.ts +11 -0
  146. package/built/react-common/components/extensions/DeleteConfirmationModal.d.ts +6 -0
  147. package/built/react-common/components/extensions/ExtensionCard.d.ts +12 -0
  148. package/built/react-common/components/extensions/ImportModal.d.ts +5 -0
  149. package/built/react-common/components/language/LanguageCard.d.ts +14 -0
  150. package/built/react-common/components/language/LanguageSelector.d.ts +12 -0
  151. package/built/react-common/components/palette/ColorPickerField.d.ts +7 -0
  152. package/built/react-common/components/palette/PaletteEditor.d.ts +6 -0
  153. package/built/react-common/components/palette/PalettePicker.d.ts +7 -0
  154. package/built/react-common/components/palette/PaletteSwatch.d.ts +5 -0
  155. package/built/react-common/components/palette/Palettes.d.ts +18 -0
  156. package/built/react-common/components/profile/Badge.d.ts +7 -0
  157. package/built/react-common/components/profile/BadgeInfo.d.ts +6 -0
  158. package/built/react-common/components/profile/BadgeList.d.ts +6 -0
  159. package/built/react-common/components/profile/Profile.d.ts +12 -0
  160. package/built/react-common/components/profile/SignInModal.d.ts +14 -0
  161. package/built/react-common/components/profile/UserNotification.d.ts +4 -0
  162. package/built/react-common/components/profile/UserPane.d.ts +12 -0
  163. package/built/react-common/components/share/Kiosk.d.ts +1 -0
  164. package/built/react-common/components/share/MultiplayerConfirmation.d.ts +6 -0
  165. package/built/react-common/components/share/Share.d.ts +27 -0
  166. package/built/react-common/components/share/ShareInfo.d.ts +17 -0
  167. package/built/react-common/components/share/SocialButton.d.ts +8 -0
  168. package/built/react-common/components/share/ThumbnailRecorder.d.ts +25 -0
  169. package/built/react-common/components/util.d.ts +26 -0
  170. package/built/target.js +1 -1
  171. package/built/tests/common/testHost.d.ts +18 -0
  172. package/built/tests/common/testUtils.d.ts +21 -0
  173. package/built/tests/compile-test/compilerunner.d.ts +3 -0
  174. package/built/tests/decompile-test/decompilerunner.d.ts +1 -0
  175. package/built/tests/errors-test/errorrunner.d.ts +2 -0
  176. package/built/tests/format-test/formatrunner.d.ts +2 -0
  177. package/built/tests/helpers-test/helperrunner.d.ts +3 -0
  178. package/built/tests/language-service/languageservicerunner.d.ts +2 -0
  179. package/built/tests/pxt-editor-test/editorrunner.d.ts +2 -0
  180. package/built/tests/pyconverter-test/pyconvertrunner.d.ts +2 -0
  181. package/built/tests/pydecompile-test/pydecompilerunner.d.ts +2 -0
  182. package/built/tests/runtime-trace-tests/tracerunner.d.ts +3 -0
  183. package/built/tests/tutorial-test/tutorialrunner.d.ts +2 -0
  184. package/built/web/pxtweb.d.ts +31 -0
  185. package/built/web/teachertool/css/main.35eb3dd4.css +1 -0
  186. package/built/web/teachertool/js/main.70082f23.js +2 -0
  187. package/package.json +2 -2
  188. package/scripts/patchUglifyify.js +2 -1
  189. package/webapp/public/teachertool.html +1 -1
  190. package/built/web/teachertool/css/main.4df9c5c6.css +0 -1
  191. package/built/web/teachertool/js/main.bc2da240.js +0 -2
@@ -0,0 +1,10 @@
1
+ import * as Blockly from "blockly";
2
+ import { DuplicateOnDragBlockDragger } from "./plugins/duplicateOnDrag";
3
+ /**
4
+ * The following patch to blockly is to add the Trash icon on top of the toolbox,
5
+ * the trash icon should only show when a user drags a block that is already in the workspace.
6
+ */
7
+ export declare class BlockDragger extends DuplicateOnDragBlockDragger {
8
+ drag(e: PointerEvent, currentDragDeltaXY: Blockly.utils.Coordinate): void;
9
+ endDrag(e: PointerEvent, currentDragDeltaXY: Blockly.utils.Coordinate): void;
10
+ }
@@ -0,0 +1,15 @@
1
+ import * as Blockly from "blockly";
2
+ export declare class BreakpointIcon extends Blockly.icons.Icon {
3
+ protected readonly onStateChange: (block: Blockly.Block, isSet: boolean) => void;
4
+ static readonly type: Blockly.icons.IconType<Blockly.IIcon>;
5
+ protected isSet_: boolean;
6
+ protected breakpointSvg: SVGCircleElement;
7
+ constructor(sourceBlock: Blockly.Block, onStateChange: (block: Blockly.Block, isSet: boolean) => void);
8
+ getType(): Blockly.icons.IconType<Blockly.IIcon>;
9
+ initView(pointerdownListener: (e: PointerEvent) => void): void;
10
+ getSize(): Blockly.utils.Size;
11
+ onClick(): void;
12
+ isEnabled(): boolean;
13
+ setEnabled(enabled: boolean): void;
14
+ protected updateColor(): void;
15
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function initFunctions(): void;
@@ -0,0 +1,2 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function initLists(): void;
@@ -0,0 +1,2 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function initLogic(): void;
@@ -0,0 +1,2 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function initLoops(): void;
@@ -0,0 +1,4 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function initMath(blockInfo: pxtc.BlocksInfo): void;
3
+ export declare function initMathOpBlock(): void;
4
+ export declare function initMathRoundBlock(): void;
@@ -0,0 +1 @@
1
+ export declare function initOnStart(): void;
@@ -0,0 +1 @@
1
+ export declare function initText(): void;
@@ -0,0 +1 @@
1
+ export declare function initVariables(): void;
@@ -0,0 +1,5 @@
1
+ export interface CodeCardRenderOptions {
2
+ hideHeader?: boolean;
3
+ shortName?: boolean;
4
+ }
5
+ export declare function renderCodeCard(card: pxt.CodeCard, options?: CodeCardRenderOptions): HTMLElement;
@@ -0,0 +1,8 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { BlockCompilationResult, BlockCompileOptions, Environment } from "./environment";
4
+ export declare function compileBlockAsync(b: Blockly.Block, blockInfo: pxtc.BlocksInfo): Promise<BlockCompilationResult>;
5
+ export declare function compileAsync(b: Blockly.Workspace, blockInfo: pxtc.BlocksInfo, opts?: BlockCompileOptions): Promise<BlockCompilationResult>;
6
+ export declare function callKey(e: Environment, b: Blockly.Block): string;
7
+ export declare function compileExpression(e: Environment, b: Blockly.Block, comments: string[]): pxt.blocks.JsNode;
8
+ export declare function workerOpAsync(op: string, arg: pxtc.service.OpArg): Promise<any>;
@@ -0,0 +1,97 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ export interface Environment {
4
+ workspace: Blockly.Workspace;
5
+ options: BlockCompileOptions;
6
+ stdCallTable: pxt.Map<StdFunc>;
7
+ userFunctionReturnValues: pxt.Map<Point>;
8
+ diagnostics: BlockDiagnostic[];
9
+ errors: Blockly.Block[];
10
+ renames: RenameMap;
11
+ stats: pxt.Map<number>;
12
+ enums: pxtc.EnumInfo[];
13
+ kinds: pxtc.KindInfo[];
14
+ idToScope: pxt.Map<Scope>;
15
+ blockDeclarations: pxt.Map<VarInfo[]>;
16
+ blocksInfo: pxtc.BlocksInfo;
17
+ allVariables: VarInfo[];
18
+ placeholders: pxt.Map<pxt.Map<PlaceholderLikeBlock>>;
19
+ }
20
+ export interface StdFunc {
21
+ f: string;
22
+ comp: pxt.blocks.BlockCompileInfo;
23
+ attrs: ts.pxtc.CommentAttrs;
24
+ isExtensionMethod?: boolean;
25
+ isExpression?: boolean;
26
+ imageLiteral?: number;
27
+ imageLiteralColumns?: number;
28
+ imageLiteralRows?: number;
29
+ hasHandler?: boolean;
30
+ property?: boolean;
31
+ namespace?: string;
32
+ isIdentity?: boolean;
33
+ }
34
+ export interface RenameMap {
35
+ oldToNew: pxt.Map<string>;
36
+ takenNames: pxt.Map<boolean>;
37
+ oldToNewFunctions: pxt.Map<string>;
38
+ }
39
+ export interface PlaceholderLikeBlock extends Blockly.Block {
40
+ p?: Point;
41
+ }
42
+ export interface BlockCompilationResult {
43
+ source: string;
44
+ sourceMap: pxt.blocks.BlockSourceInterval[];
45
+ stats: pxt.Map<number>;
46
+ diagnostics: BlockDiagnostic[];
47
+ }
48
+ export interface BlockCompileOptions {
49
+ emitTilemapLiterals?: boolean;
50
+ }
51
+ export declare class Point {
52
+ link: Point;
53
+ type: string;
54
+ parentType?: Point;
55
+ childType?: Point;
56
+ isArrayType?: boolean;
57
+ constructor(link: Point, type: string, parentType?: Point, childType?: Point, isArrayType?: boolean);
58
+ }
59
+ export interface Scope {
60
+ parent?: Scope;
61
+ firstStatement: Blockly.Block;
62
+ declaredVars: pxt.Map<VarInfo>;
63
+ referencedVars: number[];
64
+ assignedVars: number[];
65
+ children: Scope[];
66
+ }
67
+ export declare enum BlockDeclarationType {
68
+ None = 0,
69
+ Argument = 1,
70
+ Assigned = 2,
71
+ Implicit = 3
72
+ }
73
+ export interface BlockDiagnostic {
74
+ blockId: string;
75
+ message: string;
76
+ }
77
+ export interface VarInfo {
78
+ name: string;
79
+ id: number;
80
+ escapedName?: string;
81
+ type?: Point;
82
+ alreadyDeclared?: BlockDeclarationType;
83
+ firstReference?: Blockly.Block;
84
+ isAssigned?: boolean;
85
+ isFunctionParameter?: boolean;
86
+ }
87
+ export interface GrayBlock extends Blockly.Block {
88
+ setPythonEnabled(enabled: boolean): void;
89
+ }
90
+ export interface GrayBlockStatement extends GrayBlock {
91
+ domToMutation(xmlElement: Element): void;
92
+ mutationToDom(): Element;
93
+ getLines: () => string[];
94
+ declaredVariables: string;
95
+ }
96
+ export declare function emptyEnv(w: Blockly.Workspace, options: BlockCompileOptions): Environment;
97
+ export declare function mkEnv(w: Blockly.Workspace, blockInfo?: pxtc.BlocksInfo, options?: BlockCompileOptions): Environment;
@@ -0,0 +1,25 @@
1
+ import * as Blockly from "blockly";
2
+ import { Point, Environment, VarInfo, StdFunc } from "./environment";
3
+ interface DeclaredVariable {
4
+ name: string;
5
+ type: Point;
6
+ isFunctionParameter?: boolean;
7
+ }
8
+ export interface IfBlock extends Blockly.Block {
9
+ elseifCount_: number;
10
+ elseCount_: number;
11
+ }
12
+ export declare function infer(allBlocks: Blockly.Block[], e: Environment, w: Blockly.Workspace): void;
13
+ export declare function mkPoint(t: string, isArrayType?: boolean): Point;
14
+ export declare function find(p: Point): Point;
15
+ export declare function returnType(e: Environment, b: Blockly.Block): Point;
16
+ export declare function attachPlaceholderIf(e: Environment, b: Blockly.Block, n: string, type?: string): void;
17
+ export declare function getConcreteType(point: Point, found?: Point[]): Point;
18
+ export declare function lookup(e: Environment, b: Blockly.Block, name: string): VarInfo;
19
+ export declare function getDeclaredVariables(block: Blockly.Block, e: Environment): DeclaredVariable[];
20
+ export declare function isFunctionRecursive(e: Environment, b: Blockly.Block, strict: boolean): boolean;
21
+ export declare function getEscapedCBParameters(b: Blockly.Block, stdfun: StdFunc, e: Environment): string[];
22
+ export declare function defaultValueForType(t: Point): pxt.blocks.JsNode;
23
+ export declare function isStringType(type: Point): boolean;
24
+ export declare function isBooleanType(type: Point): boolean;
25
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as Blockly from "blockly";
2
+ import { Environment, Scope, StdFunc } from "./environment";
3
+ import { MutatingBlock } from "../legacyMutations";
4
+ export declare function forEachChildExpression(block: Blockly.Block, cb: (block: Blockly.Block) => void, recursive?: boolean): void;
5
+ export declare function forEachStatementInput(block: Blockly.Block, cb: (block: Blockly.Block) => void): void;
6
+ export declare function printScope(scope: Scope, depth?: number): void;
7
+ export declare function getLoopVariableField(e: Environment, b: Blockly.Block): Blockly.Block;
8
+ export declare function getFunctionName(functionBlock: Blockly.Block): string;
9
+ export declare function visibleParams({ comp }: StdFunc, optionalCount: number): pxt.blocks.BlockParameter[];
10
+ export declare function countOptionals(b: Blockly.Block, func: StdFunc): number;
11
+ export declare function getInputTargetBlock(e: Environment, b: Blockly.Block, n: string): Blockly.Block;
12
+ export declare function isMutatingBlock(b: Blockly.Block): b is MutatingBlock;
13
+ export declare function escapeVarName(name: string, e: Environment, isFunction?: boolean): string;
14
+ export declare function append<T>(a1: T[], a2: T[]): void;
15
+ export declare function isFunctionDefinition(b: Blockly.Block): boolean;
@@ -0,0 +1,4 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { Scope, Environment } from "./environment";
4
+ export declare function trackAllVariables(topBlocks: Blockly.Block[], e: Environment): Scope;
@@ -0,0 +1,9 @@
1
+ /// <reference path="../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ export interface ComposableMutation {
4
+ mutationToDom(mutationElement: Element): Element;
5
+ domToMutation(savedElement: Element): void;
6
+ }
7
+ export declare function appendMutation(block: Blockly.Block, mutation: ComposableMutation): void;
8
+ export declare function initVariableArgsBlock(b: Blockly.Block, handlerArgs: pxt.blocks.HandlerArg[]): void;
9
+ export declare function initExpandableBlock(info: pxtc.BlocksInfo, b: Blockly.Block, def: pxtc.ParsedBlockDef, comp: pxt.blocks.BlockCompileInfo, toggle: boolean, addInputs: () => void): void;
@@ -0,0 +1,4 @@
1
+ import * as Blockly from "blockly";
2
+ export declare let provider: Blockly.zelos.ConstantProvider;
3
+ export declare const optionalDummyInputPrefix = "0_optional_dummy";
4
+ export declare const optionalInputWithFieldPrefix = "0_optional_field";
@@ -0,0 +1,2 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function registerBlockitems(): void;
@@ -0,0 +1,4 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ export declare function initContextMenu(): void;
4
+ export declare function setupWorkspaceContextMenu(workspace: Blockly.WorkspaceSvg): void;
@@ -0,0 +1 @@
1
+ export * from "./contextMenu";
@@ -0,0 +1,2 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ export declare function registerWorkspaceItems(): void;
@@ -0,0 +1,22 @@
1
+ /// <reference path="../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { BlocksRenderOptions } from "./render";
4
+ export interface DiffOptions {
5
+ hideDeletedTopBlocks?: boolean;
6
+ hideDeletedBlocks?: boolean;
7
+ renderOptions?: BlocksRenderOptions;
8
+ statementsOnly?: boolean;
9
+ }
10
+ export interface DiffResult {
11
+ ws?: Blockly.WorkspaceSvg;
12
+ message?: string;
13
+ error?: any;
14
+ svg?: Element;
15
+ deleted: number;
16
+ added: number;
17
+ modified: number;
18
+ }
19
+ export declare function needsDecompiledDiff(oldXml: string, newXml: string): boolean;
20
+ export declare function diffXml(oldXml: string, newXml: string, options?: DiffOptions): DiffResult;
21
+ export declare function mergeXml(xmlA: string, xmlO: string, xmlB: string): string;
22
+ export declare function decompiledDiffAsync(oldTs: string, oldResp: pxtc.CompileResult, newTs: string, newResp: pxtc.CompileResult, options?: DiffOptions): DiffResult;
@@ -0,0 +1,14 @@
1
+ import * as Blockly from "blockly";
2
+ export declare function promptTranslateBlock(blockId: string, blockTranslationIds: string[]): void;
3
+ export declare function setPromptTranslateBlock(impl: (blockId: string, blockTranslationIds: string[]) => void): void;
4
+ export declare function extensionBlocklyPatch(pkgTargetVersion: string, el: Element): void;
5
+ export declare function setExtensionBlocklyPatch(impl: (pkgTargetVersion: string, el: Element) => void): void;
6
+ export declare function openHelpUrl(url: string): void;
7
+ export declare function setOpenHelpUrl(impl: (url: string) => void): void;
8
+ export declare function onWorkspaceContextMenu(workspace: Blockly.WorkspaceSvg, options: Blockly.ContextMenuRegistry.ContextMenuOption[]): void;
9
+ export declare function setOnWorkspaceContextMenu(impl: (workspace: Blockly.WorkspaceSvg, options: Blockly.ContextMenuRegistry.ContextMenuOption[]) => void): void;
10
+ export interface PromptOptions {
11
+ placeholder: string;
12
+ }
13
+ export declare function setPrompt(impl: (message: string, defaultValue: string, callback: (value: string) => void, options?: PromptOptions) => void, setBlocklyAlso?: boolean): void;
14
+ export declare function prompt(message: string, defaultValue: string, callback: (value: string) => void, options?: PromptOptions): void;
@@ -0,0 +1,5 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import { FieldCustom, FieldCustomConstructor } from "./field_utils";
3
+ export declare function initFieldEditors(): void;
4
+ export declare function registerFieldEditor(selector: string, field: FieldCustomConstructor, validator?: any): void;
5
+ export declare function createFieldEditor(selector: string, text: string, params: any): FieldCustom;
@@ -0,0 +1,39 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import svg = pxt.svgUtil;
4
+ import { FieldAssetEditor } from "./field_asset";
5
+ export interface FieldAnimationOptions {
6
+ initWidth: string;
7
+ initHeight: string;
8
+ disableResize: string;
9
+ filter?: string;
10
+ lightMode: boolean;
11
+ }
12
+ export interface ParsedFieldAnimationOptions {
13
+ initWidth: number;
14
+ initHeight: number;
15
+ disableResize: boolean;
16
+ filter?: string;
17
+ lightMode: boolean;
18
+ }
19
+ export declare class FieldAnimationEditor extends FieldAssetEditor<FieldAnimationOptions, ParsedFieldAnimationOptions> {
20
+ protected frames: string[];
21
+ protected preview: svg.Image;
22
+ protected animateRef: any;
23
+ protected asset: pxt.Animation;
24
+ protected initInterval: number;
25
+ initView(): void;
26
+ showEditor_(): void;
27
+ render_(): void;
28
+ protected getAssetType(): pxt.AssetType;
29
+ protected createNewAsset(text?: string): pxt.Asset;
30
+ protected onEditorClose(newValue: pxt.Animation): void;
31
+ protected getValueText(): string;
32
+ protected redrawPreview(): void;
33
+ protected onMouseEnter: () => void;
34
+ protected onMouseLeave: () => void;
35
+ protected getParentIntervalBlock(): Blockly.Block;
36
+ protected setParentInterval(interval: number): void;
37
+ protected getParentInterval(): number;
38
+ protected parseFieldOptions(opts: FieldAnimationOptions): ParsedFieldAnimationOptions;
39
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ /**
4
+ * Subclass of FieldVariable to filter out the "delete" option when
5
+ * variables are part of a function argument (or else the whole function
6
+ * gets deleted).
7
+ */
8
+ export declare class FieldArgumentVariable extends Blockly.FieldVariable {
9
+ constructor(varName: string);
10
+ generateMenu(): any;
11
+ }
@@ -0,0 +1,63 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { FieldBase } from "./field_base";
4
+ export interface FieldAssetEditorOptions {
5
+ initWidth?: string;
6
+ initHeight?: string;
7
+ disableResize?: string;
8
+ }
9
+ interface ParsedFieldAssetEditorOptions {
10
+ initWidth?: number;
11
+ initHeight?: number;
12
+ disableResize?: boolean;
13
+ lightMode?: boolean;
14
+ }
15
+ export declare abstract class FieldAssetEditor<U extends FieldAssetEditorOptions, V extends ParsedFieldAssetEditorOptions> extends FieldBase<U> {
16
+ protected asset: pxt.Asset;
17
+ protected params: V;
18
+ protected blocksInfo: pxtc.BlocksInfo;
19
+ protected lightMode: boolean;
20
+ protected undoRedoState: any;
21
+ protected pendingEdit: boolean;
22
+ protected isEmpty: boolean;
23
+ isGreyBlock: boolean;
24
+ constructor(text: string, params: any, validator?: Blockly.FieldValidator);
25
+ protected abstract getAssetType(): pxt.AssetType;
26
+ protected abstract createNewAsset(text?: string): pxt.Asset;
27
+ protected abstract getValueText(): string;
28
+ onInit(): void;
29
+ onValueChanged(newValue: string): string;
30
+ showEditor_(): void;
31
+ protected showEditorFullscreen(editorKind: string, params: any): void;
32
+ protected showEditorInWidgetDiv(editorKind: string, params: any): void;
33
+ protected onFieldEditorHide(fv: pxt.react.FieldEditorView<pxt.Asset>): void;
34
+ render_(): void;
35
+ getDisplayText_(): string;
36
+ updateEditable(): void;
37
+ getValue(): string;
38
+ onDispose(): void;
39
+ disposeOfTemporaryAsset(): void;
40
+ clearTemporaryAssetData(): void;
41
+ isTemporaryAsset(): boolean;
42
+ getAsset(): pxt.Asset;
43
+ updateAsset(asset: pxt.Asset): void;
44
+ protected onEditorClose(newValue: pxt.Asset): void;
45
+ protected redrawPreview(): void;
46
+ protected parseValueText(newText: string): void;
47
+ protected parseFieldOptions(opts: U): V;
48
+ protected updateAssetMeta(): void;
49
+ protected updateAssetListener(): void;
50
+ protected assetChangeListener: () => void;
51
+ protected isFullscreen(): boolean;
52
+ }
53
+ export declare class BlocklyTilemapChange extends Blockly.Events.BlockChange {
54
+ protected oldRevision: number;
55
+ protected newRevision: number;
56
+ oldAssetId: string;
57
+ newAssetId: string;
58
+ fieldName: string;
59
+ constructor(block: Blockly.Block, element: string, name: string, oldValue: any, newValue: any, oldRevision: number, newRevision: number);
60
+ isNull(): boolean;
61
+ run(forward: boolean): void;
62
+ }
63
+ export {};
@@ -0,0 +1,32 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { FieldCustom } from "./field_utils";
4
+ import { FieldTextDropdown, FieldTextDropdownOptions } from "./field_textdropdown";
5
+ export interface FieldAutoCompleteOptions extends FieldTextDropdownOptions {
6
+ key: string;
7
+ }
8
+ export declare class FieldAutoComplete extends FieldTextDropdown implements FieldCustom {
9
+ isFieldCustom_: boolean;
10
+ protected key: string;
11
+ protected parsedValue: string;
12
+ protected quoteSize_: number;
13
+ protected quoteWidth_: number;
14
+ protected quoteLeftX_: number;
15
+ protected quoteRightX_: number;
16
+ protected quoteY_: number;
17
+ protected quoteLeft_: SVGTextElement;
18
+ protected quoteRight_: SVGTextElement;
19
+ constructor(text: string, options: FieldAutoCompleteOptions, opt_validator?: Blockly.FieldValidator);
20
+ isOptionListDynamic(): boolean;
21
+ getDisplayText_(): string;
22
+ doValueUpdate_(newValue: string): void;
23
+ getValue(): string;
24
+ getOptions(): [string, string][];
25
+ showDropdown_(): void;
26
+ getKey(): string;
27
+ initView(): void;
28
+ updateSize_(): void;
29
+ positionRight(x: number): number;
30
+ positionLeft(x: number): number;
31
+ createSVGArrow(): void;
32
+ }
@@ -0,0 +1,31 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { FieldCustom } from "./field_utils";
4
+ export declare abstract class FieldBase<U> extends Blockly.Field implements FieldCustom {
5
+ isFieldCustom_: true;
6
+ SERIALIZABLE: boolean;
7
+ options: U;
8
+ protected valueText: string;
9
+ protected loaded: boolean;
10
+ protected workspace: Blockly.Workspace;
11
+ constructor(text: string, params: U, validator?: Blockly.FieldValidator);
12
+ protected abstract onInit(): void;
13
+ protected abstract onDispose(): void;
14
+ protected abstract onValueChanged(newValue: string): string;
15
+ static pendingInit: FieldBase<any>[];
16
+ static pendingTimeout: any;
17
+ static enqueueInit(field: FieldBase<any>): void;
18
+ static flushInitQueue(): void;
19
+ init(): void;
20
+ dispose(): void;
21
+ getValue(): string;
22
+ doValueUpdate_(newValue: string): void;
23
+ getDisplayText_(): string;
24
+ onLoadedIntoWorkspace(): void;
25
+ protected getAnchorDimensions(): any;
26
+ protected isInitialized(): boolean;
27
+ protected getBlockData(): string;
28
+ protected setBlockData(value: string): void;
29
+ protected getSiblingBlock(inputName: string, useGrandparent?: boolean): Blockly.Block;
30
+ protected getSiblingField(fieldName: string, useGrandparent?: boolean): Blockly.Field<any>;
31
+ }
@@ -0,0 +1,32 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { FieldCustom } from "./field_utils";
4
+ import { FieldSlider } from "../plugins/math";
5
+ export declare class FieldColorWheel extends FieldSlider implements FieldCustom {
6
+ isFieldCustom_: boolean;
7
+ private params;
8
+ private channel_;
9
+ /**
10
+ * Class for a color wheel field.
11
+ * @param {number|string} value The initial content of the field.
12
+ * @param {Function=} opt_validator An optional function that is called
13
+ * to validate any constraints on what the user entered. Takes the new
14
+ * text as an argument and returns either the accepted text, a replacement
15
+ * text, or null to abort the change.
16
+ * @extends {Blockly.FieldNumber}
17
+ * @constructor
18
+ */
19
+ constructor(value_: any, params: any, opt_validator?: Blockly.FieldValidator);
20
+ /**
21
+ * Set the gradient CSS properties for the given node and channel
22
+ * @param {Node} node - The DOM node the gradient will be set on.
23
+ * @private
24
+ */
25
+ setBackground_(node: HTMLElement): void;
26
+ setReadout_(readout: Element, value: string): void;
27
+ createColourStops_(): string[];
28
+ colorWheel(wheelPos: number, channel?: string): string;
29
+ hsvFast(hue: number, sat: number, val: number): string;
30
+ private hex;
31
+ private componentToHex;
32
+ }
@@ -0,0 +1,38 @@
1
+ /// <reference path="../../pxtlib.d.ts" />
2
+ import * as Blockly from "blockly";
3
+ import { FieldCustom, FieldCustomOptions } from "./field_utils";
4
+ /**
5
+ * The value modes:
6
+ * hex - Outputs an HTML color string: "#ffffff" (with quotes)
7
+ * rgb - Outputs an RGB number in hex: 0xffffff
8
+ * index - Outputs the index of the color in the list of colors: 0
9
+ */
10
+ export declare type FieldColourValueMode = "hex" | "rgb" | "index";
11
+ export interface FieldColourNumberOptions extends FieldCustomOptions {
12
+ colours?: string;
13
+ columns?: string;
14
+ className?: string;
15
+ valueMode?: FieldColourValueMode;
16
+ }
17
+ export declare class FieldColorNumber extends Blockly.FieldColour implements FieldCustom {
18
+ isFieldCustom_: boolean;
19
+ protected colour_: string;
20
+ private valueMode_;
21
+ protected colours_: string[];
22
+ constructor(text: string, params: FieldColourNumberOptions, opt_validator?: Blockly.FieldValidator);
23
+ setColours(colours: string[], titles?: string[]): Blockly.FieldColour;
24
+ doClassValidation_(colour: string): string;
25
+ /**
26
+ * Return the current colour.
27
+ * @param {boolean} opt_asHex optional field if the returned value should be a hex
28
+ * @return {string} Current colour in '#rrggbb' format.
29
+ */
30
+ getValue(opt_asHex?: boolean): string;
31
+ /**
32
+ * Set the colour.
33
+ * @param {string} colour The new colour in '#rrggbb' format.
34
+ */
35
+ doValueUpdate_(colour: string): void;
36
+ getColours_(): string[];
37
+ applyColour(): void;
38
+ }
@@ -0,0 +1,5 @@
1
+ import * as Blockly from "blockly";
2
+ export declare class FieldDropdown extends Blockly.FieldDropdown {
3
+ protected shouldAddBorderRect_(): boolean;
4
+ protected showEditor_(e?: MouseEvent): void;
5
+ }