pxt-core 9.3.13 → 9.3.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-core",
3
- "version": "9.3.13",
3
+ "version": "9.3.14",
4
4
  "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
5
5
  "keywords": [
6
6
  "TypeScript",
@@ -46,7 +46,7 @@ export function fireClickOnEnter(e: React.KeyboardEvent<HTMLElement>) {
46
46
  }
47
47
  }
48
48
 
49
- export function classList(...classes: string[]) {
49
+ export function classList(...classes: (string | undefined)[]) {
50
50
  return classes
51
51
  .filter(c => typeof c === "string")
52
52
  .reduce((prev, c) => prev.concat(c.split(" ")), [] as string[])
package/theme/pxt.less CHANGED
@@ -3,6 +3,7 @@
3
3
  @import 'themes/pxt/globals/site.variables';
4
4
  @import 'pxtsemantic';
5
5
 
6
+ @import 'themepacks'; // defines theme variables used everywhere
6
7
  @import 'common';
7
8
  @import 'common-components';
8
9
  @import 'monaco';
@@ -0,0 +1,41 @@
1
+ /**************************************************************************
2
+ CSS theme variables
3
+ These are overridden by targets and used in: react-common, CRA webapps.
4
+ To add new theme variable:
5
+ 1. Add variable to :root and .high-contrast below
6
+ 2. Set the variable value in each target's theme/themepacks.less
7
+ ***************************************************************************/
8
+
9
+ // TODO: Define the complete set of theme variables we want to support
10
+ :root {
11
+ // Default to a resonable scheme that doesn't closely match any existing target's colors
12
+ /// Page
13
+ --pxt-page-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
14
+ --pxt-page-background: white;
15
+ --pxt-page-foreground: black;
16
+ /// Header bar
17
+ --pxt-headerbar-background: #475569;
18
+ --pxt-headerbar-background-glass: #47556940;
19
+ --pxt-headerbar-foreground: white;
20
+ --pxt-headerbar-accent: #475569;
21
+ --pxt-headerbar-accent-smoke: #334155;
22
+ /// Content area
23
+ --pxt-content-background: #C7D2FE;
24
+ --pxt-content-background-glass: #C7D2FE40;
25
+ --pxt-content-foreground: #1E293B;
26
+ --pxt-content-accent: #EEF2FF;
27
+ /// Primary button
28
+ --pxt-button-primary-background: #065F46;
29
+ --pxt-button-primary-background-glass: #065F4640;
30
+ --pxt-button-primary-foreground: white;
31
+ --pxt-button-primary-accent: #065F46;
32
+ /// Secondary button
33
+ --pxt-button-secondary-background: #CBD5E1;
34
+ --pxt-button-secondary-background-glass: #CBD5E140;
35
+ --pxt-button-secondary-foreground: #1E293B;
36
+ --pxt-button-secondary-accent: #334155;
37
+ }
38
+
39
+ .theme-highcontrast {
40
+ // TODO: Fill this in
41
+ }
@@ -27,7 +27,7 @@
27
27
  window.ksRunnerWhenLoaded = function() {
28
28
  pxt.docs.requireHighlightJs = function() { return hljs; }
29
29
  pxt.setupWebConfig(pxtConfig || window.pxtWebConfig)
30
- pxt.runner.initCallbacks = pxtCallbacks
30
+ pxt.runner.setInitCallbacks(pxtCallbacks)
31
31
  pxtCallbacks.push(function() {
32
32
  pxtCallbacks = null
33
33
  })
@@ -17,7 +17,7 @@
17
17
  <link rel="manifest" href="/teachertool-data/manifest.json"/>
18
18
  <title>MakeCode Teacher Tool</title>
19
19
  <script>var pxtConfig=null</script>
20
- <script defer="defer" src="/blb/teachertool/js/main.3a94a341.js"></script><link href="/blb/teachertool/css/main.59776cd1.css" rel="stylesheet"></head>
20
+ <script defer="defer" src="/blb/teachertool/js/main.37b40d1d.js"></script><link href="/blb/teachertool/css/main.807e0772.css" rel="stylesheet"></head>
21
21
  <body>
22
22
  <noscript>You need to enable JavaScript to run this app.</noscript>
23
23
 
@@ -32,7 +32,5 @@
32
32
  <script type="text/javascript" src="/blb/pxtblocks.js"></script>
33
33
 
34
34
  <div id="root"></div>
35
-
36
- <!-- @include footer.html -->
37
35
  </body>
38
36
  </html>
@@ -1,151 +0,0 @@
1
- /// <reference path="pxtlib.d.ts" />
2
- /// <reference path="pxteditor.d.ts" />
3
- /// <reference path="pxtcompiler.d.ts" />
4
- /// <reference path="pxtblocks.d.ts" />
5
- /// <reference path="pxtsim.d.ts" />
6
- declare namespace pxt.runner {
7
- /**
8
- * Starts the simulator and injects it into the provided container.
9
- * the simulator will attempt to establish a websocket connection
10
- * to the debugger's user interface on port 3234.
11
- *
12
- * @param container The container to inject the simulator into
13
- */
14
- function startDebuggerAsync(container: HTMLElement): void;
15
- /**
16
- * Runner for the debugger that handles communication with the user
17
- * interface. Also talks to the server for anything to do with
18
- * the filesystem (like reading code)
19
- */
20
- class DebugRunner implements pxsim.protocol.DebugSessionHost {
21
- private container;
22
- private static RETRY_MS;
23
- private session;
24
- private ws;
25
- private pkgLoaded;
26
- private dataListener;
27
- private errorListener;
28
- private closeListener;
29
- private intervalId;
30
- private intervalRunning;
31
- constructor(container: HTMLElement);
32
- start(): void;
33
- private initializeWebsocket;
34
- send(msg: string): void;
35
- onData(cb: (msg: DebugProtocol.ProtocolMessage) => void): void;
36
- onError(cb: (e?: any) => void): void;
37
- onClose(cb: () => void): void;
38
- close(): void;
39
- private handleRunnerMessage;
40
- private runCode;
41
- private sendRunnerMessage;
42
- }
43
- }
44
- declare namespace pxt.runner {
45
- interface ClientRenderOptions {
46
- snippetClass?: string;
47
- signatureClass?: string;
48
- blocksClass?: string;
49
- blocksXmlClass?: string;
50
- diffBlocksXmlClass?: string;
51
- diffBlocksClass?: string;
52
- diffClass?: string;
53
- staticPythonClass?: string;
54
- diffStaticPythonClass?: string;
55
- projectClass?: string;
56
- blocksAspectRatio?: number;
57
- simulatorClass?: string;
58
- linksClass?: string;
59
- namespacesClass?: string;
60
- apisClass?: string;
61
- codeCardClass?: string;
62
- tutorial?: boolean;
63
- snippetReplaceParent?: boolean;
64
- simulator?: boolean;
65
- hex?: boolean;
66
- hexName?: string;
67
- pxtUrl?: string;
68
- packageClass?: string;
69
- package?: string;
70
- jresClass?: string;
71
- assetJSONClass?: string;
72
- assetJSON?: Map<string>;
73
- showEdit?: boolean;
74
- showJavaScript?: boolean;
75
- split?: boolean;
76
- }
77
- function defaultClientRenderOptions(): ClientRenderOptions;
78
- interface WidgetOptions {
79
- showEdit?: boolean;
80
- showJs?: boolean;
81
- showPy?: boolean;
82
- hideGutter?: boolean;
83
- run?: boolean;
84
- hexname?: string;
85
- hex?: string;
86
- }
87
- function renderAsync(options?: ClientRenderOptions): Promise<void>;
88
- }
89
- declare namespace pxt.runner {
90
- interface SimulateOptions {
91
- embedId?: string;
92
- id?: string;
93
- code?: string;
94
- assets?: string;
95
- highContrast?: boolean;
96
- light?: boolean;
97
- fullScreen?: boolean;
98
- dependencies?: string[];
99
- builtJsInfo?: pxtc.BuiltSimJsInfo;
100
- single?: boolean;
101
- mute?: boolean;
102
- hideSimButtons?: boolean;
103
- autofocus?: boolean;
104
- additionalQueryParameters?: string;
105
- debug?: boolean;
106
- mpRole?: "server" | "client";
107
- }
108
- let mainPkg: pxt.MainPackage;
109
- function initHost(): void;
110
- function initFooter(footer: HTMLElement, shareId?: string): void;
111
- function showError(msg: string): void;
112
- function generateHexFileAsync(options: SimulateOptions): Promise<string>;
113
- function generateVMFileAsync(options: SimulateOptions): Promise<any>;
114
- function simulateAsync(container: HTMLElement, simOptions: SimulateOptions): Promise<pxtc.BuiltSimJsInfo>;
115
- function preloadSim(container: HTMLElement, simOpts: SimulateOptions): void;
116
- function currentDriver(): pxsim.SimulatorDriver;
117
- function postSimMessage(msg: pxsim.SimulatorMessage): void;
118
- function fetchSimJsInfo(simOptions: SimulateOptions): Promise<pxtc.BuiltSimJsInfo>;
119
- function buildSimJsInfo(simOptions: SimulateOptions): Promise<pxtc.BuiltSimJsInfo>;
120
- enum LanguageMode {
121
- Blocks = 0,
122
- TypeScript = 1,
123
- Python = 2
124
- }
125
- let editorLanguageMode: LanguageMode;
126
- function setEditorContextAsync(mode: LanguageMode, localeInfo: string): Promise<void>;
127
- function startRenderServer(): void;
128
- function startDocsServer(loading: HTMLElement, content: HTMLElement, backButton?: HTMLElement): void;
129
- function renderProjectAsync(content: HTMLElement, projectid: string): Promise<void>;
130
- function renderProjectFilesAsync(content: HTMLElement, files: Map<string>, projectid?: string, escapeLinks?: boolean): Promise<void>;
131
- interface RenderMarkdownOptions {
132
- path?: string;
133
- tutorial?: boolean;
134
- blocksAspectRatio?: number;
135
- print?: boolean;
136
- }
137
- function renderMarkdownAsync(content: HTMLElement, md: string, options?: RenderMarkdownOptions): Promise<void>;
138
- interface DecompileResult {
139
- package: pxt.MainPackage;
140
- compileProgram?: ts.Program;
141
- compileJS?: pxtc.CompileResult;
142
- compileBlocks?: pxtc.CompileResult;
143
- compilePython?: pxtc.transpile.TranspileResult;
144
- apiInfo?: pxtc.ApisInfo;
145
- blocksSvg?: Element;
146
- }
147
- function decompileSnippetAsync(code: string, options?: blocks.BlocksRenderOptions): Promise<DecompileResult>;
148
- function compileBlocksAsync(code: string, options?: blocks.BlocksRenderOptions): Promise<DecompileResult>;
149
- let initCallbacks: (() => void)[];
150
- function init(): void;
151
- }