diff --git a/package.json b/package.json index b2078f03fb93..6ad6e2b21798 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pxt-core", - "version": "12.1.0", + "version": "12.1.1", "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors", "keywords": [ "TypeScript", diff --git a/pxtblocks/builtins/variables.ts b/pxtblocks/builtins/variables.ts index ce2281c261bf..64a465042892 100644 --- a/pxtblocks/builtins/variables.ts +++ b/pxtblocks/builtins/variables.ts @@ -199,7 +199,7 @@ export function initVariables() { * @this Blockly.Block */ customContextMenu: function (this: Blockly.BlockSvg, options: any[]) { - if (!(this.workspace?.options?.readOnly)) { + if (!(this.workspace?.options?.readOnly) && !this.isInFlyout) { let option: any = { enabled: this.workspace.remainingCapacity() > 0 }; diff --git a/pxtblocks/fields/field_ledmatrix.ts b/pxtblocks/fields/field_ledmatrix.ts index 103afceb4ef0..8b908a44b9b0 100644 --- a/pxtblocks/fields/field_ledmatrix.ts +++ b/pxtblocks/fields/field_ledmatrix.ts @@ -310,7 +310,8 @@ export class FieldLedMatrix extends FieldMatrix implements FieldCustom { } setValue(newValue: string | number, restoreState = true) { - super.setValue(String(newValue)); + const shouldFireChangeEvent = newValue !== this.value_; + super.setValue(String(newValue), shouldFireChangeEvent); if (this.matrixSvg) { if (restoreState) this.restoreStateFromString(); diff --git a/teachertool/src/components/SignInModal.tsx b/teachertool/src/components/SignInModal.tsx index 5fe9d49450a7..b0918ef397a2 100644 --- a/teachertool/src/components/SignInModal.tsx +++ b/teachertool/src/components/SignInModal.tsx @@ -14,6 +14,15 @@ export const SignInModal: React.FC = () => { params: pxt.Util.parseQueryString(window.location.href), } + // Projects loaded from urls get cleared after load, so check if we need to add that back. + if (teacherTool.projectMetadata?.persistId && !callbackState.params?.["project"]) { + if (!callbackState.params) { + callbackState.params = {}; + } + + callbackState.params["project"] = teacherTool.projectMetadata.persistId; + } + return teacherTool.modalOptions?.modal === "sign-in" ? ( JSX.Element; popOutHref: string; + singleTabStop: boolean; // if the whole doc is only one tab stop, the "open in new tab" button placement becomes unintuitive. } const builtIns: Record = { "keyboardControls": { component: KeyboardControlsHelp, - popOutHref: "https://makecode.com/accessibility" + popOutHref: "https://makecode.com/accessibility", + singleTabStop: true } } @@ -778,20 +780,27 @@ export class SideDocs extends data.Component { tabIndex: 0, }; + const openInNewTab = !lockedEditor &&
+ + + +
; + + const content =
+ {this.renderContent(url, builtIn, lockedEditor)} +
; + + const flipNewTabLinkOrder = builtIn?.singleTabStop; + + const contentParts = flipNewTabLinkOrder ? [content, openInNewTab] : [openInNewTab, content]; + /* eslint-disable @microsoft/sdl/react-iframe-missing-sandbox */ return
- {!lockedEditor &&
- - - -
} -
- {this.renderContent(url, builtIn, lockedEditor)} -
+ {contentParts}
/* eslint-enable @microsoft/sdl/react-iframe-missing-sandbox */