Skip to content

Commit 262a821

Browse files
committed
Merge branch 'master' of https://github.com/microsoft/pxt into tball/settingSizeConfig
2 parents d6fa059 + a0fc939 commit 262a821

File tree

92 files changed

+1208
-656
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1208
-656
lines changed

cli/cli.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,6 +2647,7 @@ async function buildTargetCoreAsync(options: BuildTargetOptions = {}) {
26472647
delete targetlight.compile.compilerExtension;
26482648
const targetlightjson = nodeutil.stringify(targetlight);
26492649
nodeutil.writeFileSync("built/targetlight.json", targetlightjson)
2650+
nodeutil.writeFileSync("built/targetlight.js", targetJsPrefix + targetlightjson)
26502651
nodeutil.writeFileSync("built/sim.webmanifest", nodeutil.stringify(webmanifest))
26512652

26522653
console.log("target.json built.");
@@ -7352,10 +7353,10 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
73527353
name: "buildskillmap",
73537354
aliases: ["skillmap"],
73547355
advanced: true,
7355-
help: "Serves the skill map webapp",
7356+
help: "Serves the skillmap webapp",
73567357
flags: {
73577358
serve: {
7358-
description: "Serve the skill map locally after building (npm start)"
7359+
description: "Serve the skillmap locally after building (npm start)"
73597360
},
73607361
docs: {
73617362
description: "Path to local docs folder to copy into skillmap",
773 Bytes
Loading

docs/blog/arcade/update-jan-2021.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ For those of you paying close attention, you may have noticed a new "Game Maker
144144

145145
We are experimenting with a new format for tutorials where there are a series of tutorial activities which build upon each other through progressive levels of difficulty. This helps provide a bit more guidance to students on a recommended progression path It also helps keep individual tutorials shorter.
146146

147-
![Skills map](/static/blog/arcade/update-jan-2021/skills-map.png)
147+
![Skillmap](/static/blog/arcade/update-jan-2021/skills-map.png)
148148

149149
Right now we have 2 learning paths available in the Game Maker Guide – Design a Space Explorer game, and Learn to Make a Platformer. Students must complete a sequence of tutorials in order – once they complete a tutorial, the next tutorial in the series unlocks.
150150

localtypings/ocv.d.ts

Lines changed: 67 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ declare namespace ocv {
22

33
type FeedbackKind = "generic" | "rating";
44

5-
const enum FeedbackAgeGroup {
6-
Undefined = "Undefined",
7-
MinorWithoutParentalConsent = "MinorWithoutParentalConsent",
8-
MinorWithParentalConsent = "MinorWithParentalConsent",
9-
NotAdult = "NotAdult",
10-
Adult = "Adult",
11-
MinorNoParentalConsentRequired = "MinorNoParentalConsentRequired"
12-
}
5+
type FeedbackAgeGroup =
6+
| "Undefined"
7+
| "MinorWithoutParentalConsent"
8+
| "MinorWithParentalConsent"
9+
| "NotAdult"
10+
| "Adult"
11+
| "MinorNoParentalConsentRequired";
1312

1413
interface IFeedbackCallbackFunctions {
1514
attachDiagnosticsLogs?: (diagnosticsUploadId: string, diagnosticsEndpoint: string) => void;
@@ -21,26 +20,12 @@ declare namespace ocv {
2120
setSubmitButtonState?: (isEnabled: boolean) => void;
2221
}
2322

24-
const enum FeedbackAuthenticationType {
25-
MSA = "MSA",
26-
AAD = "AAD",
27-
Unauthenticated = "Unauthenticated"
28-
}
2923

30-
const enum FeedbackType {
31-
Smile = "Smile",
32-
Frown = "Frown",
33-
Idea = "Idea",
34-
Unclassified = "Unclassified",
35-
Survey = "Survey"
36-
}
24+
type FeedbackAuthenticationType = "MSA" | "AAD" | "Unauthenticated";
3725

38-
const enum FeedbackPolicyValue {
39-
Enabled = "Enabled",
40-
Disabled = "Disabled",
41-
NotConfigured = "Not Configured",
42-
NotApplicable = "Not Applicable"
43-
}
26+
type FeedbackType = "Smile" | "Frown" | "Idea" | "Unclassified" | "Survey";
27+
28+
type FeedbackPolicyValue = "Enabled" | "Disabled" | "Not Configured" | "Not Applicable";
4429

4530
interface IThemeOptions {
4631
isFluentV9?: boolean;
@@ -68,79 +53,63 @@ declare namespace ocv {
6853
themeOptions?: IThemeOptions;
6954
}
7055

71-
const enum FeedbackUiType {
72-
SidePane = "SidePane",// Default: Used for side pane/detail view
73-
Modal = "Modal",// Used for modal view
74-
CallOut = "CallOut",// Used for inscreen pop up dialogue
75-
IFrameWithinSidePane = "IFrameWithinSidePane",// Same as side pane but used inside an iframe
76-
IFrameWithinModal = "IFrameWithinModal",// Same as modal but used inside an iframe
77-
IFrameWithinCallOut = "IFrameWithinCallOut",// Same as callout but used inside an iframe
78-
NoSurface = "NoSurface",// Used when the surface is provided by the host app
79-
NoSurfaceWithoutTitle = "NoSurfaceWithoutTitle"
80-
}
81-
82-
const enum FeedbackHostPlatformType {
83-
Windows = "Windows",
84-
IOS = "iOS",
85-
Android = "Android",
86-
WacTaskPane = "WacTaskPane",
87-
MacOS = "MacOS",
88-
Web = "Web",
89-
IFrame = "IFrame"
90-
}
91-
92-
const enum FeedbackHostEventName {
93-
SubmitClicked = "InAppFeedback_HostEvent_SubmitClicked",
94-
BackClicked = "InAppFeedback_HostEvent_BackClicked"
95-
}
96-
97-
const enum InitializationStatus {
98-
Success = "Success",
99-
Error = "Error",
100-
Warning = "Warning"
101-
}
102-
103-
const enum InAppFeedbackQuestionUiType {
104-
DropDown = "DropDown",
105-
MultiSelect = "MultiSelect",
106-
Rating = "Rating",
107-
SingleSelect = "SingleSelect",
108-
SingleSelectHorizontal = "SingleSelectHorizontal"
109-
}
110-
111-
const enum InAppFeedbackScenarioType {
112-
FeatureArea = "FeatureArea",
113-
ResponsibleAI = "ResponsibleAI",
114-
Experience = "Experience",
115-
ProductSatisfaction = "ProductSatisfaction",
116-
CrashImpact = "CrashImpact",// CrashImpact is of type Survey
117-
Custom = "Custom",
118-
AIThumbsDown = "AIThumbsDown",
119-
AIThumbsUp = "AIThumbsUp",
120-
AIError = "AIError",
121-
PromptSuggestion = "PromptSuggestion"
122-
}
123-
124-
const enum InAppFeedbackQuestionUiBehaviour {
125-
QuestionNotRequired = "QuestionNotRequired",
126-
CommentNotRequired = "CommentNotRequired",
127-
CommentRequiredWithLastOption = "CommentRequiredWithLastOption"
128-
}
129-
130-
const enum FeedbackAttachmentOrigin {
131-
Application = "Application",
132-
User = "User"
133-
}
134-
135-
const enum FeedbackEntryPoint {
136-
Header = "Header",
137-
Footer = "Footer",
138-
Backstage = "Backstage",
139-
HelpMenu = "Help Menu",
140-
Canvas = "Canvas",
141-
Chat = "Chat"
142-
}
56+
type FeedbackUiType =
57+
| "SidePane"
58+
| "Modal"
59+
| "CallOut"
60+
| "IFrameWithinSidePane"
61+
| "IFrameWithinModal"
62+
| "IFrameWithinCallOut"
63+
| "NoSurface"
64+
| "NoSurfaceWithoutTitle";
65+
66+
67+
type FeedbackHostPlatformType =
68+
| "Windows"
69+
| "iOS"
70+
| "Android"
71+
| "WacTaskPane"
72+
| "MacOS"
73+
| "Web"
74+
| "IFrame";
75+
76+
type FeedbackHostEventName = "InAppFeedback_HostEvent_SubmitClicked" | "InAppFeedback_HostEvent_BackClicked";
77+
78+
type InitializationStatus = "Success" | "Error" | "Warning";
79+
80+
type InAppFeedbackQuestionUiType =
81+
| "DropDown"
82+
| "MultiSelect"
83+
| "Rating"
84+
| "SingleSelect"
85+
| "SingleSelectHorizontal";
14386

87+
type InAppFeedbackScenarioType =
88+
| "FeatureArea"
89+
| "ResponsibleAI"
90+
| "Experience"
91+
| "ProductSatisfaction"
92+
| "CrashImpact"
93+
| "Custom"
94+
| "AIThumbsDown"
95+
| "AIThumbsUp"
96+
| "AIError"
97+
| "PromptSuggestion";
98+
99+
type InAppFeedbackQuestionUiBehaviour =
100+
| "QuestionNotRequired"
101+
| "CommentNotRequired"
102+
| "CommentRequiredWithLastOption";
103+
104+
type FeedbackAttachmentOrigin = "Application" | "User";
105+
106+
type FeedbackEntryPoint =
107+
| "Header"
108+
| "Footer"
109+
| "Backstage"
110+
| "Help Menu"
111+
| "Canvas"
112+
| "Chat";
144113
interface InitializationResult {
145114
status: InitializationStatus;
146115
/**

localtypings/pxtarget.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,6 @@ declare namespace pxt {
527527
timeMachineDiffInterval?: number; // An interval in milliseconds at which to take diffs to store in project history. Defaults to 5 minutes
528528
timeMachineSnapshotInterval?: number; // An interval in milliseconds at which to take full project snapshots in project history. Defaults to 15 minutes
529529
adjustBlockContrast?: boolean; // If set to true, all block colors will automatically be adjusted to have a contrast ratio of 4.5 with text
530-
feedbackEnabled?: boolean; // allow feedback to be shown on a target
531-
ocvAppId?: number; // the app id needed to attach to the OCV service
532-
ocvFrameUrl?: string; // the base url for the OCV service
533530
}
534531

535532
interface DownloadDialogTheme {

localtypings/pxteditor.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ declare namespace pxt.editor {
104104
| "serviceworkerregistered"
105105
| "runeval"
106106
| "precachetutorial"
107-
| "setcolortheme"
107+
| "setcolorthemebyid"
108108

109109
// package extension messasges
110110
| ExtInitializeType
@@ -512,8 +512,9 @@ declare namespace pxt.editor {
512512
}
513513

514514
export interface EditorMessageSetColorThemeRequest extends EditorMessageRequest {
515-
action: "setcolortheme";
515+
action: "setcolorthemebyid";
516516
colorThemeId: string;
517+
savePreference?: boolean;
517518
}
518519

519520
/**
@@ -1044,6 +1045,7 @@ declare namespace pxt.editor {
10441045
isEmbedSimActive(): boolean;
10451046
isBlocksActive(): boolean;
10461047
isJavaScriptActive(): boolean;
1048+
isTextSourceCodeEditorActive(): boolean;
10471049
isPythonActive(): boolean;
10481050
isAssetsActive(): boolean;
10491051

@@ -1100,7 +1102,7 @@ declare namespace pxt.editor {
11001102
hasHeaderBeenPersistentShared(): boolean;
11011103
getSharePreferenceForHeader(): boolean;
11021104
saveSharePreferenceForHeaderAsync(anonymousByDefault: boolean): Promise<void>;
1103-
setColorTheme(colorThemeId: string): void;
1105+
setColorThemeById(colorThemeId: string, savePreference: boolean): void;
11041106
}
11051107

11061108
export interface IHexFileImporter {
@@ -1167,7 +1169,7 @@ declare namespace pxt.editor {
11671169
perfMeasurementThresholdMs?: number;
11681170
onPerfMilestone?: (payload: { milestone: string, time: number, params?: Map<string> }) => void;
11691171
onPerfMeasurement?: (payload: { name: string, start: number, duration: number, params?: Map<string> }) => void;
1170-
1172+
11711173
// Used with the @tutorialCompleted macro. See docs/writing-docs/tutorials.md for more info
11721174
onTutorialCompleted?: () => void;
11731175
onMarkdownActivityLoad?: (path: string, title?: string, editorProjectName?: string) => Promise<void>;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pxt-core",
3-
"version": "11.3.26",
3+
"version": "11.3.43",
44
"description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
55
"keywords": [
66
"TypeScript",

pxtblocks/plugins/flyout/verticalFlyout.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as Blockly from "blockly";
22

3+
const MAX_CACHED_FLYOUTS = 20;
4+
35
export class VerticalFlyout implements Blockly.IFlyout {
46
horizontalLayout = false;
57
RTL: boolean;
@@ -129,12 +131,21 @@ export class VerticalFlyout implements Blockly.IFlyout {
129131
this.activeFlyout = existing;
130132
this.activeFlyout.autoClose = this.autoClose;
131133
this.activeFlyout.setContainerVisible(this.containerVisible);
132-
this.activeFlyout.show(flyoutDef)
134+
this.activeFlyout.show(flyoutDef);
135+
136+
// move to most recently used in the cache
137+
this.cached.splice(this.cached.indexOf(existing), 1);
138+
this.cached.push(existing);
133139
return;
134140
}
135141

136142
this.activeFlyout = new CachedFlyout(this.options);
137143
this.cached.push(this.activeFlyout);
144+
145+
if (this.cached.length >= MAX_CACHED_FLYOUTS) {
146+
this.cached.shift().dispose();
147+
}
148+
138149
this.element.appendChild(this.activeFlyout.createDom("g"));
139150
this.activeFlyout.init(this.targetWorkspace);
140151

pxtblocks/plugins/functions/blocks/functionCallBlocks.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ import {
55
FUNCTION_CALL_OUTPUT_BLOCK_TYPE,
66
FUNCTION_DEFINITION_BLOCK_TYPE,
77
} from "../constants";
8-
import { getDefinition, getShadowBlockInfoFromType_, isVariableBlockType, mutateCallersAndDefinition } from "../utils";
8+
import { getArgMap, getDefinition, getShadowBlockInfoFromType_, isVariableBlockType, mutateCallersAndDefinition } from "../utils";
99
import { MsgKey } from "../msg";
1010

11+
export interface SerializedShadow {
12+
inputName: string;
13+
connectedShadow?: any;
14+
connectedBlock?: string;
15+
}
16+
1117
interface FunctionCallMixin extends CommonFunctionMixin {
1218
attachShadow_(input: Blockly.Input, typeName: string): void;
1319
buildShadowDom_(argumentType: string): Element;
1420
onchange(event: Blockly.Events.Abstract): void;
1521
afterWorkspaceLoad(): void;
22+
serializeChangedInputs(newMutation: Element): SerializedShadow[];
1623
}
1724

18-
type FunctionCallBlock = CommonFunctionBlock & FunctionCallMixin;
25+
export type FunctionCallBlock = CommonFunctionBlock & FunctionCallMixin;
1926

2027
const FUNCTION_CALL_MIXIN: FunctionCallMixin = {
2128
...COMMON_FUNCTION_MIXIN,
@@ -188,6 +195,34 @@ const FUNCTION_CALL_MIXIN: FunctionCallMixin = {
188195
}
189196
}
190197
},
198+
serializeChangedInputs(this: FunctionCallBlock, newMutation: Element) {
199+
const out: SerializedShadow[] = [];
200+
201+
const newIdToArg = getArgMap(newMutation, true);
202+
203+
for (const argument of this.arguments_) {
204+
if (newIdToArg[argument.id]) continue;
205+
206+
const connection = this.getInput(argument.id).connection;
207+
208+
const targetBlock = connection.targetBlock() as Blockly.BlockSvg;
209+
210+
if (targetBlock.isShadow()) {
211+
out.push({
212+
inputName: argument.id,
213+
connectedShadow: connection.getShadowState(true)
214+
});
215+
}
216+
else {
217+
out.push({
218+
inputName: argument.id,
219+
connectedBlock: targetBlock.id
220+
});
221+
}
222+
}
223+
224+
return out;
225+
}
191226
};
192227

193228
Blockly.Blocks[FUNCTION_CALL_BLOCK_TYPE] = {

0 commit comments

Comments
 (0)