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.
- package/built/pxtblocks/blockDragger.d.ts +10 -0
- package/built/pxtblocks/breakpointIcon.d.ts +15 -0
- package/built/pxtblocks/builtins/functions.d.ts +2 -0
- package/built/pxtblocks/builtins/lists.d.ts +2 -0
- package/built/pxtblocks/builtins/logic.d.ts +2 -0
- package/built/pxtblocks/builtins/loops.d.ts +2 -0
- package/built/pxtblocks/builtins/math.d.ts +4 -0
- package/built/pxtblocks/builtins/misc.d.ts +1 -0
- package/built/pxtblocks/builtins/text.d.ts +1 -0
- package/built/pxtblocks/builtins/variables.d.ts +1 -0
- package/built/pxtblocks/codecardRenderer.d.ts +5 -0
- package/built/pxtblocks/compiler/compiler.d.ts +8 -0
- package/built/pxtblocks/compiler/environment.d.ts +97 -0
- package/built/pxtblocks/compiler/typeChecker.d.ts +25 -0
- package/built/pxtblocks/compiler/util.d.ts +15 -0
- package/built/pxtblocks/compiler/variables.d.ts +4 -0
- package/built/pxtblocks/composableMutations.d.ts +9 -0
- package/built/pxtblocks/constants.d.ts +4 -0
- package/built/pxtblocks/contextMenu/blockItems.d.ts +2 -0
- package/built/pxtblocks/contextMenu/contextMenu.d.ts +4 -0
- package/built/pxtblocks/contextMenu/index.d.ts +1 -0
- package/built/pxtblocks/contextMenu/workspaceItems.d.ts +2 -0
- package/built/pxtblocks/diff.d.ts +22 -0
- package/built/pxtblocks/external.d.ts +14 -0
- package/built/pxtblocks/fields/fieldEditorRegistry.d.ts +5 -0
- package/built/pxtblocks/fields/field_animation.d.ts +39 -0
- package/built/pxtblocks/fields/field_argumentvariable.d.ts +11 -0
- package/built/pxtblocks/fields/field_asset.d.ts +63 -0
- package/built/pxtblocks/fields/field_autocomplete.d.ts +32 -0
- package/built/pxtblocks/fields/field_base.d.ts +31 -0
- package/built/pxtblocks/fields/field_colorwheel.d.ts +32 -0
- package/built/pxtblocks/fields/field_colour.d.ts +38 -0
- package/built/pxtblocks/fields/field_dropdown.d.ts +5 -0
- package/built/pxtblocks/fields/field_gridpicker.d.ts +109 -0
- package/built/pxtblocks/fields/field_imagedropdown.d.ts +35 -0
- package/built/pxtblocks/fields/field_images.d.ts +20 -0
- package/built/pxtblocks/fields/field_kind.d.ts +12 -0
- package/built/pxtblocks/fields/field_ledmatrix.d.ts +52 -0
- package/built/pxtblocks/fields/field_melodySandbox.d.ts +89 -0
- package/built/pxtblocks/fields/field_musiceditor.d.ts +16 -0
- package/built/pxtblocks/fields/field_note.d.ts +117 -0
- package/built/pxtblocks/fields/field_numberdropdown.d.ts +28 -0
- package/built/pxtblocks/fields/field_position.d.ts +29 -0
- package/built/pxtblocks/fields/field_procedure.d.ts +12 -0
- package/built/pxtblocks/fields/field_protractor.d.ts +27 -0
- package/built/pxtblocks/fields/field_sound_effect.d.ts +37 -0
- package/built/pxtblocks/fields/field_speed.d.ts +32 -0
- package/built/pxtblocks/fields/field_sprite.d.ts +26 -0
- package/built/pxtblocks/fields/field_styledlabel.d.ts +11 -0
- package/built/pxtblocks/fields/field_textdropdown.d.ts +36 -0
- package/built/pxtblocks/fields/field_textinput.d.ts +6 -0
- package/built/pxtblocks/fields/field_tilemap.d.ts +30 -0
- package/built/pxtblocks/fields/field_tileset.d.ts +36 -0
- package/built/pxtblocks/fields/field_toggle.d.ts +48 -0
- package/built/pxtblocks/fields/field_toggle_downup.d.ts +7 -0
- package/built/pxtblocks/fields/field_toggle_highlow.d.ts +7 -0
- package/built/pxtblocks/fields/field_toggle_onoff.d.ts +7 -0
- package/built/pxtblocks/fields/field_toggle_updown.d.ts +7 -0
- package/built/pxtblocks/fields/field_toggle_winlose.d.ts +7 -0
- package/built/pxtblocks/fields/field_toggle_yesno.d.ts +7 -0
- package/built/pxtblocks/fields/field_tsexpression.d.ts +14 -0
- package/built/pxtblocks/fields/field_turnratio.d.ts +29 -0
- package/built/pxtblocks/fields/field_userenum.d.ts +12 -0
- package/built/pxtblocks/fields/field_utils.d.ts +64 -0
- package/built/pxtblocks/fields/index.d.ts +38 -0
- package/built/pxtblocks/help.d.ts +7 -0
- package/built/pxtblocks/importer.d.ts +38 -0
- package/built/pxtblocks/index.d.ts +24 -0
- package/built/pxtblocks/layout.d.ts +35 -0
- package/built/pxtblocks/legacyMutations.d.ts +42 -0
- package/built/pxtblocks/loader.d.ts +47 -0
- package/built/pxtblocks/monkeyPatches/blockSvg.d.ts +1 -0
- package/built/pxtblocks/monkeyPatches/index.d.ts +1 -0
- package/built/pxtblocks/plugins/arrays/createList.d.ts +35 -0
- package/built/pxtblocks/plugins/arrays/index.d.ts +1 -0
- package/built/pxtblocks/plugins/duplicateOnDrag/connectionChecker.d.ts +9 -0
- package/built/pxtblocks/plugins/duplicateOnDrag/duplicateOnDrag.d.ts +6 -0
- package/built/pxtblocks/plugins/duplicateOnDrag/index.d.ts +3 -0
- package/built/pxtblocks/plugins/duplicateOnDrag/variablesGetReporter.d.ts +11 -0
- package/built/pxtblocks/plugins/flyout/index.d.ts +1 -0
- package/built/pxtblocks/plugins/flyout/verticalFlyout.d.ts +51 -0
- package/built/pxtblocks/plugins/functions/blocks/argumentEditorBlocks.d.ts +11 -0
- package/built/pxtblocks/plugins/functions/blocks/argumentReporterBlocks.d.ts +13 -0
- package/built/pxtblocks/plugins/functions/blocks/functionCallBlocks.d.ts +1 -0
- package/built/pxtblocks/plugins/functions/blocks/functionDeclarationBlock.d.ts +17 -0
- package/built/pxtblocks/plugins/functions/blocks/functionDefinitionBlock.d.ts +12 -0
- package/built/pxtblocks/plugins/functions/commonFunctionMixin.d.ts +46 -0
- package/built/pxtblocks/plugins/functions/constants.d.ts +14 -0
- package/built/pxtblocks/plugins/functions/extensions.d.ts +5 -0
- package/built/pxtblocks/plugins/functions/fields/fieldArgumentEditor.d.ts +12 -0
- package/built/pxtblocks/plugins/functions/fields/fieldAutocapitalizeTextInput.d.ts +11 -0
- package/built/pxtblocks/plugins/functions/functionManager.d.ts +16 -0
- package/built/pxtblocks/plugins/functions/index.d.ts +11 -0
- package/built/pxtblocks/plugins/functions/msg.d.ts +21 -0
- package/built/pxtblocks/plugins/functions/svgs.d.ts +3 -0
- package/built/pxtblocks/plugins/functions/utils.d.ts +19 -0
- package/built/pxtblocks/plugins/logic/extensions.d.ts +1 -0
- package/built/pxtblocks/plugins/logic/ifElse.d.ts +59 -0
- package/built/pxtblocks/plugins/logic/index.d.ts +2 -0
- package/built/pxtblocks/plugins/math/fieldSlider.d.ts +21 -0
- package/built/pxtblocks/plugins/math/index.d.ts +2 -0
- package/built/pxtblocks/plugins/math/numberBlocks.d.ts +1 -0
- package/built/pxtblocks/plugins/newVariableField/fieldDropdownMixin.d.ts +2 -0
- package/built/pxtblocks/plugins/newVariableField/fieldVariable.d.ts +12 -0
- package/built/pxtblocks/plugins/newVariableField/index.d.ts +1 -0
- package/built/pxtblocks/plugins/renderer/collapsedInputRow.d.ts +7 -0
- package/built/pxtblocks/plugins/renderer/constants.d.ts +42 -0
- package/built/pxtblocks/plugins/renderer/drawer.d.ts +8 -0
- package/built/pxtblocks/plugins/renderer/index.d.ts +1 -0
- package/built/pxtblocks/plugins/renderer/info.d.ts +15 -0
- package/built/pxtblocks/plugins/renderer/pathObject.d.ts +14 -0
- package/built/pxtblocks/plugins/renderer/renderer.d.ts +16 -0
- package/built/pxtblocks/plugins/text/fieldString.d.ts +15 -0
- package/built/pxtblocks/plugins/text/index.d.ts +3 -0
- package/built/pxtblocks/plugins/text/join.d.ts +24 -0
- package/built/pxtblocks/plugins/text/text.d.ts +1 -0
- package/built/pxtblocks/render.d.ts +25 -0
- package/built/pxtblocks/sourceMap.d.ts +8 -0
- package/built/pxtblocks/toolbox.d.ts +14 -0
- package/built/pxtblocks/xml.d.ts +6 -0
- package/built/react-common/components/Notification.d.ts +18 -0
- package/built/react-common/components/animations/Confetti.d.ts +5 -0
- package/built/react-common/components/controls/Button.d.ts +29 -0
- package/built/react-common/components/controls/Card.d.ts +9 -0
- package/built/react-common/components/controls/Checkbox.d.ts +10 -0
- package/built/react-common/components/controls/DraggableGraph.d.ts +13 -0
- package/built/react-common/components/controls/Dropdown.d.ts +14 -0
- package/built/react-common/components/controls/EditorToggle.d.ts +18 -0
- package/built/react-common/components/controls/EmbedVideo.d.ts +8 -0
- package/built/react-common/components/controls/FocusList.d.ts +16 -0
- package/built/react-common/components/controls/FocusTrap.d.ts +10 -0
- package/built/react-common/components/controls/Input.d.ts +27 -0
- package/built/react-common/components/controls/LazyImage.d.ts +7 -0
- package/built/react-common/components/controls/Link.d.ts +7 -0
- package/built/react-common/components/controls/List.d.ts +4 -0
- package/built/react-common/components/controls/MenuBar.d.ts +4 -0
- package/built/react-common/components/controls/MenuDropdown.d.ts +18 -0
- package/built/react-common/components/controls/Modal.d.ts +25 -0
- package/built/react-common/components/controls/ProgressBar.d.ts +9 -0
- package/built/react-common/components/controls/RadioButtonGroup.d.ts +16 -0
- package/built/react-common/components/controls/TeachingBubble.d.ts +22 -0
- package/built/react-common/components/controls/Textarea.d.ts +18 -0
- package/built/react-common/components/controls/Tree.d.ts +15 -0
- package/built/react-common/components/controls/VerticalResizeContainer.d.ts +10 -0
- package/built/react-common/components/controls/VerticalSlider.d.ts +11 -0
- package/built/react-common/components/extensions/DeleteConfirmationModal.d.ts +6 -0
- package/built/react-common/components/extensions/ExtensionCard.d.ts +12 -0
- package/built/react-common/components/extensions/ImportModal.d.ts +5 -0
- package/built/react-common/components/language/LanguageCard.d.ts +14 -0
- package/built/react-common/components/language/LanguageSelector.d.ts +12 -0
- package/built/react-common/components/palette/ColorPickerField.d.ts +7 -0
- package/built/react-common/components/palette/PaletteEditor.d.ts +6 -0
- package/built/react-common/components/palette/PalettePicker.d.ts +7 -0
- package/built/react-common/components/palette/PaletteSwatch.d.ts +5 -0
- package/built/react-common/components/palette/Palettes.d.ts +18 -0
- package/built/react-common/components/profile/Badge.d.ts +7 -0
- package/built/react-common/components/profile/BadgeInfo.d.ts +6 -0
- package/built/react-common/components/profile/BadgeList.d.ts +6 -0
- package/built/react-common/components/profile/Profile.d.ts +12 -0
- package/built/react-common/components/profile/SignInModal.d.ts +14 -0
- package/built/react-common/components/profile/UserNotification.d.ts +4 -0
- package/built/react-common/components/profile/UserPane.d.ts +12 -0
- package/built/react-common/components/share/Kiosk.d.ts +1 -0
- package/built/react-common/components/share/MultiplayerConfirmation.d.ts +6 -0
- package/built/react-common/components/share/Share.d.ts +27 -0
- package/built/react-common/components/share/ShareInfo.d.ts +17 -0
- package/built/react-common/components/share/SocialButton.d.ts +8 -0
- package/built/react-common/components/share/ThumbnailRecorder.d.ts +25 -0
- package/built/react-common/components/util.d.ts +26 -0
- package/built/target.js +1 -1
- package/built/tests/common/testHost.d.ts +18 -0
- package/built/tests/common/testUtils.d.ts +21 -0
- package/built/tests/compile-test/compilerunner.d.ts +3 -0
- package/built/tests/decompile-test/decompilerunner.d.ts +1 -0
- package/built/tests/errors-test/errorrunner.d.ts +2 -0
- package/built/tests/format-test/formatrunner.d.ts +2 -0
- package/built/tests/helpers-test/helperrunner.d.ts +3 -0
- package/built/tests/language-service/languageservicerunner.d.ts +2 -0
- package/built/tests/pxt-editor-test/editorrunner.d.ts +2 -0
- package/built/tests/pyconverter-test/pyconvertrunner.d.ts +2 -0
- package/built/tests/pydecompile-test/pydecompilerunner.d.ts +2 -0
- package/built/tests/runtime-trace-tests/tracerunner.d.ts +3 -0
- package/built/tests/tutorial-test/tutorialrunner.d.ts +2 -0
- package/built/web/pxtweb.d.ts +31 -0
- package/built/web/teachertool/css/main.35eb3dd4.css +1 -0
- package/built/web/teachertool/js/main.70082f23.js +2 -0
- package/package.json +2 -2
- package/scripts/patchUglifyify.js +2 -1
- package/webapp/public/teachertool.html +1 -1
- package/built/web/teachertool/css/main.4df9c5c6.css +0 -1
- package/built/web/teachertool/js/main.bc2da240.js +0 -2
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldCustom, FieldCustomDropdownOptions } from "./field_utils";
|
|
4
|
+
export interface FieldGridPickerToolTipConfig {
|
|
5
|
+
yOffset?: number;
|
|
6
|
+
xOffset?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface FieldGridPickerOptions extends FieldCustomDropdownOptions {
|
|
9
|
+
columns?: string;
|
|
10
|
+
maxRows?: string;
|
|
11
|
+
width?: string;
|
|
12
|
+
tooltips?: string;
|
|
13
|
+
tooltipsXOffset?: string;
|
|
14
|
+
tooltipsYOffset?: string;
|
|
15
|
+
hasSearchBar?: boolean;
|
|
16
|
+
hideRect?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class FieldGridPicker extends Blockly.FieldDropdown implements FieldCustom {
|
|
19
|
+
isFieldCustom_: boolean;
|
|
20
|
+
private width_;
|
|
21
|
+
private columns_;
|
|
22
|
+
private maxRows_;
|
|
23
|
+
protected backgroundColour_: string;
|
|
24
|
+
protected borderColour_: string;
|
|
25
|
+
private tooltipConfig_;
|
|
26
|
+
private gridTooltip_;
|
|
27
|
+
private firstItem_;
|
|
28
|
+
private hasSearchBar_;
|
|
29
|
+
private hideRect_;
|
|
30
|
+
private observer;
|
|
31
|
+
private selectedItemDom;
|
|
32
|
+
private closeModal_;
|
|
33
|
+
private selectedBar_;
|
|
34
|
+
private selectedImg_;
|
|
35
|
+
private selectedBarText_;
|
|
36
|
+
private selectedBarValue_;
|
|
37
|
+
private static DEFAULT_IMG;
|
|
38
|
+
constructor(text: string, options: FieldGridPickerOptions, validator?: Function);
|
|
39
|
+
/**
|
|
40
|
+
* When disposing the grid picker, make sure the tooltips are disposed too.
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
dispose(): void;
|
|
44
|
+
private createTooltip_;
|
|
45
|
+
/**
|
|
46
|
+
* Create blocklyGridPickerRows and add them to table container
|
|
47
|
+
* @param options
|
|
48
|
+
* @param tableContainer
|
|
49
|
+
*/
|
|
50
|
+
private populateTableContainer;
|
|
51
|
+
/**
|
|
52
|
+
* Populate a single row and add it to table container
|
|
53
|
+
* @param row
|
|
54
|
+
* @param options
|
|
55
|
+
* @param tableContainer
|
|
56
|
+
*/
|
|
57
|
+
private populateRow;
|
|
58
|
+
/**
|
|
59
|
+
* Callback for when a button is clicked inside the drop-down.
|
|
60
|
+
* Should be bound to the FieldIconMenu.
|
|
61
|
+
* @param {Event} e DOM event for the click/touch
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
protected buttonClick_: (e: any) => void;
|
|
65
|
+
protected buttonClickAndClose_: (e: any) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Whether or not to show a box around the dropdown menu.
|
|
68
|
+
* @return {boolean} True if we should show a box (rect) around the dropdown menu. Otherwise false.
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
|
+
shouldShowRect_(): boolean;
|
|
72
|
+
doClassValidation_(newValue: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Closes the gridpicker.
|
|
75
|
+
*/
|
|
76
|
+
private close;
|
|
77
|
+
/**
|
|
78
|
+
* Getter method
|
|
79
|
+
*/
|
|
80
|
+
private getFirstItem;
|
|
81
|
+
/**
|
|
82
|
+
* Highlight first item in menu, de-select and de-highlight all others
|
|
83
|
+
*/
|
|
84
|
+
private highlightFirstItem;
|
|
85
|
+
/**
|
|
86
|
+
* Scroll menu to item that equals current value of gridpicker
|
|
87
|
+
*/
|
|
88
|
+
private highlightAndScrollSelected;
|
|
89
|
+
/**
|
|
90
|
+
* Create a dropdown menu under the text.
|
|
91
|
+
* @private
|
|
92
|
+
*/
|
|
93
|
+
showEditor_(): void;
|
|
94
|
+
private positionMenu_;
|
|
95
|
+
private shouldShowTooltips;
|
|
96
|
+
private getAnchorDimensions_;
|
|
97
|
+
private createWidget_;
|
|
98
|
+
private createSearchBar_;
|
|
99
|
+
private createSelectedBar_;
|
|
100
|
+
private updateSelectedBar_;
|
|
101
|
+
private setupIntersectionObserver_;
|
|
102
|
+
private disposeIntersectionObserver;
|
|
103
|
+
/**
|
|
104
|
+
* Disposes the tooltip DOM.
|
|
105
|
+
* @private
|
|
106
|
+
*/
|
|
107
|
+
private disposeTooltip;
|
|
108
|
+
private onClose_;
|
|
109
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import { FieldCustom, FieldCustomDropdownOptions } from "./field_utils";
|
|
3
|
+
import { FieldDropdown } from "./field_dropdown";
|
|
4
|
+
export interface FieldImageDropdownOptions extends FieldCustomDropdownOptions {
|
|
5
|
+
columns?: string;
|
|
6
|
+
maxRows?: string;
|
|
7
|
+
width?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class FieldImageDropdown extends FieldDropdown implements FieldCustom {
|
|
10
|
+
isFieldCustom_: boolean;
|
|
11
|
+
protected width_: number;
|
|
12
|
+
protected columns_: number;
|
|
13
|
+
protected maxRows_: number;
|
|
14
|
+
protected backgroundColour_: string;
|
|
15
|
+
protected borderColour_: string;
|
|
16
|
+
protected savedPrimary_: string;
|
|
17
|
+
constructor(text: string, options: FieldImageDropdownOptions, validator?: Function);
|
|
18
|
+
/**
|
|
19
|
+
* Create a dropdown menu under the text.
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
showEditor_(): void;
|
|
23
|
+
doValueUpdate_(newValue: any): void;
|
|
24
|
+
/**
|
|
25
|
+
* Callback for when a button is clicked inside the drop-down.
|
|
26
|
+
* Should be bound to the FieldIconMenu.
|
|
27
|
+
* @param {Event} e DOM event for the click/touch
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
protected buttonClick_: (e: MouseEvent) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Callback for when the drop-down is hidden.
|
|
33
|
+
*/
|
|
34
|
+
protected onHide_(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import { FieldImageDropdown, FieldImageDropdownOptions } from "./field_imagedropdown";
|
|
3
|
+
import { FieldCustom } from "./field_utils";
|
|
4
|
+
export interface FieldImagesOptions extends FieldImageDropdownOptions {
|
|
5
|
+
sort?: boolean;
|
|
6
|
+
addLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FieldImages extends FieldImageDropdown implements FieldCustom {
|
|
9
|
+
isFieldCustom_: boolean;
|
|
10
|
+
private shouldSort_;
|
|
11
|
+
protected addLabel_: boolean;
|
|
12
|
+
constructor(text: string, options: FieldImagesOptions, validator?: Function);
|
|
13
|
+
/**
|
|
14
|
+
* Create a dropdown menu under the text.
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
showEditor_(): void;
|
|
18
|
+
protected onHideCallback(): void;
|
|
19
|
+
protected createTextNode_(text: string): HTMLSpanElement;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldDropdown } from "./field_dropdown";
|
|
4
|
+
export declare class FieldKind extends FieldDropdown {
|
|
5
|
+
private opts;
|
|
6
|
+
constructor(opts: pxtc.KindInfo);
|
|
7
|
+
initView(): void;
|
|
8
|
+
onItemSelected_(menu: Blockly.Menu, menuItem: Blockly.MenuItem): void;
|
|
9
|
+
doClassValidation_(value: any): string;
|
|
10
|
+
getOptions(opt_useCache?: boolean): Blockly.MenuOption[];
|
|
11
|
+
private initVariables;
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
/// <reference path="../../pxtsim.d.ts" />
|
|
3
|
+
import * as Blockly from "blockly";
|
|
4
|
+
import { FieldCustom } from "./field_utils";
|
|
5
|
+
export declare class FieldMatrix extends Blockly.Field implements FieldCustom {
|
|
6
|
+
private static CELL_WIDTH;
|
|
7
|
+
private static CELL_HORIZONTAL_MARGIN;
|
|
8
|
+
private static CELL_VERTICAL_MARGIN;
|
|
9
|
+
private static CELL_CORNER_RADIUS;
|
|
10
|
+
private static BOTTOM_MARGIN;
|
|
11
|
+
private static Y_AXIS_WIDTH;
|
|
12
|
+
private static X_AXIS_HEIGHT;
|
|
13
|
+
private static TAB;
|
|
14
|
+
isFieldCustom_: boolean;
|
|
15
|
+
SERIALIZABLE: boolean;
|
|
16
|
+
private params;
|
|
17
|
+
private onColor;
|
|
18
|
+
private offColor;
|
|
19
|
+
private static DEFAULT_OFF_COLOR;
|
|
20
|
+
private scale;
|
|
21
|
+
private matrixWidth;
|
|
22
|
+
private matrixHeight;
|
|
23
|
+
private yAxisLabel;
|
|
24
|
+
private xAxisLabel;
|
|
25
|
+
private cellState;
|
|
26
|
+
private cells;
|
|
27
|
+
private elt;
|
|
28
|
+
private currentDragState_;
|
|
29
|
+
constructor(text: string, params: any, validator?: Blockly.FieldValidator);
|
|
30
|
+
/**
|
|
31
|
+
* Show the inline free-text editor on top of the text.
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
34
|
+
showEditor_(): void;
|
|
35
|
+
private initMatrix;
|
|
36
|
+
private getLabel;
|
|
37
|
+
private dontHandleMouseEvent_;
|
|
38
|
+
private clearLedDragHandler;
|
|
39
|
+
private createCell;
|
|
40
|
+
private toggleRect;
|
|
41
|
+
private handleRootMouseMoveListener;
|
|
42
|
+
private getColor;
|
|
43
|
+
private getOpacity;
|
|
44
|
+
private updateCell;
|
|
45
|
+
setValue(newValue: string | number, restoreState?: boolean): void;
|
|
46
|
+
render_(): void;
|
|
47
|
+
getValue(): string;
|
|
48
|
+
private restoreStateFromString;
|
|
49
|
+
private updateValue;
|
|
50
|
+
private getYAxisWidth;
|
|
51
|
+
private getXAxisHeight;
|
|
52
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import svg = pxt.svgUtil;
|
|
4
|
+
import { FieldCustom, FieldCustomOptions } from "./field_utils";
|
|
5
|
+
export declare const HEADER_HEIGHT = 50;
|
|
6
|
+
export declare const TOTAL_WIDTH = 300;
|
|
7
|
+
export declare class FieldCustomMelody<U extends FieldCustomOptions> extends Blockly.Field implements FieldCustom {
|
|
8
|
+
isFieldCustom_: boolean;
|
|
9
|
+
SERIALIZABLE: boolean;
|
|
10
|
+
protected params: U;
|
|
11
|
+
private melody;
|
|
12
|
+
private soundingKeys;
|
|
13
|
+
private numRow;
|
|
14
|
+
private numCol;
|
|
15
|
+
private tempo;
|
|
16
|
+
private stringRep;
|
|
17
|
+
private isPlaying;
|
|
18
|
+
private timeouts;
|
|
19
|
+
private invalidString;
|
|
20
|
+
private prevString;
|
|
21
|
+
private topDiv;
|
|
22
|
+
private editorDiv;
|
|
23
|
+
private gridDiv;
|
|
24
|
+
private bottomDiv;
|
|
25
|
+
private doneButton;
|
|
26
|
+
private playButton;
|
|
27
|
+
private playIcon;
|
|
28
|
+
private tempoInput;
|
|
29
|
+
private static CELL_WIDTH;
|
|
30
|
+
private static CELL_HORIZONTAL_MARGIN;
|
|
31
|
+
private static CELL_VERTICAL_MARGIN;
|
|
32
|
+
private static CELL_CORNER_RADIUS;
|
|
33
|
+
private elt;
|
|
34
|
+
private cells;
|
|
35
|
+
private static VIEWBOX_WIDTH;
|
|
36
|
+
private static VIEWBOX_HEIGHT;
|
|
37
|
+
private static COLOR_BLOCK_WIDTH;
|
|
38
|
+
private static COLOR_BLOCK_HEIGHT;
|
|
39
|
+
private static COLOR_BLOCK_X;
|
|
40
|
+
private static COLOR_BLOCK_Y;
|
|
41
|
+
private static COLOR_BLOCK_SPACING;
|
|
42
|
+
private static MUSIC_ICON_WIDTH;
|
|
43
|
+
private toggle;
|
|
44
|
+
private root;
|
|
45
|
+
private gallery;
|
|
46
|
+
constructor(value: string, params: U, validator?: Blockly.FieldValidator);
|
|
47
|
+
init(): void;
|
|
48
|
+
showEditor_(): void;
|
|
49
|
+
getValue(): string;
|
|
50
|
+
doValueUpdate_(newValue: string): void;
|
|
51
|
+
getText_(): string;
|
|
52
|
+
protected onInit(): void;
|
|
53
|
+
render_(): void;
|
|
54
|
+
protected renderEditor(div: HTMLDivElement): void;
|
|
55
|
+
protected onEditorClose(): void;
|
|
56
|
+
private onDone;
|
|
57
|
+
private clearDomReferences;
|
|
58
|
+
protected getTypeScriptValue(): string;
|
|
59
|
+
protected parseTypeScriptValue(value: string): void;
|
|
60
|
+
private isValidNote;
|
|
61
|
+
protected getPreviewWidth(): number;
|
|
62
|
+
protected getPreviewHeight(): number;
|
|
63
|
+
protected getDropdownBackgroundColour(): string;
|
|
64
|
+
protected getDropdownBorderColour(): string;
|
|
65
|
+
private updateFieldLabel;
|
|
66
|
+
private setTempo;
|
|
67
|
+
private syncTempoField;
|
|
68
|
+
private getDuration;
|
|
69
|
+
private createMelodyIfDoesntExist;
|
|
70
|
+
private onNoteSelect;
|
|
71
|
+
private updateGrid;
|
|
72
|
+
private playNote;
|
|
73
|
+
protected queueToneForColumn(column: number, delay: number, duration: number): void;
|
|
74
|
+
protected playToneCore(row: number): void;
|
|
75
|
+
private highlightColumn;
|
|
76
|
+
private createGridDisplay;
|
|
77
|
+
private createCell;
|
|
78
|
+
private togglePlay;
|
|
79
|
+
private updatePlayButton;
|
|
80
|
+
private playMelody;
|
|
81
|
+
private stopMelody;
|
|
82
|
+
private showGallery;
|
|
83
|
+
private hideGallery;
|
|
84
|
+
}
|
|
85
|
+
export interface ButtonGroup {
|
|
86
|
+
root: svg.Group;
|
|
87
|
+
cx: number;
|
|
88
|
+
cy: number;
|
|
89
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import { FieldAssetEditor } from "./field_asset";
|
|
3
|
+
export interface FieldMusicEditorOptions {
|
|
4
|
+
}
|
|
5
|
+
interface ParsedFieldMusicEditorOptions {
|
|
6
|
+
}
|
|
7
|
+
export declare class FieldMusicEditor extends FieldAssetEditor<FieldMusicEditorOptions, ParsedFieldMusicEditorOptions> {
|
|
8
|
+
protected getAssetType(): pxt.AssetType;
|
|
9
|
+
protected createNewAsset(text?: string): pxt.Asset;
|
|
10
|
+
render_(): void;
|
|
11
|
+
protected getValueText(): string;
|
|
12
|
+
protected parseFieldOptions(opts: FieldMusicEditorOptions): ParsedFieldMusicEditorOptions;
|
|
13
|
+
protected redrawPreview(): void;
|
|
14
|
+
protected previewWidth(): number;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldCustomOptions, FieldCustom } from "./field_utils";
|
|
4
|
+
export interface FieldNoteOptions extends FieldCustomOptions {
|
|
5
|
+
editorColour?: string;
|
|
6
|
+
minNote?: string;
|
|
7
|
+
maxNote?: string;
|
|
8
|
+
eps?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class FieldNote extends Blockly.FieldNumber implements FieldCustom {
|
|
11
|
+
isFieldCustom_: boolean;
|
|
12
|
+
SERIALIZABLE: boolean;
|
|
13
|
+
isTextValid_: boolean;
|
|
14
|
+
private static Notes;
|
|
15
|
+
protected static readonly keyWidth = 22;
|
|
16
|
+
protected static readonly keyHeight = 90;
|
|
17
|
+
protected static readonly labelHeight = 24;
|
|
18
|
+
protected static readonly prevNextHeight = 20;
|
|
19
|
+
protected static readonly notesPerOctave = 12;
|
|
20
|
+
protected static readonly blackKeysPerOctave = 5;
|
|
21
|
+
/**
|
|
22
|
+
* default number of piano keys
|
|
23
|
+
*/
|
|
24
|
+
protected nKeys_: number;
|
|
25
|
+
protected minNote_: number;
|
|
26
|
+
protected maxNote_: number;
|
|
27
|
+
/** Absolute error for note frequency identification (Hz) **/
|
|
28
|
+
protected eps: number;
|
|
29
|
+
protected primaryColour: string;
|
|
30
|
+
protected borderColour: string;
|
|
31
|
+
protected isExpanded: Boolean;
|
|
32
|
+
protected totalPlayCount: number;
|
|
33
|
+
protected currentPage: number;
|
|
34
|
+
protected piano: HTMLDivElement[];
|
|
35
|
+
protected noteLabel: HTMLDivElement;
|
|
36
|
+
protected currentSelectedKey: HTMLDivElement;
|
|
37
|
+
constructor(text: string, params: FieldNoteOptions, validator?: Blockly.FieldValidator);
|
|
38
|
+
/**
|
|
39
|
+
* Ensure that only a non negative number may be entered.
|
|
40
|
+
* @param {string} text The user's text.
|
|
41
|
+
* @return A string representing a valid positive number, or null if invalid.
|
|
42
|
+
*/
|
|
43
|
+
doClassValidation_(text: string): number;
|
|
44
|
+
/**
|
|
45
|
+
* Return the current note frequency.
|
|
46
|
+
* @return Current note in string format.
|
|
47
|
+
*/
|
|
48
|
+
getValue(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Called by setValue if the text input is valid. Updates the value of the
|
|
51
|
+
* field, and updates the text of the field if it is not currently being
|
|
52
|
+
* edited (i.e. handled by the htmlInput_).
|
|
53
|
+
* @param {string} note The new note in string format.
|
|
54
|
+
*/
|
|
55
|
+
doValueUpdate_(note: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get the text from this field
|
|
58
|
+
* @return Current text.
|
|
59
|
+
*/
|
|
60
|
+
getText(): string;
|
|
61
|
+
/**
|
|
62
|
+
* This block shows up differently when it's being edited;
|
|
63
|
+
* on any transition between `editing <--> not-editing`
|
|
64
|
+
* or other change in state,
|
|
65
|
+
* refresh the text to get back into a valid state.
|
|
66
|
+
**/
|
|
67
|
+
protected refreshText(): void;
|
|
68
|
+
onFinishEditing_(text: string): void;
|
|
69
|
+
protected onHide(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Create a piano under the note field.
|
|
72
|
+
*/
|
|
73
|
+
showEditor_(e: Event): void;
|
|
74
|
+
protected playKey(key: HTMLDivElement, frequency: number): void;
|
|
75
|
+
/**
|
|
76
|
+
* Close the note picker if this input is being deleted.
|
|
77
|
+
*/
|
|
78
|
+
dispose(): void;
|
|
79
|
+
private updateColor;
|
|
80
|
+
protected setPage(page: number): void;
|
|
81
|
+
/**
|
|
82
|
+
* create a DOM to assign a style to the previous and next buttons
|
|
83
|
+
* @param pianoWidth the width of the containing piano
|
|
84
|
+
* @param isPrev true if is previous button, false otherwise
|
|
85
|
+
* @return DOM with the new css style.s
|
|
86
|
+
*/
|
|
87
|
+
protected getNextPrevDiv(isPrev: boolean, pianoWidth: number): HTMLDivElement;
|
|
88
|
+
protected getKeyDiv(keyInd: number, leftPosition: number): HTMLDivElement;
|
|
89
|
+
/**
|
|
90
|
+
* @param idx index of the key
|
|
91
|
+
* @return true if idx is white
|
|
92
|
+
*/
|
|
93
|
+
protected isWhite(idx: number): boolean;
|
|
94
|
+
protected whiteKeysBefore(idx: number): number;
|
|
95
|
+
/**
|
|
96
|
+
* get width of the piano key
|
|
97
|
+
* @param idx index of the key
|
|
98
|
+
* @return width of the key
|
|
99
|
+
*/
|
|
100
|
+
protected getKeyWidth(idx: number): number;
|
|
101
|
+
/**
|
|
102
|
+
* get height of the piano key
|
|
103
|
+
* @param idx index of the key
|
|
104
|
+
* @return height of the key
|
|
105
|
+
*/
|
|
106
|
+
protected getKeyHeight(idx: number): number;
|
|
107
|
+
protected getKeyFreq(keyIndex: number): number;
|
|
108
|
+
protected getKeyName(keyIndex: number): string;
|
|
109
|
+
private getKeyNoteData;
|
|
110
|
+
/**
|
|
111
|
+
* get the position of the key in the piano
|
|
112
|
+
* @param idx index of the key
|
|
113
|
+
* @return position of the key
|
|
114
|
+
*/
|
|
115
|
+
protected getPosition(idx: number): number;
|
|
116
|
+
private prepareNotes;
|
|
117
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldCustom, FieldCustomDropdownOptions } from "./field_utils";
|
|
4
|
+
import { BaseFieldTextDropdown } from "./field_textdropdown";
|
|
5
|
+
declare class BaseFieldNumberDropdown extends BaseFieldTextDropdown {
|
|
6
|
+
min_: number;
|
|
7
|
+
max_: number;
|
|
8
|
+
precision_: number;
|
|
9
|
+
decimalPlaces: number;
|
|
10
|
+
constructor(value: number | string, menuGenerator: Blockly.MenuOption[], opt_min?: number, opt_max?: number, opt_precision?: number, opt_validator?: Blockly.FieldValidator);
|
|
11
|
+
setConstraints(min: number | string | undefined | null, max: number | string | undefined | null, precision: number | string | undefined | null): void;
|
|
12
|
+
getValue(): string;
|
|
13
|
+
private setMinInternal;
|
|
14
|
+
private setMaxInternal;
|
|
15
|
+
private setPrecisionInternal;
|
|
16
|
+
protected doClassValidation_(newValue?: any): string;
|
|
17
|
+
}
|
|
18
|
+
export interface FieldNumberDropdownOptions extends FieldCustomDropdownOptions {
|
|
19
|
+
min?: number;
|
|
20
|
+
max?: number;
|
|
21
|
+
precision?: any;
|
|
22
|
+
}
|
|
23
|
+
export declare class FieldNumberDropdown extends BaseFieldNumberDropdown implements FieldCustom {
|
|
24
|
+
isFieldCustom_: boolean;
|
|
25
|
+
constructor(value: number | string, options: FieldNumberDropdownOptions, opt_validator?: Blockly.FieldValidator);
|
|
26
|
+
getOptions(): [string, string][];
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldSlider } from "../plugins/math";
|
|
4
|
+
import { FieldCustomOptions, FieldCustom } from "./field_utils";
|
|
5
|
+
export interface FieldPositionOptions extends FieldCustomOptions {
|
|
6
|
+
min?: string;
|
|
7
|
+
max?: string;
|
|
8
|
+
screenWidth?: number;
|
|
9
|
+
screenHeight?: number;
|
|
10
|
+
xInputName?: string;
|
|
11
|
+
yInputName?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class FieldPosition extends FieldSlider implements FieldCustom {
|
|
14
|
+
isFieldCustom_: boolean;
|
|
15
|
+
private params;
|
|
16
|
+
private selectorDiv_;
|
|
17
|
+
private resetCrosshair;
|
|
18
|
+
constructor(text: string, params: FieldPositionOptions, validator?: Blockly.FieldValidator);
|
|
19
|
+
showEditor_(_opt_e?: Event): void;
|
|
20
|
+
doValueUpdate_(value: string): void;
|
|
21
|
+
protected renderScreenPicker(): void;
|
|
22
|
+
private resizeHandler;
|
|
23
|
+
private setXY;
|
|
24
|
+
private getFieldByName;
|
|
25
|
+
private getXY;
|
|
26
|
+
private getTargetField;
|
|
27
|
+
widgetDispose_(): void;
|
|
28
|
+
private close;
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldDropdown } from "./field_dropdown";
|
|
4
|
+
export declare class FieldProcedure extends FieldDropdown {
|
|
5
|
+
protected rawValue: string;
|
|
6
|
+
constructor(funcname: string, opt_validator?: Blockly.FieldValidator);
|
|
7
|
+
getOptions(useCache?: boolean): Blockly.MenuOption[];
|
|
8
|
+
protected doClassValidation_(newValue?: string): string;
|
|
9
|
+
protected doValueUpdate_(newValue: string): void;
|
|
10
|
+
init(): void;
|
|
11
|
+
setSourceBlock(block: Blockly.Block): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldSlider } from "../plugins/math";
|
|
4
|
+
import { FieldCustomOptions, FieldCustom } from "./field_utils";
|
|
5
|
+
export interface FieldProtractorOptions extends FieldCustomOptions {
|
|
6
|
+
}
|
|
7
|
+
export declare class FieldProtractor extends FieldSlider implements FieldCustom {
|
|
8
|
+
isFieldCustom_: boolean;
|
|
9
|
+
private params;
|
|
10
|
+
private circleSVG;
|
|
11
|
+
private circleBar;
|
|
12
|
+
private reporter;
|
|
13
|
+
/**
|
|
14
|
+
* Class for a color wheel field.
|
|
15
|
+
* @param {number|string} value The initial content of the field.
|
|
16
|
+
* @param {Function=} opt_validator An optional function that is called
|
|
17
|
+
* to validate any constraints on what the user entered. Takes the new
|
|
18
|
+
* text as an argument and returns either the accepted text, a replacement
|
|
19
|
+
* text, or null to abort the change.
|
|
20
|
+
* @extends {Blockly.FieldNumber}
|
|
21
|
+
* @constructor
|
|
22
|
+
*/
|
|
23
|
+
constructor(value_: any, params: FieldProtractorOptions, opt_validator?: Blockly.FieldValidator);
|
|
24
|
+
createLabelDom_(labelText: string): [HTMLDivElement, HTMLSpanElement];
|
|
25
|
+
setReadout(value: string | number): void;
|
|
26
|
+
private updateAngle;
|
|
27
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldBase } from "./field_base";
|
|
4
|
+
import { FieldCustomOptions } from "./field_utils";
|
|
5
|
+
export interface FieldSoundEffectParams extends FieldCustomOptions {
|
|
6
|
+
durationInputName: string;
|
|
7
|
+
startFrequencyInputName: string;
|
|
8
|
+
endFrequencyInputName: string;
|
|
9
|
+
startVolumeInputName: string;
|
|
10
|
+
endVolumeInputName: string;
|
|
11
|
+
waveFieldName: string;
|
|
12
|
+
interpolationFieldName: string;
|
|
13
|
+
effectFieldName: string;
|
|
14
|
+
useMixerSynthesizer: any;
|
|
15
|
+
}
|
|
16
|
+
export declare class FieldSoundEffect extends FieldBase<FieldSoundEffectParams> {
|
|
17
|
+
protected mostRecentValue: pxt.assets.Sound;
|
|
18
|
+
protected drawnSound: pxt.assets.Sound;
|
|
19
|
+
protected workspace: Blockly.Workspace;
|
|
20
|
+
protected registeredChangeListener: boolean;
|
|
21
|
+
protected onInit(): void;
|
|
22
|
+
protected onDispose(): void;
|
|
23
|
+
protected onValueChanged(newValue: string): string;
|
|
24
|
+
redrawPreview(): void;
|
|
25
|
+
showEditor_(): void;
|
|
26
|
+
render_(): void;
|
|
27
|
+
protected updateSiblingBlocks(sound: pxt.assets.Sound): void;
|
|
28
|
+
protected setNumberInputValue(name: string, value: number): void;
|
|
29
|
+
protected getNumberInputValue(name: string, defaultValue: number): number;
|
|
30
|
+
protected fireNumberInputUpdate(name: string, oldValue: number): void;
|
|
31
|
+
protected setFieldDropdownValue(name: string, value: string): void;
|
|
32
|
+
protected getFieldDropdownValue(name: string): string;
|
|
33
|
+
protected fireFieldDropdownUpdate(name: string, oldValue: string): void;
|
|
34
|
+
protected readCurrentSound(): pxt.assets.Sound;
|
|
35
|
+
protected readBlockDataSound(): pxt.assets.Sound;
|
|
36
|
+
protected onWorkspaceChange: (ev: Blockly.Events.BlockChange) => void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldSlider } from "../plugins/math";
|
|
4
|
+
import { FieldCustomOptions, FieldCustom } from "./field_utils";
|
|
5
|
+
export interface FieldSpeedOptions extends FieldCustomOptions {
|
|
6
|
+
min?: string;
|
|
7
|
+
max?: string;
|
|
8
|
+
format?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class FieldSpeed extends FieldSlider implements FieldCustom {
|
|
12
|
+
isFieldCustom_: boolean;
|
|
13
|
+
private params;
|
|
14
|
+
private speedSVG;
|
|
15
|
+
private circleBar;
|
|
16
|
+
private reporter;
|
|
17
|
+
/**
|
|
18
|
+
* Class for a color wheel field.
|
|
19
|
+
* @param {number|string} value The initial content of the field.
|
|
20
|
+
* @param {Function=} opt_validator An optional function that is called
|
|
21
|
+
* to validate any constraints on what the user entered. Takes the new
|
|
22
|
+
* text as an argument and returns either the accepted text, a replacement
|
|
23
|
+
* text, or null to abort the change.
|
|
24
|
+
* @extends {Blockly.FieldNumber}
|
|
25
|
+
* @constructor
|
|
26
|
+
*/
|
|
27
|
+
constructor(value_: any, params: FieldSpeedOptions, opt_validator?: Blockly.FieldValidator);
|
|
28
|
+
createLabelDom_(labelText: string): [HTMLDivElement, HTMLSpanElement];
|
|
29
|
+
setReadout(value: string | number): void;
|
|
30
|
+
private updateSpeed;
|
|
31
|
+
private sign;
|
|
32
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import { FieldAssetEditor } from "./field_asset";
|
|
3
|
+
export interface FieldSpriteEditorOptions {
|
|
4
|
+
sizes: string;
|
|
5
|
+
initColor: string;
|
|
6
|
+
initWidth: string;
|
|
7
|
+
initHeight: string;
|
|
8
|
+
disableResize: string;
|
|
9
|
+
filter?: string;
|
|
10
|
+
lightMode: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ParsedSpriteEditorOptions {
|
|
13
|
+
initColor: number;
|
|
14
|
+
initWidth: number;
|
|
15
|
+
initHeight: number;
|
|
16
|
+
disableResize: boolean;
|
|
17
|
+
filter?: string;
|
|
18
|
+
lightMode: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class FieldSpriteEditor extends FieldAssetEditor<FieldSpriteEditorOptions, ParsedSpriteEditorOptions> {
|
|
21
|
+
protected getAssetType(): pxt.AssetType;
|
|
22
|
+
protected createNewAsset(text?: string): pxt.Asset;
|
|
23
|
+
protected getValueText(): string;
|
|
24
|
+
protected parseFieldOptions(opts: FieldSpriteEditorOptions): ParsedSpriteEditorOptions;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference path="../../pxtlib.d.ts" />
|
|
2
|
+
import * as Blockly from "blockly";
|
|
3
|
+
import { FieldCustomOptions, FieldCustom } from "./field_utils";
|
|
4
|
+
export interface StyleOptions extends FieldCustomOptions {
|
|
5
|
+
bold: boolean;
|
|
6
|
+
italics: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class FieldStyledLabel extends Blockly.FieldLabel implements FieldCustom {
|
|
9
|
+
isFieldCustom_: boolean;
|
|
10
|
+
constructor(value: string, options?: StyleOptions, opt_validator?: Function);
|
|
11
|
+
}
|