pxt-core 9.3.9 → 9.3.10
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/pxt.js +17 -5
- package/built/pxteditor.js +20 -6
- package/built/pxtlib.d.ts +20 -1
- package/built/pxtlib.js +16 -5
- package/built/pxtsim.js +1 -0
- package/built/server.js +1 -1
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxteditor.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtsim.js +1 -1
- package/built/web/pxtweb.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/teachertool/css/main.59776cd1.css +1 -0
- package/built/web/teachertool/js/{main.e5ff478b.js → main.1c77038c.js} +2 -2
- package/common-docs/blocks/math.md +1 -1
- package/docfiles/pxtweb/cookieCompliance.ts +10 -1
- package/localtypings/pxtarget.d.ts +2 -0
- package/package.json +1 -1
- package/webapp/public/teachertool.html +1 -1
- package/built/web/teachertool/css/main.a04db2f1.css +0 -1
package/built/pxt.js
CHANGED
|
@@ -97781,6 +97781,17 @@ var pxt;
|
|
|
97781
97781
|
};
|
|
97782
97782
|
}
|
|
97783
97783
|
analytics.enable = enable;
|
|
97784
|
+
function trackPerformanceReport() {
|
|
97785
|
+
if (pxt.perf.perfReportLogged)
|
|
97786
|
+
return;
|
|
97787
|
+
const data = pxt.perf.report();
|
|
97788
|
+
if (data) {
|
|
97789
|
+
const { durations, milestones } = data;
|
|
97790
|
+
pxt.tickEvent("performance.milestones", milestones);
|
|
97791
|
+
pxt.tickEvent("performance.durations", durations);
|
|
97792
|
+
}
|
|
97793
|
+
}
|
|
97794
|
+
analytics.trackPerformanceReport = trackPerformanceReport;
|
|
97784
97795
|
})(analytics = pxt.analytics || (pxt.analytics = {}));
|
|
97785
97796
|
})(pxt || (pxt = {}));
|
|
97786
97797
|
var pxt;
|
|
@@ -101171,7 +101182,7 @@ var pxt;
|
|
|
101171
101182
|
// Sometimes these aren't initialized, for example in tests. We only care about them
|
|
101172
101183
|
// doing anything in the browser.
|
|
101173
101184
|
if (!pxt.perf.report)
|
|
101174
|
-
pxt.perf.report = () =>
|
|
101185
|
+
pxt.perf.report = () => undefined;
|
|
101175
101186
|
if (!pxt.perf.recordMilestone)
|
|
101176
101187
|
pxt.perf.recordMilestone = () => { };
|
|
101177
101188
|
if (!pxt.perf.measureStart)
|
|
@@ -101919,26 +101930,26 @@ var pxt;
|
|
|
101919
101930
|
},
|
|
101920
101931
|
'math_number': {
|
|
101921
101932
|
name: pxt.Util.lf("{id:block}number"),
|
|
101922
|
-
url: '/
|
|
101933
|
+
url: '/types/number',
|
|
101923
101934
|
category: 'math',
|
|
101924
101935
|
tooltip: (pxt.appTarget && pxt.appTarget.compile) ?
|
|
101925
101936
|
pxt.Util.lf("a decimal number") : pxt.Util.lf("an integer number")
|
|
101926
101937
|
},
|
|
101927
101938
|
'math_integer': {
|
|
101928
101939
|
name: pxt.Util.lf("{id:block}number"),
|
|
101929
|
-
url: '/
|
|
101940
|
+
url: '/types/number',
|
|
101930
101941
|
category: 'math',
|
|
101931
101942
|
tooltip: pxt.Util.lf("an integer number")
|
|
101932
101943
|
},
|
|
101933
101944
|
'math_whole_number': {
|
|
101934
101945
|
name: pxt.Util.lf("{id:block}number"),
|
|
101935
|
-
url: '/
|
|
101946
|
+
url: '/types/number',
|
|
101936
101947
|
category: 'math',
|
|
101937
101948
|
tooltip: pxt.Util.lf("a whole number")
|
|
101938
101949
|
},
|
|
101939
101950
|
'math_number_minmax': {
|
|
101940
101951
|
name: pxt.Util.lf("{id:block}number"),
|
|
101941
|
-
url: '/blocks/math
|
|
101952
|
+
url: '/blocks/math',
|
|
101942
101953
|
category: 'math'
|
|
101943
101954
|
},
|
|
101944
101955
|
'math_arithmetic': {
|
|
@@ -155574,6 +155585,7 @@ var pxsim;
|
|
|
155574
155585
|
return wrapper;
|
|
155575
155586
|
}
|
|
155576
155587
|
preload(aspectRatio, clearRuntime) {
|
|
155588
|
+
this.addEventListeners();
|
|
155577
155589
|
if (clearRuntime) {
|
|
155578
155590
|
this._currentRuntime = undefined;
|
|
155579
155591
|
this.container.textContent = "";
|
package/built/pxteditor.js
CHANGED
|
@@ -613,10 +613,10 @@ var pxt;
|
|
|
613
613
|
(function (pxt) {
|
|
614
614
|
var workspace;
|
|
615
615
|
(function (workspace) {
|
|
616
|
-
// 5 minutes
|
|
617
|
-
const
|
|
618
|
-
// 15 minutes
|
|
619
|
-
const
|
|
616
|
+
// 5 minutes. This is overridden in pxtarget.json
|
|
617
|
+
const DEFAULT_DIFF_HISTORY_INTERVAL = 1000 * 60 * 5;
|
|
618
|
+
// 15 minutes. This is overridden in pxtarget.json
|
|
619
|
+
const DEFAULT_SNAPSHOT_HISTORY_INTERVAL = 1000 * 60 * 15;
|
|
620
620
|
const ONE_DAY = 1000 * 60 * 60 * 24;
|
|
621
621
|
function collapseHistory(history, text, options, diff, patch) {
|
|
622
622
|
var _a, _b;
|
|
@@ -863,7 +863,7 @@ var pxt;
|
|
|
863
863
|
if (history.entries.length > 1) {
|
|
864
864
|
const topTime = history.entries[history.entries.length - 1].timestamp;
|
|
865
865
|
const prevTime = history.entries[history.entries.length - 2].timestamp;
|
|
866
|
-
if (currentTime - topTime <
|
|
866
|
+
if (currentTime - topTime < diffInterval() && topTime - prevTime < diffInterval()) {
|
|
867
867
|
shouldCombine = true;
|
|
868
868
|
}
|
|
869
869
|
}
|
|
@@ -887,7 +887,7 @@ var pxt;
|
|
|
887
887
|
if (history.snapshots.length == 0) {
|
|
888
888
|
history.snapshots.push(takeSnapshot(previousText, currentTime - 1));
|
|
889
889
|
}
|
|
890
|
-
else if (currentTime - history.snapshots[history.snapshots.length - 1].timestamp >=
|
|
890
|
+
else if (currentTime - history.snapshots[history.snapshots.length - 1].timestamp >= snapshotInterval()) {
|
|
891
891
|
history.snapshots.push(takeSnapshot(previousText, currentTime));
|
|
892
892
|
const trimmed = [];
|
|
893
893
|
let currentDay = Math.floor(currentTime / ONE_DAY) * ONE_DAY;
|
|
@@ -965,6 +965,20 @@ var pxt;
|
|
|
965
965
|
}
|
|
966
966
|
return true;
|
|
967
967
|
}
|
|
968
|
+
function diffInterval() {
|
|
969
|
+
var _a, _b;
|
|
970
|
+
if (((_b = (_a = pxt.appTarget) === null || _a === void 0 ? void 0 : _a.appTheme) === null || _b === void 0 ? void 0 : _b.timeMachineDiffInterval) != undefined) {
|
|
971
|
+
return pxt.appTarget.appTheme.timeMachineDiffInterval;
|
|
972
|
+
}
|
|
973
|
+
return DEFAULT_DIFF_HISTORY_INTERVAL;
|
|
974
|
+
}
|
|
975
|
+
function snapshotInterval() {
|
|
976
|
+
var _a, _b;
|
|
977
|
+
if (((_b = (_a = pxt.appTarget) === null || _a === void 0 ? void 0 : _a.appTheme) === null || _b === void 0 ? void 0 : _b.timeMachineSnapshotInterval) != undefined) {
|
|
978
|
+
return pxt.appTarget.appTheme.timeMachineSnapshotInterval;
|
|
979
|
+
}
|
|
980
|
+
return DEFAULT_SNAPSHOT_HISTORY_INTERVAL;
|
|
981
|
+
}
|
|
968
982
|
})(workspace = pxt.workspace || (pxt.workspace = {}));
|
|
969
983
|
})(pxt || (pxt = {}));
|
|
970
984
|
/// <reference path="../localtypings/monaco.d.ts" />
|
package/built/pxtlib.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare namespace pxt.analytics {
|
|
|
22
22
|
let consoleTicks: ConsoleTickOptions;
|
|
23
23
|
function addDefaultProperties(props: Map<string | number>): void;
|
|
24
24
|
function enable(lang: string): void;
|
|
25
|
+
function trackPerformanceReport(): void;
|
|
25
26
|
}
|
|
26
27
|
declare namespace pxt {
|
|
27
28
|
let appTarget: TargetBundle;
|
|
@@ -484,7 +485,14 @@ declare namespace ts.pxtc.jsonPatch.tests {
|
|
|
484
485
|
}
|
|
485
486
|
declare namespace pxt.perf {
|
|
486
487
|
let perfReportLogged: boolean;
|
|
487
|
-
function report():
|
|
488
|
+
function report(): {
|
|
489
|
+
milestones: {
|
|
490
|
+
[index: string]: number;
|
|
491
|
+
};
|
|
492
|
+
durations: {
|
|
493
|
+
[index: string]: number;
|
|
494
|
+
};
|
|
495
|
+
} | undefined;
|
|
488
496
|
function recordMilestone(msg: string, time?: number): void;
|
|
489
497
|
function measureStart(name: string): void;
|
|
490
498
|
function measureEnd(name: string): void;
|
|
@@ -3689,6 +3697,17 @@ declare namespace pxt.Cloud {
|
|
|
3689
3697
|
thumb?: boolean;
|
|
3690
3698
|
persistId?: string;
|
|
3691
3699
|
}
|
|
3700
|
+
interface JsonText {
|
|
3701
|
+
"Readme.md"?: string;
|
|
3702
|
+
"assets.json"?: string;
|
|
3703
|
+
"images.g.jres"?: string;
|
|
3704
|
+
"images.g.ts"?: string;
|
|
3705
|
+
"main.blocks"?: string;
|
|
3706
|
+
"main.ts"?: string;
|
|
3707
|
+
"pxt.json"?: string;
|
|
3708
|
+
"tilemap.g.jres"?: string;
|
|
3709
|
+
"tilemap.g.ts"?: string;
|
|
3710
|
+
}
|
|
3692
3711
|
}
|
|
3693
3712
|
declare namespace ts.pxtc {
|
|
3694
3713
|
function f4EncodeImg(w: number, h: number, bpp: number, getPix: (x: number, y: number) => number): string;
|
package/built/pxtlib.js
CHANGED
|
@@ -95,6 +95,17 @@ var pxt;
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
analytics.enable = enable;
|
|
98
|
+
function trackPerformanceReport() {
|
|
99
|
+
if (pxt.perf.perfReportLogged)
|
|
100
|
+
return;
|
|
101
|
+
const data = pxt.perf.report();
|
|
102
|
+
if (data) {
|
|
103
|
+
const { durations, milestones } = data;
|
|
104
|
+
pxt.tickEvent("performance.milestones", milestones);
|
|
105
|
+
pxt.tickEvent("performance.durations", durations);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
analytics.trackPerformanceReport = trackPerformanceReport;
|
|
98
109
|
})(analytics = pxt.analytics || (pxt.analytics = {}));
|
|
99
110
|
})(pxt || (pxt = {}));
|
|
100
111
|
var pxt;
|
|
@@ -3485,7 +3496,7 @@ var pxt;
|
|
|
3485
3496
|
// Sometimes these aren't initialized, for example in tests. We only care about them
|
|
3486
3497
|
// doing anything in the browser.
|
|
3487
3498
|
if (!pxt.perf.report)
|
|
3488
|
-
pxt.perf.report = () =>
|
|
3499
|
+
pxt.perf.report = () => undefined;
|
|
3489
3500
|
if (!pxt.perf.recordMilestone)
|
|
3490
3501
|
pxt.perf.recordMilestone = () => { };
|
|
3491
3502
|
if (!pxt.perf.measureStart)
|
|
@@ -4233,26 +4244,26 @@ var pxt;
|
|
|
4233
4244
|
},
|
|
4234
4245
|
'math_number': {
|
|
4235
4246
|
name: pxt.Util.lf("{id:block}number"),
|
|
4236
|
-
url: '/
|
|
4247
|
+
url: '/types/number',
|
|
4237
4248
|
category: 'math',
|
|
4238
4249
|
tooltip: (pxt.appTarget && pxt.appTarget.compile) ?
|
|
4239
4250
|
pxt.Util.lf("a decimal number") : pxt.Util.lf("an integer number")
|
|
4240
4251
|
},
|
|
4241
4252
|
'math_integer': {
|
|
4242
4253
|
name: pxt.Util.lf("{id:block}number"),
|
|
4243
|
-
url: '/
|
|
4254
|
+
url: '/types/number',
|
|
4244
4255
|
category: 'math',
|
|
4245
4256
|
tooltip: pxt.Util.lf("an integer number")
|
|
4246
4257
|
},
|
|
4247
4258
|
'math_whole_number': {
|
|
4248
4259
|
name: pxt.Util.lf("{id:block}number"),
|
|
4249
|
-
url: '/
|
|
4260
|
+
url: '/types/number',
|
|
4250
4261
|
category: 'math',
|
|
4251
4262
|
tooltip: pxt.Util.lf("a whole number")
|
|
4252
4263
|
},
|
|
4253
4264
|
'math_number_minmax': {
|
|
4254
4265
|
name: pxt.Util.lf("{id:block}number"),
|
|
4255
|
-
url: '/blocks/math
|
|
4266
|
+
url: '/blocks/math',
|
|
4256
4267
|
category: 'math'
|
|
4257
4268
|
},
|
|
4258
4269
|
'math_arithmetic': {
|
package/built/pxtsim.js
CHANGED